gi-gdk-3.0.16: Gdk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.Cursor

Contents

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
GObject Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

Methods

gobjectType :: Cursor -> IO GType #

IsObject Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

IsCursor Cursor Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

class GObject o => IsCursor o Source #

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

Instances
(GObject a, (UnknownAncestorError Cursor a :: Constraint)) => IsCursor a Source # 
Instance details

Defined in GI.Gdk.Objects.Cursor

IsCursor Cursor 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.

noCursor :: Maybe Cursor Source #

A convenience alias for Nothing :: Maybe Cursor.

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 => CursorType -> IO (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, IsDisplay a) => a -> IO (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