Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
A Cursor
represents a cursor. Its contents are private.
Cursors are immutable objects, so they can not change after they have been constructed.
Synopsis
- newtype Cursor = Cursor (ManagedPtr Cursor)
- class (GObject o, IsDescendantOf Cursor o) => IsCursor o
- toCursor :: (MonadIO m, IsCursor o) => o -> m Cursor
- cursorGetFallback :: (HasCallStack, MonadIO m, IsCursor a) => a -> m (Maybe Cursor)
- cursorGetHotspotX :: (HasCallStack, MonadIO m, IsCursor a) => a -> m Int32
- cursorGetHotspotY :: (HasCallStack, MonadIO m, IsCursor a) => a -> m Int32
- cursorGetName :: (HasCallStack, MonadIO m, IsCursor a) => a -> m (Maybe Text)
- cursorGetTexture :: (HasCallStack, MonadIO m, IsCursor a) => a -> m (Maybe Texture)
- cursorNewFromName :: (HasCallStack, MonadIO m, IsCursor a) => Text -> Maybe a -> m (Maybe Cursor)
- cursorNewFromTexture :: (HasCallStack, MonadIO m, IsTexture a, IsCursor b) => a -> Int32 -> Int32 -> Maybe b -> m Cursor
- constructCursorFallback :: (IsCursor o, MonadIO m, IsCursor a) => a -> m (GValueConstruct o)
- getCursorFallback :: (MonadIO m, IsCursor o) => o -> m (Maybe Cursor)
- constructCursorHotspotX :: (IsCursor o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getCursorHotspotX :: (MonadIO m, IsCursor o) => o -> m Int32
- constructCursorHotspotY :: (IsCursor o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getCursorHotspotY :: (MonadIO m, IsCursor o) => o -> m Int32
- constructCursorName :: (IsCursor o, MonadIO m) => Text -> m (GValueConstruct o)
- getCursorName :: (MonadIO m, IsCursor o) => o -> m (Maybe Text)
- constructCursorTexture :: (IsCursor o, MonadIO m, IsTexture a) => a -> m (GValueConstruct o)
- getCursorTexture :: (MonadIO m, IsCursor o) => o -> m (Maybe Texture)
Exported types
Memory-managed wrapper type.
Instances
Eq Cursor Source # | |
IsGValue Cursor Source # | Convert |
ManagedPtrNewtype Cursor Source # | |
Defined in GI.Gdk.Objects.Cursor toManagedPtr :: Cursor -> ManagedPtr Cursor # | |
TypedObject Cursor Source # | |
Defined in GI.Gdk.Objects.Cursor | |
GObject Cursor Source # | |
Defined in GI.Gdk.Objects.Cursor | |
HasParentTypes Cursor Source # | |
Defined in GI.Gdk.Objects.Cursor | |
type ParentTypes Cursor Source # | |
Defined in GI.Gdk.Objects.Cursor |
class (GObject o, IsDescendantOf Cursor o) => IsCursor o Source #
Instances
(GObject o, IsDescendantOf Cursor o) => IsCursor o Source # | |
Defined in GI.Gdk.Objects.Cursor |
Methods
Overloaded methods
getFallback
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m (Maybe Cursor) | Returns: the fallback of the cursor or |
Returns the fallback for this cursor
. The fallback will be used if this
cursor is not available on a given Display
.
For named cursors, this can happen when using nonstandard names or when
using an incomplete cursor theme.
For textured cursors, this can happen when the texture is too large or
when the Display
it is used on does not support textured cursors.
getHotspotX
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m Int32 | Returns: the horizontal offset of the hotspot or 0 for named cursors |
Returns the horizontal offset of the hotspot. The hotspot indicates the pixel that will be directly above the cursor.
getHotspotY
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m Int32 | Returns: the vertical offset of the hotspot or 0 for named cursors |
Returns the vertical offset of the hotspot. The hotspot indicates the pixel that will be directly above the cursor.
getName
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the name of the cursor or |
Returns the name of the cursor. If the cursor is not a named cursor, Nothing
will be returned and the GdkCursor[texture](#g:signal:texture) property will be set.
getTexture
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m (Maybe Texture) | Returns: the texture for cursor or |
Returns the texture for the cursor. If the cursor is a named cursor, Nothing
will be returned and the GdkCursor[name](#g:signal:name) property will be set.
newFromName
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> Text |
|
-> Maybe a |
|
-> m (Maybe Cursor) | Returns: a new |
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"
newFromTexture
:: (HasCallStack, MonadIO m, IsTexture a, IsCursor b) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> Maybe b |
|
-> m Cursor | Returns: a new |
Creates a new cursor from a Texture
.
Properties
fallback
No description available in the introspection data.
constructCursorFallback :: (IsCursor o, MonadIO m, IsCursor a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “fallback
” property. This is rarely needed directly, but it is used by new
.
getCursorFallback :: (MonadIO m, IsCursor o) => o -> m (Maybe Cursor) Source #
Get the value of the “fallback
” property.
When overloading is enabled, this is equivalent to
get
cursor #fallback
hotspotX
No description available in the introspection data.
constructCursorHotspotX :: (IsCursor o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “hotspot-x
” property. This is rarely needed directly, but it is used by new
.
getCursorHotspotX :: (MonadIO m, IsCursor o) => o -> m Int32 Source #
Get the value of the “hotspot-x
” property.
When overloading is enabled, this is equivalent to
get
cursor #hotspotX
hotspotY
No description available in the introspection data.
constructCursorHotspotY :: (IsCursor o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “hotspot-y
” property. This is rarely needed directly, but it is used by new
.
getCursorHotspotY :: (MonadIO m, IsCursor o) => o -> m Int32 Source #
Get the value of the “hotspot-y
” property.
When overloading is enabled, this is equivalent to
get
cursor #hotspotY
name
No description available in the introspection data.
constructCursorName :: (IsCursor o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “name
” property. This is rarely needed directly, but it is used by new
.
getCursorName :: (MonadIO m, IsCursor o) => o -> m (Maybe Text) Source #
Get the value of the “name
” property.
When overloading is enabled, this is equivalent to
get
cursor #name
texture
No description available in the introspection data.
constructCursorTexture :: (IsCursor o, MonadIO m, IsTexture a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “texture
” property. This is rarely needed directly, but it is used by new
.
getCursorTexture :: (MonadIO m, IsCursor o) => o -> m (Maybe Texture) Source #
Get the value of the “texture
” property.
When overloading is enabled, this is equivalent to
get
cursor #texture