]> Pileus Git - ~andy/gtk/blobdiff - gdk/gdkcursor.c
Add vtables for DND
[~andy/gtk] / gdk / gdkcursor.c
index 77d5abf4bcda61aa052aa891e1ffdb7fae773a8a..475e96fbff3aa1d5ab84e4a3b1c96fdc08b0d89e 100644 (file)
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
+#include "config.h"
+
 #include "gdkcursor.h"
+
 #include "gdkdisplay.h"
 #include "gdkinternals.h"
 
-GType
-gdk_cursor_get_type (void)
-{
-  static GType our_type = 0;
-  
-  if (our_type == 0)
-    our_type = g_boxed_type_register_static ("GdkCursor",
-                                            (GBoxedCopyFunc)gdk_cursor_ref,
-                                            (GBoxedFreeFunc)gdk_cursor_unref);
-  return our_type;
-}
+
+/**
+ * SECTION:cursors
+ * @Short_description: Standard and pixmap cursors
+ * @Title: Cursors
+ *
+ * These functions are used to create and destroy cursors.
+ * There is a number of standard cursors, but it is also
+ * possible to construct new cursors from pixbufs. There
+ * may be limitations as to what kinds of cursors can be
+ * constructed on a given display, see
+ * gdk_display_supports_cursor_alpha(),
+ * gdk_display_supports_cursor_color(),
+ * gdk_display_get_default_cursor_size() and
+ * gdk_display_get_maximal_cursor_size().
+ *
+ * Cursors by themselves are not very interesting, they must be be
+ * bound to a window for users to see them. This is done with
+ * gdk_window_set_cursor() or by setting the cursor member of the
+ * #GdkWindowAttr struct passed to gdk_window_new().
+ */
+
+
+G_DEFINE_BOXED_TYPE (GdkCursor, gdk_cursor,
+                     gdk_cursor_ref,
+                     gdk_cursor_unref)
 
 /**
  * gdk_cursor_ref:
@@ -86,8 +104,7 @@ gdk_cursor_unref (GdkCursor *cursor)
  * 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_cursor_new_from_pixmap() to create
- * a cursor with no pixels in it.
+ * To make the cursor invisible, use %GDK_BLANK_CURSOR.
  * 
  * Return value: a new #GdkCursor
  **/
@@ -96,3 +113,21 @@ gdk_cursor_new (GdkCursorType cursor_type)
 {
   return gdk_cursor_new_for_display (gdk_display_get_default(), cursor_type);
 }
+
+/**
+ * gdk_cursor_get_cursor_type:
+ * @cursor:  a #GdkCursor
+ *
+ * Returns the cursor type for this cursor.
+ *
+ * Return value: a #GdkCursorType
+ *
+ * Since: 2.22
+ **/
+GdkCursorType
+gdk_cursor_get_cursor_type (GdkCursor *cursor)
+{
+  g_return_val_if_fail (cursor != NULL, GDK_BLANK_CURSOR);
+
+  return cursor->type;
+}