gi-gdk-3.0.23: Gdk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.Cursor

Description

A Cursor represents a cursor. Its contents are private.

Synopsis

Exported types

newtype Cursor Source #

Memory-managed wrapper type.

Constructors

Cursor (ManagedPtr Cursor) 

Instances

Instances details
Eq Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

Methods

(==) :: Cursor -> Cursor -> Bool

(/=) :: Cursor -> Cursor -> Bool

GObject Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

ManagedPtrNewtype Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

Methods

toManagedPtr :: Cursor -> ManagedPtr Cursor

TypedObject Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

Methods

glibType :: IO GType

IsGValue Cursor Source #

Convert Cursor to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.Cursor

Methods

toGValue :: Cursor -> IO GValue

fromGValue :: GValue -> IO Cursor

HasParentTypes Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

type ParentTypes Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

type ParentTypes Cursor = '[Object]

class (GObject o, IsDescendantOf Cursor o) => IsCursor o Source #

Type class for types which can be safely cast to Cursor, for instance with toCursor.

Instances

Instances details
(GObject o, IsDescendantOf Cursor o) => IsCursor o Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

toCursor :: (MonadIO m, IsCursor o) => o -> m Cursor Source #

Cast to Cursor, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getCursorType

cursorGetCursorType Source #

Arguments

:: (HasCallStack, MonadIO m, IsCursor a) 
=> a

cursor: a Cursor

-> m CursorType

Returns: a CursorType

Returns the cursor type for this cursor.

Since: 2.22

getDisplay

cursorGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsCursor a) 
=> a

cursor: a Cursor.

-> m Display

Returns: the Display associated to cursor

Returns the display on which the Cursor is defined.

Since: 2.2

getImage

cursorGetImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsCursor a) 
=> a

cursor: a Cursor

-> m (Maybe Pixbuf)

Returns: a Pixbuf representing cursor, or Nothing

Returns a Pixbuf 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, Nothing is returned.

Since: 2.8

getSurface

cursorGetSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsCursor a) 
=> a

cursor: a Cursor

-> m (Maybe Surface, Double, Double)

Returns: a Surface representing cursor, or Nothing

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, Nothing is returned.

Since: 3.10

new

cursorNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> CursorType

cursorType: cursor to create

-> m Cursor

Returns: a new Cursor

Deprecated: (Since version 3.16)Use cursorNewForDisplay instead.

Creates a new cursor from the set of builtin cursors for the default display. See cursorNewForDisplay.

To make the cursor invisible, use CursorTypeBlankCursor.

newForDisplay

cursorNewForDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the Display for which the cursor will be created

-> CursorType

cursorType: cursor to create

-> m Cursor

Returns: a new Cursor

Creates a new cursor from the set of builtin cursors.

Since: 2.2

newFromName

cursorNewFromName Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the Display for which the cursor will be created

-> Text

name: the name of the cursor

-> m (Maybe Cursor)

Returns: a new Cursor, or Nothing if there is no cursor with the given name

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: 2.8

newFromPixbuf

cursorNewFromPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsPixbuf b) 
=> a

display: the Display for which the cursor will be created

-> b

pixbuf: the Pixbuf containing the cursor image

-> Int32

x: the horizontal offset of the “hotspot” of the cursor.

-> Int32

y: the vertical offset of the “hotspot” of the cursor.

-> m Cursor

Returns: a new Cursor.

Creates a new cursor from a pixbuf.

Not all GDK backends support RGBA cursors. If they are not supported, a monochrome approximation will be displayed. The functions displaySupportsCursorAlpha and displaySupportsCursorColor can be used to determine whether RGBA cursors are supported; displayGetDefaultCursorSize and displayGetMaximalCursorSize give information about cursor sizes.

If x or y are -1, the pixbuf must have options named “x_hot” and “y_hot”, resp., containing integer values between 0 and the width resp. height of the pixbuf. (Since: 3.0)

On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.

Since: 2.4

newFromSurface

cursorNewFromSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the Display for which the cursor will be created

-> Surface

surface: the cairo image surface containing the cursor pixel data

-> Double

x: the horizontal offset of the “hotspot” of the cursor

-> Double

y: the vertical offset of the “hotspot” of the cursor

-> m Cursor

Returns: a new 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 displaySupportsCursorAlpha and displaySupportsCursorColor can be used to determine whether RGBA cursors are supported; displayGetDefaultCursorSize and displayGetMaximalCursorSize give information about cursor sizes.

On the X backend, support for RGBA cursors requires a sufficently new version of the X Render extension.

Since: 3.10

ref

cursorRef Source #

Arguments

:: (HasCallStack, MonadIO m, IsCursor a) 
=> a

cursor: a Cursor

-> m Cursor

Returns: Same cursor that was passed in

Deprecated: (Since version 3.0)Use objectRef instead

Adds a reference to cursor.

unref

cursorUnref Source #

Arguments

:: (HasCallStack, MonadIO m, IsCursor a) 
=> a

cursor: a Cursor

-> m () 

Deprecated: (Since version 3.0)Use objectUnref instead

Removes a reference from cursor, deallocating the cursor if no references remain.

Properties

cursorType

No description available in the introspection data.

constructCursorCursorType :: (IsCursor o, MonadIO m) => CursorType -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cursor-type” property. This is rarely needed directly, but it is used by new.

getCursorCursorType :: (MonadIO m, IsCursor o) => o -> m CursorType Source #

Get the value of the “cursor-type” property. When overloading is enabled, this is equivalent to

get cursor #cursorType

display

No description available in the introspection data.

constructCursorDisplay :: (IsCursor o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “display” property. This is rarely needed directly, but it is used by new.

getCursorDisplay :: (MonadIO m, IsCursor o) => o -> m Display Source #

Get the value of the “display” property. When overloading is enabled, this is equivalent to

get cursor #display