Add display-add-client-message-handler and gdk-spawn-on-screen
[cl-gtk2.git] / gdk / gdk.drag-and-drop.lisp
1 (in-package :gdk)
2
3 (defcstruct %gdk-drag-context
4   (parent-instance gobject.ffi::%g-object)
5   (protocol gdk-drag-protocol)
6   (is-source :boolean)
7   (source-window (g-object gdk-window))
8   (dest-window (g-object gdk-window))
9   (targets (glib:glist gdk-atom-as-string :free-from-foreign nil))
10   (actions gdk-drag-action)
11   (suggested-action gdk-drag-action)
12   (action gdk-drag-action)
13   (start-time :uint32))
14
15 (defun %gdk-drag-context-get-protocol (context)
16   (foreign-slot-value (pointer context) '%gdk-drag-context 'protocol))
17
18 (defun %gdk-drag-context-get-is-source (context)
19   (foreign-slot-value (pointer context) '%gdk-drag-context 'is-source))
20
21 (defun %gdk-drag-context-get-source-window (context)
22   (foreign-slot-value (pointer context) '%gdk-drag-context 'source-window))
23
24 (defun %gdk-drag-context-get-dest-window (context)
25   (foreign-slot-value (pointer context) '%gdk-drag-context 'dest-window))
26
27 (defun %gdk-drag-context-get-targets (context)
28   (foreign-slot-value (pointer context) '%gdk-drag-context 'targets))
29
30 (defun %gdk-drag-context-get-actions (context)
31   (foreign-slot-value (pointer context) '%gdk-drag-context 'actions))
32
33 (defun %gdk-drag-context-get-suggested-action (context)
34   (foreign-slot-value (pointer context) '%gdk-drag-context 'suggested-action))
35
36 (defun %gdk-drag-context-get-action (context)
37   (foreign-slot-value (pointer context) '%gdk-drag-context 'action))
38
39 (defun %gdk-drag-context-get-start-time (context)
40   (foreign-slot-value (pointer context) '%gdk-drag-context 'start-time))
41
42 (defcfun gdk-drag-get-selection gdk-atom-as-string
43   (context (g-object drag-context)))
44
45 (export 'gdk-drag-get-selection)
46
47 (defcfun gdk-drag-abort :void
48   (context (g-object drag-context))
49   (time :uint32))
50
51 (export 'gdk-drag-abord)
52
53 (defcfun gdk-drop-reply :void
54   (context (g-object drag-context))
55   (ok :boolean)
56   (time :uint32))
57
58 (export 'gdk-drop-reply)
59
60 (defcfun gdk-drag-drop :void
61   (context (g-object drag-context))
62   (time :uint32))
63
64 (export 'gdk-drag-drop)
65
66 (defcfun gdk_drag_find_window :void
67   (context (g-object drag-context))
68   (window (g-object gdk-window))
69   (x-root :int)
70   (y-root :int)
71   (dest-window (:pointer (g-object gdk-window)))
72   (protocol (:pointer gdk-drag-protocol)))
73
74 (defun gdk-drag-find-window (context window x-root y-root)
75   (with-foreign-objects ((dest-window :pointer) (protocol 'gdk-drag-protocol))
76     (gdk_drag_find_window context window x-root y-root dest-window protocol)
77     (values (mem-ref dest-window '(g-object gdk-window))
78             (mem-ref protocol 'gdk-drag-protocol))))
79
80 (export 'gdk-drag-find-window)
81
82 (defcfun gdk_drag_find_window_for_screen :void
83   (context (g-object drag-context))
84   (window (g-object gdk-window))
85   (screen (g-object screen))
86   (x-root :int)
87   (y-root :int)
88   (dest-window (:pointer (g-object gdk-window)))
89   (protocol (:pointer gdk-drag-protocol)))
90
91 (defun gdk-drag-find-window-for-screen (context window screen x-root y-root)
92   (with-foreign-objects ((dest-window :pointer) (protocol 'gdk-drag-protocol))
93     (gdk_drag_find_window_for_screen context window screen x-root y-root dest-window protocol)
94     (values (mem-ref dest-window '(g-object gdk-window))
95             (mem-ref protocol 'gdk-drag-protocol))))
96
97 (export 'gdk-drag-find-window-for-screen)
98
99 (defcfun gdk-drag-begin (g-object gdk-drag-context :already-referenced)
100   (window (g-object gdk-window))
101   (targets (glib:glist gdk-atom-as-string)))
102
103 (export 'gdk-drag-begin)
104
105 (defcfun gdk-drag-motion :boolean
106   (context (g-object drag-context))
107   (dest-window (g-object gdk-window))
108   (protocol gdk-drag-protocol)
109   (x-root :int)
110   (y-root :int)
111   (suggested-action gdk-drag-action)
112   (possible-actions gdk-drag-action)
113   (time :uint32))
114
115 (export 'gdk-drag-motion)
116
117 (defcfun gdk-drop-finish :void
118   (context (g-object drag-context))
119   (success :boolean)
120   (time :uint32))
121
122 (export 'gdk-drop-finish)
123
124 (defcfun gdk_drag_get_protocol native-window
125   (xid native-window)
126   (protocol (:pointer gdk-drag-protocol)))
127
128 (defun gdk-drag-get-protocol (xid)
129   (with-foreign-object (protocol 'gdk-drag-protocol)
130     (let ((dest-window (gdk_drag_get_protocol xid protocol)))
131       (values dest-window (mem-ref protocol 'gdk-drag-protocol)))))
132
133 (export 'gdk-drag-get-protocol)
134
135 (defcfun gdk_drag_get_protocol_for_display native-window
136   (display (g-object display))
137   (xid native-window)
138   (protocol (:pointer gdk-drag-protocol)))
139
140 (defun gdk-drag-get-protocol-for-dispaly (display xid)
141   (with-foreign-object (protocol 'gdk-drag-protocol)
142     (let ((dest-window (gdk_drag_get_protocol_for_display display xid protocol)))
143       (values dest-window (mem-ref protocol 'gdk-drag-protocol)))))
144
145 (export 'gdk-drag-get-protocol-for-display)
146
147 (defcfun gdk-drag-status :void
148   (context (g-object drag-context))
149   (action gdk-drag-action)
150   (time :uint32))
151
152 (export 'gdk-drag-status)
153
154 (defcfun gdk-drag-drop-succeeded :boolean
155   (context (g-object drag-context)))
156
157 (export 'gdk-drag-drop-succeeded)