summaryrefslogtreecommitdiff
path: root/gdk/linux-fb/gdkdnd-fb.c
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>2000-07-24 16:19:00 +0000
committerElliot Lee <sopwith@src.gnome.org>2000-07-24 16:19:00 +0000
commit6d7a643f7cc4f0d022ede73c369fc5624cf98b6f (patch)
treefe564cab7b7b0216796f431407ffc9fba115c360 /gdk/linux-fb/gdkdnd-fb.c
parent72aa0d6611ca379ce79c79adff6f50ad7be94031 (diff)
downloadgtk+-6d7a643f7cc4f0d022ede73c369fc5624cf98b6f.tar.gz
(Part 2) Remove gdk_*_lookup() defines, since they are defined by the
(Part 2) * gdk/gdkprivate.h: Remove gdk_*_lookup() defines, since they are defined by the individual backends already. * gdk/gdkregion-generic.h, gdk/gdktypes.h: Put gdkregionbox & gdksegment back together again. Yes, there really is a good reason for this, if you are using the gdkregion internals, and if you're not, why do you care? * gdk/gdkwindow.c: Fix inverted condition * gdk/linux-fb: Compiles (for me - it will not work elsewhere most likely). * gtk/gtkcolorsel.c, gtk/gtkwindow.c: Add include for linux-fb * gtk/gtkrange.c: Redraw trough when moving. * gtk/gtktypeutils.c: Fix warning by adding const cast. * modules/linux-fb/basic.c: Fix unknown glyph retrieval.
Diffstat (limited to 'gdk/linux-fb/gdkdnd-fb.c')
-rw-r--r--gdk/linux-fb/gdkdnd-fb.c109
1 files changed, 67 insertions, 42 deletions
diff --git a/gdk/linux-fb/gdkdnd-fb.c b/gdk/linux-fb/gdkdnd-fb.c
index b65c55a8e5..8c17c2a59e 100644
--- a/gdk/linux-fb/gdkdnd-fb.c
+++ b/gdk/linux-fb/gdkdnd-fb.c
@@ -53,67 +53,92 @@ struct _GdkDragContextPrivate {
/* Drag Contexts */
static GList *contexts;
+static gpointer parent_class = NULL;
-GdkDragContext *
-gdk_drag_context_new (void)
+
+static void
+gdk_drag_context_init (GdkDragContext *dragcontext)
{
- GdkDragContextPrivate *result;
+ dragcontext->windowing_data = NULL;
- result = g_new0 (GdkDragContextPrivate, 1);
+ contexts = g_list_prepend (contexts, dragcontext);
+}
- result->ref_count = 1;
+static void
+gdk_drag_context_finalize (GObject *object)
+{
+ GdkDragContext *context = GDK_DRAG_CONTEXT (object);
+
+ g_list_free (context->targets);
- contexts = g_list_prepend (contexts, result);
+ if (context->source_window)
+ {
+ gdk_window_unref (context->source_window);
+ }
+
+ if (context->dest_window)
+ gdk_window_unref (context->dest_window);
+
+ contexts = g_list_remove (contexts, context);
- return (GdkDragContext *)result;
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
-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)
-{
- GdkDragContextPrivate *private = (GdkDragContextPrivate *)context;
- g_return_if_fail (context != NULL);
- g_return_if_fail (private->ref_count > 0);
+GType
+gdk_drag_context_get_type (void)
+{
+ static GType object_type = 0;
- private->ref_count--;
-
- if (private->ref_count == 0)
+ if (!object_type)
{
- g_dataset_destroy (private);
+ 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,
+ };
- g_list_free (context->targets);
-
- if (context->source_window)
- {
-#if 0
- if ((context->protocol == GDK_DRAG_PROTO_XDND) &&
- !context->is_source)
- xdnd_manage_source_filter (context, context->source_window, FALSE);
-#endif
-
- gdk_window_unref (context->source_window);
- }
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "GdkDragContext",
+ &object_info);
+ }
+
+ return object_type;
+}
- if (context->dest_window)
- gdk_window_unref (context->dest_window);
+GdkDragContext *
+gdk_drag_context_new (void)
+{
+ return (GdkDragContext *)g_type_create_instance(gdk_drag_context_get_type());
+}
-#if 0
- if (private->window_cache)
- gdk_window_cache_destroy (private->window_cache);
-#endif
+void
+gdk_drag_context_ref (GdkDragContext *context)
+{
+ g_object_ref(G_OBJECT(context));
+}
- contexts = g_list_remove (contexts, private);
- g_free (private);
- }
+void
+gdk_drag_context_unref (GdkDragContext *context)
+{
+ g_object_unref(G_OBJECT(context));
}
/*************************************************************