Gdk.Cursor

Entities

Simple Types

Constants

Subprograms

Generic Instantiations

Description

A Gdk.Gdk_Cursor represents a cursor. Its contents are private.

Cursor_Type_Property

Cursor_Type_Property : constant Glib.Properties.Property_Boxed;

Type: Cursor_Type

Display_Property

Display_Property : constant Glib.Properties.Property_Boxed;

Type: Display

Gdk_Cursor_New

function Gdk_Cursor_New (Cursor_Type : Gdk_Cursor_Type) return Gdk_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.Blank_Cursor.

Parameters
Cursor_Type

cursor to create

Return Value

Gdk_Cursor_New_For_Display

function Gdk_Cursor_New_For_Display
   (Display     : not null access Gdk.Display.Gdk_Display_Record'Class;
    Cursor_Type : Gdk_Cursor_Type) return Gdk_Cursor

Creates a new cursor from the set of builtin cursors. Since: gtk+ 2.2

Parameters
Display

the Gdk.Display.Gdk_Display for which the cursor will be created

Cursor_Type

cursor to create

Return Value

Gdk_Cursor_New_From_Name

function Gdk_Cursor_New_From_Name
   (Display : not null access Gdk.Display.Gdk_Display_Record'Class;
    Name    : UTF8_String) return Gdk_Cursor

Creates a new cursor by looking up Name in the current cursor theme. A recommended set of cursor names that will work across different platforms can be found in the CSS specification: - "none" - "default" - "help" - "pointer" - "context-menu" - "progress" - "wait" - "cell" - "crosshair" - "text" - "vertical-text" - "alias" - "copy" - "no-drop" - "move" - "not-allowed" - "grab" - "grabbing" - "all-scroll" - "col-resize" - "row-resize" - "n-resize" - "e-resize" - "s-resize" - "w-resize" - "ne-resize" - "nw-resize" - "sw-resize" - "se-resize" - "ew-resize" - "ns-resize" - "nesw-resize" - "nwse-resize" - "zoom-in" - "zoom-out" Since: gtk+ 2.8

Parameters
Display

the Gdk.Display.Gdk_Display for which the cursor will be created

Name

the name of the cursor

Return Value

Gdk_Cursor_New_From_Surface

function Gdk_Cursor_New_From_Surface
   (Display : not null access Gdk.Display.Gdk_Display_Record'Class;
    Surface : Cairo.Cairo_Surface;
    X       : Gdouble;
    Y       : Gdouble) return Gdk_Cursor

Creates a new cursor from a cairo image surface. Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions Gdk.Display.Supports_Cursor_Alpha and Gdk.Display.Supports_Cursor_Color can be used to determine whether RGBA cursors are supported; Gdk.Display.Get_Default_Cursor_Size and Gdk.Display.Get_Maximal_Cursor_Size give information about cursor sizes. On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension. Since: gtk+ 3.10

Parameters
Display

the Gdk.Display.Gdk_Display for which the cursor will be created

Surface

the cairo image surface containing the cursor pixel data

X

the horizontal offset of the "hotspot" of the cursor

Y

the vertical offset of the "hotspot" of the cursor

Return Value

Gdk_Cursor_Type

type Gdk_Cursor_Type is (
   Blank_Cursor,
   Cursor_Is_Pixmap,
   X_Cursor,
   Arrow,
   Based_Arrow_Down,
   Based_Arrow_Up,
   Boat,
   Bogosity,
   …,
   Last_Cursor);

Predefined cursors.

Note that these IDs are directly taken from the X cursor font, and many of these cursors are either not useful, or are not available on other platforms.

The recommended way to create cursors is to use gdk_cursor_new_from_name.

Enumeration Literal
Blank_Cursor
Cursor_Is_Pixmap
X_Cursor
Arrow
Based_Arrow_Down
Based_Arrow_Up
Boat
Bogosity
Bottom_Left_Corner
Bottom_Right_Corner
Bottom_Side
Bottom_Tee
Box_Spiral
Center_Ptr
Circle
Clock
Coffee_Mug
Cross
Cross_Reverse
Crosshair
Diamond_Cross
Dot
Dotbox
Double_Arrow
Draft_Large
Draft_Small
Draped_Box
Exchange
Fleur
Gobbler
Gumby
Hand1
Hand2
Heart
Icon
Iron_Cross
Left_Ptr
Left_Side
Left_Tee
Leftbutton
Ll_Angle
Lr_Angle
Man
Middlebutton
Mouse
Pencil
Pirate
Plus
Question_Arrow
Right_Ptr
Right_Side
Right_Tee
Rightbutton
Rtl_Logo
Sailboat
Sb_Down_Arrow
Sb_H_Double_Arrow
Sb_Left_Arrow
Sb_Right_Arrow
Sb_Up_Arrow
Sb_V_Double_Arrow
Shuttle
Sizing
Spider
Spraycan
Star
Target
Tcross
Top_Left_Arrow
Top_Left_Corner
Top_Right_Corner
Top_Side
Top_Tee
Trek
Ul_Angle
Umbrella
Ur_Angle
Watch
Xterm
Last_Cursor

Gdk_Cursor_Type_Properties

package Gdk_Cursor_Type_Properties is
   new Generic_Internal_Discrete_Property (Gdk_Cursor_Type);

Gdk_New

procedure Gdk_New (Self : out Gdk_Cursor; Cursor_Type : Gdk_Cursor_Type)

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.

Parameters
Self
Cursor_Type

cursor to create

Gdk_New_For_Display

procedure Gdk_New_For_Display
   (Self        : out Gdk_Cursor;
    Display     : not null access Gdk.Display.Gdk_Display_Record'Class;
    Cursor_Type : Gdk_Cursor_Type)

Creates a new cursor from the set of builtin cursors. Since: gtk+ 2.2

Parameters
Self
Display

the Gdk.Display.Gdk_Display for which the cursor will be created

Cursor_Type

cursor to create

Gdk_New_From_Name

procedure Gdk_New_From_Name
   (Self    : out Gdk_Cursor;
    Display : not null access Gdk.Display.Gdk_Display_Record'Class;
    Name    : UTF8_String)

Creates a new cursor by looking up Name in the current cursor theme. A recommended set of cursor names that will work across different platforms can be found in the CSS specification: - "none" - "default" - "help" - "pointer" - "context-menu" - "progress" - "wait" - "cell" - "crosshair" - "text" - "vertical-text" - "alias" - "copy" - "no-drop" - "move" - "not-allowed" - "grab" - "grabbing" - "all-scroll" - "col-resize" - "row-resize" - "n-resize" - "e-resize" - "s-resize" - "w-resize" - "ne-resize" - "nw-resize" - "sw-resize" - "se-resize" - "ew-resize" - "ns-resize" - "nesw-resize" - "nwse-resize" - "zoom-in" - "zoom-out" Since: gtk+ 2.8

Parameters
Self
Display

the Gdk.Display.Gdk_Display for which the cursor will be created

Name

the name of the cursor

Gdk_New_From_Surface

procedure Gdk_New_From_Surface
   (Self    : out Gdk_Cursor;
    Display : not null access Gdk.Display.Gdk_Display_Record'Class;
    Surface : Cairo.Cairo_Surface;
    X       : Gdouble;
    Y       : Gdouble)

Creates a new cursor from a cairo image surface. Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions Gdk.Display.Supports_Cursor_Alpha and Gdk.Display.Supports_Cursor_Color can be used to determine whether RGBA cursors are supported; Gdk.Display.Get_Default_Cursor_Size and Gdk.Display.Get_Maximal_Cursor_Size give information about cursor sizes. On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension. Since: gtk+ 3.10

Parameters
Self
Display

the Gdk.Display.Gdk_Display for which the cursor will be created

Surface

the cairo image surface containing the cursor pixel data

X

the horizontal offset of the "hotspot" of the cursor

Y

the vertical offset of the "hotspot" of the cursor

Get_Cursor_Type

function Get_Cursor_Type (Self : Gdk.Gdk_Cursor) return Gdk_Cursor_Type

Returns the cursor type for this cursor. Since: gtk+ 2.22

Parameters
Self
Return Value

a Gdk.Cursor.Gdk_Cursor_Type

Get_Display

function Get_Display
   (Self : Gdk.Gdk_Cursor) return Gdk.Display.Gdk_Display

Returns the display on which the Gdk.Gdk_Cursor is defined. Since: gtk+ 2.2

Parameters
Self
Return Value

the Gdk.Display.Gdk_Display associated to Cursor

Get_Surface

procedure Get_Surface
   (Self    : Gdk.Gdk_Cursor;
    X_Hot   : out Gdouble;
    Y_Hot   : out Gdouble;
    Surface : out Cairo.Cairo_Surface)

Returns a cairo image surface with the image used to display the cursor. Note that depending on the capabilities of the windowing system and on the cursor, GDK may not be able to obtain the image data. In this case, null is returned. Since: gtk+ 3.10

Parameters
Self
X_Hot

Location to store the hotspot x position, or null

Y_Hot

Location to store the hotspot y position, or null @return a cairo_surface_t representing Cursor, or null

Surface

Get_Type

function Get_Type return Glib.GType
Return Value

Property_Gdk_Cursor_Type

type Property_Gdk_Cursor_Type is new Gdk_Cursor_Type_Properties.Property;

Ref

procedure Ref (Self : Gdk.Gdk_Cursor)
Parameters
Self

Unref

procedure Unref (Self : Gdk.Gdk_Cursor)
Parameters
Self