1
2@c %start of fragment
3
4@deffn Function gtk-drag-dest-set  (self@tie{}@code{<gtk-widget>}) (flags@tie{}@code{<gtk-dest-defaults>}) (types@tie{}@code{glist-of}) (actions@tie{}@code{<gdk-drag-action>})
5Sets a widget as a potential drop destination.
6
7@table @var
8@item widget
9a @code{<gtk-widget>}
10
11@item flags
12the flags that specify what actions GTK+ should take on behalf of a widget for
13drops onto that widget. The @var{targets} and @var{actions} fields only are used
14if @samp{GTK_DEST_DEFAULT_MOTION} or @samp{GTK_DEST_DEFAULT_DROP} are given.
15
16@item targets
17a pointer to an array of @code{<gtk-target-entry>}s indicating the drop types
18that this widget will accept.
19
20@item n-targets
21the number of entries in @var{targets}.
22
23@item actions
24a bitmask of possible actions for a drop onto this widget.
25
26@end table
27
28@end deffn
29
30@deffn Function gtk-drag-dest-set-proxy  (self@tie{}@code{<gtk-widget>}) (proxy_window@tie{}@code{<gdk-window>}) (protocol@tie{}@code{<gdk-drag-protocol>}) (use_coordinates@tie{}@code{bool})
31Sets this widget as a proxy for drops to another window.
32
33@table @var
34@item widget
35a @code{<gtk-widget>}
36
37@item proxy-window
38the window to which to forward drag events
39
40@item protocol
41the drag protocol which the @var{proxy-window} accepts (You can use
42@code{gdk-drag-get-protocol} to determine this)
43
44@item use-coordinates
45If @samp{@code{#t}}, send the same coordinates to the destination, because it is
46an embedded subwindow.
47
48@end table
49
50@end deffn
51
52@deffn Function gtk-drag-dest-unset  (self@tie{}@code{<gtk-widget>})
53Clears information about a drop destination set with @code{gtk-drag-dest-set}.
54The widget will no longer receive notification of drags.
55
56@table @var
57@item widget
58a @code{<gtk-widget>}
59
60@end table
61
62@end deffn
63
64@deffn Function gtk-drag-dest-add-text-targets  (widget@tie{}@code{<gtk-widget>})
65Add the text targets supported by @code{<gtk-selection>} to the target list of
66the drag destination. The targets are added with @var{info} = 0. If you need
67another value, use @code{gtk-target-list-add-text-targets} and
68@code{gtk-drag-dest-set-target-list}.
69
70@table @var
71@item widget
72a @code{<gtk-widget>} that's a drag destination
73
74@end table
75
76Since 2.6
77
78@end deffn
79
80@deffn Function gtk-drag-dest-add-image-targets  (widget@tie{}@code{<gtk-widget>})
81Add the image targets supported by @code{<gtk-selection>} to the target list of
82the drag destination. The targets are added with @var{info} = 0. If you need
83another value, use @code{gtk-target-list-add-image-targets} and
84@code{gtk-drag-dest-set-target-list}.
85
86@table @var
87@item widget
88a @code{<gtk-widget>} that's a drag destination
89
90@end table
91
92Since 2.6
93
94@end deffn
95
96@deffn Function gtk-drag-dest-add-uri-targets  (widget@tie{}@code{<gtk-widget>})
97Add the URI targets supported by @code{<gtk-selection>} to the target list of
98the drag destination. The targets are added with @var{info} = 0. If you need
99another value, use @code{gtk-target-list-add-uri-targets} and
100@code{gtk-drag-dest-set-target-list}.
101
102@table @var
103@item widget
104a @code{<gtk-widget>} that's a drag destination
105
106@end table
107
108Since 2.6
109
110@end deffn
111
112@deffn Function gtk-drag-dest-set-track-motion  (widget@tie{}@code{<gtk-widget>}) (track_motion@tie{}@code{bool})
113Tells the widget to emit ::drag-motion and ::drag-leave events regardless of the
114targets and the @samp{GTK_DEST_DEFAULT_MOTION} flag.
115
116This may be used when a widget wants to do generic actions regardless of the
117targets that the source offers.
118
119@table @var
120@item widget
121a @code{<gtk-widget>} that's a drag destination
122
123@item track-motion
124whether to accept all targets
125
126@end table
127
128Since 2.10
129
130@end deffn
131
132@deffn Function gtk-drag-dest-get-track-motion  (widget@tie{}@code{<gtk-widget>}) @result{}@tie{} (ret@tie{}@code{bool})
133Returns whether the widget has been configured to always emit ::drag-motion
134signals.
135
136@table @var
137@item widget
138a @code{<gtk-widget>} that's a drag destination
139
140@item ret
141@samp{@code{#t}} if the widget always emits ::drag-motion events
142
143@end table
144
145Since 2.10
146
147@end deffn
148
149@deffn Function gtk-drag-finish  (self@tie{}@code{<gdk-drag-context>}) (success@tie{}@code{bool}) (del@tie{}@code{bool}) (time@tie{}@code{unsigned-int32})
150Informs the drag source that the drop is finished, and that the data of the drag
151will no longer be required.
152
153@table @var
154@item context
155the drag context.
156
157@item success
158a flag indicating whether the drop was successful
159
160@item del
161a flag indicating whether the source should delete the original data. (This
162should be @samp{@code{#t}} for a move)
163
164@item time
165the timestamp from the "drag_data_drop" signal.
166
167@end table
168
169@end deffn
170
171@deffn Function gtk-drag-get-data  (self@tie{}@code{<gtk-widget>}) (context@tie{}@code{<gdk-drag-context>}) (target@tie{}@code{<gdk-atom>}) (time@tie{}@code{unsigned-int32})
172Gets the data associated with a drag. When the data is received or the retrieval
173fails, GTK+ will emit a "drag_data_received" signal. Failure of the retrieval is
174indicated by the length field of the @var{selection-data} signal parameter being
175negative. However, when @code{gtk-drag-get-data} is called implicitely because
176the @samp{GTK_DEST_DEFAULT_DROP} was set, then the widget will not receive
177notification of failed drops.
178
179@table @var
180@item widget
181the widget that will receive the "drag_data_received" signal.
182
183@item context
184the drag context
185
186@item target
187the target (form of the data) to retrieve.
188
189@item time
190a timestamp for retrieving the data. This will generally be the time received in
191a "drag_data_motion" or "drag_data_drop" signal.
192
193@end table
194
195@end deffn
196
197@deffn Function gtk-drag-get-source-widget  (self@tie{}@code{<gdk-drag-context>}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
198Determines the source widget for a drag.
199
200@table @var
201@item context
202a (destination side) drag context.
203
204@item ret
205if the drag is occurring within a single application, a pointer to the source
206widget. Otherwise, @samp{@code{#f}}.
207
208@end table
209
210@end deffn
211
212@deffn Function gtk-drag-highlight  (self@tie{}@code{<gtk-widget>})
213Draws a highlight around a widget. This will attach handlers to "expose_event"
214and "draw", so the highlight will continue to be displayed until
215@code{gtk-drag-unhighlight} is called.
216
217@table @var
218@item widget
219a widget to highlight
220
221@end table
222
223@end deffn
224
225@deffn Function gtk-drag-unhighlight  (self@tie{}@code{<gtk-widget>})
226Removes a highlight set by @code{gtk-drag-highlight} from a widget.
227
228@table @var
229@item widget
230a widget to remove the highlight from.
231
232@end table
233
234@end deffn
235
236@deffn Function gtk-drag-set-icon-widget  (self@tie{}@code{<gdk-drag-context>}) (widget@tie{}@code{<gtk-widget>}) (hot_x@tie{}@code{int}) (hot_y@tie{}@code{int})
237Changes the icon for a widget to a given widget. GTK+ will not destroy the icon,
238so if you don't want it to persist, you should connect to the "drag_end" signal
239and destroy it yourself.
240
241@table @var
242@item context
243the context for a drag. (This must be called with a context for the source side
244of a drag)
245
246@item widget
247a toplevel window to use as an icon.
248
249@item hot-x
250the X offset within @var{widget} of the hotspot.
251
252@item hot-y
253the Y offset within @var{widget} of the hotspot.
254
255@end table
256
257@end deffn
258
259@deffn Function gtk-drag-set-icon-pixmap  (self@tie{}@code{<gdk-drag-context>}) (colormap@tie{}@code{<gdk-colormap>}) (pixmap@tie{}@code{<gdk-pixmap>}) (mask@tie{}@code{<gdk-drawable>}) (hot_x@tie{}@code{int}) (hot_y@tie{}@code{int})
260Sets @var{pixmap} as the icon for a given drag. GTK+ retains references for the
261arguments, and will release them when they are no longer needed. In general,
262@code{gtk-drag-set-icon-pixbuf} will be more convenient to use.
263
264@table @var
265@item context
266the context for a drag. (This must be called with a context for the source side
267of a drag)
268
269@item colormap
270the colormap of the icon
271
272@item pixmap
273the image data for the icon
274
275@item mask
276the transparency mask for the icon
277
278@item hot-x
279the X offset within @var{pixmap} of the hotspot.
280
281@item hot-y
282the Y offset within @var{pixmap} of the hotspot.
283
284@end table
285
286@end deffn
287
288@deffn Function gtk-drag-set-icon-pixbuf  (self@tie{}@code{<gdk-drag-context>}) (pixbuf@tie{}@code{<gdk-pixbuf>}) (hot_x@tie{}@code{int}) (hot_y@tie{}@code{int})
289Sets @var{pixbuf} as the icon for a given drag.
290
291@table @var
292@item context
293the context for a drag. (This must be called with a context for the source side
294of a drag)
295
296@item pixbuf
297the @code{<gdk-pixbuf>} to use as the drag icon.
298
299@item hot-x
300the X offset within @var{widget} of the hotspot.
301
302@item hot-y
303the Y offset within @var{widget} of the hotspot.
304
305@end table
306
307@end deffn
308
309@deffn Function gtk-drag-set-icon-stock  (self@tie{}@code{<gdk-drag-context>}) (stock_id@tie{}@code{mchars}) (hot_x@tie{}@code{int}) (hot_y@tie{}@code{int})
310Sets the icon for a given drag from a stock ID.
311
312@table @var
313@item context
314the context for a drag. (This must be called with a context for the source side
315of a drag)
316
317@item stock-id
318the ID of the stock icon to use for the drag.
319
320@item hot-x
321the X offset within the icon of the hotspot.
322
323@item hot-y
324the Y offset within the icon of the hotspot.
325
326@end table
327
328@end deffn
329
330@deffn Function gtk-drag-set-icon-name  (context@tie{}@code{<gdk-drag-context>}) (icon_name@tie{}@code{mchars}) (hot_x@tie{}@code{int}) (hot_y@tie{}@code{int})
331Sets the icon for a given drag from a named themed icon. See the docs for
332@code{<gtk-icon-theme>} for more details. Note that the size of the icon depends
333on the icon theme (the icon is loaded at the symbolic size
334@code{<gtk-icon-size-dnd>}), thus @var{hot-x} and @var{hot-y} have to be used
335with care.
336
337@table @var
338@item context
339the context for a drag. (This must be called with a context for the source side
340of a drag)
341
342@item icon-name
343name of icon to use
344
345@item hot-x
346the X offset of the hotspot within the icon
347
348@item hot-y
349the Y offset of the hotspot within the icon
350
351@end table
352
353Since 2.8
354
355@end deffn
356
357@deffn Function gtk-drag-set-icon-default  (self@tie{}@code{<gdk-drag-context>})
358Sets the icon for a particular drag to the default icon.
359
360@table @var
361@item context
362the context for a drag. (This must be called with a context for the source side
363of a drag)
364
365@end table
366
367@end deffn
368
369@deffn Function gtk-drag-check-threshold  (self@tie{}@code{<gtk-widget>}) (start_x@tie{}@code{int}) (start_y@tie{}@code{int}) (current_x@tie{}@code{int}) (current_y@tie{}@code{int}) @result{}@tie{} (ret@tie{}@code{bool})
370Checks to see if a mouse drag starting at (@var{start-x}, @var{start-y}) and
371ending at (@var{current-x}, @var{current-y}) has passed the GTK+ drag threshold,
372and thus should trigger the beginning of a drag-and-drop operation.
373
374@table @var
375@item widget
376a @code{<gtk-widget>}
377
378@item start-x
379X coordinate of start of drag
380
381@item start-y
382Y coordinate of start of drag
383
384@item current-x
385current X coordinate
386
387@item current-y
388current Y coordinate
389
390@item ret
391@samp{@code{#t}} if the drag threshold has been passed.
392
393@end table
394
395@end deffn
396
397@deffn Function gtk-drag-source-set-icon  (self@tie{}@code{<gtk-widget>}) (colormap@tie{}@code{<gdk-colormap>}) (pixmap@tie{}@code{<gdk-pixmap>}) (mask@tie{}@code{<gdk-drawable>})
398Sets the icon that will be used for drags from a particular widget from a
399pixmap/mask. GTK+ retains references for the arguments, and will release them
400when they are no longer needed. Use @code{gtk-drag-source-set-icon-pixbuf}
401instead.
402
403@table @var
404@item widget
405a @code{<gtk-widget>}
406
407@item colormap
408the colormap of the icon
409
410@item pixmap
411the image data for the icon
412
413@item mask
414the transparency mask for an image.
415
416@end table
417
418@end deffn
419
420@deffn Function gtk-drag-source-set-icon-pixbuf  (self@tie{}@code{<gtk-widget>}) (pixbuf@tie{}@code{<gdk-pixbuf>})
421Sets the icon that will be used for drags from a particular widget from a
422@code{<gdk-pixbuf>}. GTK+ retains a reference for @var{pixbuf} and will release
423it when it is no longer needed.
424
425@table @var
426@item widget
427a @code{<gtk-widget>}
428
429@item pixbuf
430the @code{<gdk-pixbuf>} for the drag icon
431
432@end table
433
434@end deffn
435
436@deffn Function gtk-drag-source-set-icon-stock  (self@tie{}@code{<gtk-widget>}) (stock_id@tie{}@code{mchars})
437Sets the icon that will be used for drags from a particular source to a stock
438icon.
439
440@table @var
441@item widget
442a @code{<gtk-widget>}
443
444@item stock-id
445the ID of the stock icon to use
446
447@end table
448
449@end deffn
450
451@deffn Function gtk-drag-source-set-icon-name  (widget@tie{}@code{<gtk-widget>}) (icon_name@tie{}@code{mchars})
452Sets the icon that will be used for drags from a particular source to a themed
453icon. See the docs for @code{<gtk-icon-theme>} for more details.
454
455@table @var
456@item widget
457a @code{<gtk-widget>}
458
459@item icon-name
460name of icon to use
461
462@end table
463
464Since 2.8
465
466@end deffn
467
468@deffn Function gtk-drag-source-unset  (self@tie{}@code{<gtk-widget>})
469Undoes the effects of @code{gtk-drag-source-set}.
470
471@table @var
472@item widget
473a @code{<gtk-widget>}
474
475@end table
476
477@end deffn
478
479@deffn Function gtk-drag-source-add-text-targets  (widget@tie{}@code{<gtk-widget>})
480Add the text targets supported by @code{<gtk-selection>} to the target list of
481the drag source. The targets are added with @var{info} = 0. If you need another
482value, use @code{gtk-target-list-add-text-targets} and
483@code{gtk-drag-source-set-target-list}.
484
485@table @var
486@item widget
487a @code{<gtk-widget>} that's is a drag source
488
489@end table
490
491Since 2.6
492
493@end deffn
494
495@deffn Function gtk-drag-source-add-image-targets  (widget@tie{}@code{<gtk-widget>})
496Add the writable image targets supported by @code{<gtk-selection>} to the target
497list of the drag source. The targets are added with @var{info} = 0. If you need
498another value, use @code{gtk-target-list-add-image-targets} and
499@code{gtk-drag-source-set-target-list}.
500
501@table @var
502@item widget
503a @code{<gtk-widget>} that's is a drag source
504
505@end table
506
507Since 2.6
508
509@end deffn
510
511@deffn Function gtk-drag-source-add-uri-targets  (widget@tie{}@code{<gtk-widget>})
512Add the URI targets supported by @code{<gtk-selection>} to the target list of
513the drag source. The targets are added with @var{info} = 0. If you need another
514value, use @code{gtk-target-list-add-uri-targets} and
515@code{gtk-drag-source-set-target-list}.
516
517@table @var
518@item widget
519a @code{<gtk-widget>} that's is a drag source
520
521@end table
522
523Since 2.6
524
525@end deffn
526
527
528@c %end of fragment
529