summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdk/gdkdnd.c35
-rw-r--r--gdk/gdkdndprivate.h6
-rw-r--r--gdk/gdkdrop.c6
-rw-r--r--gdk/wayland/gdkdevice-wayland.c1
-rw-r--r--gdk/wayland/gdkdrop-wayland.c2
-rw-r--r--gdk/win32/gdkdrop-win32.c3
-rw-r--r--gdk/x11/gdkdrop-x11.c2
7 files changed, 9 insertions, 46 deletions
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index 8db911b7ba..d091c6c560 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -35,16 +35,12 @@
#include "gdkenumtypes.h"
#include "gdkeventsprivate.h"
-#define DROP_SUBCLASS 1
-
typedef struct _GdkDragContextPrivate GdkDragContextPrivate;
struct _GdkDragContextPrivate
{
-#ifndef DROP_SUBCLASS
GdkDisplay *display;
GdkDevice *device;
-#endif
GdkContentFormats *formats;
GdkDragAction actions;
GdkDragAction suggested_action;
@@ -65,11 +61,9 @@ static struct {
enum {
PROP_0,
PROP_CONTENT,
-#ifndef DROP_SUBCLASS
PROP_DEVICE,
PROP_DISPLAY,
PROP_FORMATS,
-#endif
N_PROPERTIES
};
@@ -85,7 +79,7 @@ static GParamSpec *properties[N_PROPERTIES] = { NULL, };
static guint signals[N_SIGNALS] = { 0 };
static GList *contexts = NULL;
-G_DEFINE_TYPE_WITH_PRIVATE (GdkDragContext, gdk_drag_context, GDK_TYPE_DROP)
+G_DEFINE_TYPE_WITH_PRIVATE (GdkDragContext, gdk_drag_context, G_TYPE_OBJECT)
/**
* SECTION:dnd
@@ -121,15 +115,11 @@ G_DEFINE_TYPE_WITH_PRIVATE (GdkDragContext, gdk_drag_context, GDK_TYPE_DROP)
GdkDisplay *
gdk_drag_context_get_display (GdkDragContext *context)
{
-#ifdef DROP_SUBCLASS
- return gdk_drop_get_display (GDK_DROP (context));
-#else
GdkDragContextPrivate *priv = gdk_drag_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
return priv->display;
-#endif
}
/**
@@ -147,12 +137,6 @@ gdk_drag_context_get_formats (GdkDragContext *context)
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
-#ifdef DROP_SUBCLASS
- GdkContentFormats *formats = gdk_drop_get_formats (GDK_DROP (context));
-
- if (formats)
- return formats;
-#endif
return priv->formats;
}
@@ -220,15 +204,11 @@ gdk_drag_context_get_selected_action (GdkDragContext *context)
GdkDevice *
gdk_drag_context_get_device (GdkDragContext *context)
{
-#ifdef DROP_SUBCLASS
- return gdk_drop_get_device (GDK_DROP (context));
-#else
GdkDragContextPrivate *priv = gdk_drag_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
return priv->device;
-#endif
}
static void
@@ -257,7 +237,6 @@ gdk_drag_context_set_property (GObject *gobject,
}
break;
-#ifndef DROP_SUBCLASS
case PROP_DEVICE:
priv->device = g_value_dup_object (value);
g_assert (priv->device != NULL);
@@ -280,7 +259,6 @@ gdk_drag_context_set_property (GObject *gobject,
g_assert (priv->formats != NULL);
}
break;
-#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
@@ -295,9 +273,7 @@ gdk_drag_context_get_property (GObject *gobject,
GParamSpec *pspec)
{
GdkDragContext *context = GDK_DRAG_CONTEXT (gobject);
-#ifndef DROP_SUBCLASS
GdkDragContextPrivate *priv = gdk_drag_context_get_instance_private (context);
-#endif
switch (prop_id)
{
@@ -305,7 +281,6 @@ gdk_drag_context_get_property (GObject *gobject,
g_value_set_object (value, context->content);
break;
-#ifndef DROP_SUBCLASS
case PROP_DEVICE:
g_value_set_object (value, priv->device);
break;
@@ -317,7 +292,6 @@ gdk_drag_context_get_property (GObject *gobject,
case PROP_FORMATS:
g_value_set_boxed (value, priv->formats);
break;
-#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
@@ -370,7 +344,6 @@ gdk_drag_context_class_init (GdkDragContextClass *klass)
G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY);
-#ifndef DROP_SUBCLASS
/**
* GdkDragContext:device:
*
@@ -414,7 +387,6 @@ gdk_drag_context_class_init (GdkDragContextClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY);
-#endif
/**
* GdkDragContext::cancel:
@@ -648,11 +620,6 @@ gdk_drag_context_set_actions (GdkDragContext *context,
priv->actions = actions;
priv->suggested_action = suggested_action;
-
- if (suggested_action & GDK_ACTION_ASK)
- gdk_drop_set_actions (GDK_DROP (context), actions & GDK_ACTION_ALL);
- else
- gdk_drop_set_actions (GDK_DROP (context), suggested_action);
}
/**
diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h
index 923cef005e..5f1871a3be 100644
--- a/gdk/gdkdndprivate.h
+++ b/gdk/gdkdndprivate.h
@@ -20,8 +20,6 @@
#include "gdkdnd.h"
-#include "gdkdropprivate.h"
-
G_BEGIN_DECLS
@@ -33,7 +31,7 @@ typedef struct _GdkDragContextClass GdkDragContextClass;
struct _GdkDragContextClass {
- GdkDropClass parent_class;
+ GObjectClass parent_class;
void (*drag_abort) (GdkDragContext *context,
guint32 time_);
@@ -61,7 +59,7 @@ struct _GdkDragContextClass {
};
struct _GdkDragContext {
- GdkDrop parent_instance;
+ GObject parent_instance;
/*< private >*/
gboolean is_source;
diff --git a/gdk/gdkdrop.c b/gdk/gdkdrop.c
index 0873a2ee0d..f17f709ea8 100644
--- a/gdk/gdkdrop.c
+++ b/gdk/gdkdrop.c
@@ -19,7 +19,7 @@
#include "config.h"
-#include "gdkdndprivate.h"
+#include "gdkdropprivate.h"
#include "gdkcontentdeserializer.h"
#include "gdkcontentformats.h"
@@ -187,18 +187,14 @@ gdk_drop_set_property (GObject *gobject,
case PROP_FORMATS:
priv->formats = g_value_dup_boxed (value);
-#ifdef DROP_SUBCLASS
g_assert (priv->formats != NULL);
-#endif
break;
case PROP_SURFACE:
priv->surface = g_value_dup_object (value);
-#ifdef DROP_SUBCLASS
g_assert (priv->surface != NULL);
if (priv->device)
g_assert (gdk_surface_get_display (priv->surface) == gdk_device_get_display (priv->device));
-#endif
break;
default:
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 8ab8a07986..9c9b79b563 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -34,6 +34,7 @@
#include "gdkdeviceprivate.h"
#include "gdkdevicepadprivate.h"
#include "gdkdevicetoolprivate.h"
+#include "gdkdropprivate.h"
#include "gdkprimary-wayland.h"
#include "gdkseatprivate.h"
#include "pointer-gestures-unstable-v1-client-protocol.h"
diff --git a/gdk/wayland/gdkdrop-wayland.c b/gdk/wayland/gdkdrop-wayland.c
index 09d6de5b48..d290c6229b 100644
--- a/gdk/wayland/gdkdrop-wayland.c
+++ b/gdk/wayland/gdkdrop-wayland.c
@@ -17,7 +17,7 @@
#include "config.h"
-#include "gdkdndprivate.h"
+#include "gdkdropprivate.h"
#include "gdkinternals.h"
#include "gdkproperty.h"
diff --git a/gdk/win32/gdkdrop-win32.c b/gdk/win32/gdkdrop-win32.c
index 6d7ff78e7a..71c47405fe 100644
--- a/gdk/win32/gdkdrop-win32.c
+++ b/gdk/win32/gdkdrop-win32.c
@@ -39,6 +39,8 @@
/* For C-style COM wrapper macros */
#define COBJMACROS
+#include "gdkdropprivate.h"
+
#include "gdkdnd.h"
#include "gdkproperty.h"
#include "gdkinternals.h"
@@ -46,7 +48,6 @@
#include "gdkwin32.h"
#include "gdkwin32dnd.h"
#include "gdkdisplayprivate.h"
-#include "gdk/gdkdndprivate.h"
#include "gdkwin32dnd-private.h"
#include "gdkdisplay-win32.h"
#include "gdkdeviceprivate.h"
diff --git a/gdk/x11/gdkdrop-x11.c b/gdk/x11/gdkdrop-x11.c
index ddae88e13d..1bd315efe5 100644
--- a/gdk/x11/gdkdrop-x11.c
+++ b/gdk/x11/gdkdrop-x11.c
@@ -24,7 +24,7 @@
#include "config.h"
-#include "gdkx11dnd.h"
+#include "gdkdropprivate.h"
#include "gdk-private.h"
#include "gdkasync.h"