1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
34 #include <gdk/gdktypes.h>
35 #include <gdk/gdkdevice.h>
39 typedef struct _GdkDragContext GdkDragContext;
43 GDK_ACTION_DEFAULT = 1 << 0,
44 GDK_ACTION_COPY = 1 << 1,
45 GDK_ACTION_MOVE = 1 << 2,
46 GDK_ACTION_LINK = 1 << 3,
47 GDK_ACTION_PRIVATE = 1 << 4,
48 GDK_ACTION_ASK = 1 << 5
55 GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming
57 GDK_DRAG_PROTO_NONE, /* Not a valid drag window */
58 GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
59 GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */
60 GDK_DRAG_PROTO_LOCAL /* Intra-app */
63 /* Object that holds information about a drag in progress.
64 * this is used on both source and destination sides.
67 typedef struct _GdkDragContextClass GdkDragContextClass;
69 #define GDK_TYPE_DRAG_CONTEXT (gdk_drag_context_get_type ())
70 #define GDK_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
71 #define GDK_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
72 #define GDK_IS_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
73 #define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
74 #define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
76 struct _GdkDragContext {
77 GObject parent_instance;
81 GdkDragProtocol GSEAL (protocol);
83 gboolean GSEAL (is_source);
85 GdkWindow *GSEAL (source_window);
86 GdkWindow *GSEAL (dest_window);
88 GList *GSEAL (targets);
89 GdkDragAction GSEAL (actions);
90 GdkDragAction GSEAL (suggested_action);
91 GdkDragAction GSEAL (action);
93 guint32 GSEAL (start_time);
97 gpointer GSEAL (windowing_data);
100 struct _GdkDragContextClass {
101 GObjectClass parent_class;
107 GType gdk_drag_context_get_type (void) G_GNUC_CONST;
108 GdkDragContext * gdk_drag_context_new (void);
110 void gdk_drag_context_set_device (GdkDragContext *context,
112 GdkDevice * gdk_drag_context_get_device (GdkDragContext *context);
114 GList *gdk_drag_context_list_targets (GdkDragContext *context);
115 GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context);
116 GdkDragAction gdk_drag_context_get_suggested_action (GdkDragContext *context);
117 GdkDragAction gdk_drag_context_get_action (GdkDragContext *context);
119 /* Destination side */
121 void gdk_drag_status (GdkDragContext *context,
122 GdkDragAction action,
124 void gdk_drop_reply (GdkDragContext *context,
127 void gdk_drop_finish (GdkDragContext *context,
130 GdkAtom gdk_drag_get_selection (GdkDragContext *context);
134 GdkDragContext * gdk_drag_begin (GdkWindow *window,
137 GdkNativeWindow gdk_drag_get_protocol_for_display (GdkDisplay *display,
139 GdkDragProtocol *protocol);
141 void gdk_drag_find_window_for_screen (GdkDragContext *context,
142 GdkWindow *drag_window,
146 GdkWindow **dest_window,
147 GdkDragProtocol *protocol);
149 #ifndef GDK_MULTIHEAD_SAFE
150 GdkNativeWindow gdk_drag_get_protocol (GdkNativeWindow xid,
151 GdkDragProtocol *protocol);
153 void gdk_drag_find_window (GdkDragContext *context,
154 GdkWindow *drag_window,
157 GdkWindow **dest_window,
158 GdkDragProtocol *protocol);
159 #endif /* GDK_MULTIHEAD_SAFE */
161 gboolean gdk_drag_motion (GdkDragContext *context,
162 GdkWindow *dest_window,
163 GdkDragProtocol protocol,
166 GdkDragAction suggested_action,
167 GdkDragAction possible_actions,
169 void gdk_drag_drop (GdkDragContext *context,
171 void gdk_drag_abort (GdkDragContext *context,
173 gboolean gdk_drag_drop_succeeded (GdkDragContext *context);
177 #endif /* __GDK_DND_H__ */