3 * Copyright (C) 2005 Imendio AB
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 #include "gdkprivate-quartz.h"
24 static gpointer parent_class = NULL;
27 gdk_drag_context_finalize (GObject *object)
29 GdkDragContext *context = GDK_DRAG_CONTEXT (object);
30 GdkDragContextPrivate *private = GDK_DRAG_CONTEXT_PRIVATE (context);
34 G_OBJECT_CLASS (parent_class)->finalize (object);
38 gdk_drag_context_init (GdkDragContext *dragcontext)
40 GdkDragContextPrivate *priv = g_new0 (GdkDragContextPrivate, 1);
42 dragcontext->windowing_data = priv;
46 gdk_drag_context_class_init (GdkDragContextClass *klass)
48 GObjectClass *object_class = G_OBJECT_CLASS (klass);
50 parent_class = g_type_class_peek_parent (klass);
52 object_class->finalize = gdk_drag_context_finalize;
56 gdk_drag_context_get_type (void)
58 static GType object_type = 0;
62 const GTypeInfo object_info =
64 sizeof (GdkDragContextClass),
66 (GBaseFinalizeFunc) NULL,
67 (GClassInitFunc) gdk_drag_context_class_init,
68 NULL, /* class_finalize */
69 NULL, /* class_data */
70 sizeof (GdkDragContext),
72 (GInstanceInitFunc) gdk_drag_context_init,
75 object_type = g_type_register_static (G_TYPE_OBJECT,
85 gdk_drag_context_new (void)
87 return (GdkDragContext *)g_object_new (gdk_drag_context_get_type (), NULL);
91 * gdk_drag_context_set_device:
92 * @context: a #GdkDragContext
93 * @device: a #GdkDevice
95 * Associates a #GdkDevice to @context, so all Drag and Drop events
96 * for @context are emitted as if they came from this device.
99 gdk_drag_context_set_device (GdkDragContext *context,
102 GdkDragContextPrivate *private;
104 g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
105 g_return_if_fail (GDK_IS_DEVICE (device));
107 private = GDK_DRAG_CONTEXT_PRIVATE (context);
111 g_object_unref (private->device);
112 private->device = NULL;
116 private->device = g_object_ref (device);
120 * gdk_drag_context_get_device:
121 * @context: a #GdkDragContext
123 * Returns the #GdkDevice associated to the drag context.
125 * Returns: The #GdkDevice associated to @context.
128 gdk_drag_context_get_device (GdkDragContext *context)
130 GdkDragContextPrivate *private;
132 g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
134 private = GDK_DRAG_CONTEXT_PRIVATE (context);
136 return private->device;
140 GdkDragContext *_gdk_quartz_drag_source_context = NULL;
143 gdk_quartz_drag_source_context ()
145 return _gdk_quartz_drag_source_context;
149 gdk_drag_begin (GdkWindow *window,
152 GdkDeviceManager *device_manager;
154 g_assert (_gdk_quartz_drag_source_context == NULL);
156 /* Create fake context */
157 _gdk_quartz_drag_source_context = gdk_drag_context_new ();
158 _gdk_quartz_drag_source_context->is_source = TRUE;
160 device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
161 gdk_drag_context_set_device (_gdk_quartz_drag_source_context,
162 gdk_device_manager_get_client_pointer (device_manager));
164 return _gdk_quartz_drag_source_context;
168 gdk_drag_motion (GdkDragContext *context,
169 GdkWindow *dest_window,
170 GdkDragProtocol protocol,
173 GdkDragAction suggested_action,
174 GdkDragAction possible_actions,
177 /* FIXME: Implement */
182 gdk_drag_get_protocol_for_display (GdkDisplay *display,
184 GdkDragProtocol *protocol)
186 /* FIXME: Implement */
191 gdk_drag_find_window_for_screen (GdkDragContext *context,
192 GdkWindow *drag_window,
196 GdkWindow **dest_window,
197 GdkDragProtocol *protocol)
199 /* FIXME: Implement */
203 gdk_drag_drop (GdkDragContext *context,
206 /* FIXME: Implement */
210 gdk_drag_abort (GdkDragContext *context,
213 g_return_if_fail (context != NULL);
215 /* FIXME: Implement */
219 gdk_drag_status (GdkDragContext *context,
220 GdkDragAction action,
223 context->action = action;
227 gdk_drop_reply (GdkDragContext *context,
231 g_return_if_fail (context != NULL);
233 /* FIXME: Implement */
237 gdk_drop_finish (GdkDragContext *context,
241 /* FIXME: Implement */
245 gdk_window_register_dnd (GdkWindow *window)
247 /* FIXME: Implement */
251 gdk_drag_get_selection (GdkDragContext *context)
253 /* FIXME: Implement */
258 gdk_drag_drop_succeeded (GdkDragContext *context)
260 /* FIXME: Implement */
265 gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context)
267 return GDK_DRAG_CONTEXT_PRIVATE (context)->dragging_info;