summaryrefslogtreecommitdiff
path: root/gdk/gdkcursor.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-12-20 03:09:31 +0100
committerMatthias Clasen <mclasen@redhat.com>2010-12-21 12:07:04 -0500
commit0b4913a1666aae0907bb32626a1c89a2e5a50e76 (patch)
treeda3c1425a5fc3710804c37c3a370281fe4a098ae /gdk/gdkcursor.c
parent66e38945390cd86a3f97867fc63005d5e60ed7fc (diff)
downloadgtk+-0b4913a1666aae0907bb32626a1c89a2e5a50e76.tar.gz
gdk: Make GdkCursor a GObject
Also port the X11 implementation. Win32 and Quartz need to be ported still.
Diffstat (limited to 'gdk/gdkcursor.c')
-rw-r--r--gdk/gdkcursor.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c
index 1609c9cbcd..3bbbbddae9 100644
--- a/gdk/gdkcursor.c
+++ b/gdk/gdkcursor.c
@@ -59,9 +59,17 @@
* The #GdkCursor structure represents a cursor. Its contents are private.
*/
-G_DEFINE_BOXED_TYPE (GdkCursor, gdk_cursor,
- gdk_cursor_ref,
- gdk_cursor_unref)
+G_DEFINE_ABSTRACT_TYPE (GdkCursor, gdk_cursor, G_TYPE_OBJECT)
+
+static void
+gdk_cursor_class_init (GdkCursorClass *cursor_class)
+{
+}
+
+static void
+gdk_cursor_init (GdkCursor *cursor)
+{
+}
/**
* gdk_cursor_ref:
@@ -75,11 +83,8 @@ GdkCursor*
gdk_cursor_ref (GdkCursor *cursor)
{
g_return_val_if_fail (cursor != NULL, NULL);
- g_return_val_if_fail (cursor->ref_count > 0, NULL);
- cursor->ref_count += 1;
-
- return cursor;
+ return g_object_ref (cursor);
}
/**
@@ -93,12 +98,8 @@ void
gdk_cursor_unref (GdkCursor *cursor)
{
g_return_if_fail (cursor != NULL);
- g_return_if_fail (cursor->ref_count > 0);
-
- cursor->ref_count -= 1;
- if (cursor->ref_count == 0)
- _gdk_cursor_destroy (cursor);
+ g_object_unref (cursor);
}
/**