diff options
author | Matthias Clasen <mclasen@redhat.com> | 2010-12-10 01:27:10 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2010-12-21 12:06:56 -0500 |
commit | c53ec081ceeb84ee2b3088e1c3ec986c89e954af (patch) | |
tree | 47a2f3b95d4a7f050ebad8e690f3d30906c8dc49 /gdk/gdkdnd.h | |
parent | 3c47c8467cc7067e6aae93a99c6710667c05d4bb (diff) | |
download | gtk+-c53ec081ceeb84ee2b3088e1c3ec986c89e954af.tar.gz |
Add vtables for DND
This commit hides GdkDragContext and GdkDragContextClass, adds
vfuncs for most drag context functionality, and turns the X11 DND
implementation into GdkDragContextX11. We also add vfuncs to
GdkDisplay for gdk_drag_get_protocol and to GdkWindow for
gdk_drag_begin, and implemenet them for X11.
Other backends need similar treatment and are broken now.
Diffstat (limited to 'gdk/gdkdnd.h')
-rw-r--r-- | gdk/gdkdnd.h | 73 |
1 files changed, 16 insertions, 57 deletions
diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h index e383c957e2..080af34db9 100644 --- a/gdk/gdkdnd.h +++ b/gdk/gdkdnd.h @@ -36,7 +36,11 @@ G_BEGIN_DECLS +/* Object that holds information about a drag in progress. + * this is used on both source and destination sides. + */ typedef struct _GdkDragContext GdkDragContext; +typedef struct _GdkDragContextClass GdkDragContextClass; /** * GdkDragAction: @@ -81,19 +85,13 @@ typedef enum { GDK_DRAG_PROTO_MOTIF, GDK_DRAG_PROTO_XDND, - GDK_DRAG_PROTO_ROOTWIN, /* A root window with nobody claiming - * drags */ - GDK_DRAG_PROTO_NONE, /* Not a valid drag window */ - GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */ - GDK_DRAG_PROTO_OLE2, /* The complex OLE2 dnd (not implemented) */ - GDK_DRAG_PROTO_LOCAL /* Intra-app */ + GDK_DRAG_PROTO_ROOTWIN, + GDK_DRAG_PROTO_NONE, + GDK_DRAG_PROTO_WIN32_DROPFILES, + GDK_DRAG_PROTO_OLE2, + GDK_DRAG_PROTO_LOCAL } GdkDragProtocol; -/* Object that holds information about a drag in progress. - * this is used on both source and destination sides. - */ - -typedef struct _GdkDragContextClass GdkDragContextClass; #define GDK_TYPE_DRAG_CONTEXT (gdk_drag_context_get_type ()) #define GDK_DRAG_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext)) @@ -102,39 +100,8 @@ typedef struct _GdkDragContextClass GdkDragContextClass; #define GDK_IS_DRAG_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT)) #define GDK_DRAG_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass)) -struct _GdkDragContext { - GObject parent_instance; - - /*< public >*/ - - GdkDragProtocol GSEAL (protocol); - gboolean GSEAL (is_source); - - GdkWindow *GSEAL (source_window); - GdkWindow *GSEAL (dest_window); - - GList *GSEAL (targets); - GdkDragAction GSEAL (actions); - GdkDragAction GSEAL (suggested_action); - GdkDragAction GSEAL (action); - - guint32 GSEAL (start_time); - - /*< private >*/ - - gpointer GSEAL (windowing_data); -}; - -struct _GdkDragContextClass { - GObjectClass parent_class; - -}; - -/* Drag and Drop */ - -GType gdk_drag_context_get_type (void) G_GNUC_CONST; -GdkDragContext * gdk_drag_context_new (void); +GType gdk_drag_context_get_type (void) G_GNUC_CONST; void gdk_drag_context_set_device (GdkDragContext *context, GdkDevice *device); @@ -164,8 +131,12 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context); /* Source side */ -GdkDragContext * gdk_drag_begin (GdkWindow *window, - GList *targets); +GdkDragContext * gdk_drag_begin (GdkWindow *window, + GList *targets); + +GdkDragContext * gdk_drag_begin_for_device (GdkWindow *window, + GdkDevice *device, + GList *targets); GdkNativeWindow gdk_drag_get_protocol_for_display (GdkDisplay *display, GdkNativeWindow xid, @@ -179,18 +150,6 @@ void gdk_drag_find_window_for_screen (GdkDragContext *context, GdkWindow **dest_window, GdkDragProtocol *protocol); -#ifndef GDK_MULTIHEAD_SAFE -GdkNativeWindow gdk_drag_get_protocol (GdkNativeWindow xid, - GdkDragProtocol *protocol); - -void gdk_drag_find_window (GdkDragContext *context, - GdkWindow *drag_window, - gint x_root, - gint y_root, - GdkWindow **dest_window, - GdkDragProtocol *protocol); -#endif /* GDK_MULTIHEAD_SAFE */ - gboolean gdk_drag_motion (GdkDragContext *context, GdkWindow *dest_window, GdkDragProtocol protocol, |