]> Pileus Git - ~andy/gtk/blob - gdk/gdkdnd.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gdk / gdkdnd.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 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, see <http://www.gnu.org/licenses/>.
16  */
17
18 /*
19  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20  * file for a list of people on the GTK+ Team.  See the ChangeLog
21  * files for a list of changes.  These files are distributed with
22  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23  */
24
25 #ifndef __GDK_DND_H__
26 #define __GDK_DND_H__
27
28 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
29 #error "Only <gdk/gdk.h> can be included directly."
30 #endif
31
32 #include <gdk/gdktypes.h>
33 #include <gdk/gdkdevice.h>
34
35 G_BEGIN_DECLS
36
37 #define GDK_TYPE_DRAG_CONTEXT              (gdk_drag_context_get_type ())
38 #define GDK_DRAG_CONTEXT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
39 #define GDK_IS_DRAG_CONTEXT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
40
41 /**
42  * GdkDragAction:
43  * @GDK_ACTION_DEFAULT: Means nothing, and should not be used.
44  * @GDK_ACTION_COPY: Copy the data.
45  * @GDK_ACTION_MOVE: Move the data, i.e. first copy it, then delete
46  *  it from the source using the DELETE target of the X selection protocol.
47  * @GDK_ACTION_LINK: Add a link to the data. Note that this is only
48  *  useful if source and destination agree on what it means.
49  * @GDK_ACTION_PRIVATE: Special action which tells the source that the
50  *  destination will do something that the source doesn't understand.
51  * @GDK_ACTION_ASK: Ask the user what to do with the data.
52  *
53  * Used in #GdkDragContext to indicate what the destination
54  * should do with the dropped data.
55  */
56 typedef enum
57 {
58   GDK_ACTION_DEFAULT = 1 << 0,
59   GDK_ACTION_COPY    = 1 << 1,
60   GDK_ACTION_MOVE    = 1 << 2,
61   GDK_ACTION_LINK    = 1 << 3,
62   GDK_ACTION_PRIVATE = 1 << 4,
63   GDK_ACTION_ASK     = 1 << 5
64 } GdkDragAction;
65
66 /**
67  * GdkDragProtocol:
68  * @GDK_DRAG_PROTO_NONE: no protocol.
69  * @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
70  * @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
71  * @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
72  *  unclaimed root window drops.
73  * @GDK_DRAG_PROTO_WIN32_DROPFILES: The simple WM_DROPFILES protocol.
74  * @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented).
75  * @GDK_DRAG_PROTO_LOCAL: Intra-application DND.
76  *
77  * Used in #GdkDragContext to indicate the protocol according to
78  * which DND is done.
79  */
80 typedef enum
81 {
82   GDK_DRAG_PROTO_NONE = 0,
83   GDK_DRAG_PROTO_MOTIF,
84   GDK_DRAG_PROTO_XDND,
85   GDK_DRAG_PROTO_ROOTWIN,
86   GDK_DRAG_PROTO_WIN32_DROPFILES,
87   GDK_DRAG_PROTO_OLE2,
88   GDK_DRAG_PROTO_LOCAL
89 } GdkDragProtocol;
90
91
92 GType            gdk_drag_context_get_type             (void) G_GNUC_CONST;
93
94 void             gdk_drag_context_set_device           (GdkDragContext *context,
95                                                         GdkDevice      *device);
96 GdkDevice *      gdk_drag_context_get_device           (GdkDragContext *context);
97
98 GList           *gdk_drag_context_list_targets         (GdkDragContext *context);
99 GdkDragAction    gdk_drag_context_get_actions          (GdkDragContext *context);
100 GdkDragAction    gdk_drag_context_get_suggested_action (GdkDragContext *context);
101 GdkDragAction    gdk_drag_context_get_selected_action  (GdkDragContext *context);
102
103 GdkWindow       *gdk_drag_context_get_source_window    (GdkDragContext *context);
104 GdkWindow       *gdk_drag_context_get_dest_window      (GdkDragContext *context);
105 GdkDragProtocol  gdk_drag_context_get_protocol         (GdkDragContext *context);
106
107 /* Destination side */
108
109 void             gdk_drag_status        (GdkDragContext   *context,
110                                          GdkDragAction     action,
111                                          guint32           time_);
112 void             gdk_drop_reply         (GdkDragContext   *context,
113                                          gboolean          accepted,
114                                          guint32           time_);
115 void             gdk_drop_finish        (GdkDragContext   *context,
116                                          gboolean          success,
117                                          guint32           time_);
118 GdkAtom          gdk_drag_get_selection (GdkDragContext   *context);
119
120 /* Source side */
121
122 GdkDragContext * gdk_drag_begin            (GdkWindow      *window,
123                                             GList          *targets);
124
125 GdkDragContext * gdk_drag_begin_for_device (GdkWindow      *window,
126                                             GdkDevice      *device,
127                                             GList          *targets);
128
129 void    gdk_drag_find_window_for_screen   (GdkDragContext   *context,
130                                            GdkWindow        *drag_window,
131                                            GdkScreen        *screen,
132                                            gint              x_root,
133                                            gint              y_root,
134                                            GdkWindow       **dest_window,
135                                            GdkDragProtocol  *protocol);
136
137 gboolean        gdk_drag_motion      (GdkDragContext *context,
138                                       GdkWindow      *dest_window,
139                                       GdkDragProtocol protocol,
140                                       gint            x_root,
141                                       gint            y_root,
142                                       GdkDragAction   suggested_action,
143                                       GdkDragAction   possible_actions,
144                                       guint32         time_);
145 void            gdk_drag_drop        (GdkDragContext *context,
146                                       guint32         time_);
147 void            gdk_drag_abort       (GdkDragContext *context,
148                                       guint32         time_);
149 gboolean        gdk_drag_drop_succeeded (GdkDragContext *context);
150
151 G_END_DECLS
152
153 #endif /* __GDK_DND_H__ */