{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Device
(
Device(..) ,
IsDevice ,
toDevice ,
#if defined(ENABLE_OVERLOADING)
ResolveDeviceMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DeviceGetAssociatedDeviceMethodInfo ,
#endif
deviceGetAssociatedDevice ,
#if defined(ENABLE_OVERLOADING)
DeviceGetAxesMethodInfo ,
#endif
deviceGetAxes ,
#if defined(ENABLE_OVERLOADING)
DeviceGetAxisNamesMethodInfo ,
#endif
deviceGetAxisNames ,
#if defined(ENABLE_OVERLOADING)
DeviceGetAxisUseMethodInfo ,
#endif
deviceGetAxisUse ,
#if defined(ENABLE_OVERLOADING)
DeviceGetCapsLockStateMethodInfo ,
#endif
deviceGetCapsLockState ,
#if defined(ENABLE_OVERLOADING)
DeviceGetDeviceToolMethodInfo ,
#endif
deviceGetDeviceTool ,
#if defined(ENABLE_OVERLOADING)
DeviceGetDeviceTypeMethodInfo ,
#endif
deviceGetDeviceType ,
#if defined(ENABLE_OVERLOADING)
DeviceGetDirectionMethodInfo ,
#endif
deviceGetDirection ,
#if defined(ENABLE_OVERLOADING)
DeviceGetDisplayMethodInfo ,
#endif
deviceGetDisplay ,
#if defined(ENABLE_OVERLOADING)
DeviceGetHasCursorMethodInfo ,
#endif
deviceGetHasCursor ,
#if defined(ENABLE_OVERLOADING)
DeviceGetKeyMethodInfo ,
#endif
deviceGetKey ,
#if defined(ENABLE_OVERLOADING)
DeviceGetLastEventSurfaceMethodInfo ,
#endif
deviceGetLastEventSurface ,
#if defined(ENABLE_OVERLOADING)
DeviceGetModifierStateMethodInfo ,
#endif
deviceGetModifierState ,
#if defined(ENABLE_OVERLOADING)
DeviceGetNAxesMethodInfo ,
#endif
deviceGetNAxes ,
#if defined(ENABLE_OVERLOADING)
DeviceGetNKeysMethodInfo ,
#endif
deviceGetNKeys ,
#if defined(ENABLE_OVERLOADING)
DeviceGetNameMethodInfo ,
#endif
deviceGetName ,
#if defined(ENABLE_OVERLOADING)
DeviceGetNumLockStateMethodInfo ,
#endif
deviceGetNumLockState ,
#if defined(ENABLE_OVERLOADING)
DeviceGetNumTouchesMethodInfo ,
#endif
deviceGetNumTouches ,
#if defined(ENABLE_OVERLOADING)
DeviceGetProductIdMethodInfo ,
#endif
deviceGetProductId ,
#if defined(ENABLE_OVERLOADING)
DeviceGetScrollLockStateMethodInfo ,
#endif
deviceGetScrollLockState ,
#if defined(ENABLE_OVERLOADING)
DeviceGetSeatMethodInfo ,
#endif
deviceGetSeat ,
#if defined(ENABLE_OVERLOADING)
DeviceGetSourceMethodInfo ,
#endif
deviceGetSource ,
#if defined(ENABLE_OVERLOADING)
DeviceGetSurfaceAtPositionMethodInfo ,
#endif
deviceGetSurfaceAtPosition ,
#if defined(ENABLE_OVERLOADING)
DeviceGetVendorIdMethodInfo ,
#endif
deviceGetVendorId ,
#if defined(ENABLE_OVERLOADING)
DeviceHasBidiLayoutsMethodInfo ,
#endif
deviceHasBidiLayouts ,
#if defined(ENABLE_OVERLOADING)
DeviceListSlaveDevicesMethodInfo ,
#endif
deviceListSlaveDevices ,
#if defined(ENABLE_OVERLOADING)
DeviceSetAxisUseMethodInfo ,
#endif
deviceSetAxisUse ,
#if defined(ENABLE_OVERLOADING)
DeviceSetKeyMethodInfo ,
#endif
deviceSetKey ,
#if defined(ENABLE_OVERLOADING)
DeviceAssociatedDevicePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceAssociatedDevice ,
#endif
getDeviceAssociatedDevice ,
#if defined(ENABLE_OVERLOADING)
DeviceAxesPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceAxes ,
#endif
getDeviceAxes ,
#if defined(ENABLE_OVERLOADING)
DeviceCapsLockStatePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceCapsLockState ,
#endif
getDeviceCapsLockState ,
#if defined(ENABLE_OVERLOADING)
DeviceDirectionPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceDirection ,
#endif
getDeviceDirection ,
#if defined(ENABLE_OVERLOADING)
DeviceDisplayPropertyInfo ,
#endif
constructDeviceDisplay ,
#if defined(ENABLE_OVERLOADING)
deviceDisplay ,
#endif
getDeviceDisplay ,
#if defined(ENABLE_OVERLOADING)
DeviceHasBidiLayoutsPropertyInfo ,
#endif
getDeviceHasBidiLayouts ,
#if defined(ENABLE_OVERLOADING)
DeviceHasCursorPropertyInfo ,
#endif
constructDeviceHasCursor ,
#if defined(ENABLE_OVERLOADING)
deviceHasCursor ,
#endif
getDeviceHasCursor ,
#if defined(ENABLE_OVERLOADING)
DeviceModifierStatePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceModifierState ,
#endif
getDeviceModifierState ,
#if defined(ENABLE_OVERLOADING)
DeviceNAxesPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceNAxes ,
#endif
getDeviceNAxes ,
#if defined(ENABLE_OVERLOADING)
DeviceNamePropertyInfo ,
#endif
constructDeviceName ,
#if defined(ENABLE_OVERLOADING)
deviceName ,
#endif
getDeviceName ,
#if defined(ENABLE_OVERLOADING)
DeviceNumLockStatePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceNumLockState ,
#endif
getDeviceNumLockState ,
#if defined(ENABLE_OVERLOADING)
DeviceNumTouchesPropertyInfo ,
#endif
constructDeviceNumTouches ,
#if defined(ENABLE_OVERLOADING)
deviceNumTouches ,
#endif
getDeviceNumTouches ,
#if defined(ENABLE_OVERLOADING)
DeviceProductIdPropertyInfo ,
#endif
constructDeviceProductId ,
#if defined(ENABLE_OVERLOADING)
deviceProductId ,
#endif
getDeviceProductId ,
#if defined(ENABLE_OVERLOADING)
DeviceScrollLockStatePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceScrollLockState ,
#endif
getDeviceScrollLockState ,
#if defined(ENABLE_OVERLOADING)
DeviceSeatPropertyInfo ,
#endif
clearDeviceSeat ,
constructDeviceSeat ,
#if defined(ENABLE_OVERLOADING)
deviceSeat ,
#endif
getDeviceSeat ,
setDeviceSeat ,
#if defined(ENABLE_OVERLOADING)
DeviceSourcePropertyInfo ,
#endif
constructDeviceSource ,
#if defined(ENABLE_OVERLOADING)
deviceSource ,
#endif
getDeviceSource ,
#if defined(ENABLE_OVERLOADING)
DeviceToolPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
deviceTool ,
#endif
getDeviceTool ,
#if defined(ENABLE_OVERLOADING)
DeviceTypePropertyInfo ,
#endif
constructDeviceType ,
#if defined(ENABLE_OVERLOADING)
deviceType ,
#endif
getDeviceType ,
#if defined(ENABLE_OVERLOADING)
DeviceVendorIdPropertyInfo ,
#endif
constructDeviceVendorId ,
#if defined(ENABLE_OVERLOADING)
deviceVendorId ,
#endif
getDeviceVendorId ,
C_DeviceChangedCallback ,
DeviceChangedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceChangedSignalInfo ,
#endif
afterDeviceChanged ,
genClosure_DeviceChanged ,
mk_DeviceChangedCallback ,
noDeviceChangedCallback ,
onDeviceChanged ,
wrap_DeviceChangedCallback ,
C_DeviceToolChangedCallback ,
DeviceToolChangedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceToolChangedSignalInfo ,
#endif
afterDeviceToolChanged ,
genClosure_DeviceToolChanged ,
mk_DeviceToolChangedCallback ,
noDeviceToolChangedCallback ,
onDeviceToolChanged ,
wrap_DeviceToolChangedCallback ,
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.Text as T
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 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.Objects.DeviceTool as Gdk.DeviceTool
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import qualified GI.Pango.Enums as Pango.Enums
newtype Device = Device (SP.ManagedPtr Device)
deriving (Device -> Device -> Bool
(Device -> Device -> Bool)
-> (Device -> Device -> Bool) -> Eq Device
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Device -> Device -> Bool
$c/= :: Device -> Device -> Bool
== :: Device -> Device -> Bool
$c== :: Device -> Device -> Bool
Eq)
instance SP.ManagedPtrNewtype Device where
toManagedPtr :: Device -> ManagedPtr Device
toManagedPtr (Device ManagedPtr Device
p) = ManagedPtr Device
p
foreign import ccall "gdk_device_get_type"
c_gdk_device_get_type :: IO B.Types.GType
instance B.Types.TypedObject Device where
glibType :: IO GType
glibType = IO GType
c_gdk_device_get_type
instance B.Types.GObject Device
instance B.GValue.IsGValue Device where
toGValue :: Device -> IO GValue
toGValue Device
o = do
GType
gtype <- IO GType
c_gdk_device_get_type
Device -> (Ptr Device -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Device
o (GType -> (GValue -> Ptr Device -> IO ()) -> Ptr Device -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Device -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Device
fromGValue GValue
gv = do
Ptr Device
ptr <- GValue -> IO (Ptr Device)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Device)
(ManagedPtr Device -> Device) -> Ptr Device -> IO Device
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Device -> Device
Device Ptr Device
ptr
class (SP.GObject o, O.IsDescendantOf Device o) => IsDevice o
instance (SP.GObject o, O.IsDescendantOf Device o) => IsDevice o
instance O.HasParentTypes Device
type instance O.ParentTypes Device = '[GObject.Object.Object]
toDevice :: (MonadIO m, IsDevice o) => o -> m Device
toDevice :: o -> m Device
toDevice = IO Device -> m Device
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Device -> m Device) -> (o -> IO Device) -> o -> m Device
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Device -> Device) -> o -> IO Device
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Device -> Device
Device
#if defined(ENABLE_OVERLOADING)
type family ResolveDeviceMethod (t :: Symbol) (o :: *) :: * where
ResolveDeviceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDeviceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDeviceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDeviceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDeviceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDeviceMethod "hasBidiLayouts" o = DeviceHasBidiLayoutsMethodInfo
ResolveDeviceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDeviceMethod "listSlaveDevices" o = DeviceListSlaveDevicesMethodInfo
ResolveDeviceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDeviceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDeviceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDeviceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDeviceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDeviceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDeviceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDeviceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDeviceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDeviceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDeviceMethod "getAssociatedDevice" o = DeviceGetAssociatedDeviceMethodInfo
ResolveDeviceMethod "getAxes" o = DeviceGetAxesMethodInfo
ResolveDeviceMethod "getAxisNames" o = DeviceGetAxisNamesMethodInfo
ResolveDeviceMethod "getAxisUse" o = DeviceGetAxisUseMethodInfo
ResolveDeviceMethod "getCapsLockState" o = DeviceGetCapsLockStateMethodInfo
ResolveDeviceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDeviceMethod "getDeviceTool" o = DeviceGetDeviceToolMethodInfo
ResolveDeviceMethod "getDeviceType" o = DeviceGetDeviceTypeMethodInfo
ResolveDeviceMethod "getDirection" o = DeviceGetDirectionMethodInfo
ResolveDeviceMethod "getDisplay" o = DeviceGetDisplayMethodInfo
ResolveDeviceMethod "getHasCursor" o = DeviceGetHasCursorMethodInfo
ResolveDeviceMethod "getKey" o = DeviceGetKeyMethodInfo
ResolveDeviceMethod "getLastEventSurface" o = DeviceGetLastEventSurfaceMethodInfo
ResolveDeviceMethod "getModifierState" o = DeviceGetModifierStateMethodInfo
ResolveDeviceMethod "getNAxes" o = DeviceGetNAxesMethodInfo
ResolveDeviceMethod "getNKeys" o = DeviceGetNKeysMethodInfo
ResolveDeviceMethod "getName" o = DeviceGetNameMethodInfo
ResolveDeviceMethod "getNumLockState" o = DeviceGetNumLockStateMethodInfo
ResolveDeviceMethod "getNumTouches" o = DeviceGetNumTouchesMethodInfo
ResolveDeviceMethod "getProductId" o = DeviceGetProductIdMethodInfo
ResolveDeviceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDeviceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDeviceMethod "getScrollLockState" o = DeviceGetScrollLockStateMethodInfo
ResolveDeviceMethod "getSeat" o = DeviceGetSeatMethodInfo
ResolveDeviceMethod "getSource" o = DeviceGetSourceMethodInfo
ResolveDeviceMethod "getSurfaceAtPosition" o = DeviceGetSurfaceAtPositionMethodInfo
ResolveDeviceMethod "getVendorId" o = DeviceGetVendorIdMethodInfo
ResolveDeviceMethod "setAxisUse" o = DeviceSetAxisUseMethodInfo
ResolveDeviceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDeviceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDeviceMethod "setKey" o = DeviceSetKeyMethodInfo
ResolveDeviceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDeviceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDeviceMethod t Device, O.MethodInfo info Device p) => OL.IsLabel t (Device -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DeviceChangedCallback =
IO ()
noDeviceChangedCallback :: Maybe DeviceChangedCallback
noDeviceChangedCallback :: Maybe (IO ())
noDeviceChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_DeviceChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceChangedCallback :: C_DeviceChangedCallback -> IO (FunPtr C_DeviceChangedCallback)
genClosure_DeviceChanged :: MonadIO m => DeviceChangedCallback -> m (GClosure C_DeviceChangedCallback)
genClosure_DeviceChanged :: IO () -> m (GClosure C_DeviceChangedCallback)
genClosure_DeviceChanged IO ()
cb = IO (GClosure C_DeviceChangedCallback)
-> m (GClosure C_DeviceChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DeviceChangedCallback)
-> m (GClosure C_DeviceChangedCallback))
-> IO (GClosure C_DeviceChangedCallback)
-> m (GClosure C_DeviceChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceChangedCallback
cb' = IO () -> C_DeviceChangedCallback
wrap_DeviceChangedCallback IO ()
cb
C_DeviceChangedCallback -> IO (FunPtr C_DeviceChangedCallback)
mk_DeviceChangedCallback C_DeviceChangedCallback
cb' IO (FunPtr C_DeviceChangedCallback)
-> (FunPtr C_DeviceChangedCallback
-> IO (GClosure C_DeviceChangedCallback))
-> IO (GClosure C_DeviceChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DeviceChangedCallback
-> IO (GClosure C_DeviceChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DeviceChangedCallback ::
DeviceChangedCallback ->
C_DeviceChangedCallback
wrap_DeviceChangedCallback :: IO () -> C_DeviceChangedCallback
wrap_DeviceChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onDeviceChanged :: (IsDevice a, MonadIO m) => a -> DeviceChangedCallback -> m SignalHandlerId
onDeviceChanged :: a -> IO () -> m SignalHandlerId
onDeviceChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceChangedCallback
cb' = IO () -> C_DeviceChangedCallback
wrap_DeviceChangedCallback IO ()
cb
FunPtr C_DeviceChangedCallback
cb'' <- C_DeviceChangedCallback -> IO (FunPtr C_DeviceChangedCallback)
mk_DeviceChangedCallback C_DeviceChangedCallback
cb'
a
-> Text
-> FunPtr C_DeviceChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_DeviceChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDeviceChanged :: (IsDevice a, MonadIO m) => a -> DeviceChangedCallback -> m SignalHandlerId
afterDeviceChanged :: a -> IO () -> m SignalHandlerId
afterDeviceChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceChangedCallback
cb' = IO () -> C_DeviceChangedCallback
wrap_DeviceChangedCallback IO ()
cb
FunPtr C_DeviceChangedCallback
cb'' <- C_DeviceChangedCallback -> IO (FunPtr C_DeviceChangedCallback)
mk_DeviceChangedCallback C_DeviceChangedCallback
cb'
a
-> Text
-> FunPtr C_DeviceChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_DeviceChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DeviceChangedSignalInfo
instance SignalInfo DeviceChangedSignalInfo where
type HaskellCallbackType DeviceChangedSignalInfo = DeviceChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DeviceChangedCallback cb
cb'' <- mk_DeviceChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
#endif
type DeviceToolChangedCallback =
Gdk.DeviceTool.DeviceTool
-> IO ()
noDeviceToolChangedCallback :: Maybe DeviceToolChangedCallback
noDeviceToolChangedCallback :: Maybe DeviceToolChangedCallback
noDeviceToolChangedCallback = Maybe DeviceToolChangedCallback
forall a. Maybe a
Nothing
type C_DeviceToolChangedCallback =
Ptr () ->
Ptr Gdk.DeviceTool.DeviceTool ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceToolChangedCallback :: C_DeviceToolChangedCallback -> IO (FunPtr C_DeviceToolChangedCallback)
genClosure_DeviceToolChanged :: MonadIO m => DeviceToolChangedCallback -> m (GClosure C_DeviceToolChangedCallback)
genClosure_DeviceToolChanged :: DeviceToolChangedCallback
-> m (GClosure C_DeviceToolChangedCallback)
genClosure_DeviceToolChanged DeviceToolChangedCallback
cb = IO (GClosure C_DeviceToolChangedCallback)
-> m (GClosure C_DeviceToolChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DeviceToolChangedCallback)
-> m (GClosure C_DeviceToolChangedCallback))
-> IO (GClosure C_DeviceToolChangedCallback)
-> m (GClosure C_DeviceToolChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceToolChangedCallback
cb' = DeviceToolChangedCallback -> C_DeviceToolChangedCallback
wrap_DeviceToolChangedCallback DeviceToolChangedCallback
cb
C_DeviceToolChangedCallback
-> IO (FunPtr C_DeviceToolChangedCallback)
mk_DeviceToolChangedCallback C_DeviceToolChangedCallback
cb' IO (FunPtr C_DeviceToolChangedCallback)
-> (FunPtr C_DeviceToolChangedCallback
-> IO (GClosure C_DeviceToolChangedCallback))
-> IO (GClosure C_DeviceToolChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DeviceToolChangedCallback
-> IO (GClosure C_DeviceToolChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DeviceToolChangedCallback ::
DeviceToolChangedCallback ->
C_DeviceToolChangedCallback
wrap_DeviceToolChangedCallback :: DeviceToolChangedCallback -> C_DeviceToolChangedCallback
wrap_DeviceToolChangedCallback DeviceToolChangedCallback
_cb Ptr ()
_ Ptr DeviceTool
tool Ptr ()
_ = do
DeviceTool
tool' <- ((ManagedPtr DeviceTool -> DeviceTool)
-> Ptr DeviceTool -> IO DeviceTool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DeviceTool -> DeviceTool
Gdk.DeviceTool.DeviceTool) Ptr DeviceTool
tool
DeviceToolChangedCallback
_cb DeviceTool
tool'
onDeviceToolChanged :: (IsDevice a, MonadIO m) => a -> DeviceToolChangedCallback -> m SignalHandlerId
onDeviceToolChanged :: a -> DeviceToolChangedCallback -> m SignalHandlerId
onDeviceToolChanged a
obj DeviceToolChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceToolChangedCallback
cb' = DeviceToolChangedCallback -> C_DeviceToolChangedCallback
wrap_DeviceToolChangedCallback DeviceToolChangedCallback
cb
FunPtr C_DeviceToolChangedCallback
cb'' <- C_DeviceToolChangedCallback
-> IO (FunPtr C_DeviceToolChangedCallback)
mk_DeviceToolChangedCallback C_DeviceToolChangedCallback
cb'
a
-> Text
-> FunPtr C_DeviceToolChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tool-changed" FunPtr C_DeviceToolChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDeviceToolChanged :: (IsDevice a, MonadIO m) => a -> DeviceToolChangedCallback -> m SignalHandlerId
afterDeviceToolChanged :: a -> DeviceToolChangedCallback -> m SignalHandlerId
afterDeviceToolChanged a
obj DeviceToolChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceToolChangedCallback
cb' = DeviceToolChangedCallback -> C_DeviceToolChangedCallback
wrap_DeviceToolChangedCallback DeviceToolChangedCallback
cb
FunPtr C_DeviceToolChangedCallback
cb'' <- C_DeviceToolChangedCallback
-> IO (FunPtr C_DeviceToolChangedCallback)
mk_DeviceToolChangedCallback C_DeviceToolChangedCallback
cb'
a
-> Text
-> FunPtr C_DeviceToolChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tool-changed" FunPtr C_DeviceToolChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DeviceToolChangedSignalInfo
instance SignalInfo DeviceToolChangedSignalInfo where
type HaskellCallbackType DeviceToolChangedSignalInfo = DeviceToolChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DeviceToolChangedCallback cb
cb'' <- mk_DeviceToolChangedCallback cb'
connectSignalFunPtr obj "tool-changed" cb'' connectMode detail
#endif
getDeviceAssociatedDevice :: (MonadIO m, IsDevice o) => o -> m (Maybe Device)
getDeviceAssociatedDevice :: o -> m (Maybe Device)
getDeviceAssociatedDevice o
obj = IO (Maybe Device) -> m (Maybe Device)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Device) -> m (Maybe Device))
-> IO (Maybe Device) -> m (Maybe Device)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Device -> Device) -> IO (Maybe Device)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"associated-device" ManagedPtr Device -> Device
Device
#if defined(ENABLE_OVERLOADING)
data DeviceAssociatedDevicePropertyInfo
instance AttrInfo DeviceAssociatedDevicePropertyInfo where
type AttrAllowedOps DeviceAssociatedDevicePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceAssociatedDevicePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceAssociatedDevicePropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceAssociatedDevicePropertyInfo = (~) ()
type AttrTransferType DeviceAssociatedDevicePropertyInfo = ()
type AttrGetType DeviceAssociatedDevicePropertyInfo = (Maybe Device)
type AttrLabel DeviceAssociatedDevicePropertyInfo = "associated-device"
type AttrOrigin DeviceAssociatedDevicePropertyInfo = Device
attrGet = getDeviceAssociatedDevice
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceAxes :: (MonadIO m, IsDevice o) => o -> m [Gdk.Flags.AxisFlags]
getDeviceAxes :: o -> m [AxisFlags]
getDeviceAxes o
obj = IO [AxisFlags] -> m [AxisFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AxisFlags] -> m [AxisFlags])
-> IO [AxisFlags] -> m [AxisFlags]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [AxisFlags]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"axes"
#if defined(ENABLE_OVERLOADING)
data DeviceAxesPropertyInfo
instance AttrInfo DeviceAxesPropertyInfo where
type AttrAllowedOps DeviceAxesPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceAxesPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceAxesPropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceAxesPropertyInfo = (~) ()
type AttrTransferType DeviceAxesPropertyInfo = ()
type AttrGetType DeviceAxesPropertyInfo = [Gdk.Flags.AxisFlags]
type AttrLabel DeviceAxesPropertyInfo = "axes"
type AttrOrigin DeviceAxesPropertyInfo = Device
attrGet = getDeviceAxes
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceCapsLockState :: (MonadIO m, IsDevice o) => o -> m Bool
getDeviceCapsLockState :: o -> m Bool
getDeviceCapsLockState o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"caps-lock-state"
#if defined(ENABLE_OVERLOADING)
data DeviceCapsLockStatePropertyInfo
instance AttrInfo DeviceCapsLockStatePropertyInfo where
type AttrAllowedOps DeviceCapsLockStatePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceCapsLockStatePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceCapsLockStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceCapsLockStatePropertyInfo = (~) ()
type AttrTransferType DeviceCapsLockStatePropertyInfo = ()
type AttrGetType DeviceCapsLockStatePropertyInfo = Bool
type AttrLabel DeviceCapsLockStatePropertyInfo = "caps-lock-state"
type AttrOrigin DeviceCapsLockStatePropertyInfo = Device
attrGet = getDeviceCapsLockState
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceDirection :: (MonadIO m, IsDevice o) => o -> m Pango.Enums.Direction
getDeviceDirection :: o -> m Direction
getDeviceDirection o
obj = IO Direction -> m Direction
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Direction -> m Direction) -> IO Direction -> m Direction
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Direction
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"direction"
#if defined(ENABLE_OVERLOADING)
data DeviceDirectionPropertyInfo
instance AttrInfo DeviceDirectionPropertyInfo where
type AttrAllowedOps DeviceDirectionPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceDirectionPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceDirectionPropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceDirectionPropertyInfo = (~) ()
type AttrTransferType DeviceDirectionPropertyInfo = ()
type AttrGetType DeviceDirectionPropertyInfo = Pango.Enums.Direction
type AttrLabel DeviceDirectionPropertyInfo = "direction"
type AttrOrigin DeviceDirectionPropertyInfo = Device
attrGet = getDeviceDirection
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceDisplay :: (MonadIO m, IsDevice o) => o -> m Gdk.Display.Display
getDeviceDisplay :: o -> m Display
getDeviceDisplay o
obj = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Display) -> IO Display
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDeviceDisplay" (IO (Maybe Display) -> IO Display)
-> IO (Maybe Display) -> IO Display
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Display -> Display) -> IO (Maybe Display)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"display" ManagedPtr Display -> Display
Gdk.Display.Display
constructDeviceDisplay :: (IsDevice o, MIO.MonadIO m, Gdk.Display.IsDisplay a) => a -> m (GValueConstruct o)
constructDeviceDisplay :: a -> m (GValueConstruct o)
constructDeviceDisplay a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"display" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data DeviceDisplayPropertyInfo
instance AttrInfo DeviceDisplayPropertyInfo where
type AttrAllowedOps DeviceDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceDisplayPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferTypeConstraint DeviceDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferType DeviceDisplayPropertyInfo = Gdk.Display.Display
type AttrGetType DeviceDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel DeviceDisplayPropertyInfo = "display"
type AttrOrigin DeviceDisplayPropertyInfo = Device
attrGet = getDeviceDisplay
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Display.Display v
attrConstruct = constructDeviceDisplay
attrClear = undefined
#endif
getDeviceHasBidiLayouts :: (MonadIO m, IsDevice o) => o -> m Bool
getDeviceHasBidiLayouts :: o -> m Bool
getDeviceHasBidiLayouts o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"has-bidi-layouts"
#if defined(ENABLE_OVERLOADING)
data DeviceHasBidiLayoutsPropertyInfo
instance AttrInfo DeviceHasBidiLayoutsPropertyInfo where
type AttrAllowedOps DeviceHasBidiLayoutsPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceHasBidiLayoutsPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceHasBidiLayoutsPropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceHasBidiLayoutsPropertyInfo = (~) ()
type AttrTransferType DeviceHasBidiLayoutsPropertyInfo = ()
type AttrGetType DeviceHasBidiLayoutsPropertyInfo = Bool
type AttrLabel DeviceHasBidiLayoutsPropertyInfo = "has-bidi-layouts"
type AttrOrigin DeviceHasBidiLayoutsPropertyInfo = Device
attrGet = getDeviceHasBidiLayouts
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceHasCursor :: (MonadIO m, IsDevice o) => o -> m Bool
getDeviceHasCursor :: o -> m Bool
getDeviceHasCursor o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"has-cursor"
constructDeviceHasCursor :: (IsDevice o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructDeviceHasCursor :: Bool -> m (GValueConstruct o)
constructDeviceHasCursor Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"has-cursor" Bool
val
#if defined(ENABLE_OVERLOADING)
data DeviceHasCursorPropertyInfo
instance AttrInfo DeviceHasCursorPropertyInfo where
type AttrAllowedOps DeviceHasCursorPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DeviceHasCursorPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceHasCursorPropertyInfo = (~) Bool
type AttrTransferTypeConstraint DeviceHasCursorPropertyInfo = (~) Bool
type AttrTransferType DeviceHasCursorPropertyInfo = Bool
type AttrGetType DeviceHasCursorPropertyInfo = Bool
type AttrLabel DeviceHasCursorPropertyInfo = "has-cursor"
type AttrOrigin DeviceHasCursorPropertyInfo = Device
attrGet = getDeviceHasCursor
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceHasCursor
attrClear = undefined
#endif
getDeviceModifierState :: (MonadIO m, IsDevice o) => o -> m [Gdk.Flags.ModifierType]
getDeviceModifierState :: o -> m [ModifierType]
getDeviceModifierState o
obj = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO [ModifierType]
forall a b.
(GObject a, IsGFlag b, BoxedFlags b) =>
a -> String -> IO [b]
B.Properties.getObjectPropertyFlags o
obj String
"modifier-state"
#if defined(ENABLE_OVERLOADING)
data DeviceModifierStatePropertyInfo
instance AttrInfo DeviceModifierStatePropertyInfo where
type AttrAllowedOps DeviceModifierStatePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceModifierStatePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceModifierStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceModifierStatePropertyInfo = (~) ()
type AttrTransferType DeviceModifierStatePropertyInfo = ()
type AttrGetType DeviceModifierStatePropertyInfo = [Gdk.Flags.ModifierType]
type AttrLabel DeviceModifierStatePropertyInfo = "modifier-state"
type AttrOrigin DeviceModifierStatePropertyInfo = Device
attrGet = getDeviceModifierState
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceNAxes :: (MonadIO m, IsDevice o) => o -> m Word32
getDeviceNAxes :: o -> m Word32
getDeviceNAxes o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"n-axes"
#if defined(ENABLE_OVERLOADING)
data DeviceNAxesPropertyInfo
instance AttrInfo DeviceNAxesPropertyInfo where
type AttrAllowedOps DeviceNAxesPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceNAxesPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceNAxesPropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceNAxesPropertyInfo = (~) ()
type AttrTransferType DeviceNAxesPropertyInfo = ()
type AttrGetType DeviceNAxesPropertyInfo = Word32
type AttrLabel DeviceNAxesPropertyInfo = "n-axes"
type AttrOrigin DeviceNAxesPropertyInfo = Device
attrGet = getDeviceNAxes
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceName :: (MonadIO m, IsDevice o) => o -> m T.Text
getDeviceName :: o -> m Text
getDeviceName o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDeviceName" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO 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"
constructDeviceName :: (IsDevice o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDeviceName :: Text -> m (GValueConstruct o)
constructDeviceName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ 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 DeviceNamePropertyInfo
instance AttrInfo DeviceNamePropertyInfo where
type AttrAllowedOps DeviceNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceNamePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceNamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DeviceNamePropertyInfo = (~) T.Text
type AttrTransferType DeviceNamePropertyInfo = T.Text
type AttrGetType DeviceNamePropertyInfo = T.Text
type AttrLabel DeviceNamePropertyInfo = "name"
type AttrOrigin DeviceNamePropertyInfo = Device
attrGet = getDeviceName
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceName
attrClear = undefined
#endif
getDeviceNumLockState :: (MonadIO m, IsDevice o) => o -> m Bool
getDeviceNumLockState :: o -> m Bool
getDeviceNumLockState o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"num-lock-state"
#if defined(ENABLE_OVERLOADING)
data DeviceNumLockStatePropertyInfo
instance AttrInfo DeviceNumLockStatePropertyInfo where
type AttrAllowedOps DeviceNumLockStatePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceNumLockStatePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceNumLockStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceNumLockStatePropertyInfo = (~) ()
type AttrTransferType DeviceNumLockStatePropertyInfo = ()
type AttrGetType DeviceNumLockStatePropertyInfo = Bool
type AttrLabel DeviceNumLockStatePropertyInfo = "num-lock-state"
type AttrOrigin DeviceNumLockStatePropertyInfo = Device
attrGet = getDeviceNumLockState
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceNumTouches :: (MonadIO m, IsDevice o) => o -> m Word32
getDeviceNumTouches :: o -> m Word32
getDeviceNumTouches o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"num-touches"
constructDeviceNumTouches :: (IsDevice o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructDeviceNumTouches :: Word32 -> m (GValueConstruct o)
constructDeviceNumTouches Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"num-touches" Word32
val
#if defined(ENABLE_OVERLOADING)
data DeviceNumTouchesPropertyInfo
instance AttrInfo DeviceNumTouchesPropertyInfo where
type AttrAllowedOps DeviceNumTouchesPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DeviceNumTouchesPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceNumTouchesPropertyInfo = (~) Word32
type AttrTransferTypeConstraint DeviceNumTouchesPropertyInfo = (~) Word32
type AttrTransferType DeviceNumTouchesPropertyInfo = Word32
type AttrGetType DeviceNumTouchesPropertyInfo = Word32
type AttrLabel DeviceNumTouchesPropertyInfo = "num-touches"
type AttrOrigin DeviceNumTouchesPropertyInfo = Device
attrGet = getDeviceNumTouches
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceNumTouches
attrClear = undefined
#endif
getDeviceProductId :: (MonadIO m, IsDevice o) => o -> m (Maybe T.Text)
getDeviceProductId :: o -> m (Maybe Text)
getDeviceProductId o
obj = IO (Maybe Text) -> m (Maybe Text)
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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"product-id"
constructDeviceProductId :: (IsDevice o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDeviceProductId :: Text -> m (GValueConstruct o)
constructDeviceProductId Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"product-id" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DeviceProductIdPropertyInfo
instance AttrInfo DeviceProductIdPropertyInfo where
type AttrAllowedOps DeviceProductIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceProductIdPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceProductIdPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DeviceProductIdPropertyInfo = (~) T.Text
type AttrTransferType DeviceProductIdPropertyInfo = T.Text
type AttrGetType DeviceProductIdPropertyInfo = (Maybe T.Text)
type AttrLabel DeviceProductIdPropertyInfo = "product-id"
type AttrOrigin DeviceProductIdPropertyInfo = Device
attrGet = getDeviceProductId
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceProductId
attrClear = undefined
#endif
getDeviceScrollLockState :: (MonadIO m, IsDevice o) => o -> m Bool
getDeviceScrollLockState :: o -> m Bool
getDeviceScrollLockState o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"scroll-lock-state"
#if defined(ENABLE_OVERLOADING)
data DeviceScrollLockStatePropertyInfo
instance AttrInfo DeviceScrollLockStatePropertyInfo where
type AttrAllowedOps DeviceScrollLockStatePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DeviceScrollLockStatePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceScrollLockStatePropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceScrollLockStatePropertyInfo = (~) ()
type AttrTransferType DeviceScrollLockStatePropertyInfo = ()
type AttrGetType DeviceScrollLockStatePropertyInfo = Bool
type AttrLabel DeviceScrollLockStatePropertyInfo = "scroll-lock-state"
type AttrOrigin DeviceScrollLockStatePropertyInfo = Device
attrGet = getDeviceScrollLockState
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceSeat :: (MonadIO m, IsDevice o) => o -> m Gdk.Seat.Seat
getDeviceSeat :: o -> m Seat
getDeviceSeat o
obj = IO Seat -> m Seat
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Seat -> m Seat) -> IO Seat -> m Seat
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Seat) -> IO Seat
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getDeviceSeat" (IO (Maybe Seat) -> IO Seat) -> IO (Maybe Seat) -> IO Seat
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Seat -> Seat) -> IO (Maybe Seat)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"seat" ManagedPtr Seat -> Seat
Gdk.Seat.Seat
setDeviceSeat :: (MonadIO m, IsDevice o, Gdk.Seat.IsSeat a) => o -> a -> m ()
setDeviceSeat :: o -> a -> m ()
setDeviceSeat o
obj a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"seat" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructDeviceSeat :: (IsDevice o, MIO.MonadIO m, Gdk.Seat.IsSeat a) => a -> m (GValueConstruct o)
constructDeviceSeat :: a -> m (GValueConstruct o)
constructDeviceSeat a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"seat" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearDeviceSeat :: (MonadIO m, IsDevice o) => o -> m ()
clearDeviceSeat :: o -> m ()
clearDeviceSeat o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Seat -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"seat" (Maybe Seat
forall a. Maybe a
Nothing :: Maybe Gdk.Seat.Seat)
#if defined(ENABLE_OVERLOADING)
data DeviceSeatPropertyInfo
instance AttrInfo DeviceSeatPropertyInfo where
type AttrAllowedOps DeviceSeatPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceSeatPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceSeatPropertyInfo = Gdk.Seat.IsSeat
type AttrTransferTypeConstraint DeviceSeatPropertyInfo = Gdk.Seat.IsSeat
type AttrTransferType DeviceSeatPropertyInfo = Gdk.Seat.Seat
type AttrGetType DeviceSeatPropertyInfo = Gdk.Seat.Seat
type AttrLabel DeviceSeatPropertyInfo = "seat"
type AttrOrigin DeviceSeatPropertyInfo = Device
attrGet = getDeviceSeat
attrSet = setDeviceSeat
attrTransfer _ v = do
unsafeCastTo Gdk.Seat.Seat v
attrConstruct = constructDeviceSeat
attrClear = clearDeviceSeat
#endif
getDeviceSource :: (MonadIO m, IsDevice o) => o -> m Gdk.Enums.InputSource
getDeviceSource :: o -> m InputSource
getDeviceSource o
obj = IO InputSource -> m InputSource
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputSource -> m InputSource)
-> IO InputSource -> m InputSource
forall a b. (a -> b) -> a -> b
$ o -> String -> IO InputSource
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"source"
constructDeviceSource :: (IsDevice o, MIO.MonadIO m) => Gdk.Enums.InputSource -> m (GValueConstruct o)
constructDeviceSource :: InputSource -> m (GValueConstruct o)
constructDeviceSource InputSource
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> InputSource -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"source" InputSource
val
#if defined(ENABLE_OVERLOADING)
data DeviceSourcePropertyInfo
instance AttrInfo DeviceSourcePropertyInfo where
type AttrAllowedOps DeviceSourcePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DeviceSourcePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceSourcePropertyInfo = (~) Gdk.Enums.InputSource
type AttrTransferTypeConstraint DeviceSourcePropertyInfo = (~) Gdk.Enums.InputSource
type AttrTransferType DeviceSourcePropertyInfo = Gdk.Enums.InputSource
type AttrGetType DeviceSourcePropertyInfo = Gdk.Enums.InputSource
type AttrLabel DeviceSourcePropertyInfo = "source"
type AttrOrigin DeviceSourcePropertyInfo = Device
attrGet = getDeviceSource
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceSource
attrClear = undefined
#endif
getDeviceTool :: (MonadIO m, IsDevice o) => o -> m (Maybe Gdk.DeviceTool.DeviceTool)
getDeviceTool :: o -> m (Maybe DeviceTool)
getDeviceTool o
obj = IO (Maybe DeviceTool) -> m (Maybe DeviceTool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DeviceTool) -> m (Maybe DeviceTool))
-> IO (Maybe DeviceTool) -> m (Maybe DeviceTool)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr DeviceTool -> DeviceTool)
-> IO (Maybe DeviceTool)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"tool" ManagedPtr DeviceTool -> DeviceTool
Gdk.DeviceTool.DeviceTool
#if defined(ENABLE_OVERLOADING)
data DeviceToolPropertyInfo
instance AttrInfo DeviceToolPropertyInfo where
type AttrAllowedOps DeviceToolPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceToolPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceToolPropertyInfo = (~) ()
type AttrTransferTypeConstraint DeviceToolPropertyInfo = (~) ()
type AttrTransferType DeviceToolPropertyInfo = ()
type AttrGetType DeviceToolPropertyInfo = (Maybe Gdk.DeviceTool.DeviceTool)
type AttrLabel DeviceToolPropertyInfo = "tool"
type AttrOrigin DeviceToolPropertyInfo = Device
attrGet = getDeviceTool
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getDeviceType :: (MonadIO m, IsDevice o) => o -> m Gdk.Enums.DeviceType
getDeviceType :: o -> m DeviceType
getDeviceType o
obj = IO DeviceType -> m DeviceType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DeviceType -> m DeviceType) -> IO DeviceType -> m DeviceType
forall a b. (a -> b) -> a -> b
$ o -> String -> IO DeviceType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"type"
constructDeviceType :: (IsDevice o, MIO.MonadIO m) => Gdk.Enums.DeviceType -> m (GValueConstruct o)
constructDeviceType :: DeviceType -> m (GValueConstruct o)
constructDeviceType DeviceType
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> DeviceType -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"type" DeviceType
val
#if defined(ENABLE_OVERLOADING)
data DeviceTypePropertyInfo
instance AttrInfo DeviceTypePropertyInfo where
type AttrAllowedOps DeviceTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint DeviceTypePropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceTypePropertyInfo = (~) Gdk.Enums.DeviceType
type AttrTransferTypeConstraint DeviceTypePropertyInfo = (~) Gdk.Enums.DeviceType
type AttrTransferType DeviceTypePropertyInfo = Gdk.Enums.DeviceType
type AttrGetType DeviceTypePropertyInfo = Gdk.Enums.DeviceType
type AttrLabel DeviceTypePropertyInfo = "type"
type AttrOrigin DeviceTypePropertyInfo = Device
attrGet = getDeviceType
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceType
attrClear = undefined
#endif
getDeviceVendorId :: (MonadIO m, IsDevice o) => o -> m (Maybe T.Text)
getDeviceVendorId :: o -> m (Maybe Text)
getDeviceVendorId o
obj = IO (Maybe Text) -> m (Maybe Text)
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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"vendor-id"
constructDeviceVendorId :: (IsDevice o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDeviceVendorId :: Text -> m (GValueConstruct o)
constructDeviceVendorId Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"vendor-id" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DeviceVendorIdPropertyInfo
instance AttrInfo DeviceVendorIdPropertyInfo where
type AttrAllowedOps DeviceVendorIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceVendorIdPropertyInfo = IsDevice
type AttrSetTypeConstraint DeviceVendorIdPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DeviceVendorIdPropertyInfo = (~) T.Text
type AttrTransferType DeviceVendorIdPropertyInfo = T.Text
type AttrGetType DeviceVendorIdPropertyInfo = (Maybe T.Text)
type AttrLabel DeviceVendorIdPropertyInfo = "vendor-id"
type AttrOrigin DeviceVendorIdPropertyInfo = Device
attrGet = getDeviceVendorId
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDeviceVendorId
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Device
type instance O.AttributeList Device = DeviceAttributeList
type DeviceAttributeList = ('[ '("associatedDevice", DeviceAssociatedDevicePropertyInfo), '("axes", DeviceAxesPropertyInfo), '("capsLockState", DeviceCapsLockStatePropertyInfo), '("direction", DeviceDirectionPropertyInfo), '("display", DeviceDisplayPropertyInfo), '("hasBidiLayouts", DeviceHasBidiLayoutsPropertyInfo), '("hasCursor", DeviceHasCursorPropertyInfo), '("modifierState", DeviceModifierStatePropertyInfo), '("nAxes", DeviceNAxesPropertyInfo), '("name", DeviceNamePropertyInfo), '("numLockState", DeviceNumLockStatePropertyInfo), '("numTouches", DeviceNumTouchesPropertyInfo), '("productId", DeviceProductIdPropertyInfo), '("scrollLockState", DeviceScrollLockStatePropertyInfo), '("seat", DeviceSeatPropertyInfo), '("source", DeviceSourcePropertyInfo), '("tool", DeviceToolPropertyInfo), '("type", DeviceTypePropertyInfo), '("vendorId", DeviceVendorIdPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
deviceAssociatedDevice :: AttrLabelProxy "associatedDevice"
deviceAssociatedDevice = AttrLabelProxy
deviceAxes :: AttrLabelProxy "axes"
deviceAxes = AttrLabelProxy
deviceCapsLockState :: AttrLabelProxy "capsLockState"
deviceCapsLockState = AttrLabelProxy
deviceDirection :: AttrLabelProxy "direction"
deviceDirection = AttrLabelProxy
deviceDisplay :: AttrLabelProxy "display"
deviceDisplay = AttrLabelProxy
deviceHasCursor :: AttrLabelProxy "hasCursor"
deviceHasCursor = AttrLabelProxy
deviceModifierState :: AttrLabelProxy "modifierState"
deviceModifierState = AttrLabelProxy
deviceNAxes :: AttrLabelProxy "nAxes"
deviceNAxes = AttrLabelProxy
deviceName :: AttrLabelProxy "name"
deviceName = AttrLabelProxy
deviceNumLockState :: AttrLabelProxy "numLockState"
deviceNumLockState = AttrLabelProxy
deviceNumTouches :: AttrLabelProxy "numTouches"
deviceNumTouches = AttrLabelProxy
deviceProductId :: AttrLabelProxy "productId"
deviceProductId = AttrLabelProxy
deviceScrollLockState :: AttrLabelProxy "scrollLockState"
deviceScrollLockState = AttrLabelProxy
deviceSeat :: AttrLabelProxy "seat"
deviceSeat = AttrLabelProxy
deviceSource :: AttrLabelProxy "source"
deviceSource = AttrLabelProxy
deviceTool :: AttrLabelProxy "tool"
deviceTool = AttrLabelProxy
deviceType :: AttrLabelProxy "type"
deviceType = AttrLabelProxy
deviceVendorId :: AttrLabelProxy "vendorId"
deviceVendorId = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Device = DeviceSignalList
type DeviceSignalList = ('[ '("changed", DeviceChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("toolChanged", DeviceToolChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_device_get_associated_device" gdk_device_get_associated_device ::
Ptr Device ->
IO (Ptr Device)
deviceGetAssociatedDevice ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe Device)
deviceGetAssociatedDevice :: a -> m (Maybe Device)
deviceGetAssociatedDevice a
device = IO (Maybe Device) -> m (Maybe Device)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Device) -> m (Maybe Device))
-> IO (Maybe Device) -> m (Maybe Device)
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Device
result <- Ptr Device -> IO (Ptr Device)
gdk_device_get_associated_device Ptr Device
device'
Maybe Device
maybeResult <- Ptr Device -> (Ptr Device -> IO Device) -> IO (Maybe Device)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Device
result ((Ptr Device -> IO Device) -> IO (Maybe Device))
-> (Ptr Device -> IO Device) -> IO (Maybe Device)
forall a b. (a -> b) -> a -> b
$ \Ptr Device
result' -> do
Device
result'' <- ((ManagedPtr Device -> Device) -> Ptr Device -> IO Device
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Device -> Device
Device) Ptr Device
result'
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe Device -> IO (Maybe Device)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Device
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetAssociatedDeviceMethodInfo
instance (signature ~ (m (Maybe Device)), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetAssociatedDeviceMethodInfo a signature where
overloadedMethod = deviceGetAssociatedDevice
#endif
foreign import ccall "gdk_device_get_axes" gdk_device_get_axes ::
Ptr Device ->
IO CUInt
deviceGetAxes ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m [Gdk.Flags.AxisFlags]
deviceGetAxes :: a -> m [AxisFlags]
deviceGetAxes a
device = IO [AxisFlags] -> m [AxisFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AxisFlags] -> m [AxisFlags])
-> IO [AxisFlags] -> m [AxisFlags]
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CUInt
result <- Ptr Device -> IO CUInt
gdk_device_get_axes Ptr Device
device'
let result' :: [AxisFlags]
result' = CUInt -> [AxisFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
[AxisFlags] -> IO [AxisFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [AxisFlags]
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetAxesMethodInfo
instance (signature ~ (m [Gdk.Flags.AxisFlags]), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetAxesMethodInfo a signature where
overloadedMethod = deviceGetAxes
#endif
foreign import ccall "gdk_device_get_axis_names" gdk_device_get_axis_names ::
Ptr Device ->
IO (Ptr CString)
deviceGetAxisNames ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe [T.Text])
deviceGetAxisNames :: a -> m (Maybe [Text])
deviceGetAxisNames a
device = IO (Maybe [Text]) -> m (Maybe [Text])
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
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr CString
result <- Ptr Device -> IO (Ptr CString)
gdk_device_get_axis_names Ptr Device
device'
Maybe [Text]
maybeResult <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CString
result ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
result' -> do
[Text]
result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result'
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe [Text] -> IO (Maybe [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetAxisNamesMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetAxisNamesMethodInfo a signature where
overloadedMethod = deviceGetAxisNames
#endif
foreign import ccall "gdk_device_get_axis_use" gdk_device_get_axis_use ::
Ptr Device ->
Word32 ->
IO CUInt
deviceGetAxisUse ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> Word32
-> m Gdk.Enums.AxisUse
deviceGetAxisUse :: a -> Word32 -> m AxisUse
deviceGetAxisUse a
device Word32
index_ = IO AxisUse -> m AxisUse
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AxisUse -> m AxisUse) -> IO AxisUse -> m AxisUse
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CUInt
result <- Ptr Device -> Word32 -> IO CUInt
gdk_device_get_axis_use Ptr Device
device' Word32
index_
let result' :: AxisUse
result' = (Int -> AxisUse
forall a. Enum a => Int -> a
toEnum (Int -> AxisUse) -> (CUInt -> Int) -> CUInt -> AxisUse
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
AxisUse -> IO AxisUse
forall (m :: * -> *) a. Monad m => a -> m a
return AxisUse
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetAxisUseMethodInfo
instance (signature ~ (Word32 -> m Gdk.Enums.AxisUse), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetAxisUseMethodInfo a signature where
overloadedMethod = deviceGetAxisUse
#endif
foreign import ccall "gdk_device_get_caps_lock_state" gdk_device_get_caps_lock_state ::
Ptr Device ->
IO CInt
deviceGetCapsLockState ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Bool
deviceGetCapsLockState :: a -> m Bool
deviceGetCapsLockState a
device = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CInt
result <- Ptr Device -> IO CInt
gdk_device_get_caps_lock_state Ptr Device
device'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetCapsLockStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetCapsLockStateMethodInfo a signature where
overloadedMethod = deviceGetCapsLockState
#endif
foreign import ccall "gdk_device_get_device_tool" gdk_device_get_device_tool ::
Ptr Device ->
IO (Ptr Gdk.DeviceTool.DeviceTool)
deviceGetDeviceTool ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Gdk.DeviceTool.DeviceTool
deviceGetDeviceTool :: a -> m DeviceTool
deviceGetDeviceTool a
device = IO DeviceTool -> m DeviceTool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DeviceTool -> m DeviceTool) -> IO DeviceTool -> m DeviceTool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr DeviceTool
result <- Ptr Device -> IO (Ptr DeviceTool)
gdk_device_get_device_tool Ptr Device
device'
Text -> Ptr DeviceTool -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceGetDeviceTool" Ptr DeviceTool
result
DeviceTool
result' <- ((ManagedPtr DeviceTool -> DeviceTool)
-> Ptr DeviceTool -> IO DeviceTool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr DeviceTool -> DeviceTool
Gdk.DeviceTool.DeviceTool) Ptr DeviceTool
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
DeviceTool -> IO DeviceTool
forall (m :: * -> *) a. Monad m => a -> m a
return DeviceTool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetDeviceToolMethodInfo
instance (signature ~ (m Gdk.DeviceTool.DeviceTool), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetDeviceToolMethodInfo a signature where
overloadedMethod = deviceGetDeviceTool
#endif
foreign import ccall "gdk_device_get_device_type" gdk_device_get_device_type ::
Ptr Device ->
IO CUInt
deviceGetDeviceType ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Gdk.Enums.DeviceType
deviceGetDeviceType :: a -> m DeviceType
deviceGetDeviceType a
device = IO DeviceType -> m DeviceType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DeviceType -> m DeviceType) -> IO DeviceType -> m DeviceType
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CUInt
result <- Ptr Device -> IO CUInt
gdk_device_get_device_type Ptr Device
device'
let result' :: DeviceType
result' = (Int -> DeviceType
forall a. Enum a => Int -> a
toEnum (Int -> DeviceType) -> (CUInt -> Int) -> CUInt -> DeviceType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
DeviceType -> IO DeviceType
forall (m :: * -> *) a. Monad m => a -> m a
return DeviceType
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetDeviceTypeMethodInfo
instance (signature ~ (m Gdk.Enums.DeviceType), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetDeviceTypeMethodInfo a signature where
overloadedMethod = deviceGetDeviceType
#endif
foreign import ccall "gdk_device_get_direction" gdk_device_get_direction ::
Ptr Device ->
IO CUInt
deviceGetDirection ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Pango.Enums.Direction
deviceGetDirection :: a -> m Direction
deviceGetDirection a
device = IO Direction -> m Direction
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Direction -> m Direction) -> IO Direction -> m Direction
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CUInt
result <- Ptr Device -> IO CUInt
gdk_device_get_direction Ptr Device
device'
let result' :: Direction
result' = (Int -> Direction
forall a. Enum a => Int -> a
toEnum (Int -> Direction) -> (CUInt -> Int) -> CUInt -> Direction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Direction -> IO Direction
forall (m :: * -> *) a. Monad m => a -> m a
return Direction
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetDirectionMethodInfo
instance (signature ~ (m Pango.Enums.Direction), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetDirectionMethodInfo a signature where
overloadedMethod = deviceGetDirection
#endif
foreign import ccall "gdk_device_get_display" gdk_device_get_display ::
Ptr Device ->
IO (Ptr Gdk.Display.Display)
deviceGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Gdk.Display.Display
deviceGetDisplay :: a -> m Display
deviceGetDisplay a
device = IO Display -> m Display
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Display
result <- Ptr Device -> IO (Ptr Display)
gdk_device_get_display Ptr Device
device'
Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceGetDisplay" Ptr Display
result
Display
result' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetDisplayMethodInfo a signature where
overloadedMethod = deviceGetDisplay
#endif
foreign import ccall "gdk_device_get_has_cursor" gdk_device_get_has_cursor ::
Ptr Device ->
IO CInt
deviceGetHasCursor ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Bool
deviceGetHasCursor :: a -> m Bool
deviceGetHasCursor a
device = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CInt
result <- Ptr Device -> IO CInt
gdk_device_get_has_cursor Ptr Device
device'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetHasCursorMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetHasCursorMethodInfo a signature where
overloadedMethod = deviceGetHasCursor
#endif
foreign import ccall "gdk_device_get_key" gdk_device_get_key ::
Ptr Device ->
Word32 ->
Ptr Word32 ->
Ptr CUInt ->
IO CInt
deviceGetKey ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> Word32
-> m ((Bool, Word32, [Gdk.Flags.ModifierType]))
deviceGetKey :: a -> Word32 -> m (Bool, Word32, [ModifierType])
deviceGetKey a
device Word32
index_ = IO (Bool, Word32, [ModifierType])
-> m (Bool, Word32, [ModifierType])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32, [ModifierType])
-> m (Bool, Word32, [ModifierType]))
-> IO (Bool, Word32, [ModifierType])
-> m (Bool, Word32, [ModifierType])
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Word32
keyval <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr CUInt
modifiers <- IO (Ptr CUInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CUInt)
CInt
result <- Ptr Device -> Word32 -> Ptr Word32 -> Ptr CUInt -> IO CInt
gdk_device_get_key Ptr Device
device' Word32
index_ Ptr Word32
keyval Ptr CUInt
modifiers
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word32
keyval' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
keyval
CUInt
modifiers' <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CUInt
modifiers
let modifiers'' :: [ModifierType]
modifiers'' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
modifiers'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
keyval
Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
modifiers
(Bool, Word32, [ModifierType]) -> IO (Bool, Word32, [ModifierType])
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
keyval', [ModifierType]
modifiers'')
#if defined(ENABLE_OVERLOADING)
data DeviceGetKeyMethodInfo
instance (signature ~ (Word32 -> m ((Bool, Word32, [Gdk.Flags.ModifierType]))), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetKeyMethodInfo a signature where
overloadedMethod = deviceGetKey
#endif
foreign import ccall "gdk_device_get_last_event_surface" gdk_device_get_last_event_surface ::
Ptr Device ->
IO (Ptr Gdk.Surface.Surface)
deviceGetLastEventSurface ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe Gdk.Surface.Surface)
deviceGetLastEventSurface :: a -> m (Maybe Surface)
deviceGetLastEventSurface a
device = IO (Maybe Surface) -> m (Maybe Surface)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface) -> m (Maybe Surface))
-> IO (Maybe Surface) -> m (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Surface
result <- Ptr Device -> IO (Ptr Surface)
gdk_device_get_last_event_surface Ptr Device
device'
Maybe Surface
maybeResult <- Ptr Surface -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Surface
result ((Ptr Surface -> IO Surface) -> IO (Maybe Surface))
-> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ \Ptr Surface
result' -> do
Surface
result'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
result'
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe Surface -> IO (Maybe Surface)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Surface
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetLastEventSurfaceMethodInfo
instance (signature ~ (m (Maybe Gdk.Surface.Surface)), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetLastEventSurfaceMethodInfo a signature where
overloadedMethod = deviceGetLastEventSurface
#endif
foreign import ccall "gdk_device_get_modifier_state" gdk_device_get_modifier_state ::
Ptr Device ->
IO CUInt
deviceGetModifierState ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m [Gdk.Flags.ModifierType]
deviceGetModifierState :: a -> m [ModifierType]
deviceGetModifierState a
device = IO [ModifierType] -> m [ModifierType]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [ModifierType] -> m [ModifierType])
-> IO [ModifierType] -> m [ModifierType]
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CUInt
result <- Ptr Device -> IO CUInt
gdk_device_get_modifier_state Ptr Device
device'
let result' :: [ModifierType]
result' = CUInt -> [ModifierType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
[ModifierType] -> IO [ModifierType]
forall (m :: * -> *) a. Monad m => a -> m a
return [ModifierType]
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetModifierStateMethodInfo
instance (signature ~ (m [Gdk.Flags.ModifierType]), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetModifierStateMethodInfo a signature where
overloadedMethod = deviceGetModifierState
#endif
foreign import ccall "gdk_device_get_n_axes" gdk_device_get_n_axes ::
Ptr Device ->
IO Int32
deviceGetNAxes ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Int32
deviceGetNAxes :: a -> m Int32
deviceGetNAxes a
device = IO Int32 -> m Int32
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
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Int32
result <- Ptr Device -> IO Int32
gdk_device_get_n_axes Ptr Device
device'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data DeviceGetNAxesMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetNAxesMethodInfo a signature where
overloadedMethod = deviceGetNAxes
#endif
foreign import ccall "gdk_device_get_n_keys" gdk_device_get_n_keys ::
Ptr Device ->
IO Int32
deviceGetNKeys ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Int32
deviceGetNKeys :: a -> m Int32
deviceGetNKeys a
device = IO Int32 -> m Int32
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
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Int32
result <- Ptr Device -> IO Int32
gdk_device_get_n_keys Ptr Device
device'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data DeviceGetNKeysMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetNKeysMethodInfo a signature where
overloadedMethod = deviceGetNKeys
#endif
foreign import ccall "gdk_device_get_name" gdk_device_get_name ::
Ptr Device ->
IO CString
deviceGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m T.Text
deviceGetName :: a -> m Text
deviceGetName a
device = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CString
result <- Ptr Device -> IO CString
gdk_device_get_name Ptr Device
device'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetNameMethodInfo a signature where
overloadedMethod = deviceGetName
#endif
foreign import ccall "gdk_device_get_num_lock_state" gdk_device_get_num_lock_state ::
Ptr Device ->
IO CInt
deviceGetNumLockState ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Bool
deviceGetNumLockState :: a -> m Bool
deviceGetNumLockState a
device = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CInt
result <- Ptr Device -> IO CInt
gdk_device_get_num_lock_state Ptr Device
device'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetNumLockStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetNumLockStateMethodInfo a signature where
overloadedMethod = deviceGetNumLockState
#endif
foreign import ccall "gdk_device_get_num_touches" gdk_device_get_num_touches ::
Ptr Device ->
IO Word32
deviceGetNumTouches ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Word32
deviceGetNumTouches :: a -> m Word32
deviceGetNumTouches a
device = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Word32
result <- Ptr Device -> IO Word32
gdk_device_get_num_touches Ptr Device
device'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data DeviceGetNumTouchesMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetNumTouchesMethodInfo a signature where
overloadedMethod = deviceGetNumTouches
#endif
foreign import ccall "gdk_device_get_product_id" gdk_device_get_product_id ::
Ptr Device ->
IO CString
deviceGetProductId ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe T.Text)
deviceGetProductId :: a -> m (Maybe Text)
deviceGetProductId a
device = IO (Maybe Text) -> m (Maybe Text)
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
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CString
result <- Ptr Device -> IO CString
gdk_device_get_product_id Ptr Device
device'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetProductIdMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetProductIdMethodInfo a signature where
overloadedMethod = deviceGetProductId
#endif
foreign import ccall "gdk_device_get_scroll_lock_state" gdk_device_get_scroll_lock_state ::
Ptr Device ->
IO CInt
deviceGetScrollLockState ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Bool
deviceGetScrollLockState :: a -> m Bool
deviceGetScrollLockState a
device = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CInt
result <- Ptr Device -> IO CInt
gdk_device_get_scroll_lock_state Ptr Device
device'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetScrollLockStateMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetScrollLockStateMethodInfo a signature where
overloadedMethod = deviceGetScrollLockState
#endif
foreign import ccall "gdk_device_get_seat" gdk_device_get_seat ::
Ptr Device ->
IO (Ptr Gdk.Seat.Seat)
deviceGetSeat ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Gdk.Seat.Seat
deviceGetSeat :: a -> m Seat
deviceGetSeat a
device = IO Seat -> m Seat
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Seat -> m Seat) -> IO Seat -> m Seat
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr Seat
result <- Ptr Device -> IO (Ptr Seat)
gdk_device_get_seat Ptr Device
device'
Text -> Ptr Seat -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceGetSeat" Ptr Seat
result
Seat
result' <- ((ManagedPtr Seat -> Seat) -> Ptr Seat -> IO Seat
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Seat -> Seat
Gdk.Seat.Seat) Ptr Seat
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Seat -> IO Seat
forall (m :: * -> *) a. Monad m => a -> m a
return Seat
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetSeatMethodInfo
instance (signature ~ (m Gdk.Seat.Seat), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetSeatMethodInfo a signature where
overloadedMethod = deviceGetSeat
#endif
foreign import ccall "gdk_device_get_source" gdk_device_get_source ::
Ptr Device ->
IO CUInt
deviceGetSource ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Gdk.Enums.InputSource
deviceGetSource :: a -> m InputSource
deviceGetSource a
device = IO InputSource -> m InputSource
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO InputSource -> m InputSource)
-> IO InputSource -> m InputSource
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CUInt
result <- Ptr Device -> IO CUInt
gdk_device_get_source Ptr Device
device'
let result' :: InputSource
result' = (Int -> InputSource
forall a. Enum a => Int -> a
toEnum (Int -> InputSource) -> (CUInt -> Int) -> CUInt -> InputSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
InputSource -> IO InputSource
forall (m :: * -> *) a. Monad m => a -> m a
return InputSource
result'
#if defined(ENABLE_OVERLOADING)
data DeviceGetSourceMethodInfo
instance (signature ~ (m Gdk.Enums.InputSource), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetSourceMethodInfo a signature where
overloadedMethod = deviceGetSource
#endif
foreign import ccall "gdk_device_get_surface_at_position" gdk_device_get_surface_at_position ::
Ptr Device ->
Ptr CDouble ->
Ptr CDouble ->
IO (Ptr Gdk.Surface.Surface)
deviceGetSurfaceAtPosition ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m ((Maybe Gdk.Surface.Surface, Double, Double))
deviceGetSurfaceAtPosition :: a -> m (Maybe Surface, Double, Double)
deviceGetSurfaceAtPosition a
device = IO (Maybe Surface, Double, Double)
-> m (Maybe Surface, Double, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Surface, Double, Double)
-> m (Maybe Surface, Double, Double))
-> IO (Maybe Surface, Double, Double)
-> m (Maybe Surface, Double, Double)
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr CDouble
winX <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr CDouble
winY <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
Ptr Surface
result <- Ptr Device -> Ptr CDouble -> Ptr CDouble -> IO (Ptr Surface)
gdk_device_get_surface_at_position Ptr Device
device' Ptr CDouble
winX Ptr CDouble
winY
Maybe Surface
maybeResult <- Ptr Surface -> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Surface
result ((Ptr Surface -> IO Surface) -> IO (Maybe Surface))
-> (Ptr Surface -> IO Surface) -> IO (Maybe Surface)
forall a b. (a -> b) -> a -> b
$ \Ptr Surface
result' -> do
Surface
result'' <- ((ManagedPtr Surface -> Surface) -> Ptr Surface -> IO Surface
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Surface -> Surface
Gdk.Surface.Surface) Ptr Surface
result'
Surface -> IO Surface
forall (m :: * -> *) a. Monad m => a -> m a
return Surface
result''
CDouble
winX' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
winX
let winX'' :: Double
winX'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
winX'
CDouble
winY' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
winY
let winY'' :: Double
winY'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
winY'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
winX
Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
winY
(Maybe Surface, Double, Double)
-> IO (Maybe Surface, Double, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Surface
maybeResult, Double
winX'', Double
winY'')
#if defined(ENABLE_OVERLOADING)
data DeviceGetSurfaceAtPositionMethodInfo
instance (signature ~ (m ((Maybe Gdk.Surface.Surface, Double, Double))), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetSurfaceAtPositionMethodInfo a signature where
overloadedMethod = deviceGetSurfaceAtPosition
#endif
foreign import ccall "gdk_device_get_vendor_id" gdk_device_get_vendor_id ::
Ptr Device ->
IO CString
deviceGetVendorId ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m (Maybe T.Text)
deviceGetVendorId :: a -> m (Maybe Text)
deviceGetVendorId a
device = IO (Maybe Text) -> m (Maybe Text)
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
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CString
result <- Ptr Device -> IO CString
gdk_device_get_vendor_id Ptr Device
device'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceGetVendorIdMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDevice a) => O.MethodInfo DeviceGetVendorIdMethodInfo a signature where
overloadedMethod = deviceGetVendorId
#endif
foreign import ccall "gdk_device_has_bidi_layouts" gdk_device_has_bidi_layouts ::
Ptr Device ->
IO CInt
deviceHasBidiLayouts ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m Bool
deviceHasBidiLayouts :: a -> m Bool
deviceHasBidiLayouts a
device = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
CInt
result <- Ptr Device -> IO CInt
gdk_device_has_bidi_layouts Ptr Device
device'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DeviceHasBidiLayoutsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDevice a) => O.MethodInfo DeviceHasBidiLayoutsMethodInfo a signature where
overloadedMethod = deviceHasBidiLayouts
#endif
foreign import ccall "gdk_device_list_slave_devices" gdk_device_list_slave_devices ::
Ptr Device ->
IO (Ptr (GList (Ptr Device)))
deviceListSlaveDevices ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> m [Device]
deviceListSlaveDevices :: a -> m [Device]
deviceListSlaveDevices a
device = IO [Device] -> m [Device]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Device] -> m [Device]) -> IO [Device] -> m [Device]
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
Ptr (GList (Ptr Device))
result <- Ptr Device -> IO (Ptr (GList (Ptr Device)))
gdk_device_list_slave_devices Ptr Device
device'
[Ptr Device]
result' <- Ptr (GList (Ptr Device)) -> IO [Ptr Device]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Device))
result
[Device]
result'' <- (Ptr Device -> IO Device) -> [Ptr Device] -> IO [Device]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Device -> Device) -> Ptr Device -> IO Device
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Device -> Device
Device) [Ptr Device]
result'
Ptr (GList (Ptr Device)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Device))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
[Device] -> IO [Device]
forall (m :: * -> *) a. Monad m => a -> m a
return [Device]
result''
#if defined(ENABLE_OVERLOADING)
data DeviceListSlaveDevicesMethodInfo
instance (signature ~ (m [Device]), MonadIO m, IsDevice a) => O.MethodInfo DeviceListSlaveDevicesMethodInfo a signature where
overloadedMethod = deviceListSlaveDevices
#endif
foreign import ccall "gdk_device_set_axis_use" gdk_device_set_axis_use ::
Ptr Device ->
Word32 ->
CUInt ->
IO ()
deviceSetAxisUse ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> Word32
-> Gdk.Enums.AxisUse
-> m ()
deviceSetAxisUse :: a -> Word32 -> AxisUse -> m ()
deviceSetAxisUse a
device Word32
index_ AxisUse
use = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
let use' :: CUInt
use' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (AxisUse -> Int) -> AxisUse -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AxisUse -> Int
forall a. Enum a => a -> Int
fromEnum) AxisUse
use
Ptr Device -> Word32 -> CUInt -> IO ()
gdk_device_set_axis_use Ptr Device
device' Word32
index_ CUInt
use'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DeviceSetAxisUseMethodInfo
instance (signature ~ (Word32 -> Gdk.Enums.AxisUse -> m ()), MonadIO m, IsDevice a) => O.MethodInfo DeviceSetAxisUseMethodInfo a signature where
overloadedMethod = deviceSetAxisUse
#endif
foreign import ccall "gdk_device_set_key" gdk_device_set_key ::
Ptr Device ->
Word32 ->
Word32 ->
CUInt ->
IO ()
deviceSetKey ::
(B.CallStack.HasCallStack, MonadIO m, IsDevice a) =>
a
-> Word32
-> Word32
-> [Gdk.Flags.ModifierType]
-> m ()
deviceSetKey :: a -> Word32 -> Word32 -> [ModifierType] -> m ()
deviceSetKey a
device Word32
index_ Word32
keyval [ModifierType]
modifiers = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Device
device' <- a -> IO (Ptr Device)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
let modifiers' :: CUInt
modifiers' = [ModifierType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [ModifierType]
modifiers
Ptr Device -> Word32 -> Word32 -> CUInt -> IO ()
gdk_device_set_key Ptr Device
device' Word32
index_ Word32
keyval CUInt
modifiers'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DeviceSetKeyMethodInfo
instance (signature ~ (Word32 -> Word32 -> [Gdk.Flags.ModifierType] -> m ()), MonadIO m, IsDevice a) => O.MethodInfo DeviceSetKeyMethodInfo a signature where
overloadedMethod = deviceSetKey
#endif