]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkdnd.sgml
Move documentation for gtk_drag_dest_set to gtkdnd.c.
[~andy/gtk] / docs / reference / gtk / tmpl / gtkdnd.sgml
1 <!-- ##### SECTION Title ##### -->
2 Drag and Drop
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Functions for controlling drag and drop handling
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 GTK+ has a rich set of functions for doing inter-process
10 communication via the drag-and-drop metaphor. GTK+
11 can do drag-and-drop (DND) via multiple protocols.
12 The currently supported protocols are the Xdnd and
13 Motif protocols.
14
15 As well as the functions listed here, applications
16 may need to use some facilities provided for
17 <link linkend="gtk-Selections">Selections</link>.
18 Also, the Drag and Drop API makes use of signals
19 in the #GtkWidget class.
20 </para>
21
22 <!-- ##### SECTION See_Also ##### -->
23 <para>
24
25 </para>
26
27 <!-- ##### SECTION Stability_Level ##### -->
28
29
30 <!-- ##### ENUM GtkDestDefaults ##### -->
31 <para>
32 The #GtkDestDefaults enumeration specifies the various
33 types of action that will be taken on behalf
34 of the user for a drag destination site.
35 </para>
36
37 @GTK_DEST_DEFAULT_MOTION: 
38    If set for a widget, GTK+, during a drag over this
39    widget will check if the drag matches this widget's
40    list of possible targets and actions.
41    GTK+ will then call gdk_drag_status() as appropriate.
42 @GTK_DEST_DEFAULT_HIGHLIGHT: 
43    If set for a widget, GTK+ will draw a highlight on
44    this widget as long as a drag is over this widget
45    and the widget drag format and action are acceptable.
46 @GTK_DEST_DEFAULT_DROP: 
47    If set for a widget, when a drop occurs, GTK+ will
48    will check if the drag matches this widget's
49    list of possible targets and actions. If so, 
50    GTK+ will call gtk_drag_get_data() on behalf 
51    of the widget. Whether or not the drop is successful,
52    GTK+ will call gtk_drag_finish(). If the action
53    was a move, then if the drag was successful, then
54    %TRUE will be passed for the @delete parameter
55    to gtk_drag_finish().
56 @GTK_DEST_DEFAULT_ALL: 
57    If set, specifies that all default actions should
58    be taken.
59
60 <!-- ##### ENUM GtkTargetFlags ##### -->
61 <para>
62 The #GtkTargetFlags enumeration is used to specify
63 constraints on an entry in a #GtkTargetTable. 
64 </para>
65
66 @GTK_TARGET_SAME_APP: 
67    If this is set, the target will only be selected
68    for drags within a single application.
69 @GTK_TARGET_SAME_WIDGET: 
70    If this is set, the target will only be selected
71    for drags within a single widget.
72 @GTK_TARGET_OTHER_APP: 
73    If this is set, the target will not be selected
74    for drags within a single application. Since 2.12
75 @GTK_TARGET_OTHER_WIDGET: 
76    If this is set, the target will not be selected
77    for drags withing a single widget. Since 2.12
78
79 <!-- ##### FUNCTION gtk_drag_dest_set ##### -->
80 <para>
81 </para>
82
83 @widget: 
84 @flags: 
85 @targets: 
86 @n_targets: 
87 @actions: 
88
89
90 <!-- ##### FUNCTION gtk_drag_dest_set_proxy ##### -->
91 <para>
92 Sets this widget as a proxy for drops to another window.
93 </para>
94
95 @widget: a #GtkWidget
96 @proxy_window: the window to which to forward drag events
97 @protocol: the drag protocol which the @proxy_window accepts
98            (You can use gdk_drag_get_protocol() to determine this)
99 @use_coordinates: If %TRUE, send the same coordinates to the
100                   destination, because it is an embedded 
101                   subwindow.
102
103
104 <!-- ##### FUNCTION gtk_drag_dest_unset ##### -->
105 <para>
106 Clears information about a drop destination set with
107 gtk_drag_dest_set(). The widget will no longer receive
108 notification of drags.
109 </para>
110
111 @widget: a #GtkWidget
112
113
114 <!-- ##### FUNCTION gtk_drag_dest_find_target ##### -->
115 <para>
116
117 </para>
118
119 @widget: 
120 @context: 
121 @target_list: 
122 @Returns: 
123
124
125 <!-- ##### FUNCTION gtk_drag_dest_get_target_list ##### -->
126 <para>
127
128 </para>
129
130 @widget: 
131 @Returns: 
132
133
134 <!-- ##### FUNCTION gtk_drag_dest_set_target_list ##### -->
135 <para>
136
137 </para>
138
139 @widget: 
140 @target_list: 
141
142
143 <!-- ##### FUNCTION gtk_drag_dest_add_text_targets ##### -->
144 <para>
145
146 </para>
147
148 @widget: 
149
150
151 <!-- ##### FUNCTION gtk_drag_dest_add_image_targets ##### -->
152 <para>
153
154 </para>
155
156 @widget: 
157
158
159 <!-- ##### FUNCTION gtk_drag_dest_add_uri_targets ##### -->
160 <para>
161
162 </para>
163
164 @widget: 
165
166
167 <!-- ##### FUNCTION gtk_drag_dest_set_track_motion ##### -->
168 <para>
169
170 </para>
171
172 @widget: 
173 @track_motion: 
174
175
176 <!-- ##### FUNCTION gtk_drag_dest_get_track_motion ##### -->
177 <para>
178
179 </para>
180
181 @widget: 
182 @Returns: 
183
184
185 <!-- ##### FUNCTION gtk_drag_finish ##### -->
186 <para>
187 Informs the drag source that the drop is finished, and
188 that the data of the drag will no longer be required.
189 </para>
190
191 @context: the drag context.
192 @success: a flag indicating whether the drop was successful
193 @del: a flag indicating whether the source should delete the
194       original data. (This should be %TRUE for a move)
195 @time_: the timestamp from the "drag_data_drop" signal.
196
197
198 <!-- ##### FUNCTION gtk_drag_get_data ##### -->
199 <para>
200 Gets the data associated with a drag. When the data
201 is received or the retrieval fails, GTK+ will emit a 
202 "drag_data_received" signal. Failure of the retrieval
203 is indicated by the length field of the @selection_data
204 signal parameter being negative. However, when gtk_drag_get_data() 
205 is called implicitely because the %GTK_DEST_DEFAULT_DROP was set, 
206 then the widget will not receive notification of failed
207 drops.
208 </para>
209
210 @widget: the widget that will receive the "drag_data_received"
211  signal.
212 @context: the drag context
213 @target: the target (form of the data) to retrieve.
214 @time_: a timestamp for retrieving the data. This will
215        generally be the time received in a "drag_data_motion"
216        or "drag_data_drop" signal.
217
218
219 <!-- ##### FUNCTION gtk_drag_get_source_widget ##### -->
220 <para>
221 Determines the source widget for a drag.
222 </para>
223
224 @context: a (destination side) drag context.
225 @Returns: if the drag is occurring within a single application,
226           a pointer to the source widget. Otherwise, %NULL.
227
228
229 <!-- ##### FUNCTION gtk_drag_highlight ##### -->
230 <para>
231 Draws a highlight around a widget. This will attach
232 handlers to  "expose_event" and "draw", so the highlight
233 will continue to be displayed until gtk_drag_unhighlight()
234 is called.
235 </para>
236
237 @widget: a widget to highlight
238
239
240 <!-- ##### FUNCTION gtk_drag_unhighlight ##### -->
241 <para>
242 Removes a highlight set by gtk_drag_highlight() from
243 a widget.
244 </para>
245
246 @widget: a widget to remove the highlight from.
247
248
249 <!-- ##### FUNCTION gtk_drag_begin ##### -->
250 <para>
251
252 </para>
253
254 @widget: 
255 @targets: 
256 @actions: 
257 @button: 
258 @event: 
259 @Returns: 
260
261
262 <!-- ##### FUNCTION gtk_drag_set_icon_widget ##### -->
263 <para>
264 </para>
265
266 @context: 
267 @widget: 
268 @hot_x: 
269 @hot_y: 
270
271
272 <!-- ##### FUNCTION gtk_drag_set_icon_pixmap ##### -->
273 <para>
274 </para>
275
276 @context: 
277 @colormap: 
278 @pixmap: 
279 @mask: 
280 @hot_x: 
281 @hot_y: 
282
283
284 <!-- ##### FUNCTION gtk_drag_set_icon_pixbuf ##### -->
285 <para>
286
287 </para>
288
289 @context: 
290 @pixbuf: 
291 @hot_x: 
292 @hot_y: 
293
294
295 <!-- ##### FUNCTION gtk_drag_set_icon_stock ##### -->
296 <para>
297
298 </para>
299
300 @context: 
301 @stock_id: 
302 @hot_x: 
303 @hot_y: 
304
305
306 <!-- ##### FUNCTION gtk_drag_set_icon_name ##### -->
307 <para>
308
309 </para>
310
311 @context: 
312 @icon_name: 
313 @hot_x: 
314 @hot_y: 
315
316
317 <!-- ##### FUNCTION gtk_drag_set_icon_default ##### -->
318 <para>
319 </para>
320
321 @context: 
322
323
324 <!-- ##### FUNCTION gtk_drag_set_default_icon ##### -->
325 <para>
326
327 </para>
328
329 @colormap: 
330 @pixmap: 
331 @mask: 
332 @hot_x: 
333 @hot_y: 
334
335
336 <!-- ##### FUNCTION gtk_drag_check_threshold ##### -->
337 <para>
338
339 </para>
340
341 @widget: 
342 @start_x: 
343 @start_y: 
344 @current_x: 
345 @current_y: 
346 @Returns: 
347
348
349 <!-- ##### FUNCTION gtk_drag_source_set ##### -->
350 <para>
351 Sets up a widget so that GTK+ will start a drag
352 operation when the user clicks and drags on the
353 widget. The widget must have a window.
354 </para>
355
356 @widget: a #GtkWidget
357 @start_button_mask: the bitmask of buttons that can start the drag
358 @targets: the table of targets that the drag will support
359 @n_targets: the number of items in @targets
360 @actions: the bitmask of possible actions for a drag from this
361  widget.
362
363
364 <!-- ##### FUNCTION gtk_drag_source_set_icon ##### -->
365 <para>
366 </para>
367
368 @widget: 
369 @colormap: 
370 @pixmap: 
371 @mask: 
372
373
374 <!-- ##### FUNCTION gtk_drag_source_set_icon_pixbuf ##### -->
375 <para>
376
377 </para>
378
379 @widget: 
380 @pixbuf: 
381
382
383 <!-- ##### FUNCTION gtk_drag_source_set_icon_stock ##### -->
384 <para>
385
386 </para>
387
388 @widget: 
389 @stock_id: 
390
391
392 <!-- ##### FUNCTION gtk_drag_source_set_icon_name ##### -->
393 <para>
394
395 </para>
396
397 @widget: 
398 @icon_name: 
399
400
401 <!-- ##### FUNCTION gtk_drag_source_unset ##### -->
402 <para>
403 Undoes the effects of gtk_drag_source_set().
404 </para>
405
406 @widget: a #GtkWidget
407
408
409 <!-- ##### FUNCTION gtk_drag_source_set_target_list ##### -->
410 <para>
411
412 </para>
413
414 @widget: 
415 @target_list: 
416
417
418 <!-- ##### FUNCTION gtk_drag_source_get_target_list ##### -->
419 <para>
420
421 </para>
422
423 @widget: 
424 @Returns: 
425
426
427 <!-- ##### FUNCTION gtk_drag_source_add_text_targets ##### -->
428 <para>
429
430 </para>
431
432 @widget: 
433
434
435 <!-- ##### FUNCTION gtk_drag_source_add_image_targets ##### -->
436 <para>
437
438 </para>
439
440 @widget: 
441
442
443 <!-- ##### FUNCTION gtk_drag_source_add_uri_targets ##### -->
444 <para>
445
446 </para>
447
448 @widget: 
449
450