alternative to assert
[gtkD.git] / gtkD / src / gtk / DragAndDrop.d
blob21e164c89a5bd028defdbe4abfb21a0d8b7f2e32
1 /*
2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gtk-Drag-and-Drop.html
26 * outPack = gtk
27 * outFile = DragAndDrop
28 * strct = GdkDragContext
29 * realStrct=
30 * ctorStrct=
31 * clss = DragAndDrop
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_drag_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.Widget
47 * - gdk.Window
48 * - gdk.DragContext
49 * - gdk.Event
50 * - gdk.Colormap
51 * - gdk.Pixmap
52 * - gdk.Bitmap
53 * - gdk.Pixbuf
54 * - glib.Str
55 * structWrap:
56 * - GdkBitmap* -> Bitmap
57 * - GdkColormap* -> Colormap
58 * - GdkDragContext* -> DragContext
59 * - GdkEvent* -> Event
60 * - GdkPixbuf* -> Pixbuf
61 * - GdkPixmap* -> Pixmap
62 * - GdkWindow* -> Window
63 * - GtkWidget* -> Widget
64 * module aliases:
65 * local aliases:
68 module gtk.DragAndDrop;
70 version(noAssert)
72 version(Tango)
74 import tango.io.Stdout; // use the tango loging?
78 private import gtkc.gtktypes;
80 private import gtkc.gtk;
83 private import glib.Str;
84 private import gtk.Widget;
85 private import gdk.Window;
86 private import gdk.DragContext;
87 private import gdk.Event;
88 private import gdk.Colormap;
89 private import gdk.Pixmap;
90 private import gdk.Bitmap;
91 private import gdk.Pixbuf;
92 private import glib.Str;
97 /**
98 * Description
99 * GTK+ has a rich set of functions for doing inter-process
100 * communication via the drag-and-drop metaphor. GTK+
101 * can do drag-and-drop (DND) via multiple protocols.
102 * The currently supported protocols are the Xdnd and
103 * Motif protocols.
104 * As well as the functions listed here, applications
105 * may need to use some facilities provided for
106 * Selections.
107 * Also, the Drag and Drop API makes use of signals
108 * in the GtkWidget class.
110 public class DragAndDrop
113 /** the main Gtk struct */
114 protected GdkDragContext* gdkDragContext;
117 public GdkDragContext* getDragAndDropStruct()
119 return gdkDragContext;
123 /** the main Gtk struct as a void* */
124 protected void* getStruct()
126 return cast(void*)gdkDragContext;
130 * Sets our main struct and passes it to the parent class
132 public this (GdkDragContext* gdkDragContext)
134 version(noAssert)
136 if ( gdkDragContext is null )
138 int zero = 0;
139 version(Tango)
141 Stdout("struct gdkDragContext is null on constructor").newline;
143 else
145 printf("struct gdkDragContext is null on constructor");
147 zero = zero / zero;
150 else
152 assert(gdkDragContext !is null, "struct gdkDragContext is null on constructor");
154 this.gdkDragContext = gdkDragContext;
163 * Sets a widget as a potential drop destination.
164 * widget:
165 * a GtkWidget
166 * flags:
167 * the flags that specify what actions GTK+ should take
168 * on behalf of a widget for drops onto that widget. The targets
169 * and actions fields only are used if GTK_DEST_DEFAULT_MOTION
170 * or GTK_DEST_DEFAULT_DROP are given.
171 * targets:
172 * a pointer to an array of GtkTargetEntrys indicating
173 * the drop types that this widget will accept.
174 * n_targets:
175 * the number of entries in targets.
176 * actions:
177 * a bitmask of possible actions for a drop onto this
178 * widget.
180 public static void destSet(Widget widget, GtkDestDefaults flags, GtkTargetEntry* targets, int nTargets, GdkDragAction actions)
182 // void gtk_drag_dest_set (GtkWidget *widget, GtkDestDefaults flags, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
183 gtk_drag_dest_set((widget is null) ? null : widget.getWidgetStruct(), flags, targets, nTargets, actions);
187 * Sets this widget as a proxy for drops to another window.
188 * widget:
189 * a GtkWidget
190 * proxy_window:
191 * the window to which to forward drag events
192 * protocol:
193 * the drag protocol which the proxy_window accepts
194 * (You can use gdk_drag_get_protocol() to determine this)
195 * use_coordinates:
196 * If TRUE, send the same coordinates to the
197 * destination, because it is an embedded
198 * subwindow.
200 public static void destSetProxy(Widget widget, Window proxyWindow, GdkDragProtocol protocol, int useCoordinates)
202 // void gtk_drag_dest_set_proxy (GtkWidget *widget, GdkWindow *proxy_window, GdkDragProtocol protocol, gboolean use_coordinates);
203 gtk_drag_dest_set_proxy((widget is null) ? null : widget.getWidgetStruct(), (proxyWindow is null) ? null : proxyWindow.getWindowStruct(), protocol, useCoordinates);
207 * Clears information about a drop destination set with
208 * gtk_drag_dest_set(). The widget will no longer receive
209 * notification of drags.
210 * widget:
211 * a GtkWidget
213 public static void destUnset(Widget widget)
215 // void gtk_drag_dest_unset (GtkWidget *widget);
216 gtk_drag_dest_unset((widget is null) ? null : widget.getWidgetStruct());
220 * Looks for a match between context->targets and the
221 * dest_target_list, returning the first matching target, otherwise
222 * returning GDK_NONE. dest_target_list should usually be the return
223 * value from gtk_drag_dest_get_target_list(), but some widgets may
224 * have different valid targets for different parts of the widget; in
225 * that case, they will have to implement a drag_motion handler that
226 * passes the correct target list to this function.
227 * widget:
228 * drag destination widget
229 * context:
230 * drag context
231 * target_list:
232 * list of droppable targets, or NULL to use
233 * gtk_drag_dest_get_target_list (widget).
234 * Returns:
235 * first target that the source offers and the dest can accept, or GDK_NONE
237 public static GdkAtom destFindTarget(Widget widget, DragContext context, GtkTargetList* targetList)
239 // GdkAtom gtk_drag_dest_find_target (GtkWidget *widget, GdkDragContext *context, GtkTargetList *target_list);
240 return gtk_drag_dest_find_target((widget is null) ? null : widget.getWidgetStruct(), (context is null) ? null : context.getDragContextStruct(), targetList);
244 * Returns the list of targets this widget can accept from
245 * drag-and-drop.
246 * widget:
247 * a GtkWidget
248 * Returns:
249 * the GtkTargetList, or NULL if none
251 public static GtkTargetList* destGetTargetList(Widget widget)
253 // GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget *widget);
254 return gtk_drag_dest_get_target_list((widget is null) ? null : widget.getWidgetStruct());
258 * Sets the target types that this widget can accept from drag-and-drop.
259 * The widget must first be made into a drag destination with
260 * gtk_drag_dest_set().
261 * widget:
262 * a GtkWidget that's a drag destination
263 * target_list:
264 * list of droppable targets, or NULL for none
266 public static void destSetTargetList(Widget widget, GtkTargetList* targetList)
268 // void gtk_drag_dest_set_target_list (GtkWidget *widget, GtkTargetList *target_list);
269 gtk_drag_dest_set_target_list((widget is null) ? null : widget.getWidgetStruct(), targetList);
273 * Add the text targets supported by GtkSelection to
274 * the target list of the drag destination. The targets
275 * are added with info = 0. If you need another value,
276 * use gtk_target_list_add_text_targets() and
277 * gtk_drag_dest_set_target_list().
278 * widget:
279 * a GtkWidget that's a drag destination
280 * Since 2.6
282 public static void destAddTextTargets(Widget widget)
284 // void gtk_drag_dest_add_text_targets (GtkWidget *widget);
285 gtk_drag_dest_add_text_targets((widget is null) ? null : widget.getWidgetStruct());
289 * Add the image targets supported by GtkSelection to
290 * the target list of the drag destination. The targets
291 * are added with info = 0. If you need another value,
292 * use gtk_target_list_add_image_targets() and
293 * gtk_drag_dest_set_target_list().
294 * widget:
295 * a GtkWidget that's a drag destination
296 * Since 2.6
298 public static void destAddImageTargets(Widget widget)
300 // void gtk_drag_dest_add_image_targets (GtkWidget *widget);
301 gtk_drag_dest_add_image_targets((widget is null) ? null : widget.getWidgetStruct());
305 * Add the URI targets supported by GtkSelection to
306 * the target list of the drag destination. The targets
307 * are added with info = 0. If you need another value,
308 * use gtk_target_list_add_uri_targets() and
309 * gtk_drag_dest_set_target_list().
310 * widget:
311 * a GtkWidget that's a drag destination
312 * Since 2.6
314 public static void destAddUriTargets(Widget widget)
316 // void gtk_drag_dest_add_uri_targets (GtkWidget *widget);
317 gtk_drag_dest_add_uri_targets((widget is null) ? null : widget.getWidgetStruct());
321 * Tells the widget to emit ::drag-motion and ::drag-leave
322 * events regardless of the targets and the GTK_DEST_DEFAULT_MOTION
323 * flag.
324 * This may be used when a widget wants to do generic
325 * actions regardless of the targets that the source offers.
326 * widget:
327 * a GtkWidget that's a drag destination
328 * track_motion:
329 * whether to accept all targets
330 * Since 2.10
332 public static void destSetTrackMotion(Widget widget, int trackMotion)
334 // void gtk_drag_dest_set_track_motion (GtkWidget *widget, gboolean track_motion);
335 gtk_drag_dest_set_track_motion((widget is null) ? null : widget.getWidgetStruct(), trackMotion);
339 * Returns whether the widget has been configured to always
340 * emit ::drag-motion signals.
341 * widget:
342 * a GtkWidget that's a drag destination
343 * Returns:
344 * TRUE if the widget always emits ::drag-motion events
345 * Since 2.10
347 public static int destGetTrackMotion(Widget widget)
349 // gboolean gtk_drag_dest_get_track_motion (GtkWidget *widget);
350 return gtk_drag_dest_get_track_motion((widget is null) ? null : widget.getWidgetStruct());
354 * Informs the drag source that the drop is finished, and
355 * that the data of the drag will no longer be required.
356 * context:
357 * the drag context.
358 * success:
359 * a flag indicating whether the drop was successful
360 * del:
361 * a flag indicating whether the source should delete the
362 * original data. (This should be TRUE for a move)
363 * time_:
364 * the timestamp from the "drag_data_drop" signal.
366 public void finish(int success, int del, uint time)
368 // void gtk_drag_finish (GdkDragContext *context, gboolean success, gboolean del, guint32 time_);
369 gtk_drag_finish(gdkDragContext, success, del, time);
373 * Gets the data associated with a drag. When the data
374 * is received or the retrieval fails, GTK+ will emit a
375 * "drag_data_received" signal. Failure of the retrieval
376 * is indicated by the length field of the selection_data
377 * signal parameter being negative. However, when gtk_drag_get_data()
378 * is called implicitely because the GTK_DEST_DEFAULT_DROP was set,
379 * then the widget will not receive notification of failed
380 * drops.
381 * widget:
382 * the widget that will receive the "drag_data_received"
383 * signal.
384 * context:
385 * the drag context
386 * target:
387 * the target (form of the data) to retrieve.
388 * time_:
389 * a timestamp for retrieving the data. This will
390 * generally be the time received in a "drag_data_motion"
391 * or "drag_data_drop" signal.
393 public static void getData(Widget widget, DragContext context, GdkAtom target, uint time)
395 // void gtk_drag_get_data (GtkWidget *widget, GdkDragContext *context, GdkAtom target, guint32 time_);
396 gtk_drag_get_data((widget is null) ? null : widget.getWidgetStruct(), (context is null) ? null : context.getDragContextStruct(), target, time);
400 * Determines the source widget for a drag.
401 * context:
402 * a (destination side) drag context.
403 * Returns:
404 * if the drag is occurring within a single application,
405 * a pointer to the source widget. Otherwise, NULL.
407 public Widget getSourceWidget()
409 // GtkWidget* gtk_drag_get_source_widget (GdkDragContext *context);
410 return new Widget( gtk_drag_get_source_widget(gdkDragContext) );
414 * Draws a highlight around a widget. This will attach
415 * handlers to "expose_event" and "draw", so the highlight
416 * will continue to be displayed until gtk_drag_unhighlight()
417 * is called.
418 * widget:
419 * a widget to highlight
421 public static void highlight(Widget widget)
423 // void gtk_drag_highlight (GtkWidget *widget);
424 gtk_drag_highlight((widget is null) ? null : widget.getWidgetStruct());
428 * Removes a highlight set by gtk_drag_highlight() from
429 * a widget.
430 * widget:
431 * a widget to remove the highlight from.
433 public static void unhighlight(Widget widget)
435 // void gtk_drag_unhighlight (GtkWidget *widget);
436 gtk_drag_unhighlight((widget is null) ? null : widget.getWidgetStruct());
440 * Initiates a drag on the source side. The function
441 * only needs to be used when the application is
442 * starting drags itself, and is not needed when
443 * gtk_drag_source_set() is used.
444 * widget:
445 * the source widget.
446 * targets:
447 * The targets (data formats) in which the
448 * source can provide the data.
449 * actions:
450 * A bitmask of the allowed drag actions for this drag.
451 * button:
452 * The button the user clicked to start the drag.
453 * event:
454 * The event that triggered the start of the drag.
455 * Returns:
456 * the context for this drag.
458 public static DragContext begin(Widget widget, GtkTargetList* targets, GdkDragAction actions, int button, Event event)
460 // GdkDragContext* gtk_drag_begin (GtkWidget *widget, GtkTargetList *targets, GdkDragAction actions, gint button, GdkEvent *event);
461 return new DragContext( gtk_drag_begin((widget is null) ? null : widget.getWidgetStruct(), targets, actions, button, (event is null) ? null : event.getEventStruct()) );
465 * Changes the icon for a widget to a given widget. GTK+
466 * will not destroy the icon, so if you don't want
467 * it to persist, you should connect to the "drag_end"
468 * signal and destroy it yourself.
469 * context:
470 * the context for a drag. (This must be called
471 * with a context for the source side of a drag)
472 * widget:
473 * a toplevel window to use as an icon.
474 * hot_x:
475 * the X offset within widget of the hotspot.
476 * hot_y:
477 * the Y offset within widget of the hotspot.
479 public void setIconWidget(Widget widget, int hotX, int hotY)
481 // void gtk_drag_set_icon_widget (GdkDragContext *context, GtkWidget *widget, gint hot_x, gint hot_y);
482 gtk_drag_set_icon_widget(gdkDragContext, (widget is null) ? null : widget.getWidgetStruct(), hotX, hotY);
486 * Sets pixmap as the icon for a given drag. GTK+ retains
487 * references for the arguments, and will release them when
488 * they are no longer needed. In general, gtk_drag_set_icon_pixbuf()
489 * will be more convenient to use.
490 * context:
491 * the context for a drag. (This must be called
492 * with a context for the source side of a drag)
493 * colormap:
494 * the colormap of the icon
495 * pixmap:
496 * the image data for the icon
497 * mask:
498 * the transparency mask for the icon
499 * hot_x:
500 * the X offset within pixmap of the hotspot.
501 * hot_y:
502 * the Y offset within pixmap of the hotspot.
504 public void setIconPixmap(Colormap colormap, Pixmap pixmap, Bitmap mask, int hotX, int hotY)
506 // void gtk_drag_set_icon_pixmap (GdkDragContext *context, GdkColormap *colormap, GdkPixmap *pixmap, GdkBitmap *mask, gint hot_x, gint hot_y);
507 gtk_drag_set_icon_pixmap(gdkDragContext, (colormap is null) ? null : colormap.getColormapStruct(), (pixmap is null) ? null : pixmap.getPixmapStruct(), (mask is null) ? null : mask.getBitmapStruct(), hotX, hotY);
511 * Sets pixbuf as the icon for a given drag.
512 * context:
513 * the context for a drag. (This must be called
514 * with a context for the source side of a drag)
515 * pixbuf:
516 * the GdkPixbuf to use as the drag icon.
517 * hot_x:
518 * the X offset within widget of the hotspot.
519 * hot_y:
520 * the Y offset within widget of the hotspot.
522 public void setIconPixbuf(Pixbuf pixbuf, int hotX, int hotY)
524 // void gtk_drag_set_icon_pixbuf (GdkDragContext *context, GdkPixbuf *pixbuf, gint hot_x, gint hot_y);
525 gtk_drag_set_icon_pixbuf(gdkDragContext, (pixbuf is null) ? null : pixbuf.getPixbufStruct(), hotX, hotY);
529 * Sets the icon for a given drag from a stock ID.
530 * context:
531 * the context for a drag. (This must be called
532 * with a context for the source side of a drag)
533 * stock_id:
534 * the ID of the stock icon to use for the drag.
535 * hot_x:
536 * the X offset within the icon of the hotspot.
537 * hot_y:
538 * the Y offset within the icon of the hotspot.
540 public void setIconStock(char[] stockId, int hotX, int hotY)
542 // void gtk_drag_set_icon_stock (GdkDragContext *context, const gchar *stock_id, gint hot_x, gint hot_y);
543 gtk_drag_set_icon_stock(gdkDragContext, Str.toStringz(stockId), hotX, hotY);
547 * Sets the icon for a given drag from a named themed icon. See
548 * the docs for GtkIconTheme for more details. Note that the
549 * size of the icon depends on the icon theme (the icon is
550 * loaded at the symbolic size GTK_ICON_SIZE_DND), thus
551 * hot_x and hot_y have to be used with care.
552 * context:
553 * the context for a drag. (This must be called
554 * with a context for the source side of a drag)
555 * icon_name:
556 * name of icon to use
557 * hot_x:
558 * the X offset of the hotspot within the icon
559 * hot_y:
560 * the Y offset of the hotspot within the icon
561 * Since 2.8
563 public void setIconName(char[] iconName, int hotX, int hotY)
565 // void gtk_drag_set_icon_name (GdkDragContext *context, const gchar *icon_name, gint hot_x, gint hot_y);
566 gtk_drag_set_icon_name(gdkDragContext, Str.toStringz(iconName), hotX, hotY);
570 * Sets the icon for a particular drag to the default
571 * icon.
572 * context:
573 * the context for a drag. (This must be called
574 * with a context for the source side of a drag)
576 public void setIconDefault()
578 // void gtk_drag_set_icon_default (GdkDragContext *context);
579 gtk_drag_set_icon_default(gdkDragContext);
583 * Warning
584 * gtk_drag_set_default_icon is deprecated and should not be used in newly-written code.
585 * Changes the default drag icon. GTK+ retains references for the
586 * arguments, and will release them when they are no longer needed.
587 * This function is obsolete. The default icon should now be changed
588 * via the stock system by changing the stock pixbuf for GTK_STOCK_DND.
589 * colormap:
590 * the colormap of the icon
591 * pixmap:
592 * the image data for the icon
593 * mask:
594 * the transparency mask for an image.
595 * hot_x:
596 * The X offset within widget of the hotspot.
597 * hot_y:
598 * The Y offset within widget of the hotspot.
600 public static void setDefaultIcon(Colormap colormap, Pixmap pixmap, Bitmap mask, int hotX, int hotY)
602 // void gtk_drag_set_default_icon (GdkColormap *colormap, GdkPixmap *pixmap, GdkBitmap *mask, gint hot_x, gint hot_y);
603 gtk_drag_set_default_icon((colormap is null) ? null : colormap.getColormapStruct(), (pixmap is null) ? null : pixmap.getPixmapStruct(), (mask is null) ? null : mask.getBitmapStruct(), hotX, hotY);
607 * Checks to see if a mouse drag starting at (start_x, start_y) and ending
608 * at (current_x, current_y) has passed the GTK+ drag threshold, and thus
609 * should trigger the beginning of a drag-and-drop operation.
610 * widget:
611 * a GtkWidget
612 * start_x:
613 * X coordinate of start of drag
614 * start_y:
615 * Y coordinate of start of drag
616 * current_x:
617 * current X coordinate
618 * current_y:
619 * current Y coordinate
620 * Returns:
621 * TRUE if the drag threshold has been passed.
623 public static int checkThreshold(Widget widget, int startX, int startY, int currentX, int currentY)
625 // gboolean gtk_drag_check_threshold (GtkWidget *widget, gint start_x, gint start_y, gint current_x, gint current_y);
626 return gtk_drag_check_threshold((widget is null) ? null : widget.getWidgetStruct(), startX, startY, currentX, currentY);
630 * Sets up a widget so that GTK+ will start a drag
631 * operation when the user clicks and drags on the
632 * widget. The widget must have a window.
633 * widget:
634 * a GtkWidget
635 * start_button_mask:
636 * the bitmask of buttons that can start the drag
637 * targets:
638 * the table of targets that the drag will support
639 * n_targets:
640 * the number of items in targets
641 * actions:
642 * the bitmask of possible actions for a drag from this
643 * widget.
645 public static void sourceSet(Widget widget, GdkModifierType startButtonMask, GtkTargetEntry* targets, int nTargets, GdkDragAction actions)
647 // void gtk_drag_source_set (GtkWidget *widget, GdkModifierType start_button_mask, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
648 gtk_drag_source_set((widget is null) ? null : widget.getWidgetStruct(), startButtonMask, targets, nTargets, actions);
652 * Sets the icon that will be used for drags from a particular widget
653 * from a pixmap/mask. GTK+ retains references for the arguments, and
654 * will release them when they are no longer needed.
655 * Use gtk_drag_source_set_icon_pixbuf() instead.
656 * widget:
657 * a GtkWidget
658 * colormap:
659 * the colormap of the icon
660 * pixmap:
661 * the image data for the icon
662 * mask:
663 * the transparency mask for an image.
665 public static void sourceSetIcon(Widget widget, Colormap colormap, Pixmap pixmap, Bitmap mask)
667 // void gtk_drag_source_set_icon (GtkWidget *widget, GdkColormap *colormap, GdkPixmap *pixmap, GdkBitmap *mask);
668 gtk_drag_source_set_icon((widget is null) ? null : widget.getWidgetStruct(), (colormap is null) ? null : colormap.getColormapStruct(), (pixmap is null) ? null : pixmap.getPixmapStruct(), (mask is null) ? null : mask.getBitmapStruct());
672 * Sets the icon that will be used for drags from a particular widget
673 * from a GdkPixbuf. GTK+ retains a reference for pixbuf and will
674 * release it when it is no longer needed.
675 * widget:
676 * a GtkWidget
677 * pixbuf:
678 * the GdkPixbuf for the drag icon
680 public static void sourceSetIconPixbuf(Widget widget, Pixbuf pixbuf)
682 // void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget, GdkPixbuf *pixbuf);
683 gtk_drag_source_set_icon_pixbuf((widget is null) ? null : widget.getWidgetStruct(), (pixbuf is null) ? null : pixbuf.getPixbufStruct());
687 * Sets the icon that will be used for drags from a particular source
688 * to a stock icon.
689 * widget:
690 * a GtkWidget
691 * stock_id:
692 * the ID of the stock icon to use
694 public static void sourceSetIconStock(Widget widget, char[] stockId)
696 // void gtk_drag_source_set_icon_stock (GtkWidget *widget, const gchar *stock_id);
697 gtk_drag_source_set_icon_stock((widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(stockId));
701 * Sets the icon that will be used for drags from a particular source
702 * to a themed icon. See the docs for GtkIconTheme for more details.
703 * widget:
704 * a GtkWidget
705 * icon_name:
706 * name of icon to use
707 * Since 2.8
709 public static void sourceSetIconName(Widget widget, char[] iconName)
711 // void gtk_drag_source_set_icon_name (GtkWidget *widget, const gchar *icon_name);
712 gtk_drag_source_set_icon_name((widget is null) ? null : widget.getWidgetStruct(), Str.toStringz(iconName));
716 * Undoes the effects of gtk_drag_source_set().
717 * widget:
718 * a GtkWidget
720 public static void sourceUnset(Widget widget)
722 // void gtk_drag_source_unset (GtkWidget *widget);
723 gtk_drag_source_unset((widget is null) ? null : widget.getWidgetStruct());
727 * Changes the target types that this widget offers for drag-and-drop.
728 * The widget must first be made into a drag source with
729 * gtk_drag_source_set().
730 * widget:
731 * a GtkWidget that's a drag source
732 * target_list:
733 * list of draggable targets, or NULL for none
734 * Since 2.4
736 public static void sourceSetTargetList(Widget widget, GtkTargetList* targetList)
738 // void gtk_drag_source_set_target_list (GtkWidget *widget, GtkTargetList *target_list);
739 gtk_drag_source_set_target_list((widget is null) ? null : widget.getWidgetStruct(), targetList);
743 * Gets the list of targets this widget can provide for
744 * drag-and-drop.
745 * widget:
746 * a GtkWidget
747 * Returns:
748 * the GtkTargetList, or NULL if none
749 * Since 2.4
751 public static GtkTargetList* sourceGetTargetList(Widget widget)
753 // GtkTargetList* gtk_drag_source_get_target_list (GtkWidget *widget);
754 return gtk_drag_source_get_target_list((widget is null) ? null : widget.getWidgetStruct());
758 * Add the text targets supported by GtkSelection to
759 * the target list of the drag source. The targets
760 * are added with info = 0. If you need another value,
761 * use gtk_target_list_add_text_targets() and
762 * gtk_drag_source_set_target_list().
763 * widget:
764 * a GtkWidget that's is a drag source
765 * Since 2.6
767 public static void sourceAddTextTargets(Widget widget)
769 // void gtk_drag_source_add_text_targets (GtkWidget *widget);
770 gtk_drag_source_add_text_targets((widget is null) ? null : widget.getWidgetStruct());
774 * Add the writable image targets supported by GtkSelection to
775 * the target list of the drag source. The targets
776 * are added with info = 0. If you need another value,
777 * use gtk_target_list_add_image_targets() and
778 * gtk_drag_source_set_target_list().
779 * widget:
780 * a GtkWidget that's is a drag source
781 * Since 2.6
783 public static void sourceAddImageTargets(Widget widget)
785 // void gtk_drag_source_add_image_targets (GtkWidget *widget);
786 gtk_drag_source_add_image_targets((widget is null) ? null : widget.getWidgetStruct());
790 * Add the URI targets supported by GtkSelection to
791 * the target list of the drag source. The targets
792 * are added with info = 0. If you need another value,
793 * use gtk_target_list_add_uri_targets() and
794 * gtk_drag_source_set_target_list().
795 * widget:
796 * a GtkWidget that's is a drag source
797 * Since 2.6
799 public static void sourceAddUriTargets(Widget widget)
801 // void gtk_drag_source_add_uri_targets (GtkWidget *widget);
802 gtk_drag_source_add_uri_targets((widget is null) ? null : widget.getWidgetStruct());