1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdk.DragContext;
26 
27 private import gdk.Device;
28 private import gdk.Screen;
29 private import gdk.Window;
30 private import gdk.c.functions;
31 public  import gdk.c.types;
32 private import glib.ListG;
33 private import gobject.ObjectG;
34 private import gobject.Signals;
35 public  import gtkc.gdktypes;
36 private import std.algorithm;
37 
38 
39 /** */
40 public class DragContext : ObjectG
41 {
42 	/** the main Gtk struct */
43 	protected GdkDragContext* gdkDragContext;
44 
45 	/** Get the main Gtk struct */
46 	public GdkDragContext* getDragContextStruct(bool transferOwnership = false)
47 	{
48 		if (transferOwnership)
49 			ownedRef = false;
50 		return gdkDragContext;
51 	}
52 
53 	/** the main Gtk struct as a void* */
54 	protected override void* getStruct()
55 	{
56 		return cast(void*)gdkDragContext;
57 	}
58 
59 	protected override void setStruct(GObject* obj)
60 	{
61 		gdkDragContext = cast(GdkDragContext*)obj;
62 		super.setStruct(obj);
63 	}
64 
65 	/**
66 	 * Sets our main struct and passes it to the parent class.
67 	 */
68 	public this (GdkDragContext* gdkDragContext, bool ownedRef = false)
69 	{
70 		this.gdkDragContext = gdkDragContext;
71 		super(cast(GObject*)gdkDragContext, ownedRef);
72 	}
73 
74 
75 	/** */
76 	public static GType getType()
77 	{
78 		return gdk_drag_context_get_type();
79 	}
80 
81 	/**
82 	 * Determines the bitmask of actions proposed by the source if
83 	 * gdk_drag_context_get_suggested_action() returns %GDK_ACTION_ASK.
84 	 *
85 	 * Returns: the #GdkDragAction flags
86 	 *
87 	 * Since: 2.22
88 	 */
89 	public GdkDragAction getActions()
90 	{
91 		return gdk_drag_context_get_actions(gdkDragContext);
92 	}
93 
94 	/**
95 	 * Returns the destination windw for the DND operation.
96 	 *
97 	 * Returns: a #GdkWindow
98 	 *
99 	 * Since: 3.0
100 	 */
101 	public Window getDestWindow()
102 	{
103 		auto p = gdk_drag_context_get_dest_window(gdkDragContext);
104 
105 		if(p is null)
106 		{
107 			return null;
108 		}
109 
110 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
111 	}
112 
113 	/**
114 	 * Returns the #GdkDevice associated to the drag context.
115 	 *
116 	 * Returns: The #GdkDevice associated to @context.
117 	 */
118 	public Device getDevice()
119 	{
120 		auto p = gdk_drag_context_get_device(gdkDragContext);
121 
122 		if(p is null)
123 		{
124 			return null;
125 		}
126 
127 		return ObjectG.getDObject!(Device)(cast(GdkDevice*) p);
128 	}
129 
130 	/**
131 	 * Returns the window on which the drag icon should be rendered
132 	 * during the drag operation. Note that the window may not be
133 	 * available until the drag operation has begun. GDK will move
134 	 * the window in accordance with the ongoing drag operation.
135 	 * The window is owned by @context and will be destroyed when
136 	 * the drag operation is over.
137 	 *
138 	 * Returns: the drag window, or %NULL
139 	 *
140 	 * Since: 3.20
141 	 */
142 	public Window getDragWindow()
143 	{
144 		auto p = gdk_drag_context_get_drag_window(gdkDragContext);
145 
146 		if(p is null)
147 		{
148 			return null;
149 		}
150 
151 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
152 	}
153 
154 	/**
155 	 * Returns the drag protocol thats used by this context.
156 	 *
157 	 * Returns: the drag protocol
158 	 *
159 	 * Since: 3.0
160 	 */
161 	public GdkDragProtocol getProtocol()
162 	{
163 		return gdk_drag_context_get_protocol(gdkDragContext);
164 	}
165 
166 	/**
167 	 * Determines the action chosen by the drag destination.
168 	 *
169 	 * Returns: a #GdkDragAction value
170 	 *
171 	 * Since: 2.22
172 	 */
173 	public GdkDragAction getSelectedAction()
174 	{
175 		return gdk_drag_context_get_selected_action(gdkDragContext);
176 	}
177 
178 	/**
179 	 * Returns the #GdkWindow where the DND operation started.
180 	 *
181 	 * Returns: a #GdkWindow
182 	 *
183 	 * Since: 2.22
184 	 */
185 	public Window getSourceWindow()
186 	{
187 		auto p = gdk_drag_context_get_source_window(gdkDragContext);
188 
189 		if(p is null)
190 		{
191 			return null;
192 		}
193 
194 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
195 	}
196 
197 	/**
198 	 * Determines the suggested drag action of the context.
199 	 *
200 	 * Returns: a #GdkDragAction value
201 	 *
202 	 * Since: 2.22
203 	 */
204 	public GdkDragAction getSuggestedAction()
205 	{
206 		return gdk_drag_context_get_suggested_action(gdkDragContext);
207 	}
208 
209 	/**
210 	 * Retrieves the list of targets of the context.
211 	 *
212 	 * Returns: a #GList of targets
213 	 *
214 	 * Since: 2.22
215 	 */
216 	public ListG listTargets()
217 	{
218 		auto p = gdk_drag_context_list_targets(gdkDragContext);
219 
220 		if(p is null)
221 		{
222 			return null;
223 		}
224 
225 		return new ListG(cast(GList*) p);
226 	}
227 
228 	/**
229 	 * Requests the drag and drop operation to be managed by @context.
230 	 * When a drag and drop operation becomes managed, the #GdkDragContext
231 	 * will internally handle all input and source-side #GdkEventDND events
232 	 * as required by the windowing system.
233 	 *
234 	 * Once the drag and drop operation is managed, the drag context will
235 	 * emit the following signals:
236 	 * - The #GdkDragContext::action-changed signal whenever the final action
237 	 * to be performed by the drag and drop operation changes.
238 	 * - The #GdkDragContext::drop-performed signal after the user performs
239 	 * the drag and drop gesture (typically by releasing the mouse button).
240 	 * - The #GdkDragContext::dnd-finished signal after the drag and drop
241 	 * operation concludes (after all #GdkSelection transfers happen).
242 	 * - The #GdkDragContext::cancel signal if the drag and drop operation is
243 	 * finished but doesn't happen over an accepting destination, or is
244 	 * cancelled through other means.
245 	 *
246 	 * Params:
247 	 *     ipcWindow = Window to use for IPC messaging/events
248 	 *     actions = the actions supported by the drag source
249 	 *
250 	 * Returns: #TRUE if the drag and drop operation is managed.
251 	 *
252 	 * Since: 3.20
253 	 */
254 	public bool manageDnd(Window ipcWindow, GdkDragAction actions)
255 	{
256 		return gdk_drag_context_manage_dnd(gdkDragContext, (ipcWindow is null) ? null : ipcWindow.getWindowStruct(), actions) != 0;
257 	}
258 
259 	/**
260 	 * Associates a #GdkDevice to @context, so all Drag and Drop events
261 	 * for @context are emitted as if they came from this device.
262 	 *
263 	 * Params:
264 	 *     device = a #GdkDevice
265 	 */
266 	public void setDevice(Device device)
267 	{
268 		gdk_drag_context_set_device(gdkDragContext, (device is null) ? null : device.getDeviceStruct());
269 	}
270 
271 	/**
272 	 * Sets the position of the drag window that will be kept
273 	 * under the cursor hotspot. Initially, the hotspot is at the
274 	 * top left corner of the drag window.
275 	 *
276 	 * Params:
277 	 *     hotX = x coordinate of the drag window hotspot
278 	 *     hotY = y coordinate of the drag window hotspot
279 	 *
280 	 * Since: 3.20
281 	 */
282 	public void setHotspot(int hotX, int hotY)
283 	{
284 		gdk_drag_context_set_hotspot(gdkDragContext, hotX, hotY);
285 	}
286 
287 	protected class OnActionChangedDelegateWrapper
288 	{
289 		void delegate(GdkDragAction, DragContext) dlg;
290 		gulong handlerId;
291 
292 		this(void delegate(GdkDragAction, DragContext) dlg)
293 		{
294 			this.dlg = dlg;
295 			onActionChangedListeners ~= this;
296 		}
297 
298 		void remove(OnActionChangedDelegateWrapper source)
299 		{
300 			foreach(index, wrapper; onActionChangedListeners)
301 			{
302 				if (wrapper.handlerId == source.handlerId)
303 				{
304 					onActionChangedListeners[index] = null;
305 					onActionChangedListeners = std.algorithm.remove(onActionChangedListeners, index);
306 					break;
307 				}
308 			}
309 		}
310 	}
311 	OnActionChangedDelegateWrapper[] onActionChangedListeners;
312 
313 	/**
314 	 * A new action is being chosen for the drag and drop operation.
315 	 *
316 	 * This signal will only be emitted if the #GdkDragContext manages
317 	 * the drag and drop operation. See gdk_drag_context_manage_dnd()
318 	 * for more information.
319 	 *
320 	 * Params:
321 	 *     action = The action currently chosen
322 	 *
323 	 * Since: 3.20
324 	 */
325 	gulong addOnActionChanged(void delegate(GdkDragAction, DragContext) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
326 	{
327 		auto wrapper = new OnActionChangedDelegateWrapper(dlg);
328 		wrapper.handlerId = Signals.connectData(
329 			this,
330 			"action-changed",
331 			cast(GCallback)&callBackActionChanged,
332 			cast(void*)wrapper,
333 			cast(GClosureNotify)&callBackActionChangedDestroy,
334 			connectFlags);
335 		return wrapper.handlerId;
336 	}
337 
338 	extern(C) static void callBackActionChanged(GdkDragContext* dragcontextStruct, GdkDragAction action, OnActionChangedDelegateWrapper wrapper)
339 	{
340 		wrapper.dlg(action, wrapper.outer);
341 	}
342 
343 	extern(C) static void callBackActionChangedDestroy(OnActionChangedDelegateWrapper wrapper, GClosure* closure)
344 	{
345 		wrapper.remove(wrapper);
346 	}
347 
348 	protected class OnCancelDelegateWrapper
349 	{
350 		void delegate(GdkDragCancelReason, DragContext) dlg;
351 		gulong handlerId;
352 
353 		this(void delegate(GdkDragCancelReason, DragContext) dlg)
354 		{
355 			this.dlg = dlg;
356 			onCancelListeners ~= this;
357 		}
358 
359 		void remove(OnCancelDelegateWrapper source)
360 		{
361 			foreach(index, wrapper; onCancelListeners)
362 			{
363 				if (wrapper.handlerId == source.handlerId)
364 				{
365 					onCancelListeners[index] = null;
366 					onCancelListeners = std.algorithm.remove(onCancelListeners, index);
367 					break;
368 				}
369 			}
370 		}
371 	}
372 	OnCancelDelegateWrapper[] onCancelListeners;
373 
374 	/**
375 	 * The drag and drop operation was cancelled.
376 	 *
377 	 * This signal will only be emitted if the #GdkDragContext manages
378 	 * the drag and drop operation. See gdk_drag_context_manage_dnd()
379 	 * for more information.
380 	 *
381 	 * Params:
382 	 *     reason = The reason the context was cancelled
383 	 *
384 	 * Since: 3.20
385 	 */
386 	gulong addOnCancel(void delegate(GdkDragCancelReason, DragContext) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
387 	{
388 		auto wrapper = new OnCancelDelegateWrapper(dlg);
389 		wrapper.handlerId = Signals.connectData(
390 			this,
391 			"cancel",
392 			cast(GCallback)&callBackCancel,
393 			cast(void*)wrapper,
394 			cast(GClosureNotify)&callBackCancelDestroy,
395 			connectFlags);
396 		return wrapper.handlerId;
397 	}
398 
399 	extern(C) static void callBackCancel(GdkDragContext* dragcontextStruct, GdkDragCancelReason reason, OnCancelDelegateWrapper wrapper)
400 	{
401 		wrapper.dlg(reason, wrapper.outer);
402 	}
403 
404 	extern(C) static void callBackCancelDestroy(OnCancelDelegateWrapper wrapper, GClosure* closure)
405 	{
406 		wrapper.remove(wrapper);
407 	}
408 
409 	protected class OnDndFinishedDelegateWrapper
410 	{
411 		void delegate(DragContext) dlg;
412 		gulong handlerId;
413 
414 		this(void delegate(DragContext) dlg)
415 		{
416 			this.dlg = dlg;
417 			onDndFinishedListeners ~= this;
418 		}
419 
420 		void remove(OnDndFinishedDelegateWrapper source)
421 		{
422 			foreach(index, wrapper; onDndFinishedListeners)
423 			{
424 				if (wrapper.handlerId == source.handlerId)
425 				{
426 					onDndFinishedListeners[index] = null;
427 					onDndFinishedListeners = std.algorithm.remove(onDndFinishedListeners, index);
428 					break;
429 				}
430 			}
431 		}
432 	}
433 	OnDndFinishedDelegateWrapper[] onDndFinishedListeners;
434 
435 	/**
436 	 * The drag and drop operation was finished, the drag destination
437 	 * finished reading all data. The drag source can now free all
438 	 * miscellaneous data.
439 	 *
440 	 * This signal will only be emitted if the #GdkDragContext manages
441 	 * the drag and drop operation. See gdk_drag_context_manage_dnd()
442 	 * for more information.
443 	 *
444 	 * Since: 3.20
445 	 */
446 	gulong addOnDndFinished(void delegate(DragContext) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
447 	{
448 		auto wrapper = new OnDndFinishedDelegateWrapper(dlg);
449 		wrapper.handlerId = Signals.connectData(
450 			this,
451 			"dnd-finished",
452 			cast(GCallback)&callBackDndFinished,
453 			cast(void*)wrapper,
454 			cast(GClosureNotify)&callBackDndFinishedDestroy,
455 			connectFlags);
456 		return wrapper.handlerId;
457 	}
458 
459 	extern(C) static void callBackDndFinished(GdkDragContext* dragcontextStruct, OnDndFinishedDelegateWrapper wrapper)
460 	{
461 		wrapper.dlg(wrapper.outer);
462 	}
463 
464 	extern(C) static void callBackDndFinishedDestroy(OnDndFinishedDelegateWrapper wrapper, GClosure* closure)
465 	{
466 		wrapper.remove(wrapper);
467 	}
468 
469 	protected class OnDropPerformedDelegateWrapper
470 	{
471 		void delegate(int, DragContext) dlg;
472 		gulong handlerId;
473 
474 		this(void delegate(int, DragContext) dlg)
475 		{
476 			this.dlg = dlg;
477 			onDropPerformedListeners ~= this;
478 		}
479 
480 		void remove(OnDropPerformedDelegateWrapper source)
481 		{
482 			foreach(index, wrapper; onDropPerformedListeners)
483 			{
484 				if (wrapper.handlerId == source.handlerId)
485 				{
486 					onDropPerformedListeners[index] = null;
487 					onDropPerformedListeners = std.algorithm.remove(onDropPerformedListeners, index);
488 					break;
489 				}
490 			}
491 		}
492 	}
493 	OnDropPerformedDelegateWrapper[] onDropPerformedListeners;
494 
495 	/**
496 	 * The drag and drop operation was performed on an accepting client.
497 	 *
498 	 * This signal will only be emitted if the #GdkDragContext manages
499 	 * the drag and drop operation. See gdk_drag_context_manage_dnd()
500 	 * for more information.
501 	 *
502 	 * Params:
503 	 *     time = the time at which the drop happened.
504 	 *
505 	 * Since: 3.20
506 	 */
507 	gulong addOnDropPerformed(void delegate(int, DragContext) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
508 	{
509 		auto wrapper = new OnDropPerformedDelegateWrapper(dlg);
510 		wrapper.handlerId = Signals.connectData(
511 			this,
512 			"drop-performed",
513 			cast(GCallback)&callBackDropPerformed,
514 			cast(void*)wrapper,
515 			cast(GClosureNotify)&callBackDropPerformedDestroy,
516 			connectFlags);
517 		return wrapper.handlerId;
518 	}
519 
520 	extern(C) static void callBackDropPerformed(GdkDragContext* dragcontextStruct, int time, OnDropPerformedDelegateWrapper wrapper)
521 	{
522 		wrapper.dlg(time, wrapper.outer);
523 	}
524 
525 	extern(C) static void callBackDropPerformedDestroy(OnDropPerformedDelegateWrapper wrapper, GClosure* closure)
526 	{
527 		wrapper.remove(wrapper);
528 	}
529 
530 	/**
531 	 * Aborts a drag without dropping.
532 	 *
533 	 * This function is called by the drag source.
534 	 *
535 	 * This function does not need to be called in managed drag and drop
536 	 * operations. See gdk_drag_context_manage_dnd() for more information.
537 	 *
538 	 * Params:
539 	 *     context = a #GdkDragContext
540 	 *     time = the timestamp for this operation
541 	 */
542 	public static void dragAbort(DragContext context, uint time)
543 	{
544 		gdk_drag_abort((context is null) ? null : context.getDragContextStruct(), time);
545 	}
546 
547 	/**
548 	 * Starts a drag and creates a new drag context for it.
549 	 * This function assumes that the drag is controlled by the
550 	 * client pointer device, use gdk_drag_begin_for_device() to
551 	 * begin a drag with a different device.
552 	 *
553 	 * This function is called by the drag source.
554 	 *
555 	 * Params:
556 	 *     window = the source window for this drag.
557 	 *     targets = the offered targets,
558 	 *         as list of #GdkAtoms
559 	 *
560 	 * Returns: a newly created #GdkDragContext
561 	 */
562 	public static DragContext dragBegin(Window window, ListG targets)
563 	{
564 		auto p = gdk_drag_begin((window is null) ? null : window.getWindowStruct(), (targets is null) ? null : targets.getListGStruct());
565 
566 		if(p is null)
567 		{
568 			return null;
569 		}
570 
571 		return ObjectG.getDObject!(DragContext)(cast(GdkDragContext*) p, true);
572 	}
573 
574 	/**
575 	 * Starts a drag and creates a new drag context for it.
576 	 *
577 	 * This function is called by the drag source.
578 	 *
579 	 * Params:
580 	 *     window = the source window for this drag
581 	 *     device = the device that controls this drag
582 	 *     targets = the offered targets,
583 	 *         as list of #GdkAtoms
584 	 *
585 	 * Returns: a newly created #GdkDragContext
586 	 */
587 	public static DragContext dragBeginForDevice(Window window, Device device, ListG targets)
588 	{
589 		auto p = gdk_drag_begin_for_device((window is null) ? null : window.getWindowStruct(), (device is null) ? null : device.getDeviceStruct(), (targets is null) ? null : targets.getListGStruct());
590 
591 		if(p is null)
592 		{
593 			return null;
594 		}
595 
596 		return ObjectG.getDObject!(DragContext)(cast(GdkDragContext*) p, true);
597 	}
598 
599 	/**
600 	 * Starts a drag and creates a new drag context for it.
601 	 *
602 	 * This function is called by the drag source.
603 	 *
604 	 * Params:
605 	 *     window = the source window for this drag
606 	 *     device = the device that controls this drag
607 	 *     targets = the offered targets,
608 	 *         as list of #GdkAtoms
609 	 *     xRoot = the x coordinate where the drag nominally started
610 	 *     yRoot = the y coordinate where the drag nominally started
611 	 *
612 	 * Returns: a newly created #GdkDragContext
613 	 *
614 	 * Since: 3.20
615 	 */
616 	public static DragContext dragBeginFromPoint(Window window, Device device, ListG targets, int xRoot, int yRoot)
617 	{
618 		auto p = gdk_drag_begin_from_point((window is null) ? null : window.getWindowStruct(), (device is null) ? null : device.getDeviceStruct(), (targets is null) ? null : targets.getListGStruct(), xRoot, yRoot);
619 
620 		if(p is null)
621 		{
622 			return null;
623 		}
624 
625 		return ObjectG.getDObject!(DragContext)(cast(GdkDragContext*) p, true);
626 	}
627 
628 	/**
629 	 * Drops on the current destination.
630 	 *
631 	 * This function is called by the drag source.
632 	 *
633 	 * This function does not need to be called in managed drag and drop
634 	 * operations. See gdk_drag_context_manage_dnd() for more information.
635 	 *
636 	 * Params:
637 	 *     context = a #GdkDragContext
638 	 *     time = the timestamp for this operation
639 	 */
640 	public static void dragDrop(DragContext context, uint time)
641 	{
642 		gdk_drag_drop((context is null) ? null : context.getDragContextStruct(), time);
643 	}
644 
645 	/**
646 	 * Inform GDK if the drop ended successfully. Passing %FALSE
647 	 * for @success may trigger a drag cancellation animation.
648 	 *
649 	 * This function is called by the drag source, and should
650 	 * be the last call before dropping the reference to the
651 	 * @context.
652 	 *
653 	 * The #GdkDragContext will only take the first gdk_drag_drop_done()
654 	 * call as effective, if this function is called multiple times,
655 	 * all subsequent calls will be ignored.
656 	 *
657 	 * Params:
658 	 *     context = a #GdkDragContext
659 	 *     success = whether the drag was ultimatively successful
660 	 *
661 	 * Since: 3.20
662 	 */
663 	public static void dragDropDone(DragContext context, bool success)
664 	{
665 		gdk_drag_drop_done((context is null) ? null : context.getDragContextStruct(), success);
666 	}
667 
668 	/**
669 	 * Returns whether the dropped data has been successfully
670 	 * transferred. This function is intended to be used while
671 	 * handling a %GDK_DROP_FINISHED event, its return value is
672 	 * meaningless at other times.
673 	 *
674 	 * Params:
675 	 *     context = a #GdkDragContext
676 	 *
677 	 * Returns: %TRUE if the drop was successful.
678 	 *
679 	 * Since: 2.6
680 	 */
681 	public static bool dragDropSucceeded(DragContext context)
682 	{
683 		return gdk_drag_drop_succeeded((context is null) ? null : context.getDragContextStruct()) != 0;
684 	}
685 
686 	/**
687 	 * Finds the destination window and DND protocol to use at the
688 	 * given pointer position.
689 	 *
690 	 * This function is called by the drag source to obtain the
691 	 * @dest_window and @protocol parameters for gdk_drag_motion().
692 	 *
693 	 * Params:
694 	 *     context = a #GdkDragContext
695 	 *     dragWindow = a window which may be at the pointer position, but
696 	 *         should be ignored, since it is put up by the drag source as an icon
697 	 *     screen = the screen where the destination window is sought
698 	 *     xRoot = the x position of the pointer in root coordinates
699 	 *     yRoot = the y position of the pointer in root coordinates
700 	 *     destWindow = location to store the destination window in
701 	 *     protocol = location to store the DND protocol in
702 	 *
703 	 * Since: 2.2
704 	 */
705 	public static void dragFindWindowForScreen(DragContext context, Window dragWindow, Screen screen, int xRoot, int yRoot, out Window destWindow, out GdkDragProtocol protocol)
706 	{
707 		GdkWindow* outdestWindow = null;
708 
709 		gdk_drag_find_window_for_screen((context is null) ? null : context.getDragContextStruct(), (dragWindow is null) ? null : dragWindow.getWindowStruct(), (screen is null) ? null : screen.getScreenStruct(), xRoot, yRoot, &outdestWindow, &protocol);
710 
711 		destWindow = ObjectG.getDObject!(Window)(outdestWindow);
712 	}
713 
714 	/**
715 	 * Returns the selection atom for the current source window.
716 	 *
717 	 * Params:
718 	 *     context = a #GdkDragContext.
719 	 *
720 	 * Returns: the selection atom, or %GDK_NONE
721 	 */
722 	public static GdkAtom dragGetSelection(DragContext context)
723 	{
724 		return gdk_drag_get_selection((context is null) ? null : context.getDragContextStruct());
725 	}
726 
727 	/**
728 	 * Updates the drag context when the pointer moves or the
729 	 * set of actions changes.
730 	 *
731 	 * This function is called by the drag source.
732 	 *
733 	 * This function does not need to be called in managed drag and drop
734 	 * operations. See gdk_drag_context_manage_dnd() for more information.
735 	 *
736 	 * Params:
737 	 *     context = a #GdkDragContext
738 	 *     destWindow = the new destination window, obtained by
739 	 *         gdk_drag_find_window()
740 	 *     protocol = the DND protocol in use, obtained by gdk_drag_find_window()
741 	 *     xRoot = the x position of the pointer in root coordinates
742 	 *     yRoot = the y position of the pointer in root coordinates
743 	 *     suggestedAction = the suggested action
744 	 *     possibleActions = the possible actions
745 	 *     time = the timestamp for this operation
746 	 */
747 	public static bool dragMotion(DragContext context, Window destWindow, GdkDragProtocol protocol, int xRoot, int yRoot, GdkDragAction suggestedAction, GdkDragAction possibleActions, uint time)
748 	{
749 		return gdk_drag_motion((context is null) ? null : context.getDragContextStruct(), (destWindow is null) ? null : destWindow.getWindowStruct(), protocol, xRoot, yRoot, suggestedAction, possibleActions, time) != 0;
750 	}
751 
752 	/**
753 	 * Selects one of the actions offered by the drag source.
754 	 *
755 	 * This function is called by the drag destination in response to
756 	 * gdk_drag_motion() called by the drag source.
757 	 *
758 	 * Params:
759 	 *     context = a #GdkDragContext
760 	 *     action = the selected action which will be taken when a drop happens,
761 	 *         or 0 to indicate that a drop will not be accepted
762 	 *     time = the timestamp for this operation
763 	 */
764 	public static void dragStatus(DragContext context, GdkDragAction action, uint time)
765 	{
766 		gdk_drag_status((context is null) ? null : context.getDragContextStruct(), action, time);
767 	}
768 
769 	/**
770 	 * Ends the drag operation after a drop.
771 	 *
772 	 * This function is called by the drag destination.
773 	 *
774 	 * Params:
775 	 *     context = a #GdkDragContext
776 	 *     success = %TRUE if the data was successfully received
777 	 *     time = the timestamp for this operation
778 	 */
779 	public static void dropFinish(DragContext context, bool success, uint time)
780 	{
781 		gdk_drop_finish((context is null) ? null : context.getDragContextStruct(), success, time);
782 	}
783 
784 	/**
785 	 * Accepts or rejects a drop.
786 	 *
787 	 * This function is called by the drag destination in response
788 	 * to a drop initiated by the drag source.
789 	 *
790 	 * Params:
791 	 *     context = a #GdkDragContext
792 	 *     accepted = %TRUE if the drop is accepted
793 	 *     time = the timestamp for this operation
794 	 */
795 	public static void dropReply(DragContext context, bool accepted, uint time)
796 	{
797 		gdk_drop_reply((context is null) ? null : context.getDragContextStruct(), accepted, time);
798 	}
799 }