* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <config.h>
+#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:
* 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
**/
{
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;
+}