{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Cursor
(
Cursor(..) ,
IsCursor ,
toCursor ,
#if defined(ENABLE_OVERLOADING)
ResolveCursorMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CursorGetFallbackMethodInfo ,
#endif
cursorGetFallback ,
#if defined(ENABLE_OVERLOADING)
CursorGetHotspotXMethodInfo ,
#endif
cursorGetHotspotX ,
#if defined(ENABLE_OVERLOADING)
CursorGetHotspotYMethodInfo ,
#endif
cursorGetHotspotY ,
#if defined(ENABLE_OVERLOADING)
CursorGetNameMethodInfo ,
#endif
cursorGetName ,
#if defined(ENABLE_OVERLOADING)
CursorGetTextureMethodInfo ,
#endif
cursorGetTexture ,
cursorNewFromName ,
cursorNewFromTexture ,
#if defined(ENABLE_OVERLOADING)
CursorFallbackPropertyInfo ,
#endif
constructCursorFallback ,
#if defined(ENABLE_OVERLOADING)
cursorFallback ,
#endif
getCursorFallback ,
#if defined(ENABLE_OVERLOADING)
CursorHotspotXPropertyInfo ,
#endif
constructCursorHotspotX ,
#if defined(ENABLE_OVERLOADING)
cursorHotspotX ,
#endif
getCursorHotspotX ,
#if defined(ENABLE_OVERLOADING)
CursorHotspotYPropertyInfo ,
#endif
constructCursorHotspotY ,
#if defined(ENABLE_OVERLOADING)
cursorHotspotY ,
#endif
getCursorHotspotY ,
#if defined(ENABLE_OVERLOADING)
CursorNamePropertyInfo ,
#endif
constructCursorName ,
#if defined(ENABLE_OVERLOADING)
cursorName ,
#endif
getCursorName ,
#if defined(ENABLE_OVERLOADING)
CursorTexturePropertyInfo ,
#endif
constructCursorTexture ,
#if defined(ENABLE_OVERLOADING)
cursorTexture ,
#endif
getCursorTexture ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
#endif
newtype Cursor = Cursor (SP.ManagedPtr Cursor)
deriving (Cursor -> Cursor -> Bool
(Cursor -> Cursor -> Bool)
-> (Cursor -> Cursor -> Bool) -> Eq Cursor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cursor -> Cursor -> Bool
== :: Cursor -> Cursor -> Bool
$c/= :: Cursor -> Cursor -> Bool
/= :: Cursor -> Cursor -> Bool
Eq)
instance SP.ManagedPtrNewtype Cursor where
toManagedPtr :: Cursor -> ManagedPtr Cursor
toManagedPtr (Cursor ManagedPtr Cursor
p) = ManagedPtr Cursor
p
foreign import ccall "gdk_cursor_get_type"
c_gdk_cursor_get_type :: IO B.Types.GType
instance B.Types.TypedObject Cursor where
glibType :: IO GType
glibType = IO GType
c_gdk_cursor_get_type
instance B.Types.GObject Cursor
class (SP.GObject o, O.IsDescendantOf Cursor o) => IsCursor o
instance (SP.GObject o, O.IsDescendantOf Cursor o) => IsCursor o
instance O.HasParentTypes Cursor
type instance O.ParentTypes Cursor = '[GObject.Object.Object]
toCursor :: (MIO.MonadIO m, IsCursor o) => o -> m Cursor
toCursor :: forall (m :: * -> *) o. (MonadIO m, IsCursor o) => o -> m Cursor
toCursor = IO Cursor -> m Cursor
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Cursor -> m Cursor) -> (o -> IO Cursor) -> o -> m Cursor
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Cursor -> Cursor) -> o -> IO Cursor
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Cursor -> Cursor
Cursor
instance B.GValue.IsGValue (Maybe Cursor) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_cursor_get_type
gvalueSet_ :: Ptr GValue -> Maybe Cursor -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Cursor
P.Nothing = Ptr GValue -> Ptr Cursor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Cursor
forall a. Ptr a
FP.nullPtr :: FP.Ptr Cursor)
gvalueSet_ Ptr GValue
gv (P.Just Cursor
obj) = Cursor -> (Ptr Cursor -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Cursor
obj (Ptr GValue -> Ptr Cursor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Cursor)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Cursor)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Cursor)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Cursor ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveCursorMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveCursorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCursorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCursorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCursorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCursorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCursorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCursorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCursorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCursorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCursorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCursorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCursorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCursorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCursorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCursorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCursorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCursorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCursorMethod "getFallback" o = CursorGetFallbackMethodInfo
ResolveCursorMethod "getHotspotX" o = CursorGetHotspotXMethodInfo
ResolveCursorMethod "getHotspotY" o = CursorGetHotspotYMethodInfo
ResolveCursorMethod "getName" o = CursorGetNameMethodInfo
ResolveCursorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCursorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCursorMethod "getTexture" o = CursorGetTextureMethodInfo
ResolveCursorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCursorMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCursorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCursorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCursorMethod t Cursor, O.OverloadedMethod info Cursor p) => OL.IsLabel t (Cursor -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveCursorMethod t Cursor, O.OverloadedMethod info Cursor p, R.HasField t Cursor p) => R.HasField t Cursor p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCursorMethod t Cursor, O.OverloadedMethodInfo info Cursor) => OL.IsLabel t (O.MethodProxy info Cursor) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getCursorFallback :: (MonadIO m, IsCursor o) => o -> m (Maybe Cursor)
getCursorFallback :: forall (m :: * -> *) o.
(MonadIO m, IsCursor o) =>
o -> m (Maybe Cursor)
getCursorFallback o
obj = IO (Maybe Cursor) -> m (Maybe Cursor)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Cursor -> Cursor) -> IO (Maybe Cursor)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"fallback" ManagedPtr Cursor -> Cursor
Cursor
constructCursorFallback :: (IsCursor o, MIO.MonadIO m, IsCursor a) => a -> m (GValueConstruct o)
constructCursorFallback :: forall o (m :: * -> *) a.
(IsCursor o, MonadIO m, IsCursor a) =>
a -> m (GValueConstruct o)
constructCursorFallback a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"fallback" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data CursorFallbackPropertyInfo
instance AttrInfo CursorFallbackPropertyInfo where
type AttrAllowedOps CursorFallbackPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CursorFallbackPropertyInfo = IsCursor
type AttrSetTypeConstraint CursorFallbackPropertyInfo = IsCursor
type AttrTransferTypeConstraint CursorFallbackPropertyInfo = IsCursor
type AttrTransferType CursorFallbackPropertyInfo = Cursor
type AttrGetType CursorFallbackPropertyInfo = (Maybe Cursor)
type AttrLabel CursorFallbackPropertyInfo = "fallback"
type AttrOrigin CursorFallbackPropertyInfo = Cursor
attrGet = getCursorFallback
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Cursor v
attrConstruct = constructCursorFallback
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.fallback"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#g:attr:fallback"
})
#endif
getCursorHotspotX :: (MonadIO m, IsCursor o) => o -> m Int32
getCursorHotspotX :: forall (m :: * -> *) o. (MonadIO m, IsCursor o) => o -> m Int32
getCursorHotspotX o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"hotspot-x"
constructCursorHotspotX :: (IsCursor o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructCursorHotspotX :: forall o (m :: * -> *).
(IsCursor o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructCursorHotspotX Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"hotspot-x" Int32
val
#if defined(ENABLE_OVERLOADING)
data CursorHotspotXPropertyInfo
instance AttrInfo CursorHotspotXPropertyInfo where
type AttrAllowedOps CursorHotspotXPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint CursorHotspotXPropertyInfo = IsCursor
type AttrSetTypeConstraint CursorHotspotXPropertyInfo = (~) Int32
type AttrTransferTypeConstraint CursorHotspotXPropertyInfo = (~) Int32
type AttrTransferType CursorHotspotXPropertyInfo = Int32
type AttrGetType CursorHotspotXPropertyInfo = Int32
type AttrLabel CursorHotspotXPropertyInfo = "hotspot-x"
type AttrOrigin CursorHotspotXPropertyInfo = Cursor
attrGet = getCursorHotspotX
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCursorHotspotX
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.hotspotX"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#g:attr:hotspotX"
})
#endif
getCursorHotspotY :: (MonadIO m, IsCursor o) => o -> m Int32
getCursorHotspotY :: forall (m :: * -> *) o. (MonadIO m, IsCursor o) => o -> m Int32
getCursorHotspotY o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"hotspot-y"
constructCursorHotspotY :: (IsCursor o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructCursorHotspotY :: forall o (m :: * -> *).
(IsCursor o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructCursorHotspotY Int32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"hotspot-y" Int32
val
#if defined(ENABLE_OVERLOADING)
data CursorHotspotYPropertyInfo
instance AttrInfo CursorHotspotYPropertyInfo where
type AttrAllowedOps CursorHotspotYPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint CursorHotspotYPropertyInfo = IsCursor
type AttrSetTypeConstraint CursorHotspotYPropertyInfo = (~) Int32
type AttrTransferTypeConstraint CursorHotspotYPropertyInfo = (~) Int32
type AttrTransferType CursorHotspotYPropertyInfo = Int32
type AttrGetType CursorHotspotYPropertyInfo = Int32
type AttrLabel CursorHotspotYPropertyInfo = "hotspot-y"
type AttrOrigin CursorHotspotYPropertyInfo = Cursor
attrGet = getCursorHotspotY
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCursorHotspotY
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.hotspotY"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#g:attr:hotspotY"
})
#endif
getCursorName :: (MonadIO m, IsCursor o) => o -> m (Maybe T.Text)
getCursorName :: forall (m :: * -> *) o.
(MonadIO m, IsCursor o) =>
o -> m (Maybe Text)
getCursorName o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"name"
constructCursorName :: (IsCursor o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructCursorName :: forall o (m :: * -> *).
(IsCursor o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructCursorName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data CursorNamePropertyInfo
instance AttrInfo CursorNamePropertyInfo where
type AttrAllowedOps CursorNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CursorNamePropertyInfo = IsCursor
type AttrSetTypeConstraint CursorNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint CursorNamePropertyInfo = (~) T.Text
type AttrTransferType CursorNamePropertyInfo = T.Text
type AttrGetType CursorNamePropertyInfo = (Maybe T.Text)
type AttrLabel CursorNamePropertyInfo = "name"
type AttrOrigin CursorNamePropertyInfo = Cursor
attrGet = getCursorName
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCursorName
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.name"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#g:attr:name"
})
#endif
getCursorTexture :: (MonadIO m, IsCursor o) => o -> m (Maybe Gdk.Texture.Texture)
getCursorTexture :: forall (m :: * -> *) o.
(MonadIO m, IsCursor o) =>
o -> m (Maybe Texture)
getCursorTexture o
obj = IO (Maybe Texture) -> m (Maybe Texture)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Texture) -> m (Maybe Texture))
-> IO (Maybe Texture) -> m (Maybe Texture)
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Texture -> Texture) -> IO (Maybe Texture)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"texture" ManagedPtr Texture -> Texture
Gdk.Texture.Texture
constructCursorTexture :: (IsCursor o, MIO.MonadIO m, Gdk.Texture.IsTexture a) => a -> m (GValueConstruct o)
constructCursorTexture :: forall o (m :: * -> *) a.
(IsCursor o, MonadIO m, IsTexture a) =>
a -> m (GValueConstruct o)
constructCursorTexture a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"texture" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data CursorTexturePropertyInfo
instance AttrInfo CursorTexturePropertyInfo where
type AttrAllowedOps CursorTexturePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CursorTexturePropertyInfo = IsCursor
type AttrSetTypeConstraint CursorTexturePropertyInfo = Gdk.Texture.IsTexture
type AttrTransferTypeConstraint CursorTexturePropertyInfo = Gdk.Texture.IsTexture
type AttrTransferType CursorTexturePropertyInfo = Gdk.Texture.Texture
type AttrGetType CursorTexturePropertyInfo = (Maybe Gdk.Texture.Texture)
type AttrLabel CursorTexturePropertyInfo = "texture"
type AttrOrigin CursorTexturePropertyInfo = Cursor
attrGet = getCursorTexture
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Texture.Texture v
attrConstruct = constructCursorTexture
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.texture"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#g:attr:texture"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Cursor
type instance O.AttributeList Cursor = CursorAttributeList
type CursorAttributeList = ('[ '("fallback", CursorFallbackPropertyInfo), '("hotspotX", CursorHotspotXPropertyInfo), '("hotspotY", CursorHotspotYPropertyInfo), '("name", CursorNamePropertyInfo), '("texture", CursorTexturePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
cursorFallback :: AttrLabelProxy "fallback"
cursorFallback = AttrLabelProxy
cursorHotspotX :: AttrLabelProxy "hotspotX"
cursorHotspotX = AttrLabelProxy
cursorHotspotY :: AttrLabelProxy "hotspotY"
cursorHotspotY = AttrLabelProxy
cursorName :: AttrLabelProxy "name"
cursorName = AttrLabelProxy
cursorTexture :: AttrLabelProxy "texture"
cursorTexture = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Cursor = CursorSignalList
type CursorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gdk_cursor_new_from_name" gdk_cursor_new_from_name ::
CString ->
Ptr Cursor ->
IO (Ptr Cursor)
cursorNewFromName ::
(B.CallStack.HasCallStack, MonadIO m, IsCursor a) =>
T.Text
-> Maybe (a)
-> m (Maybe Cursor)
cursorNewFromName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCursor a) =>
Text -> Maybe a -> m (Maybe Cursor)
cursorNewFromName Text
name Maybe a
fallback = IO (Maybe Cursor) -> m (Maybe Cursor)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ do
name' <- Text -> IO CString
textToCString Text
name
maybeFallback <- case fallback of
Maybe a
Nothing -> Ptr Cursor -> IO (Ptr Cursor)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
forall a. Ptr a
FP.nullPtr
Just a
jFallback -> do
jFallback' <- a -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jFallback
return jFallback'
result <- gdk_cursor_new_from_name name' maybeFallback
maybeResult <- convertIfNonNull result $ \Ptr Cursor
result' -> do
result'' <- ((ManagedPtr Cursor -> Cursor) -> Ptr Cursor -> IO Cursor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Cursor -> Cursor
Cursor) Ptr Cursor
result'
return result''
whenJust fallback touchManagedPtr
freeMem name'
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_cursor_new_from_texture" gdk_cursor_new_from_texture ::
Ptr Gdk.Texture.Texture ->
Int32 ->
Int32 ->
Ptr Cursor ->
IO (Ptr Cursor)
cursorNewFromTexture ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Texture.IsTexture a, IsCursor b) =>
a
-> Int32
-> Int32
-> Maybe (b)
-> m Cursor
cursorNewFromTexture :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsTexture a, IsCursor b) =>
a -> Int32 -> Int32 -> Maybe b -> m Cursor
cursorNewFromTexture a
texture Int32
hotspotX Int32
hotspotY Maybe b
fallback = IO Cursor -> m Cursor
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Cursor -> m Cursor) -> IO Cursor -> m Cursor
forall a b. (a -> b) -> a -> b
$ do
texture' <- a -> IO (Ptr Texture)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
texture
maybeFallback <- case fallback of
Maybe b
Nothing -> Ptr Cursor -> IO (Ptr Cursor)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
forall a. Ptr a
FP.nullPtr
Just b
jFallback -> do
jFallback' <- b -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jFallback
return jFallback'
result <- gdk_cursor_new_from_texture texture' hotspotX hotspotY maybeFallback
checkUnexpectedReturnNULL "cursorNewFromTexture" result
result' <- (wrapObject Cursor) result
touchManagedPtr texture
whenJust fallback touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_cursor_get_fallback" gdk_cursor_get_fallback ::
Ptr Cursor ->
IO (Ptr Cursor)
cursorGetFallback ::
(B.CallStack.HasCallStack, MonadIO m, IsCursor a) =>
a
-> m (Maybe Cursor)
cursorGetFallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCursor a) =>
a -> m (Maybe Cursor)
cursorGetFallback a
cursor = IO (Maybe Cursor) -> m (Maybe Cursor)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Cursor) -> m (Maybe Cursor))
-> IO (Maybe Cursor) -> m (Maybe Cursor)
forall a b. (a -> b) -> a -> b
$ do
cursor' <- a -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cursor
result <- gdk_cursor_get_fallback cursor'
maybeResult <- convertIfNonNull result $ \Ptr Cursor
result' -> do
result'' <- ((ManagedPtr Cursor -> Cursor) -> Ptr Cursor -> IO Cursor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Cursor -> Cursor
Cursor) Ptr Cursor
result'
return result''
touchManagedPtr cursor
return maybeResult
#if defined(ENABLE_OVERLOADING)
data CursorGetFallbackMethodInfo
instance (signature ~ (m (Maybe Cursor)), MonadIO m, IsCursor a) => O.OverloadedMethod CursorGetFallbackMethodInfo a signature where
overloadedMethod = cursorGetFallback
instance O.OverloadedMethodInfo CursorGetFallbackMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.cursorGetFallback",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#v:cursorGetFallback"
})
#endif
foreign import ccall "gdk_cursor_get_hotspot_x" gdk_cursor_get_hotspot_x ::
Ptr Cursor ->
IO Int32
cursorGetHotspotX ::
(B.CallStack.HasCallStack, MonadIO m, IsCursor a) =>
a
-> m Int32
cursorGetHotspotX :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCursor a) =>
a -> m Int32
cursorGetHotspotX a
cursor = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
cursor' <- a -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cursor
result <- gdk_cursor_get_hotspot_x cursor'
touchManagedPtr cursor
return result
#if defined(ENABLE_OVERLOADING)
data CursorGetHotspotXMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsCursor a) => O.OverloadedMethod CursorGetHotspotXMethodInfo a signature where
overloadedMethod = cursorGetHotspotX
instance O.OverloadedMethodInfo CursorGetHotspotXMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.cursorGetHotspotX",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#v:cursorGetHotspotX"
})
#endif
foreign import ccall "gdk_cursor_get_hotspot_y" gdk_cursor_get_hotspot_y ::
Ptr Cursor ->
IO Int32
cursorGetHotspotY ::
(B.CallStack.HasCallStack, MonadIO m, IsCursor a) =>
a
-> m Int32
cursorGetHotspotY :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCursor a) =>
a -> m Int32
cursorGetHotspotY a
cursor = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
cursor' <- a -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cursor
result <- gdk_cursor_get_hotspot_y cursor'
touchManagedPtr cursor
return result
#if defined(ENABLE_OVERLOADING)
data CursorGetHotspotYMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsCursor a) => O.OverloadedMethod CursorGetHotspotYMethodInfo a signature where
overloadedMethod = cursorGetHotspotY
instance O.OverloadedMethodInfo CursorGetHotspotYMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.cursorGetHotspotY",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#v:cursorGetHotspotY"
})
#endif
foreign import ccall "gdk_cursor_get_name" gdk_cursor_get_name ::
Ptr Cursor ->
IO CString
cursorGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsCursor a) =>
a
-> m (Maybe T.Text)
cursorGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCursor a) =>
a -> m (Maybe Text)
cursorGetName a
cursor = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
cursor' <- a -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cursor
result <- gdk_cursor_get_name cursor'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr cursor
return maybeResult
#if defined(ENABLE_OVERLOADING)
data CursorGetNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsCursor a) => O.OverloadedMethod CursorGetNameMethodInfo a signature where
overloadedMethod = cursorGetName
instance O.OverloadedMethodInfo CursorGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.cursorGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#v:cursorGetName"
})
#endif
foreign import ccall "gdk_cursor_get_texture" gdk_cursor_get_texture ::
Ptr Cursor ->
IO (Ptr Gdk.Texture.Texture)
cursorGetTexture ::
(B.CallStack.HasCallStack, MonadIO m, IsCursor a) =>
a
-> m (Maybe Gdk.Texture.Texture)
cursorGetTexture :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCursor a) =>
a -> m (Maybe Texture)
cursorGetTexture a
cursor = IO (Maybe Texture) -> m (Maybe Texture)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Texture) -> m (Maybe Texture))
-> IO (Maybe Texture) -> m (Maybe Texture)
forall a b. (a -> b) -> a -> b
$ do
cursor' <- a -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
cursor
result <- gdk_cursor_get_texture cursor'
maybeResult <- convertIfNonNull result $ \Ptr Texture
result' -> do
result'' <- ((ManagedPtr Texture -> Texture) -> Ptr Texture -> IO Texture
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Texture -> Texture
Gdk.Texture.Texture) Ptr Texture
result'
return result''
touchManagedPtr cursor
return maybeResult
#if defined(ENABLE_OVERLOADING)
data CursorGetTextureMethodInfo
instance (signature ~ (m (Maybe Gdk.Texture.Texture)), MonadIO m, IsCursor a) => O.OverloadedMethod CursorGetTextureMethodInfo a signature where
overloadedMethod = cursorGetTexture
instance O.OverloadedMethodInfo CursorGetTextureMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Cursor.cursorGetTexture",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.9/docs/GI-Gdk-Objects-Cursor.html#v:cursorGetTexture"
})
#endif