]> Pileus Git - ~andy/gtk/blob - gdk/broadway/gdkdnd-broadway.c
14fd172baa07074ffa7d5b6b2ab556132d6e037d
[~andy/gtk] / gdk / broadway / gdkdnd-broadway.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
29 #include "gdkdnd.h"
30
31 #include "gdkmain.h"
32 #include "gdkproperty.h"
33 #include "gdkprivate-broadway.h"
34 #include "gdkinternals.h"
35 #include "gdkscreen-broadway.h"
36 #include "gdkdisplay-broadway.h"
37
38 #include <string.h>
39
40 typedef struct _GdkDragContextPrivateBroadway GdkDragContextPrivateBroadway;
41
42 /* Structure that holds information about a drag in progress.
43  * this is used on both source and destination sides.
44  */
45 struct _GdkDragContextPrivateBroadway {
46   GdkDragContext context;
47 };
48
49 #define PRIVATE_DATA(context) ((GdkDragContextPrivateBroadway *) GDK_DRAG_CONTEXT (context)->windowing_data)
50
51 static void gdk_drag_context_finalize (GObject *object);
52
53 static GList *contexts;
54
55 G_DEFINE_TYPE (GdkDragContext, gdk_drag_context, G_TYPE_OBJECT)
56
57 static void
58 gdk_drag_context_init (GdkDragContext *dragcontext)
59 {
60   GdkDragContextPrivateBroadway *private;
61
62   private = G_TYPE_INSTANCE_GET_PRIVATE (dragcontext,
63                                          GDK_TYPE_DRAG_CONTEXT,
64                                          GdkDragContextPrivateBroadway);
65
66   dragcontext->windowing_data = private;
67
68   contexts = g_list_prepend (contexts, dragcontext);
69 }
70
71 static void
72 gdk_drag_context_class_init (GdkDragContextClass *klass)
73 {
74   GObjectClass *object_class = G_OBJECT_CLASS (klass);
75
76   object_class->finalize = gdk_drag_context_finalize;
77
78   g_type_class_add_private (object_class, sizeof (GdkDragContextPrivateBroadway));
79 }
80
81 static void
82 gdk_drag_context_finalize (GObject *object)
83 {
84   GdkDragContext *context = GDK_DRAG_CONTEXT (object);
85
86   contexts = g_list_remove (contexts, context);
87
88   G_OBJECT_CLASS (gdk_drag_context_parent_class)->finalize (object);
89 }
90
91 /* Drag Contexts */
92
93 GdkDragContext *
94 gdk_drag_context_new (void)
95 {
96   return g_object_new (GDK_TYPE_DRAG_CONTEXT, NULL);
97 }
98
99 void
100 gdk_drag_context_set_device (GdkDragContext *context,
101                              GdkDevice      *device)
102 {
103   g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
104   g_return_if_fail (GDK_IS_DEVICE (device));
105 }
106
107 GdkDevice *
108 gdk_drag_context_get_device (GdkDragContext *context)
109 {
110   g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
111
112   return NULL;
113 }
114
115 GdkDragContext * 
116 gdk_drag_begin (GdkWindow     *window,
117                 GList         *targets)
118 {
119   GdkDragContext *new_context;
120
121   g_return_val_if_fail (window != NULL, NULL);
122   g_return_val_if_fail (GDK_WINDOW_IS_BROADWAY (window), NULL);
123
124   new_context = gdk_drag_context_new ();
125
126   return new_context;
127 }
128
129 GdkNativeWindow
130 gdk_drag_get_protocol_for_display (GdkDisplay      *display,
131                                    GdkNativeWindow  xid,
132                                    GdkDragProtocol *protocol)
133 {
134   return 0;
135 }
136
137 void
138 gdk_drag_find_window_for_screen (GdkDragContext  *context,
139                                  GdkWindow       *drag_window,
140                                  GdkScreen       *screen,
141                                  gint             x_root,
142                                  gint             y_root,
143                                  GdkWindow      **dest_window,
144                                  GdkDragProtocol *protocol)
145 {
146   g_return_if_fail (context != NULL);
147 }
148
149 gboolean
150 gdk_drag_motion (GdkDragContext *context,
151                  GdkWindow      *dest_window,
152                  GdkDragProtocol protocol,
153                  gint            x_root,
154                  gint            y_root,
155                  GdkDragAction   suggested_action,
156                  GdkDragAction   possible_actions,
157                  guint32         time)
158 {
159   g_return_val_if_fail (context != NULL, FALSE);
160   g_return_val_if_fail (dest_window == NULL || GDK_WINDOW_IS_BROADWAY (dest_window), FALSE);
161
162   return FALSE;
163 }
164
165 void
166 gdk_drag_drop (GdkDragContext *context,
167                guint32         time)
168 {
169   g_return_if_fail (context != NULL);
170 }
171
172 void
173 gdk_drag_abort (GdkDragContext *context,
174                 guint32         time)
175 {
176   g_return_if_fail (context != NULL);
177 }
178
179 /* Destination side */
180
181 void
182 gdk_drag_status (GdkDragContext   *context,
183                  GdkDragAction     action,
184                  guint32           time)
185 {
186   g_return_if_fail (context != NULL);
187 }
188
189 void
190 gdk_drop_reply (GdkDragContext   *context,
191                 gboolean          ok,
192                 guint32           time)
193 {
194   g_return_if_fail (context != NULL);
195 }
196
197 void
198 gdk_drop_finish (GdkDragContext   *context,
199                  gboolean          success,
200                  guint32           time)
201 {
202   g_return_if_fail (context != NULL);
203 }
204
205 void
206 gdk_window_register_dnd (GdkWindow      *window)
207 {
208 }
209
210 GdkAtom
211 gdk_drag_get_selection (GdkDragContext *context)
212 {
213   g_return_val_if_fail (context != NULL, GDK_NONE);
214
215   return GDK_NONE;
216 }
217
218 gboolean
219 gdk_drag_drop_succeeded (GdkDragContext *context)
220 {
221   g_return_val_if_fail (context != NULL, FALSE);
222
223   return FALSE;
224 }
225
226 void
227 _gdk_dnd_init (GdkDisplay *display)
228 {
229 }