]> Pileus Git - ~andy/gtk/blob - gdk/gdkdnd.c
Revert name change
[~andy/gtk] / gdk / gdkdnd.c
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1999 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #include "config.h"
28 #include <gdkdnd.h>
29 #include <gdkdrawable.h>
30 #include <gdkdisplay.h>
31 #include "gdkalias.h"
32
33 /**
34  * gdk_drag_find_window:
35  * @context: a #GdkDragContext.
36  * @drag_window: a window which may be at the pointer position, but
37  *      should be ignored, since it is put up by the drag source as an icon.
38  * @x_root: the x position of the pointer in root coordinates.
39  * @y_root: the y position of the pointer in root coordinates.
40  * @dest_window: location to store the destination window in.
41  * @protocol: location to store the DND protocol in.
42  * 
43  * Finds the destination window and DND protocol to use at the
44  * given pointer position. 
45  *
46  * This function is called by the drag source to obtain the 
47  * @dest_window and @protocol parameters for gdk_drag_motion().
48  **/
49 void
50 gdk_drag_find_window (GdkDragContext  *context,
51                       GdkWindow       *drag_window,
52                       gint             x_root,
53                       gint             y_root,
54                       GdkWindow      **dest_window,
55                       GdkDragProtocol *protocol)
56 {
57   gdk_drag_find_window_for_screen (context, drag_window,
58                                    gdk_drawable_get_screen (context->source_window),
59                                    x_root, y_root, dest_window, protocol);
60 }
61
62 /**
63  * gdk_drag_get_protocol:
64  * @xid: the X id of the destination window.
65  * @protocol: location where the supported DND protocol is returned.
66  * 
67  * Finds out the DND protocol supported by a window.
68  * 
69  * Return value: the X id of the window where the drop should happen. This 
70  *    may be @xid or the X id of a proxy window, or None if @xid doesn't
71  *    support Drag and Drop.
72  **/
73 guint32
74 gdk_drag_get_protocol (guint32          xid,
75                        GdkDragProtocol *protocol)
76 {
77   return gdk_drag_get_protocol_for_display (gdk_display_get_default (), xid, protocol);
78 }
79
80 #define __GDK_DND_C__
81 #include "gdkaliasdef.c"