]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkcursor.c
Annotate gdk_display_manager_list_displays return value
[~andy/gtk] / gdk / gdkcursor.c
index c849f53d79370f9bcb68605b9b00c49ea9277be4..a3677e9f8f1eb1291170c5220d604e91d5a4b4a9 100644 (file)
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include "config.h"
 #include "gdkcursor.h"
+#include "gdkdisplay.h"
 #include "gdkinternals.h"
+#include "gdkalias.h"
 
+GType
+gdk_cursor_get_type (void)
+{
+  static GType our_type = 0;
+  
+  if (our_type == 0)
+    our_type = g_boxed_type_register_static (g_intern_static_string ("GdkCursor"),
+                                            (GBoxedCopyFunc)gdk_cursor_ref,
+                                            (GBoxedFreeFunc)gdk_cursor_unref);
+  return our_type;
+}
+
+/**
+ * gdk_cursor_ref:
+ * @cursor: a #GdkCursor
+ * 
+ * Adds a reference to @cursor.
+ * 
+ * Return value: Same @cursor that was passed in
+ **/
 GdkCursor*
 gdk_cursor_ref (GdkCursor *cursor)
 {
@@ -38,6 +61,14 @@ gdk_cursor_ref (GdkCursor *cursor)
   return cursor;
 }
 
+/**
+ * gdk_cursor_unref:
+ * @cursor: a #GdkCursor
+ *
+ * Removes a reference from @cursor, deallocating the cursor
+ * if no references remain.
+ * 
+ **/
 void
 gdk_cursor_unref (GdkCursor *cursor)
 {
@@ -50,3 +81,22 @@ gdk_cursor_unref (GdkCursor *cursor)
     _gdk_cursor_destroy (cursor);
 }
 
+/**
+ * gdk_cursor_new:
+ * @cursor_type: cursor to create
+ * 
+ * Creates a new cursor from the set of builtin cursors for the default display.
+ * See gdk_cursor_new_for_display().
+ *
+ * To make the cursor invisible, use %GDK_BLANK_CURSOR.
+ * 
+ * Return value: a new #GdkCursor
+ **/
+GdkCursor*
+gdk_cursor_new (GdkCursorType cursor_type)
+{
+  return gdk_cursor_new_for_display (gdk_display_get_default(), cursor_type);
+}
+
+#define __GDK_CURSOR_C__
+#include "gdkaliasdef.c"