Typo.
[cl-gtk2.git] / gtk / gtk.dnd.lisp
1 (in-package :gtk)
2
3 ;;
4 (define-g-boxed-opaque target-list "GtkTargetList"
5   :alloc (error "Use make-target-list to allocate GtkTargetList"))
6
7 (defcfun (gtk-target-list-new "gtk_target_list_new")
8     (g-boxed-foreign target-list :free-from-foreign nil)
9   (targets :pointer)
10   (n-targets :int))
11
12 (defun make-target-list (targets)
13   (with-foreign-boxed-array (n-targets targets-ptr target-entry targets)
14     (gtk-target-list-new targets-ptr n-targets)))
15
16 (defcfun (gtk-target-list-ref "gtk_target_list_ref")
17     (g-boxed-foreign target-list :free-from-foreign nil)
18   (target-list (g-boxed-foreign target-list)))
19
20 (defcfun (gtk-target-list-unref "gtk_target_list_unref") :void
21   (target-list (g-boxed-foreign target-list)))
22
23 (export (boxed-related-symbols 'target-list))
24
25 ;;
26
27 (defcfun (gtk-drag-dest-set "gtk_drag_dest_set") :void
28   (widget (g-object widget))
29   (flags dest-defaults)
30   (targets :pointer)
31   (n-targets :int)
32   (actions gdk-drag-action))
33
34 (defun drag-dest-set (widget flags targets actions)
35   (if (eq targets nil)
36       (gtk-drag-dest-set widget flags (null-pointer) 0 actions)
37       (with-foreign-boxed-array (n-targets targets-ptr target-entry targets)
38         (gtk-drag-dest-set widget flags targets-ptr n-targets actions))))
39
40 (export 'drag-dest-set)
41
42 (defcfun (drag-dest-unset "gtk_drag_dest_unset") :void
43   (widget (g-object widget)))
44
45 (export 'drag-dest-unset)
46
47 (defcfun (drag-dest-add-text-targets "gtk_drag_dest_add_text_targets") :void
48   (widget (g-object widget)))
49
50 (export 'drag-dest-add-text-targets)
51
52 (defcfun (drag-dest-add-image-targets "gtk_drag_dest_add_image_targets") :void
53   (widget (g-object widget)))
54
55 (export 'drag-dest-add-image-targets)
56
57 (defcfun (drag-dest-add-uri-targets "gtk_drag_dest_add_uri_targets") :void
58   (widget (g-object widget)))
59
60 (export 'drag-dest-add-uri-targets)
61
62 (defcfun (drag-dest-set-track-motion "gtk_drag_dest_set_track_motion") :void
63   (widget (g-object widget))
64   (track-motion :boolean))
65
66 (export 'drag-dest-set-track-motion)
67
68 (defcfun (drag-dest-get-track-motion "gtk_drag_dest_get_track_motion") :boolean
69   (widget (g-object widget)))
70
71 (export 'drag-dest-get-track-motion)
72
73 (defcfun (drag-finish "gtk_drag_finish") :void
74   (context (g-object drag-context))
75   (success :boolean)
76   (del :boolean)
77   (time :uint32))
78
79 (export 'drag-finish)
80
81 (defcfun (drag-get-data "gtk_drag_get_data") :void
82   (widget (g-object widget))
83   (context (g-object drag-context))
84   (target gdk-atom-as-string)
85   (time :uint32))
86
87 (export 'drag-get-data)
88
89 (defcfun (drag-get-source-widget "gtk_drag_get_source_widget")
90     (g-object widget)
91   (context (g-object drag-context)))
92
93 (export 'drag-get-source-widget)
94
95 (defcfun (drag-highlight "gtk_drag_highlight") :void
96   (widget (g-object widget)))
97
98 (export 'drag-highlight)
99
100 (defcfun (drag-unhighlight "gtk_drag_unhighlight") :void
101   (widget (g-object widget)))
102
103 (export 'drag-unhighlight)
104
105 (defcfun (gtk-drag-begin "gtk_drag_begin") (g-object drag-context :free-from-foreign nil)
106   (widget (g-object widget))
107   (targets (g-boxed-foreign target-list))
108   (actions gdk-drag-action)
109   (button :int)
110   (event (g-object gdk:event)))
111
112 (defun drag-begin (widget targets actions button event)
113   (let* ((target-list (make-target-list targets))
114          (context (gtk-drag-begin widget target-list actions button event)))
115     (gtk-target-list-unref target-list)
116     context))
117
118 (export 'drag-begin)
119
120 (defcfun (drag-set-icon-widget "gtk_drag_set_icon_widget") :void
121   (context (g-object drag-context))
122   (widget (g-object widget))
123   (hot-x :int)
124   (hot-y :int))
125
126 (export 'drag-set-icon-widget)
127
128 (defcfun (drag-set-icon-pixbuf "gtk_drag_set_icon_pixbuf") :void
129   (context (g-object drag-context))
130   (pixbuf (g-object pixbuf))
131   (hot-x :int)
132   (hot-y :int))
133
134 (export 'drag-set-icon-pixbuf)
135
136 (defcfun (drag-set-icon-stock "gtk_drag_set_icon_stock") :void
137   (context (g-object drag-context))
138   (stock-id :string)
139   (hot-x :int)
140   (hot-y :int))
141
142 (export 'drag-set-icon-stock)
143
144 (defcfun (drag-set-icon-name "gtk_drag_set_icon_name") :void
145   (context (g-object drag-context))
146   (icon-name :string)
147   (hot-x :int)
148   (hot-y :int))
149
150 (export 'drag-set-icon-name)
151
152 (defcfun (drag-set-icon-default "gtk_drag_set_icon_default") :void
153   (context (g-object drag-context)))
154
155 (export 'drag-set-icon-default)
156
157 (defcfun (drag-check-threshold "gtk_drag_check_threshold") :boolean
158   (widget (g-object widget))
159   (start-x :int)
160   (start-y :int)
161   (current-x :int)
162   (current-y :int))
163
164 (export 'drag-check-threshold)
165
166 (defcfun (gtk-drag-source-set "gtk_drag_source_set") :void
167   (widget (g-object widget))
168   (start-button-mask modifier-type)
169   (targets :pointer)
170   (n-targets :int)
171   (actions gdk-drag-action))
172
173 (defun drag-source-set (widget button-mask targets actions)
174   (with-foreign-boxed-array (n-targets targets-ptr target-entry targets)
175     (gtk-drag-source-set widget button-mask targets-ptr n-targets actions)))
176
177 (export 'drag-source-set)
178
179 (defcfun (drag-source-set-icon-pixbuf "gtk_drag_source_set_icon_pixbuf") :void
180   (widget (g-object widget))
181   (pixbuf (g-object pixbuf)))
182
183 (export 'drag-source-set-icon-pixbuf)
184
185 (defcfun (drag-source-set-icon-stock "gtk_drag_source_set_icon_stock") :void
186   (widget (g-object widget))
187   (stock-id :string))
188
189 (export 'drag-source-set-icon-stock)
190
191 (defcfun (drag-source-set-icon-name "gtk_drag_source_set_icon_name") :void
192   (widget (g-object widget))
193   (icon-name :string))
194
195 (export 'drag-source-set-icon-name)
196
197 (defcfun (gtk-drag-source-unset "gtk_drag_source_unset") :void
198   (widget (g-object widget))
199   (target-list :pointer))
200
201 (defun drag-source-unset (widget targets)
202   (let ((target-list (make-target-list targets)))
203     (gtk-drag-source-unset widget target-list)
204     (gtk-target-list-unref target-list)
205     nil))
206
207 (export 'drag-source-unset)
208
209 (defcfun (drag-source-add-text-targets "gtk_drag_source_add_text_targets") :void
210   (widget (g-object widget)))
211
212 (export 'drag-source-add-text-targets)
213
214 (defcfun (drag-source-add-image-targets "gtk_drag_source_add_image_targets") :void
215   (widget (g-object widget)))
216
217 (export 'drag-source-add-image-targets)
218
219 (defcfun (drag-source-add-uri-targets "gtk_drag_source_add_uri_targets") :void
220   (widget (g-object widget)))
221
222 (export 'drag-source-add-uri-targets)