summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkdnd-x11.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2000-06-20 21:04:44 +0000
committerHavoc Pennington <hp@src.gnome.org>2000-06-20 21:04:44 +0000
commitdf4fc3672127660c1d47e4225297d00abbee84eb (patch)
tree403962726a72ea66e7efa1b25169c03d7a59d362 /gdk/x11/gdkdnd-x11.c
parent2ad30e9fc1a98635ec329b8ff57a8e7a34968f8e (diff)
downloadgtk+-df4fc3672127660c1d47e4225297d00abbee84eb.tar.gz
Make this compile without framebuffer enabled
2000-06-20 Havoc Pennington <hp@redhat.com> * modules/linux-fb/Makefile.am: Make this compile without framebuffer enabled * gdk/linux-fb/Makefile.am: Add conditional to not build framebuffer unless specified in configure * gdk/gdkdraw.c (gdk_draw_drawable): Fix bug where I was getting the size of the target instead of source if -1 was passed for width/height * gdk/x11/gdkgeometry-x11.c (gdk_window_compute_position): Fix width/height confusion. 2000-06-19 Havoc Pennington <hp@redhat.com> * gdk/x11/gdkx.h (GDK_WINDOW_XWINDOW): change this to be GDK_DRAWABLE_XID. In the future, we probably want to make it faster with G_DISABLE_CHECKS turned on. 2000-06-14 Havoc Pennington <hp@redhat.com> * gdk/Makefile.am: add gdkpixmap.c * gdk/gdk.c: s/gdk_window_init/_gdk_windowing_window_init/ s/gdk_image_init/_gdk_windowing_image_init * gdk/gdkcolor.c: make ref/unref compat wrappers for GObject ref/unref * gdk/gdkcolor.h: make GdkColormap a GObject subclass * gdk/gdkcompat.h: remove GdkWindowType compat, since GdkWindowType is now non-deprecated; change gdk_window_get_type() compat to be gdk_window_get_window_type(). * gdk/gdkdnd.h: make GdkDragContext a GObject. * gdk/gdkdraw.c, gdk/gdkdraw.h: Convert GdkDrawable to a pure virtual GObject. Make all functions call into the vtable. Move gdk_image_put() guts in here. Remove GdkDrawableType and gdk_drawable_get_type(), these are now GdkWindow-specific. draw_image, get_depth, get_size, set_colormap, get_colormap, get_visual added to the vtable. * gdk/gdkgc.h, gdk/gdkgc.c: Convert GdkGC to a pure virtual GObject. Virtualize everything. (gdk_gc_new_with_values): remove check for destroyed window, because now GdkWindow::create_gc will check this. (gdk_gc_set_values): New function to set GC values, this was already implemented but wasn't in the header * gdk/gdkimage.h, gdk/gdkimage.c: Convert GdkImage to a GObject. * gdk/gdkinternals.h: Remove _gdk_window_alloc(), remove _gdk_window_draw_image(), remove _gdk_windowing_window_class, remove _gdk_window_class; add _gdk_window_impl_get_type() and _gdk_pixmap_impl_get_type(). Rename gdk_window_init to _gdk_windowing_window_init, rename gdk_image_init to _gdk_windowing_image_init. * gdk/gdkpango.c: Reflect GObject-ification of PangoContext. (gdk_draw_layout): Remove check for destroyed window, because all the drawable methods already check it. * gdk/gdkpixmap.h, gdk/gdkpixmap.c: Convert GdkPixmap to GObject. Add gdkpixmap.c which contains implementation of GdkDrawable virtual table (by chaining to a platform-specific implementation object). * gdk/gdkprivate.h: Remove GDK_IS_WINDOW, GDK_IS_PIXMAP, GDK_DRAWABLE_DESTROYED. Add GDK_WINDOW_DESTROYED. Replace GDK_DRAWABLE_TYPE with GDK_WINDOW_TYPE. Remove GdkDrawablePrivate, GdkWindowPrivate, GdkImageClass, GdkImagePrivate, GdkGCPrivate, GdkColormapPrivate. * gdk/gdktypes.h: #include <glib-object.h> * gdk/gdkwindow.h, gdk/gdkwindow.c: Convert GdkWindow to GObject. Move most functionality to platform-specific implementation object. GdkWindow itself now handles the backing store, then chains to the platform-specific implementation. (gdk_window_get_window_type): return GdkWindowType of the window. (gdk_window_peek_children): New routine, returns the children of a GdkWindow (gdk_window_get_children): Was in X11-specific code and did XQueryTree. Changed to simply return a copy of window->children; so it can go in cross-platform code. * gdk/x11/Makefile.am: fix broken MKINSTALLDIRS path * gdk/x11/gdkcolor-x11.c: implement X-specific parts of GdkColormap; just changed to use the new private data instead of casting to GdkColormapPrivate. * gdk/x11/gdkcursor-x11.c: added a couple typechecks to gdk_cursor_new(). * gdk/x11/gdkdnd-x11.c: Change the way we access private fields (private data member in the GObject). (xdnd_manager_source_filter): Function had broken error handling, fix it (use gdk_error_trap_push). * gdk/x11/gdkdrawable-x11.c: This file now implements a base class for GdkWindowImplX11/GdkPixmapImplX11. This base class is purely for the convenience of the X port, and not part of the interface to cross-platform GDK. * gdk/x11/gdkevents-x11.c: Reflect various renamings. * gdk/x11/gdkgc-x11.c: Implement a subclass of GdkGC that's specific to X, and returned by the create_gc virtual method of GdkDrawableImplX11. (gdk_x11_gc_set_dashes): Change this to take an array of gint8 rather than gchar, this was also changed in the GdkGC vtable. (gdk_x11_gc_values_to_xvalues): If GdkGCValues is NULL, or the mask is 0, return immediately, instead of checking every flag. This is faster, and keeps us from segfaulting if values is NULL and the mask contains some nonzero flags. * gdk/x11/gdkgeometry-x11.c: deal with all the rearranging of GdkWindow. * gdk/x11/gdkglobals-x11.c: change type of grab window, since GdkWindowPrivate is gone. * gdk/x11/gdkim-x11.c: rename things that got renamed. * gdk/x11/gdkimage-x11.c: implement in terms of GObject, and remove the image_put stuff that got transferred to GdkDrawable. * gdk/x11/gdkinput.c: renamings * gdk/x11/gdkmain-x11.c: #include <pango/pangox.h> * gdk/x11/gdkpixmap-x11.c: GObject conversion * gdk/x11/gdkprivate-x11.h: indentation fixes * gdk/x11/gdkproperty-x11.c: renamings * gdk/x11/gdkselection-x11.c: renamings * gdk/x11/gdkwindow-x11.c: Restructuring and renaming; this now implements the platform-specific "impl" object. Moved gdk_window_get_children to gdk/gdkwindow.c * gdk/x11/gdkx.h: Remove all the private structs and private datas that no longer exist. Add declaration of GdkGCX11 object here. Fix all the macros to still work. * gtk/gtk-boxed.defs: Remove GtkStyle, GdkColormap, GdkWindow, GdkDragContext from the boxed types since they are now GObjects. * gtk/gtkstyle.h, gtk/gtkstyle.c: Converted GtkStyle to a GObject, moved xthickness/ythickness into the instance. GtkStyleClass functions are now in the standard vtable for GtkStyle, so you have to create a GObject subclass to write a theme engine. (gtk_style_copy): fixed a leaked PangoFontDescription (gtk_style_init): renamed gtk_style_realize, so gtk_style_init can be the standard GObject function. * Throughout GTK: s/style->klass->[xy]thickness/style->[xy]thickness s/pango_layout_unref/g_object_unref/ * gtk/gtkrc.h, gtk/gtkrc.c: Converted GtkRcStyle to a GObject. * gtk/gtksocket.c: Use gdk_window_get_user_data() instead of accessing GDK internals. * gtk/gtkwidget.c: Use gdk_window_peek_children() instead of accessing GDK internals.
Diffstat (limited to 'gdk/x11/gdkdnd-x11.c')
-rw-r--r--gdk/x11/gdkdnd-x11.c224
1 files changed, 133 insertions, 91 deletions
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 8509b3220e..05faffd556 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -34,7 +34,7 @@
#include "gdkinternals.h"
#include "gdkprivate-x11.h"
-typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
+typedef struct _GdkDragContextPrivateX11 GdkDragContextPrivateX11;
typedef enum {
GDK_DRAG_STATUS_DRAG,
@@ -58,7 +58,7 @@ typedef struct {
/* Structure that holds information about a drag in progress.
* this is used on both source and destination sides.
*/
-struct _GdkDragContextPrivate {
+struct _GdkDragContextPrivateX11 {
GdkDragContext context;
GdkAtom motif_selection;
@@ -82,6 +82,8 @@ struct _GdkDragContextPrivate {
GdkWindowCache *window_cache;
};
+#define PRIVATE_DATA(context) ((GdkDragContextPrivateX11 *) GDK_DRAG_CONTEXT (context)->windowing_data)
+
GdkDragContext *current_dest_drag = NULL;
/* Forward declarations */
@@ -121,66 +123,115 @@ static void xdnd_manage_source_filter (GdkDragContext *context,
GdkWindow *window,
gboolean add_filter);
-/* Drag Contexts */
+static void gdk_drag_context_init (GdkDragContext *dragcontext);
+static void gdk_drag_context_class_init (GdkDragContextClass *klass);
+static void gdk_drag_context_finalize (GObject *object);
+static gpointer parent_class = NULL;
static GList *contexts;
-GdkDragContext *
-gdk_drag_context_new (void)
+GType
+gdk_drag_context_get_type (void)
{
- GdkDragContextPrivate *result;
+ static GType object_type = 0;
+
+ if (!object_type)
+ {
+ static const GTypeInfo object_info =
+ {
+ sizeof (GdkDragContextClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) gdk_drag_context_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GdkDragContext),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) gdk_drag_context_init,
+ };
+
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "GdkDragContext",
+ &object_info);
+ }
+
+ return object_type;
+}
- result = g_new0 (GdkDragContextPrivate, 1);
+static void
+gdk_drag_context_init (GdkDragContext *dragcontext)
+{
+ GdkDragContextPrivateX11 *private;
- result->ref_count = 1;
+ private = g_new0 (GdkDragContextPrivateX11, 1);
- contexts = g_list_prepend (contexts, result);
+ dragcontext->windowing_data = private;
- return (GdkDragContext *)result;
+ contexts = g_list_prepend (contexts, dragcontext);
}
-void
-gdk_drag_context_ref (GdkDragContext *context)
+static void
+gdk_drag_context_class_init (GdkDragContextClass *klass)
{
- g_return_if_fail (context != NULL);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
- ((GdkDragContextPrivate *)context)->ref_count++;
+ object_class->finalize = gdk_drag_context_finalize;
}
-void
-gdk_drag_context_unref (GdkDragContext *context)
+static void
+gdk_drag_context_finalize (GObject *object)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
-
- g_return_if_fail (context != NULL);
- g_return_if_fail (private->ref_count > 0);
-
- private->ref_count--;
+ GdkDragContext *context = GDK_DRAG_CONTEXT (object);
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
- if (private->ref_count == 0)
+ g_list_free (context->targets);
+
+ if (context->source_window)
{
- g_dataset_destroy (private);
+ if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
+ !context->is_source)
+ xdnd_manage_source_filter (context, context->source_window, FALSE);
- g_list_free (context->targets);
+ gdk_window_unref (context->source_window);
+ }
+
+ if (context->dest_window)
+ gdk_window_unref (context->dest_window);
+
+ if (private->window_cache)
+ gdk_window_cache_destroy (private->window_cache);
+
+ contexts = g_list_remove (contexts, context);
- if (context->source_window)
- {
- if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
- !context->is_source)
- xdnd_manage_source_filter (context, context->source_window, FALSE);
+ g_free (private);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
+}
- gdk_window_unref (context->source_window);
- }
+/* Drag Contexts */
+
+GdkDragContext *
+gdk_drag_context_new (void)
+{
+ return GDK_DRAG_CONTEXT (g_type_create_instance (gdk_drag_context_get_type ()));
+}
+
+void
+gdk_drag_context_ref (GdkDragContext *context)
+{
+ g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- if (context->dest_window)
- gdk_window_unref (context->dest_window);
+ g_object_ref (G_OBJECT (context));
+}
- if (private->window_cache)
- gdk_window_cache_destroy (private->window_cache);
+void
+gdk_drag_context_unref (GdkDragContext *context)
+{
+ g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- contexts = g_list_remove (contexts, private);
- g_free (private);
- }
+ g_object_unref (G_OBJECT (context));
}
static GdkDragContext *
@@ -190,19 +241,19 @@ gdk_drag_context_find (gboolean is_source,
{
GList *tmp_list = contexts;
GdkDragContext *context;
- GdkDragContextPrivate *private;
+ GdkDragContextPrivateX11 *private;
Window context_dest_xid;
while (tmp_list)
{
context = (GdkDragContext *)tmp_list->data;
- private = (GdkDragContextPrivate *)context;
+ private = PRIVATE_DATA (context);
context_dest_xid = context->dest_window ?
- (private->drop_xid ?
- private->drop_xid :
- GDK_DRAWABLE_XID (context->dest_window)) :
- None;
+ (private->drop_xid ?
+ private->drop_xid :
+ GDK_DRAWABLE_XID (context->dest_window)) :
+ None;
if ((!context->is_source == !is_source) &&
((source_xid == None) || (context->source_window &&
@@ -1250,7 +1301,7 @@ motif_dnd_get_flags (GdkDragContext *context)
static void
motif_set_targets (GdkDragContext *context)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
MotifDragInitiatorInfo info;
gint i;
static GdkAtom motif_drag_initiator_info = GDK_NONE;
@@ -1334,7 +1385,7 @@ motif_send_enter (GdkDragContext *context,
guint32 time)
{
XEvent xev;
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
@@ -1393,7 +1444,7 @@ motif_send_motion (GdkDragContext *context,
{
gboolean retval;
XEvent xev;
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
@@ -1436,7 +1487,7 @@ static void
motif_send_drop (GdkDragContext *context, guint32 time)
{
XEvent xev;
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("_MOTIF_DRAG_AND_DROP_MESSAGE", FALSE);
@@ -1537,7 +1588,7 @@ motif_drag_context_new (GdkWindow *dest_window,
guint32 atom)
{
GdkDragContext *new_context;
- GdkDragContextPrivate *private;
+ GdkDragContextPrivateX11 *private;
/* FIXME, current_dest_drag really shouldn't be NULL'd
* if we error below.
@@ -1554,7 +1605,7 @@ motif_drag_context_new (GdkWindow *dest_window,
}
new_context = gdk_drag_context_new ();
- private = (GdkDragContextPrivate *)new_context;
+ private = PRIVATE_DATA (new_context);
new_context->protocol = GDK_DRAG_PROTO_MOTIF;
new_context->is_source = FALSE;
@@ -1651,7 +1702,7 @@ motif_motion (GdkEvent *event,
gint16 x_root,
gint16 y_root)
{
- GdkDragContextPrivate *private;
+ GdkDragContextPrivateX11 *private;
GDK_NOTE(DND, g_message ("Motif DND motion: flags: %#4x time: %d (%d, %d)",
flags, timestamp, x_root, y_root));
@@ -1660,7 +1711,7 @@ motif_motion (GdkEvent *event,
(current_dest_drag->protocol == GDK_DRAG_PROTO_MOTIF) &&
(timestamp >= current_dest_drag->start_time))
{
- private = (GdkDragContextPrivate *)current_dest_drag;
+ private = PRIVATE_DATA (current_dest_drag);
event->dnd.type = GDK_DRAG_MOTION;
event->dnd.context = current_dest_drag;
@@ -1689,7 +1740,7 @@ motif_operation_changed (GdkEvent *event,
guint16 flags,
guint32 timestamp)
{
- GdkDragContextPrivate *private;
+ GdkDragContextPrivateX11 *private;
GDK_NOTE(DND, g_message ("Motif DND operation changed: flags: %#4x time: %d",
flags, timestamp));
@@ -1704,7 +1755,7 @@ motif_operation_changed (GdkEvent *event,
gdk_drag_context_ref (current_dest_drag);
event->dnd.time = timestamp;
- private = (GdkDragContextPrivate *)current_dest_drag;
+ private = PRIVATE_DATA (current_dest_drag);
motif_dnd_translate_flags (current_dest_drag, flags);
@@ -1768,7 +1819,7 @@ motif_drag_status (GdkEvent *event,
if (context)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
if ((private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT) ||
(private->drag_status == GDK_DRAG_STATUS_ACTION_WAIT))
private->drag_status = GDK_DRAG_STATUS_DRAG;
@@ -1967,7 +2018,7 @@ xdnd_status_filter (GdkXEvent *xev,
context = gdk_drag_context_find (TRUE, xevent->xclient.window, dest_window);
if (context)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
if (private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT)
private->drag_status = GDK_DRAG_STATUS_DRAG;
@@ -2020,7 +2071,7 @@ xdnd_finished_filter (GdkXEvent *xev,
static void
xdnd_set_targets (GdkDragContext *context)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
GdkAtom *atomlist;
GList *tmp_list = context->targets;
gint i;
@@ -2049,7 +2100,7 @@ xdnd_set_targets (GdkDragContext *context)
static void
xdnd_set_actions (GdkDragContext *context)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
GdkAtom *atomlist;
gint i;
gint n_atoms;
@@ -2119,7 +2170,7 @@ static void
xdnd_send_enter (GdkDragContext *context)
{
XEvent xev;
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndEnter", FALSE);
@@ -2171,7 +2222,7 @@ xdnd_send_leave (GdkDragContext *context)
{
XEvent xev;
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
xev.xclient.type = ClientMessage;
xev.xclient.message_type = gdk_atom_intern ("XdndLeave", FALSE);
@@ -2199,7 +2250,7 @@ xdnd_send_leave (GdkDragContext *context)
static void
xdnd_send_drop (GdkDragContext *context, guint32 time)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
XEvent xev;
xev.xclient.type = ClientMessage;
@@ -2232,7 +2283,7 @@ xdnd_send_motion (GdkDragContext *context,
GdkDragAction action,
guint32 time)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
XEvent xev;
xev.xclient.type = ClientMessage;
@@ -2365,7 +2416,7 @@ xdnd_read_actions (GdkDragContext *context)
for (i=0; i<nitems; i++)
context->actions |= xdnd_action_from_atom (data[i]);
- ((GdkDragContextPrivate *)context)->xdnd_have_actions = TRUE;
+ (PRIVATE_DATA (context))->xdnd_have_actions = TRUE;
#ifdef G_ENABLE_DEBUG
if (gdk_debug_flags & GDK_DEBUG_DND)
@@ -2423,16 +2474,10 @@ xdnd_manage_source_filter (GdkDragContext *context,
gboolean add_filter)
{
gint old_warnings = 0; /* quiet gcc */
-
- gboolean is_foreign = GDK_DRAWABLE_TYPE (window);
- if (is_foreign)
- {
- old_warnings = gdk_error_warnings;
- gdk_error_warnings = 0;
- }
+ gdk_error_trap_push ();
- if (!GDK_DRAWABLE_DESTROYED (window))
+ if (!GDK_WINDOW_DESTROYED (window))
{
if (add_filter)
{
@@ -2454,11 +2499,8 @@ xdnd_manage_source_filter (GdkDragContext *context,
}
}
- if (is_foreign)
- {
- gdk_flush();
- gdk_error_warnings = old_warnings;
- }
+ gdk_flush ();
+ gdk_error_trap_pop ();
}
static GdkFilterReturn
@@ -2558,7 +2600,7 @@ xdnd_enter_filter (GdkXEvent *xev,
gdk_drag_context_ref (new_context);
current_dest_drag = new_context;
- ((GdkDragContextPrivate *)new_context)->xdnd_selection =
+ (PRIVATE_DATA (new_context))->xdnd_selection =
gdk_atom_intern ("XdndSelection", FALSE);
return GDK_FILTER_TRANSLATE;
@@ -2620,14 +2662,14 @@ xdnd_position_filter (GdkXEvent *xev,
event->dnd.time = time;
current_dest_drag->suggested_action = xdnd_action_from_atom (action);
- if (!((GdkDragContextPrivate *)current_dest_drag)->xdnd_have_actions)
+ if (!(PRIVATE_DATA (current_dest_drag))->xdnd_have_actions)
current_dest_drag->actions = current_dest_drag->suggested_action;
event->dnd.x_root = x_root;
event->dnd.y_root = y_root;
- ((GdkDragContextPrivate *)current_dest_drag)->last_x = x_root;
- ((GdkDragContextPrivate *)current_dest_drag)->last_y = y_root;
+ (PRIVATE_DATA (current_dest_drag))->last_x = x_root;
+ (PRIVATE_DATA (current_dest_drag))->last_y = y_root;
return GDK_FILTER_TRANSLATE;
}
@@ -2652,8 +2694,8 @@ xdnd_drop_filter (GdkXEvent *xev,
(current_dest_drag->protocol == GDK_DRAG_PROTO_XDND) &&
(GDK_DRAWABLE_XID (current_dest_drag->source_window) == source_window))
{
- GdkDragContextPrivate *private;
- private = (GdkDragContextPrivate *)current_dest_drag;
+ GdkDragContextPrivateX11 *private;
+ private = PRIVATE_DATA (current_dest_drag);
event->dnd.type = GDK_DROP_START;
@@ -2843,7 +2885,7 @@ gdk_drag_find_window (GdkDragContext *context,
GdkWindow **dest_window,
GdkDragProtocol *protocol)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
Window dest;
g_return_if_fail (context != NULL);
@@ -2899,7 +2941,7 @@ gdk_drag_motion (GdkDragContext *context,
GdkDragAction possible_actions,
guint32 time)
{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
+ GdkDragContextPrivateX11 *private = PRIVATE_DATA (context);
g_return_val_if_fail (context != NULL, FALSE);
@@ -3073,12 +3115,12 @@ gdk_drag_status (GdkDragContext *context,
GdkDragAction action,
guint32 time)
{
- GdkDragContextPrivate *private;
+ GdkDragContextPrivateX11 *private;
XEvent xev;
g_return_if_fail (context != NULL);
- private = (GdkDragContextPrivate *)context;
+ private = PRIVATE_DATA (context);
context->action = action;
@@ -3167,11 +3209,11 @@ gdk_drop_reply (GdkDragContext *context,
gboolean ok,
guint32 time)
{
- GdkDragContextPrivate *private;
+ GdkDragContextPrivateX11 *private;
g_return_if_fail (context != NULL);
- private = (GdkDragContextPrivate *)context;
+ private = PRIVATE_DATA (context);
if (context->protocol == GDK_DRAG_PROTO_MOTIF)
{
@@ -3291,9 +3333,9 @@ gdk_drag_get_selection (GdkDragContext *context)
g_return_val_if_fail (context != NULL, GDK_NONE);
if (context->protocol == GDK_DRAG_PROTO_MOTIF)
- return ((GdkDragContextPrivate *)context)->motif_selection;
+ return (PRIVATE_DATA (context))->motif_selection;
else if (context->protocol == GDK_DRAG_PROTO_XDND)
- return ((GdkDragContextPrivate *)context)->xdnd_selection;
+ return (PRIVATE_DATA (context))->xdnd_selection;
else
return GDK_NONE;
}