#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gdk.Objects.Seat
(
Seat(..) ,
IsSeat ,
toSeat ,
noSeat ,
#if ENABLE_OVERLOADING
SeatGetCapabilitiesMethodInfo ,
#endif
seatGetCapabilities ,
#if ENABLE_OVERLOADING
SeatGetDisplayMethodInfo ,
#endif
seatGetDisplay ,
#if ENABLE_OVERLOADING
SeatGetKeyboardMethodInfo ,
#endif
seatGetKeyboard ,
#if ENABLE_OVERLOADING
SeatGetPointerMethodInfo ,
#endif
seatGetPointer ,
#if ENABLE_OVERLOADING
SeatGetSlavesMethodInfo ,
#endif
seatGetSlaves ,
#if ENABLE_OVERLOADING
SeatGrabMethodInfo ,
#endif
seatGrab ,
#if ENABLE_OVERLOADING
SeatUngrabMethodInfo ,
#endif
seatUngrab ,
#if ENABLE_OVERLOADING
SeatDisplayPropertyInfo ,
#endif
constructSeatDisplay ,
getSeatDisplay ,
#if ENABLE_OVERLOADING
seatDisplay ,
#endif
C_SeatDeviceAddedCallback ,
SeatDeviceAddedCallback ,
#if ENABLE_OVERLOADING
SeatDeviceAddedSignalInfo ,
#endif
afterSeatDeviceAdded ,
genClosure_SeatDeviceAdded ,
mk_SeatDeviceAddedCallback ,
noSeatDeviceAddedCallback ,
onSeatDeviceAdded ,
wrap_SeatDeviceAddedCallback ,
C_SeatDeviceRemovedCallback ,
SeatDeviceRemovedCallback ,
#if ENABLE_OVERLOADING
SeatDeviceRemovedSignalInfo ,
#endif
afterSeatDeviceRemoved ,
genClosure_SeatDeviceRemoved ,
mk_SeatDeviceRemovedCallback ,
noSeatDeviceRemovedCallback ,
onSeatDeviceRemoved ,
wrap_SeatDeviceRemovedCallback ,
C_SeatToolAddedCallback ,
SeatToolAddedCallback ,
#if ENABLE_OVERLOADING
SeatToolAddedSignalInfo ,
#endif
afterSeatToolAdded ,
genClosure_SeatToolAdded ,
mk_SeatToolAddedCallback ,
noSeatToolAddedCallback ,
onSeatToolAdded ,
wrap_SeatToolAddedCallback ,
C_SeatToolRemovedCallback ,
SeatToolRemovedCallback ,
#if ENABLE_OVERLOADING
SeatToolRemovedSignalInfo ,
#endif
afterSeatToolRemoved ,
genClosure_SeatToolRemoved ,
mk_SeatToolRemovedCallback ,
noSeatToolRemovedCallback ,
onSeatToolRemoved ,
wrap_SeatToolRemovedCallback ,
) 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.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.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 qualified GI.Gdk.Callbacks as Gdk.Callbacks
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
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.Window as Gdk.Window
import {-# SOURCE #-} qualified GI.Gdk.Unions.Event as Gdk.Event
newtype Seat = Seat (ManagedPtr Seat)
foreign import ccall "gdk_seat_get_type"
c_gdk_seat_get_type :: IO GType
instance GObject Seat where
gobjectType = c_gdk_seat_get_type
class (GObject o, O.IsDescendantOf Seat o) => IsSeat o
instance (GObject o, O.IsDescendantOf Seat o) => IsSeat o
instance O.HasParentTypes Seat
type instance O.ParentTypes Seat = '[GObject.Object.Object]
toSeat :: (MonadIO m, IsSeat o) => o -> m Seat
toSeat = liftIO . unsafeCastTo Seat
noSeat :: Maybe Seat
noSeat = Nothing
#if ENABLE_OVERLOADING
type family ResolveSeatMethod (t :: Symbol) (o :: *) :: * where
ResolveSeatMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSeatMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSeatMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSeatMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSeatMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSeatMethod "grab" o = SeatGrabMethodInfo
ResolveSeatMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSeatMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSeatMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSeatMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSeatMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSeatMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSeatMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSeatMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSeatMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSeatMethod "ungrab" o = SeatUngrabMethodInfo
ResolveSeatMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSeatMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSeatMethod "getCapabilities" o = SeatGetCapabilitiesMethodInfo
ResolveSeatMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSeatMethod "getDisplay" o = SeatGetDisplayMethodInfo
ResolveSeatMethod "getKeyboard" o = SeatGetKeyboardMethodInfo
ResolveSeatMethod "getPointer" o = SeatGetPointerMethodInfo
ResolveSeatMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSeatMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSeatMethod "getSlaves" o = SeatGetSlavesMethodInfo
ResolveSeatMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSeatMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSeatMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSeatMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSeatMethod t Seat, O.MethodInfo info Seat p) => OL.IsLabel t (Seat -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
type SeatDeviceAddedCallback =
Gdk.Device.Device
-> IO ()
noSeatDeviceAddedCallback :: Maybe SeatDeviceAddedCallback
noSeatDeviceAddedCallback = Nothing
type C_SeatDeviceAddedCallback =
Ptr () ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SeatDeviceAddedCallback :: C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
genClosure_SeatDeviceAdded :: MonadIO m => SeatDeviceAddedCallback -> m (GClosure C_SeatDeviceAddedCallback)
genClosure_SeatDeviceAdded cb = liftIO $ do
let cb' = wrap_SeatDeviceAddedCallback cb
mk_SeatDeviceAddedCallback cb' >>= B.GClosure.newGClosure
wrap_SeatDeviceAddedCallback ::
SeatDeviceAddedCallback ->
C_SeatDeviceAddedCallback
wrap_SeatDeviceAddedCallback _cb _ device _ = do
device' <- (newObject Gdk.Device.Device) device
_cb device'
onSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> SeatDeviceAddedCallback -> m SignalHandlerId
onSeatDeviceAdded obj cb = liftIO $ do
let cb' = wrap_SeatDeviceAddedCallback cb
cb'' <- mk_SeatDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' SignalConnectBefore
afterSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> SeatDeviceAddedCallback -> m SignalHandlerId
afterSeatDeviceAdded obj cb = liftIO $ do
let cb' = wrap_SeatDeviceAddedCallback cb
cb'' <- mk_SeatDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' SignalConnectAfter
type SeatDeviceRemovedCallback =
Gdk.Device.Device
-> IO ()
noSeatDeviceRemovedCallback :: Maybe SeatDeviceRemovedCallback
noSeatDeviceRemovedCallback = Nothing
type C_SeatDeviceRemovedCallback =
Ptr () ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SeatDeviceRemovedCallback :: C_SeatDeviceRemovedCallback -> IO (FunPtr C_SeatDeviceRemovedCallback)
genClosure_SeatDeviceRemoved :: MonadIO m => SeatDeviceRemovedCallback -> m (GClosure C_SeatDeviceRemovedCallback)
genClosure_SeatDeviceRemoved cb = liftIO $ do
let cb' = wrap_SeatDeviceRemovedCallback cb
mk_SeatDeviceRemovedCallback cb' >>= B.GClosure.newGClosure
wrap_SeatDeviceRemovedCallback ::
SeatDeviceRemovedCallback ->
C_SeatDeviceRemovedCallback
wrap_SeatDeviceRemovedCallback _cb _ device _ = do
device' <- (newObject Gdk.Device.Device) device
_cb device'
onSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> SeatDeviceRemovedCallback -> m SignalHandlerId
onSeatDeviceRemoved obj cb = liftIO $ do
let cb' = wrap_SeatDeviceRemovedCallback cb
cb'' <- mk_SeatDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' SignalConnectBefore
afterSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> SeatDeviceRemovedCallback -> m SignalHandlerId
afterSeatDeviceRemoved obj cb = liftIO $ do
let cb' = wrap_SeatDeviceRemovedCallback cb
cb'' <- mk_SeatDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' SignalConnectAfter
type SeatToolAddedCallback =
Gdk.DeviceTool.DeviceTool
-> IO ()
noSeatToolAddedCallback :: Maybe SeatToolAddedCallback
noSeatToolAddedCallback = Nothing
type C_SeatToolAddedCallback =
Ptr () ->
Ptr Gdk.DeviceTool.DeviceTool ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SeatToolAddedCallback :: C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
genClosure_SeatToolAdded :: MonadIO m => SeatToolAddedCallback -> m (GClosure C_SeatToolAddedCallback)
genClosure_SeatToolAdded cb = liftIO $ do
let cb' = wrap_SeatToolAddedCallback cb
mk_SeatToolAddedCallback cb' >>= B.GClosure.newGClosure
wrap_SeatToolAddedCallback ::
SeatToolAddedCallback ->
C_SeatToolAddedCallback
wrap_SeatToolAddedCallback _cb _ tool _ = do
tool' <- (newObject Gdk.DeviceTool.DeviceTool) tool
_cb tool'
onSeatToolAdded :: (IsSeat a, MonadIO m) => a -> SeatToolAddedCallback -> m SignalHandlerId
onSeatToolAdded obj cb = liftIO $ do
let cb' = wrap_SeatToolAddedCallback cb
cb'' <- mk_SeatToolAddedCallback cb'
connectSignalFunPtr obj "tool-added" cb'' SignalConnectBefore
afterSeatToolAdded :: (IsSeat a, MonadIO m) => a -> SeatToolAddedCallback -> m SignalHandlerId
afterSeatToolAdded obj cb = liftIO $ do
let cb' = wrap_SeatToolAddedCallback cb
cb'' <- mk_SeatToolAddedCallback cb'
connectSignalFunPtr obj "tool-added" cb'' SignalConnectAfter
type SeatToolRemovedCallback =
Gdk.DeviceTool.DeviceTool
-> IO ()
noSeatToolRemovedCallback :: Maybe SeatToolRemovedCallback
noSeatToolRemovedCallback = Nothing
type C_SeatToolRemovedCallback =
Ptr () ->
Ptr Gdk.DeviceTool.DeviceTool ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_SeatToolRemovedCallback :: C_SeatToolRemovedCallback -> IO (FunPtr C_SeatToolRemovedCallback)
genClosure_SeatToolRemoved :: MonadIO m => SeatToolRemovedCallback -> m (GClosure C_SeatToolRemovedCallback)
genClosure_SeatToolRemoved cb = liftIO $ do
let cb' = wrap_SeatToolRemovedCallback cb
mk_SeatToolRemovedCallback cb' >>= B.GClosure.newGClosure
wrap_SeatToolRemovedCallback ::
SeatToolRemovedCallback ->
C_SeatToolRemovedCallback
wrap_SeatToolRemovedCallback _cb _ tool _ = do
tool' <- (newObject Gdk.DeviceTool.DeviceTool) tool
_cb tool'
onSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> SeatToolRemovedCallback -> m SignalHandlerId
onSeatToolRemoved obj cb = liftIO $ do
let cb' = wrap_SeatToolRemovedCallback cb
cb'' <- mk_SeatToolRemovedCallback cb'
connectSignalFunPtr obj "tool-removed" cb'' SignalConnectBefore
afterSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> SeatToolRemovedCallback -> m SignalHandlerId
afterSeatToolRemoved obj cb = liftIO $ do
let cb' = wrap_SeatToolRemovedCallback cb
cb'' <- mk_SeatToolRemovedCallback cb'
connectSignalFunPtr obj "tool-removed" cb'' SignalConnectAfter
getSeatDisplay :: (MonadIO m, IsSeat o) => o -> m Gdk.Display.Display
getSeatDisplay obj = liftIO $ checkUnexpectedNothing "getSeatDisplay" $ B.Properties.getObjectPropertyObject obj "display" Gdk.Display.Display
constructSeatDisplay :: (IsSeat o, Gdk.Display.IsDisplay a) => a -> IO (GValueConstruct o)
constructSeatDisplay val = B.Properties.constructObjectPropertyObject "display" (Just val)
#if ENABLE_OVERLOADING
data SeatDisplayPropertyInfo
instance AttrInfo SeatDisplayPropertyInfo where
type AttrAllowedOps SeatDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint SeatDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrBaseTypeConstraint SeatDisplayPropertyInfo = IsSeat
type AttrGetType SeatDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel SeatDisplayPropertyInfo = "display"
type AttrOrigin SeatDisplayPropertyInfo = Seat
attrGet _ = getSeatDisplay
attrSet _ = undefined
attrConstruct _ = constructSeatDisplay
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Seat
type instance O.AttributeList Seat = SeatAttributeList
type SeatAttributeList = ('[ '("display", SeatDisplayPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
seatDisplay :: AttrLabelProxy "display"
seatDisplay = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
data SeatDeviceAddedSignalInfo
instance SignalInfo SeatDeviceAddedSignalInfo where
type HaskellCallbackType SeatDeviceAddedSignalInfo = SeatDeviceAddedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_SeatDeviceAddedCallback cb
cb'' <- mk_SeatDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' connectMode
data SeatDeviceRemovedSignalInfo
instance SignalInfo SeatDeviceRemovedSignalInfo where
type HaskellCallbackType SeatDeviceRemovedSignalInfo = SeatDeviceRemovedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_SeatDeviceRemovedCallback cb
cb'' <- mk_SeatDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' connectMode
data SeatToolAddedSignalInfo
instance SignalInfo SeatToolAddedSignalInfo where
type HaskellCallbackType SeatToolAddedSignalInfo = SeatToolAddedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_SeatToolAddedCallback cb
cb'' <- mk_SeatToolAddedCallback cb'
connectSignalFunPtr obj "tool-added" cb'' connectMode
data SeatToolRemovedSignalInfo
instance SignalInfo SeatToolRemovedSignalInfo where
type HaskellCallbackType SeatToolRemovedSignalInfo = SeatToolRemovedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_SeatToolRemovedCallback cb
cb'' <- mk_SeatToolRemovedCallback cb'
connectSignalFunPtr obj "tool-removed" cb'' connectMode
type instance O.SignalList Seat = SeatSignalList
type SeatSignalList = ('[ '("deviceAdded", SeatDeviceAddedSignalInfo), '("deviceRemoved", SeatDeviceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("toolAdded", SeatToolAddedSignalInfo), '("toolRemoved", SeatToolRemovedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_seat_get_capabilities" gdk_seat_get_capabilities ::
Ptr Seat ->
IO CUInt
seatGetCapabilities ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a) =>
a
-> m [Gdk.Flags.SeatCapabilities]
seatGetCapabilities seat = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
result <- gdk_seat_get_capabilities seat'
let result' = wordToGFlags result
touchManagedPtr seat
return result'
#if ENABLE_OVERLOADING
data SeatGetCapabilitiesMethodInfo
instance (signature ~ (m [Gdk.Flags.SeatCapabilities]), MonadIO m, IsSeat a) => O.MethodInfo SeatGetCapabilitiesMethodInfo a signature where
overloadedMethod _ = seatGetCapabilities
#endif
foreign import ccall "gdk_seat_get_display" gdk_seat_get_display ::
Ptr Seat ->
IO (Ptr Gdk.Display.Display)
seatGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a) =>
a
-> m Gdk.Display.Display
seatGetDisplay seat = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
result <- gdk_seat_get_display seat'
checkUnexpectedReturnNULL "seatGetDisplay" result
result' <- (newObject Gdk.Display.Display) result
touchManagedPtr seat
return result'
#if ENABLE_OVERLOADING
data SeatGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsSeat a) => O.MethodInfo SeatGetDisplayMethodInfo a signature where
overloadedMethod _ = seatGetDisplay
#endif
foreign import ccall "gdk_seat_get_keyboard" gdk_seat_get_keyboard ::
Ptr Seat ->
IO (Ptr Gdk.Device.Device)
seatGetKeyboard ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a) =>
a
-> m (Maybe Gdk.Device.Device)
seatGetKeyboard seat = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
result <- gdk_seat_get_keyboard seat'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gdk.Device.Device) result'
return result''
touchManagedPtr seat
return maybeResult
#if ENABLE_OVERLOADING
data SeatGetKeyboardMethodInfo
instance (signature ~ (m (Maybe Gdk.Device.Device)), MonadIO m, IsSeat a) => O.MethodInfo SeatGetKeyboardMethodInfo a signature where
overloadedMethod _ = seatGetKeyboard
#endif
foreign import ccall "gdk_seat_get_pointer" gdk_seat_get_pointer ::
Ptr Seat ->
IO (Ptr Gdk.Device.Device)
seatGetPointer ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a) =>
a
-> m (Maybe Gdk.Device.Device)
seatGetPointer seat = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
result <- gdk_seat_get_pointer seat'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gdk.Device.Device) result'
return result''
touchManagedPtr seat
return maybeResult
#if ENABLE_OVERLOADING
data SeatGetPointerMethodInfo
instance (signature ~ (m (Maybe Gdk.Device.Device)), MonadIO m, IsSeat a) => O.MethodInfo SeatGetPointerMethodInfo a signature where
overloadedMethod _ = seatGetPointer
#endif
foreign import ccall "gdk_seat_get_slaves" gdk_seat_get_slaves ::
Ptr Seat ->
CUInt ->
IO (Ptr (GList (Ptr Gdk.Device.Device)))
seatGetSlaves ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a) =>
a
-> [Gdk.Flags.SeatCapabilities]
-> m [Gdk.Device.Device]
seatGetSlaves seat capabilities = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
let capabilities' = gflagsToWord capabilities
result <- gdk_seat_get_slaves seat' capabilities'
result' <- unpackGList result
result'' <- mapM (newObject Gdk.Device.Device) result'
g_list_free result
touchManagedPtr seat
return result''
#if ENABLE_OVERLOADING
data SeatGetSlavesMethodInfo
instance (signature ~ ([Gdk.Flags.SeatCapabilities] -> m [Gdk.Device.Device]), MonadIO m, IsSeat a) => O.MethodInfo SeatGetSlavesMethodInfo a signature where
overloadedMethod _ = seatGetSlaves
#endif
foreign import ccall "gdk_seat_grab" gdk_seat_grab ::
Ptr Seat ->
Ptr Gdk.Window.Window ->
CUInt ->
CInt ->
Ptr Gdk.Cursor.Cursor ->
Ptr Gdk.Event.Event ->
FunPtr Gdk.Callbacks.C_SeatGrabPrepareFunc ->
Ptr () ->
IO CUInt
seatGrab ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a, Gdk.Window.IsWindow b, Gdk.Cursor.IsCursor c) =>
a
-> b
-> [Gdk.Flags.SeatCapabilities]
-> Bool
-> Maybe (c)
-> Maybe (Gdk.Event.Event)
-> Maybe (Gdk.Callbacks.SeatGrabPrepareFunc)
-> m Gdk.Enums.GrabStatus
seatGrab seat window capabilities ownerEvents cursor event prepareFunc = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
window' <- unsafeManagedPtrCastPtr window
let capabilities' = gflagsToWord capabilities
let ownerEvents' = (fromIntegral . fromEnum) ownerEvents
maybeCursor <- case cursor of
Nothing -> return nullPtr
Just jCursor -> do
jCursor' <- unsafeManagedPtrCastPtr jCursor
return jCursor'
maybeEvent <- case event of
Nothing -> return nullPtr
Just jEvent -> do
jEvent' <- unsafeManagedPtrGetPtr jEvent
return jEvent'
maybePrepareFunc <- case prepareFunc of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jPrepareFunc -> do
jPrepareFunc' <- Gdk.Callbacks.mk_SeatGrabPrepareFunc (Gdk.Callbacks.wrap_SeatGrabPrepareFunc Nothing (Gdk.Callbacks.drop_closures_SeatGrabPrepareFunc jPrepareFunc))
return jPrepareFunc'
let prepareFuncData = nullPtr
result <- gdk_seat_grab seat' window' capabilities' ownerEvents' maybeCursor maybeEvent maybePrepareFunc prepareFuncData
let result' = (toEnum . fromIntegral) result
safeFreeFunPtr $ castFunPtrToPtr maybePrepareFunc
touchManagedPtr seat
touchManagedPtr window
whenJust cursor touchManagedPtr
whenJust event touchManagedPtr
return result'
#if ENABLE_OVERLOADING
data SeatGrabMethodInfo
instance (signature ~ (b -> [Gdk.Flags.SeatCapabilities] -> Bool -> Maybe (c) -> Maybe (Gdk.Event.Event) -> Maybe (Gdk.Callbacks.SeatGrabPrepareFunc) -> m Gdk.Enums.GrabStatus), MonadIO m, IsSeat a, Gdk.Window.IsWindow b, Gdk.Cursor.IsCursor c) => O.MethodInfo SeatGrabMethodInfo a signature where
overloadedMethod _ = seatGrab
#endif
foreign import ccall "gdk_seat_ungrab" gdk_seat_ungrab ::
Ptr Seat ->
IO ()
seatUngrab ::
(B.CallStack.HasCallStack, MonadIO m, IsSeat a) =>
a
-> m ()
seatUngrab seat = liftIO $ do
seat' <- unsafeManagedPtrCastPtr seat
gdk_seat_ungrab seat'
touchManagedPtr seat
return ()
#if ENABLE_OVERLOADING
data SeatUngrabMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSeat a) => O.MethodInfo SeatUngrabMethodInfo a signature where
overloadedMethod _ = seatUngrab
#endif