Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
A Cursor
represents a cursor. Its contents are private.
- newtype Cursor = Cursor (ManagedPtr Cursor)
- class GObject o => IsCursor o
- toCursor :: IsCursor o => o -> IO Cursor
- noCursor :: Maybe Cursor
- data CursorGetCursorTypeMethodInfo
- cursorGetCursorType :: (HasCallStack, MonadIO m, IsCursor a) => a -> m CursorType
- data CursorGetDisplayMethodInfo
- cursorGetDisplay :: (HasCallStack, MonadIO m, IsCursor a) => a -> m Display
- data CursorGetImageMethodInfo
- cursorGetImage :: (HasCallStack, MonadIO m, IsCursor a) => a -> m (Maybe Pixbuf)
- data CursorGetSurfaceMethodInfo
- cursorGetSurface :: (HasCallStack, MonadIO m, IsCursor a) => a -> m (Maybe Surface, Double, Double)
- cursorNew :: (HasCallStack, MonadIO m) => CursorType -> m Cursor
- cursorNewForDisplay :: (HasCallStack, MonadIO m, IsDisplay a) => a -> CursorType -> m Cursor
- cursorNewFromName :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Text -> m (Maybe Cursor)
- cursorNewFromPixbuf :: (HasCallStack, MonadIO m, IsDisplay a, IsPixbuf b) => a -> b -> Int32 -> Int32 -> m Cursor
- cursorNewFromSurface :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Surface -> Double -> Double -> m Cursor
- data CursorRefMethodInfo
- cursorRef :: (HasCallStack, MonadIO m, IsCursor a) => a -> m Cursor
- data CursorUnrefMethodInfo
- cursorUnref :: (HasCallStack, MonadIO m, IsCursor a) => a -> m ()
- data CursorCursorTypePropertyInfo
- constructCursorCursorType :: IsCursor o => CursorType -> IO (GValueConstruct o)
- cursorCursorType :: AttrLabelProxy "cursorType"
- getCursorCursorType :: (MonadIO m, IsCursor o) => o -> m CursorType
- data CursorDisplayPropertyInfo
- constructCursorDisplay :: (IsCursor o, IsDisplay a) => a -> IO (GValueConstruct o)
- cursorDisplay :: AttrLabelProxy "display"
- getCursorDisplay :: (MonadIO m, IsCursor o) => o -> m Display
Exported types
GObject Cursor Source # | |
IsObject Cursor Source # | |
IsCursor Cursor Source # | |
((~) * info (ResolveCursorMethod t Cursor), MethodInfo * info Cursor p) => IsLabel t (Cursor -> p) Source # | |
((~) * info (ResolveCursorMethod t Cursor), MethodInfo * info Cursor p) => IsLabelProxy t (Cursor -> p) Source # | |
HasAttributeList * Cursor Source # | |
type AttributeList Cursor Source # | |
type SignalList Cursor Source # | |
Methods
getCursorType
data CursorGetCursorTypeMethodInfo Source #
((~) * signature (m CursorType), MonadIO m, IsCursor a) => MethodInfo * CursorGetCursorTypeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m CursorType | Returns: a |
Returns the cursor type for this cursor.
Since: 2.22
getDisplay
data CursorGetDisplayMethodInfo Source #
((~) * signature (m Display), MonadIO m, IsCursor a) => MethodInfo * CursorGetDisplayMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m Display | Returns: the |
Returns the display on which the Cursor
is defined.
Since: 2.2
getImage
data CursorGetImageMethodInfo Source #
((~) * signature (m (Maybe Pixbuf)), MonadIO m, IsCursor a) => MethodInfo * CursorGetImageMethodInfo a signature Source # | |
getSurface
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
:: (HasCallStack, MonadIO m) | |
=> CursorType |
|
-> m Cursor | Returns: a new |
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
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> CursorType |
|
-> m Cursor | Returns: a new |
Creates a new cursor from the set of builtin cursors.
Since: 2.2
newFromName
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> Text |
|
-> 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"
Since: 2.8
newFromPixbuf
:: (HasCallStack, MonadIO m, IsDisplay a, IsPixbuf b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> m Cursor | Returns: a new |
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
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> Surface |
|
-> Double |
|
-> Double |
|
-> m Cursor | Returns: a new |
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
data CursorRefMethodInfo Source #
((~) * signature (m Cursor), MonadIO m, IsCursor a) => MethodInfo * CursorRefMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m Cursor | Returns: Same |
Deprecated: (Since version 3.0)Use objectRef
instead
Adds a reference to cursor
.
unref
data CursorUnrefMethodInfo Source #
((~) * signature (m ()), MonadIO m, IsCursor a) => MethodInfo * CursorUnrefMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsCursor a) | |
=> a |
|
-> m () |
Deprecated: (Since version 3.0)Use objectUnref
instead
Removes a reference from cursor
, deallocating the cursor
if no references remain.
Properties
cursorType
data CursorCursorTypePropertyInfo Source #
constructCursorCursorType :: IsCursor o => CursorType -> IO (GValueConstruct o) Source #
cursorCursorType :: AttrLabelProxy "cursorType" Source #
getCursorCursorType :: (MonadIO m, IsCursor o) => o -> m CursorType Source #
display
data CursorDisplayPropertyInfo Source #
constructCursorDisplay :: (IsCursor o, IsDisplay a) => a -> IO (GValueConstruct o) Source #
cursorDisplay :: AttrLabelProxy "display" Source #