From c53ec081ceeb84ee2b3088e1c3ec986c89e954af Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 10 Dec 2010 01:27:10 -0500 Subject: 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. --- gdk/gdkinternals.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'gdk/gdkinternals.h') diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 604ed64aa9..b50ee9e24d 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -305,6 +305,10 @@ struct _GdkDisplayClass GdkFilterFunc func, gpointer data); GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display); + GdkNativeWindow (*get_drag_protocol) (GdkDisplay *display, + GdkNativeWindow winid, + GdkDragProtocol *protocol, + guint *version); /* Signals */ @@ -409,6 +413,59 @@ struct _GdkScreenClass void (*monitors_changed) (GdkScreen *screen); }; +struct _GdkDragContextClass { + GObjectClass parent_class; + + GdkWindow * (*find_window) (GdkDragContext *context, + GdkWindow *drag_window, + GdkScreen *screen, + gint x_root, + gint y_root, + GdkDragProtocol *protocol); + GdkAtom (*get_selection) (GdkDragContext *context); + gboolean (*drag_motion) (GdkDragContext *context, + GdkWindow *dest_window, + GdkDragProtocol protocol, + gint root_x, + gint root_y, + GdkDragAction suggested_action, + GdkDragAction possible_actions, + guint32 time_); + void (*drag_status) (GdkDragContext *context, + GdkDragAction action, + guint32 time_); + void (*drag_abort) (GdkDragContext *context, + guint32 time_); + void (*drag_drop) (GdkDragContext *context, + guint32 time_); + void (*drop_reply) (GdkDragContext *context, + gboolean accept, + guint32 time_); + void (*drop_finish) (GdkDragContext *context, + gboolean success, + guint32 time_); + gboolean (*drop_status) (GdkDragContext *context); +}; + +struct _GdkDragContext { + GObject parent_instance; + + GdkDragProtocol protocol; + + gboolean is_source; + GdkWindow *source_window; + GdkWindow *dest_window; + + GList *targets; + GdkDragAction actions; + GdkDragAction suggested_action; + GdkDragAction action; + + guint32 start_time; + + GdkDevice *device; +}; + extern GSList *_gdk_displays; extern gchar *_gdk_display_name; extern gint _gdk_screen_number; -- cgit v1.2.1