]> Pileus Git - ~andy/gtk/blob - gdk/quartz/gdkdnd-quartz.c
Change FSF Address
[~andy/gtk] / gdk / quartz / gdkdnd-quartz.c
1 /* gdkdnd-quartz.c
2  *
3  * Copyright (C) 2005 Imendio AB
4  *
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.
9  *
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.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #include "gdkdnd.h"
20 #include "gdkquartzdnd.h"
21 #include "gdkprivate-quartz.h"
22
23
24 G_DEFINE_TYPE (GdkQuartzDragContext, gdk_quartz_drag_context, GDK_TYPE_DRAG_CONTEXT)
25
26
27 GdkDragContext *_gdk_quartz_drag_source_context = NULL;
28
29 GdkDragContext *
30 gdk_quartz_drag_source_context ()
31 {
32   return _gdk_quartz_drag_source_context;
33 }
34
35 GdkDragContext *
36 _gdk_quartz_window_drag_begin (GdkWindow *window,
37                                GdkDevice *device,
38                                GList     *targets)
39 {
40   g_assert (_gdk_quartz_drag_source_context == NULL);
41
42   /* Create fake context */
43   _gdk_quartz_drag_source_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT,
44                                                   NULL);
45   _gdk_quartz_drag_source_context->is_source = TRUE;
46
47   gdk_drag_context_set_device (_gdk_quartz_drag_source_context, device);
48
49   return _gdk_quartz_drag_source_context;
50 }
51
52 static gboolean
53 gdk_quartz_drag_context_drag_motion (GdkDragContext  *context,
54                                      GdkWindow       *dest_window,
55                                      GdkDragProtocol  protocol,
56                                      gint             x_root,
57                                      gint             y_root,
58                                      GdkDragAction    suggested_action,
59                                      GdkDragAction    possible_actions,
60                                      guint32          time)
61 {
62   /* FIXME: Implement */
63   return FALSE;
64 }
65
66 static GdkWindow *
67 gdk_quartz_drag_context_find_window (GdkDragContext  *context,
68                                      GdkWindow       *drag_window,
69                                      GdkScreen       *screen,
70                                      gint             x_root,
71                                      gint             y_root,
72                                      GdkDragProtocol *protocol)
73 {
74   /* FIXME: Implement */
75   return NULL;
76 }
77
78 static void
79 gdk_quartz_drag_context_drag_drop (GdkDragContext *context,
80                                    guint32         time)
81 {
82   /* FIXME: Implement */
83 }
84
85 static void
86 gdk_quartz_drag_context_drag_abort (GdkDragContext *context,
87                                     guint32         time)
88 {
89   /* FIXME: Implement */
90 }
91
92 static void
93 gdk_quartz_drag_context_drag_status (GdkDragContext *context,
94                                      GdkDragAction   action,
95                                      guint32         time)
96 {
97   context->action = action;
98 }
99
100 static void
101 gdk_quartz_drag_context_drop_reply (GdkDragContext *context,
102                                     gboolean        ok,
103                                     guint32         time)
104 {
105   /* FIXME: Implement */
106 }
107
108 static void
109 gdk_quartz_drag_context_drop_finish (GdkDragContext *context,
110                                      gboolean        success,
111                                      guint32         time)
112 {
113   /* FIXME: Implement */
114 }
115
116 void
117 _gdk_quartz_window_register_dnd (GdkWindow *window)
118 {
119   /* FIXME: Implement */
120 }
121
122 static GdkAtom
123 gdk_quartz_drag_context_get_selection (GdkDragContext *context)
124 {
125   /* FIXME: Implement */
126   return GDK_NONE;
127 }
128
129 static gboolean
130 gdk_quartz_drag_context_drop_status (GdkDragContext *context)
131 {
132   /* FIXME: Implement */
133   return FALSE;
134 }
135
136 id
137 gdk_quartz_drag_context_get_dragging_info_libgtk_only (GdkDragContext *context)
138 {
139   return GDK_QUARTZ_DRAG_CONTEXT (context)->dragging_info;
140 }
141
142 static void
143 gdk_quartz_drag_context_init (GdkQuartzDragContext *context)
144 {
145 }
146
147 static void
148 gdk_quartz_drag_context_finalize (GObject *object)
149 {
150   G_OBJECT_CLASS (gdk_quartz_drag_context_parent_class)->finalize (object);
151 }
152
153 static void
154 gdk_quartz_drag_context_class_init (GdkQuartzDragContextClass *klass)
155 {
156   GObjectClass *object_class = G_OBJECT_CLASS (klass);
157   GdkDragContextClass *context_class = GDK_DRAG_CONTEXT_CLASS (klass);
158
159   object_class->finalize = gdk_quartz_drag_context_finalize;
160
161   context_class->find_window = gdk_quartz_drag_context_find_window;
162   context_class->drag_status = gdk_quartz_drag_context_drag_status;
163   context_class->drag_motion = gdk_quartz_drag_context_drag_motion;
164   context_class->drag_abort = gdk_quartz_drag_context_drag_abort;
165   context_class->drag_drop = gdk_quartz_drag_context_drag_drop;
166   context_class->drop_reply = gdk_quartz_drag_context_drop_reply;
167   context_class->drop_finish = gdk_quartz_drag_context_drop_finish;
168   context_class->drop_status = gdk_quartz_drag_context_drop_status;
169   context_class->get_selection = gdk_quartz_drag_context_get_selection;
170 }