diff --git a/docs/reference/gdk/tmpl/.gitignore b/docs/reference/gdk/tmpl/.gitignore index 5b8a121d69..b3484df955 100644 --- a/docs/reference/gdk/tmpl/.gitignore +++ b/docs/reference/gdk/tmpl/.gitignore @@ -1,5 +1,6 @@ cairo_interaction.sgml colors.sgml +cursors.sgml dnd.sgml gdkapplaunchcontext.sgml gdkdisplay.sgml diff --git a/docs/reference/gdk/tmpl/cursors.sgml b/docs/reference/gdk/tmpl/cursors.sgml deleted file mode 100644 index 83777c50fb..0000000000 --- a/docs/reference/gdk/tmpl/cursors.sgml +++ /dev/null @@ -1,214 +0,0 @@ - -Cursors - - -Standard and pixmap 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(). - - - - - - - - - - - - - - - -A GdkCursor structure represents a cursor. - - - - - -The standard cursors available. - - -@GDK_X_CURSOR: -@GDK_ARROW: -@GDK_BASED_ARROW_DOWN: -@GDK_BASED_ARROW_UP: -@GDK_BOAT: -@GDK_BOGOSITY: -@GDK_BOTTOM_LEFT_CORNER: -@GDK_BOTTOM_RIGHT_CORNER: -@GDK_BOTTOM_SIDE: -@GDK_BOTTOM_TEE: -@GDK_BOX_SPIRAL: -@GDK_CENTER_PTR: -@GDK_CIRCLE: -@GDK_CLOCK: -@GDK_COFFEE_MUG: -@GDK_CROSS: -@GDK_CROSS_REVERSE: -@GDK_CROSSHAIR: -@GDK_DIAMOND_CROSS: -@GDK_DOT: -@GDK_DOTBOX: -@GDK_DOUBLE_ARROW: -@GDK_DRAFT_LARGE: -@GDK_DRAFT_SMALL: -@GDK_DRAPED_BOX: -@GDK_EXCHANGE: -@GDK_FLEUR: -@GDK_GOBBLER: -@GDK_GUMBY: -@GDK_HAND1: -@GDK_HAND2: -@GDK_HEART: -@GDK_ICON: -@GDK_IRON_CROSS: -@GDK_LEFT_PTR: -@GDK_LEFT_SIDE: -@GDK_LEFT_TEE: -@GDK_LEFTBUTTON: -@GDK_LL_ANGLE: -@GDK_LR_ANGLE: -@GDK_MAN: -@GDK_MIDDLEBUTTON: -@GDK_MOUSE: -@GDK_PENCIL: -@GDK_PIRATE: -@GDK_PLUS: -@GDK_QUESTION_ARROW: -@GDK_RIGHT_PTR: -@GDK_RIGHT_SIDE: -@GDK_RIGHT_TEE: -@GDK_RIGHTBUTTON: -@GDK_RTL_LOGO: -@GDK_SAILBOAT: -@GDK_SB_DOWN_ARROW: -@GDK_SB_H_DOUBLE_ARROW: -@GDK_SB_LEFT_ARROW: -@GDK_SB_RIGHT_ARROW: -@GDK_SB_UP_ARROW: -@GDK_SB_V_DOUBLE_ARROW: -@GDK_SHUTTLE: -@GDK_SIZING: -@GDK_SPIDER: -@GDK_SPRAYCAN: -@GDK_STAR: -@GDK_TARGET: -@GDK_TCROSS: -@GDK_TOP_LEFT_ARROW: -@GDK_TOP_LEFT_CORNER: -@GDK_TOP_RIGHT_CORNER: -@GDK_TOP_SIDE: -@GDK_TOP_TEE: -@GDK_TREK: -@GDK_UL_ANGLE: -@GDK_UMBRELLA: -@GDK_UR_ANGLE: -@GDK_WATCH: -@GDK_XTERM: -@GDK_LAST_CURSOR: last cursor type -@GDK_BLANK_CURSOR: Blank cursor. Since 2.16 -@GDK_CURSOR_IS_PIXMAP: type of cursors constructed with - gdk_cursor_new_from_pixbuf() - - - - - - -@cursor_type: -@Returns: - - - - - - - -@display: -@pixbuf: -@x: -@y: -@Returns: - - - - - - - -@display: -@name: -@Returns: - - - - - - - -@display: -@cursor_type: -@Returns: - - - - - - - -@cursor: -@Returns: - - - - - - - -@cursor: -@Returns: - - - - - - - -@cursor: -@Returns: - - - - - - - -@cursor: -@Returns: - - - - - - - -@cursor: - - diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index 0aabd5940a..475e96fbff 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -32,6 +32,28 @@ #include "gdkinternals.h" +/** + * 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) @@ -106,5 +128,6 @@ GdkCursorType gdk_cursor_get_cursor_type (GdkCursor *cursor) { g_return_val_if_fail (cursor != NULL, GDK_BLANK_CURSOR); + return cursor->type; } diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h index 91fd6d523e..a421828389 100644 --- a/gdk/gdkcursor.h +++ b/gdk/gdkcursor.h @@ -38,7 +38,91 @@ G_BEGIN_DECLS #define GDK_TYPE_CURSOR (gdk_cursor_get_type ()) -/* Cursor types. +/** + * GdkCursorType: + * @GDK_X_CURSOR: + * @GDK_ARROW: + * @GDK_BASED_ARROW_DOWN: + * @GDK_BASED_ARROW_UP: + * @GDK_BOAT: + * @GDK_BOGOSITY: + * @GDK_BOTTOM_LEFT_CORNER: + * @GDK_BOTTOM_RIGHT_CORNER: + * @GDK_BOTTOM_SIDE: + * @GDK_BOTTOM_TEE: + * @GDK_BOX_SPIRAL: + * @GDK_CENTER_PTR: + * @GDK_CIRCLE: + * @GDK_CLOCK: + * @GDK_COFFEE_MUG: + * @GDK_CROSS: + * @GDK_CROSS_REVERSE: + * @GDK_CROSSHAIR: + * @GDK_DIAMOND_CROSS: + * @GDK_DOT: + * @GDK_DOTBOX: + * @GDK_DOUBLE_ARROW: + * @GDK_DRAFT_LARGE: + * @GDK_DRAFT_SMALL: + * @GDK_DRAPED_BOX: + * @GDK_EXCHANGE: + * @GDK_FLEUR: + * @GDK_GOBBLER: + * @GDK_GUMBY: + * @GDK_HAND1: + * @GDK_HAND2: + * @GDK_HEART: + * @GDK_ICON: + * @GDK_IRON_CROSS: + * @GDK_LEFT_PTR: + * @GDK_LEFT_SIDE: + * @GDK_LEFT_TEE: + * @GDK_LEFTBUTTON: + * @GDK_LL_ANGLE: + * @GDK_LR_ANGLE: + * @GDK_MAN: + * @GDK_MIDDLEBUTTON: + * @GDK_MOUSE: + * @GDK_PENCIL: + * @GDK_PIRATE: + * @GDK_PLUS: + * @GDK_QUESTION_ARROW: + * @GDK_RIGHT_PTR: + * @GDK_RIGHT_SIDE: + * @GDK_RIGHT_TEE: + * @GDK_RIGHTBUTTON: + * @GDK_RTL_LOGO: + * @GDK_SAILBOAT: + * @GDK_SB_DOWN_ARROW: + * @GDK_SB_H_DOUBLE_ARROW: + * @GDK_SB_LEFT_ARROW: + * @GDK_SB_RIGHT_ARROW: + * @GDK_SB_UP_ARROW: + * @GDK_SB_V_DOUBLE_ARROW: + * @GDK_SHUTTLE: + * @GDK_SIZING: + * @GDK_SPIDER: + * @GDK_SPRAYCAN: + * @GDK_STAR: + * @GDK_TARGET: + * @GDK_TCROSS: + * @GDK_TOP_LEFT_ARROW: + * @GDK_TOP_LEFT_CORNER: + * @GDK_TOP_RIGHT_CORNER: + * @GDK_TOP_SIDE: + * @GDK_TOP_TEE: + * @GDK_TREK: + * @GDK_UL_ANGLE: + * @GDK_UMBRELLA: + * @GDK_UR_ANGLE: + * @GDK_WATCH: + * @GDK_XTERM: + * @GDK_LAST_CURSOR: last cursor type + * @GDK_BLANK_CURSOR: Blank cursor. Since 2.16 + * @GDK_CURSOR_IS_PIXMAP: type of cursors constructed with + * gdk_cursor_new_from_pixbuf() + * + * The standard cursors available. */ typedef enum { @@ -124,10 +208,15 @@ typedef enum GDK_CURSOR_IS_PIXMAP = -1 } GdkCursorType; +/** + * GdkCursor: + * + * A #GdkCursor structure represents a cursor. + */ struct _GdkCursor { - GdkCursorType GSEAL (type); /*< private >*/ + GdkCursorType GSEAL (type); guint GSEAL (ref_count); };