{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Seat
(
Seat(..) ,
IsSeat ,
toSeat ,
#if defined(ENABLE_OVERLOADING)
ResolveSeatMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SeatGetCapabilitiesMethodInfo ,
#endif
seatGetCapabilities ,
#if defined(ENABLE_OVERLOADING)
SeatGetDisplayMethodInfo ,
#endif
seatGetDisplay ,
#if defined(ENABLE_OVERLOADING)
SeatGetKeyboardMethodInfo ,
#endif
seatGetKeyboard ,
#if defined(ENABLE_OVERLOADING)
SeatGetPointerMethodInfo ,
#endif
seatGetPointer ,
#if defined(ENABLE_OVERLOADING)
SeatGetSlavesMethodInfo ,
#endif
seatGetSlaves ,
#if defined(ENABLE_OVERLOADING)
SeatGrabMethodInfo ,
#endif
seatGrab ,
#if defined(ENABLE_OVERLOADING)
SeatUngrabMethodInfo ,
#endif
seatUngrab ,
#if defined(ENABLE_OVERLOADING)
SeatDisplayPropertyInfo ,
#endif
constructSeatDisplay ,
getSeatDisplay ,
#if defined(ENABLE_OVERLOADING)
seatDisplay ,
#endif
C_SeatDeviceAddedCallback ,
SeatDeviceAddedCallback ,
#if defined(ENABLE_OVERLOADING)
SeatDeviceAddedSignalInfo ,
#endif
afterSeatDeviceAdded ,
genClosure_SeatDeviceAdded ,
mk_SeatDeviceAddedCallback ,
noSeatDeviceAddedCallback ,
onSeatDeviceAdded ,
wrap_SeatDeviceAddedCallback ,
C_SeatDeviceRemovedCallback ,
SeatDeviceRemovedCallback ,
#if defined(ENABLE_OVERLOADING)
SeatDeviceRemovedSignalInfo ,
#endif
afterSeatDeviceRemoved ,
genClosure_SeatDeviceRemoved ,
mk_SeatDeviceRemovedCallback ,
noSeatDeviceRemovedCallback ,
onSeatDeviceRemoved ,
wrap_SeatDeviceRemovedCallback ,
C_SeatToolAddedCallback ,
SeatToolAddedCallback ,
#if defined(ENABLE_OVERLOADING)
SeatToolAddedSignalInfo ,
#endif
afterSeatToolAdded ,
genClosure_SeatToolAdded ,
mk_SeatToolAddedCallback ,
noSeatToolAddedCallback ,
onSeatToolAdded ,
wrap_SeatToolAddedCallback ,
C_SeatToolRemovedCallback ,
SeatToolRemovedCallback ,
#if defined(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.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 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 (SP.ManagedPtr Seat)
deriving (Seat -> Seat -> Bool
(Seat -> Seat -> Bool) -> (Seat -> Seat -> Bool) -> Eq Seat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Seat -> Seat -> Bool
$c/= :: Seat -> Seat -> Bool
== :: Seat -> Seat -> Bool
$c== :: Seat -> Seat -> Bool
Eq)
instance SP.ManagedPtrNewtype Seat where
toManagedPtr :: Seat -> ManagedPtr Seat
toManagedPtr (Seat ManagedPtr Seat
p) = ManagedPtr Seat
p
foreign import ccall "gdk_seat_get_type"
c_gdk_seat_get_type :: IO B.Types.GType
instance B.Types.TypedObject Seat where
glibType :: IO GType
glibType = IO GType
c_gdk_seat_get_type
instance B.Types.GObject Seat
instance B.GValue.IsGValue Seat where
toGValue :: Seat -> IO GValue
toGValue Seat
o = do
GType
gtype <- IO GType
c_gdk_seat_get_type
Seat -> (Ptr Seat -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Seat
o (GType -> (GValue -> Ptr Seat -> IO ()) -> Ptr Seat -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Seat -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Seat
fromGValue GValue
gv = do
Ptr Seat
ptr <- GValue -> IO (Ptr Seat)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Seat)
(ManagedPtr Seat -> Seat) -> Ptr Seat -> IO Seat
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Seat -> Seat
Seat Ptr Seat
ptr
class (SP.GObject o, O.IsDescendantOf Seat o) => IsSeat o
instance (SP.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 :: o -> m Seat
toSeat = IO Seat -> m Seat
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Seat -> m Seat) -> (o -> IO Seat) -> o -> m Seat
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Seat -> Seat) -> o -> IO Seat
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Seat -> Seat
Seat
#if defined(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 @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type SeatDeviceAddedCallback =
Gdk.Device.Device
-> IO ()
noSeatDeviceAddedCallback :: Maybe SeatDeviceAddedCallback
noSeatDeviceAddedCallback :: Maybe SeatDeviceAddedCallback
noSeatDeviceAddedCallback = Maybe SeatDeviceAddedCallback
forall a. Maybe a
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 :: SeatDeviceAddedCallback -> m (GClosure C_SeatDeviceAddedCallback)
genClosure_SeatDeviceAdded SeatDeviceAddedCallback
cb = IO (GClosure C_SeatDeviceAddedCallback)
-> m (GClosure C_SeatDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SeatDeviceAddedCallback)
-> m (GClosure C_SeatDeviceAddedCallback))
-> IO (GClosure C_SeatDeviceAddedCallback)
-> m (GClosure C_SeatDeviceAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SeatDeviceAddedCallback
cb' = SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceAddedCallback SeatDeviceAddedCallback
cb
C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
mk_SeatDeviceAddedCallback C_SeatDeviceAddedCallback
cb' IO (FunPtr C_SeatDeviceAddedCallback)
-> (FunPtr C_SeatDeviceAddedCallback
-> IO (GClosure C_SeatDeviceAddedCallback))
-> IO (GClosure C_SeatDeviceAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SeatDeviceAddedCallback
-> IO (GClosure C_SeatDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SeatDeviceAddedCallback ::
SeatDeviceAddedCallback ->
C_SeatDeviceAddedCallback
wrap_SeatDeviceAddedCallback :: SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceAddedCallback SeatDeviceAddedCallback
_cb Ptr ()
_ Ptr Device
device Ptr ()
_ = do
Device
device' <- ((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
Gdk.Device.Device) Ptr Device
device
SeatDeviceAddedCallback
_cb Device
device'
onSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> SeatDeviceAddedCallback -> m SignalHandlerId
onSeatDeviceAdded :: a -> SeatDeviceAddedCallback -> m SignalHandlerId
onSeatDeviceAdded a
obj SeatDeviceAddedCallback
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_SeatDeviceAddedCallback
cb' = SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceAddedCallback SeatDeviceAddedCallback
cb
FunPtr C_SeatDeviceAddedCallback
cb'' <- C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
mk_SeatDeviceAddedCallback C_SeatDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatDeviceAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-added" FunPtr C_SeatDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSeatDeviceAdded :: (IsSeat a, MonadIO m) => a -> SeatDeviceAddedCallback -> m SignalHandlerId
afterSeatDeviceAdded :: a -> SeatDeviceAddedCallback -> m SignalHandlerId
afterSeatDeviceAdded a
obj SeatDeviceAddedCallback
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_SeatDeviceAddedCallback
cb' = SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceAddedCallback SeatDeviceAddedCallback
cb
FunPtr C_SeatDeviceAddedCallback
cb'' <- C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
mk_SeatDeviceAddedCallback C_SeatDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatDeviceAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-added" FunPtr C_SeatDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SeatDeviceAddedSignalInfo
instance SignalInfo SeatDeviceAddedSignalInfo where
type HaskellCallbackType SeatDeviceAddedSignalInfo = SeatDeviceAddedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SeatDeviceAddedCallback cb
cb'' <- mk_SeatDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' connectMode detail
#endif
type SeatDeviceRemovedCallback =
Gdk.Device.Device
-> IO ()
noSeatDeviceRemovedCallback :: Maybe SeatDeviceRemovedCallback
noSeatDeviceRemovedCallback :: Maybe SeatDeviceAddedCallback
noSeatDeviceRemovedCallback = Maybe SeatDeviceAddedCallback
forall a. Maybe a
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 :: SeatDeviceAddedCallback -> m (GClosure C_SeatDeviceAddedCallback)
genClosure_SeatDeviceRemoved SeatDeviceAddedCallback
cb = IO (GClosure C_SeatDeviceAddedCallback)
-> m (GClosure C_SeatDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SeatDeviceAddedCallback)
-> m (GClosure C_SeatDeviceAddedCallback))
-> IO (GClosure C_SeatDeviceAddedCallback)
-> m (GClosure C_SeatDeviceAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SeatDeviceAddedCallback
cb' = SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceRemovedCallback SeatDeviceAddedCallback
cb
C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
mk_SeatDeviceRemovedCallback C_SeatDeviceAddedCallback
cb' IO (FunPtr C_SeatDeviceAddedCallback)
-> (FunPtr C_SeatDeviceAddedCallback
-> IO (GClosure C_SeatDeviceAddedCallback))
-> IO (GClosure C_SeatDeviceAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SeatDeviceAddedCallback
-> IO (GClosure C_SeatDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SeatDeviceRemovedCallback ::
SeatDeviceRemovedCallback ->
C_SeatDeviceRemovedCallback
wrap_SeatDeviceRemovedCallback :: SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceRemovedCallback SeatDeviceAddedCallback
_cb Ptr ()
_ Ptr Device
device Ptr ()
_ = do
Device
device' <- ((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
Gdk.Device.Device) Ptr Device
device
SeatDeviceAddedCallback
_cb Device
device'
onSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> SeatDeviceRemovedCallback -> m SignalHandlerId
onSeatDeviceRemoved :: a -> SeatDeviceAddedCallback -> m SignalHandlerId
onSeatDeviceRemoved a
obj SeatDeviceAddedCallback
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_SeatDeviceAddedCallback
cb' = SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceRemovedCallback SeatDeviceAddedCallback
cb
FunPtr C_SeatDeviceAddedCallback
cb'' <- C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
mk_SeatDeviceRemovedCallback C_SeatDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatDeviceAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-removed" FunPtr C_SeatDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSeatDeviceRemoved :: (IsSeat a, MonadIO m) => a -> SeatDeviceRemovedCallback -> m SignalHandlerId
afterSeatDeviceRemoved :: a -> SeatDeviceAddedCallback -> m SignalHandlerId
afterSeatDeviceRemoved a
obj SeatDeviceAddedCallback
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_SeatDeviceAddedCallback
cb' = SeatDeviceAddedCallback -> C_SeatDeviceAddedCallback
wrap_SeatDeviceRemovedCallback SeatDeviceAddedCallback
cb
FunPtr C_SeatDeviceAddedCallback
cb'' <- C_SeatDeviceAddedCallback -> IO (FunPtr C_SeatDeviceAddedCallback)
mk_SeatDeviceRemovedCallback C_SeatDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatDeviceAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-removed" FunPtr C_SeatDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SeatDeviceRemovedSignalInfo
instance SignalInfo SeatDeviceRemovedSignalInfo where
type HaskellCallbackType SeatDeviceRemovedSignalInfo = SeatDeviceRemovedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SeatDeviceRemovedCallback cb
cb'' <- mk_SeatDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' connectMode detail
#endif
type SeatToolAddedCallback =
Gdk.DeviceTool.DeviceTool
-> IO ()
noSeatToolAddedCallback :: Maybe SeatToolAddedCallback
noSeatToolAddedCallback :: Maybe SeatToolAddedCallback
noSeatToolAddedCallback = Maybe SeatToolAddedCallback
forall a. Maybe a
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 :: SeatToolAddedCallback -> m (GClosure C_SeatToolAddedCallback)
genClosure_SeatToolAdded SeatToolAddedCallback
cb = IO (GClosure C_SeatToolAddedCallback)
-> m (GClosure C_SeatToolAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SeatToolAddedCallback)
-> m (GClosure C_SeatToolAddedCallback))
-> IO (GClosure C_SeatToolAddedCallback)
-> m (GClosure C_SeatToolAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SeatToolAddedCallback
cb' = SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolAddedCallback SeatToolAddedCallback
cb
C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
mk_SeatToolAddedCallback C_SeatToolAddedCallback
cb' IO (FunPtr C_SeatToolAddedCallback)
-> (FunPtr C_SeatToolAddedCallback
-> IO (GClosure C_SeatToolAddedCallback))
-> IO (GClosure C_SeatToolAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SeatToolAddedCallback
-> IO (GClosure C_SeatToolAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SeatToolAddedCallback ::
SeatToolAddedCallback ->
C_SeatToolAddedCallback
wrap_SeatToolAddedCallback :: SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolAddedCallback SeatToolAddedCallback
_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
SeatToolAddedCallback
_cb DeviceTool
tool'
onSeatToolAdded :: (IsSeat a, MonadIO m) => a -> SeatToolAddedCallback -> m SignalHandlerId
onSeatToolAdded :: a -> SeatToolAddedCallback -> m SignalHandlerId
onSeatToolAdded a
obj SeatToolAddedCallback
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_SeatToolAddedCallback
cb' = SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolAddedCallback SeatToolAddedCallback
cb
FunPtr C_SeatToolAddedCallback
cb'' <- C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
mk_SeatToolAddedCallback C_SeatToolAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatToolAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tool-added" FunPtr C_SeatToolAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSeatToolAdded :: (IsSeat a, MonadIO m) => a -> SeatToolAddedCallback -> m SignalHandlerId
afterSeatToolAdded :: a -> SeatToolAddedCallback -> m SignalHandlerId
afterSeatToolAdded a
obj SeatToolAddedCallback
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_SeatToolAddedCallback
cb' = SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolAddedCallback SeatToolAddedCallback
cb
FunPtr C_SeatToolAddedCallback
cb'' <- C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
mk_SeatToolAddedCallback C_SeatToolAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatToolAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tool-added" FunPtr C_SeatToolAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SeatToolAddedSignalInfo
instance SignalInfo SeatToolAddedSignalInfo where
type HaskellCallbackType SeatToolAddedSignalInfo = SeatToolAddedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SeatToolAddedCallback cb
cb'' <- mk_SeatToolAddedCallback cb'
connectSignalFunPtr obj "tool-added" cb'' connectMode detail
#endif
type SeatToolRemovedCallback =
Gdk.DeviceTool.DeviceTool
-> IO ()
noSeatToolRemovedCallback :: Maybe SeatToolRemovedCallback
noSeatToolRemovedCallback :: Maybe SeatToolAddedCallback
noSeatToolRemovedCallback = Maybe SeatToolAddedCallback
forall a. Maybe a
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 :: SeatToolAddedCallback -> m (GClosure C_SeatToolAddedCallback)
genClosure_SeatToolRemoved SeatToolAddedCallback
cb = IO (GClosure C_SeatToolAddedCallback)
-> m (GClosure C_SeatToolAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SeatToolAddedCallback)
-> m (GClosure C_SeatToolAddedCallback))
-> IO (GClosure C_SeatToolAddedCallback)
-> m (GClosure C_SeatToolAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_SeatToolAddedCallback
cb' = SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolRemovedCallback SeatToolAddedCallback
cb
C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
mk_SeatToolRemovedCallback C_SeatToolAddedCallback
cb' IO (FunPtr C_SeatToolAddedCallback)
-> (FunPtr C_SeatToolAddedCallback
-> IO (GClosure C_SeatToolAddedCallback))
-> IO (GClosure C_SeatToolAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SeatToolAddedCallback
-> IO (GClosure C_SeatToolAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SeatToolRemovedCallback ::
SeatToolRemovedCallback ->
C_SeatToolRemovedCallback
wrap_SeatToolRemovedCallback :: SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolRemovedCallback SeatToolAddedCallback
_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
SeatToolAddedCallback
_cb DeviceTool
tool'
onSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> SeatToolRemovedCallback -> m SignalHandlerId
onSeatToolRemoved :: a -> SeatToolAddedCallback -> m SignalHandlerId
onSeatToolRemoved a
obj SeatToolAddedCallback
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_SeatToolAddedCallback
cb' = SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolRemovedCallback SeatToolAddedCallback
cb
FunPtr C_SeatToolAddedCallback
cb'' <- C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
mk_SeatToolRemovedCallback C_SeatToolAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatToolAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tool-removed" FunPtr C_SeatToolAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterSeatToolRemoved :: (IsSeat a, MonadIO m) => a -> SeatToolRemovedCallback -> m SignalHandlerId
afterSeatToolRemoved :: a -> SeatToolAddedCallback -> m SignalHandlerId
afterSeatToolRemoved a
obj SeatToolAddedCallback
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_SeatToolAddedCallback
cb' = SeatToolAddedCallback -> C_SeatToolAddedCallback
wrap_SeatToolRemovedCallback SeatToolAddedCallback
cb
FunPtr C_SeatToolAddedCallback
cb'' <- C_SeatToolAddedCallback -> IO (FunPtr C_SeatToolAddedCallback)
mk_SeatToolRemovedCallback C_SeatToolAddedCallback
cb'
a
-> Text
-> FunPtr C_SeatToolAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"tool-removed" FunPtr C_SeatToolAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data SeatToolRemovedSignalInfo
instance SignalInfo SeatToolRemovedSignalInfo where
type HaskellCallbackType SeatToolRemovedSignalInfo = SeatToolRemovedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SeatToolRemovedCallback cb
cb'' <- mk_SeatToolRemovedCallback cb'
connectSignalFunPtr obj "tool-removed" cb'' connectMode detail
#endif
getSeatDisplay :: (MonadIO m, IsSeat o) => o -> m Gdk.Display.Display
getSeatDisplay :: o -> m Display
getSeatDisplay 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
"getSeatDisplay" (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
constructSeatDisplay :: (IsSeat o, MIO.MonadIO m, Gdk.Display.IsDisplay a) => a -> m (GValueConstruct o)
constructSeatDisplay :: a -> m (GValueConstruct o)
constructSeatDisplay 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 SeatDisplayPropertyInfo
instance AttrInfo SeatDisplayPropertyInfo where
type AttrAllowedOps SeatDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SeatDisplayPropertyInfo = IsSeat
type AttrSetTypeConstraint SeatDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferTypeConstraint SeatDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferType SeatDisplayPropertyInfo = Gdk.Display.Display
type AttrGetType SeatDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel SeatDisplayPropertyInfo = "display"
type AttrOrigin SeatDisplayPropertyInfo = Seat
attrGet = getSeatDisplay
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Display.Display v
attrConstruct = constructSeatDisplay
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Seat
type instance O.AttributeList Seat = SeatAttributeList
type SeatAttributeList = ('[ '("display", SeatDisplayPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
seatDisplay :: AttrLabelProxy "display"
seatDisplay = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
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 :: a -> m [SeatCapabilities]
seatGetCapabilities a
seat = IO [SeatCapabilities] -> m [SeatCapabilities]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [SeatCapabilities] -> m [SeatCapabilities])
-> IO [SeatCapabilities] -> m [SeatCapabilities]
forall a b. (a -> b) -> a -> b
$ do
Ptr Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
CUInt
result <- Ptr Seat -> IO CUInt
gdk_seat_get_capabilities Ptr Seat
seat'
let result' :: [SeatCapabilities]
result' = CUInt -> [SeatCapabilities]
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
seat
[SeatCapabilities] -> IO [SeatCapabilities]
forall (m :: * -> *) a. Monad m => a -> m a
return [SeatCapabilities]
result'
#if defined(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 :: a -> m Display
seatGetDisplay a
seat = 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 Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
Ptr Display
result <- Ptr Seat -> IO (Ptr Display)
gdk_seat_get_display Ptr Seat
seat'
Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"seatGetDisplay" 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
seat
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'
#if defined(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 :: a -> m (Maybe Device)
seatGetKeyboard a
seat = 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 Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
Ptr Device
result <- Ptr Seat -> IO (Ptr Device)
gdk_seat_get_keyboard Ptr Seat
seat'
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
Gdk.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
seat
Maybe Device -> IO (Maybe Device)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Device
maybeResult
#if defined(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 :: a -> m (Maybe Device)
seatGetPointer a
seat = 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 Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
Ptr Device
result <- Ptr Seat -> IO (Ptr Device)
gdk_seat_get_pointer Ptr Seat
seat'
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
Gdk.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
seat
Maybe Device -> IO (Maybe Device)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Device
maybeResult
#if defined(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 :: a -> [SeatCapabilities] -> m [Device]
seatGetSlaves a
seat [SeatCapabilities]
capabilities = 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 Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
let capabilities' :: CUInt
capabilities' = [SeatCapabilities] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SeatCapabilities]
capabilities
Ptr (GList (Ptr Device))
result <- Ptr Seat -> CUInt -> IO (Ptr (GList (Ptr Device)))
gdk_seat_get_slaves Ptr Seat
seat' CUInt
capabilities'
[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
Gdk.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
seat
[Device] -> IO [Device]
forall (m :: * -> *) a. Monad m => a -> m a
return [Device]
result''
#if defined(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 :: a
-> b
-> [SeatCapabilities]
-> Bool
-> Maybe c
-> Maybe Event
-> Maybe SeatGrabPrepareFunc
-> m GrabStatus
seatGrab a
seat b
window [SeatCapabilities]
capabilities Bool
ownerEvents Maybe c
cursor Maybe Event
event Maybe SeatGrabPrepareFunc
prepareFunc = IO GrabStatus -> m GrabStatus
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GrabStatus -> m GrabStatus) -> IO GrabStatus -> m GrabStatus
forall a b. (a -> b) -> a -> b
$ do
Ptr Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
Ptr Window
window' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
window
let capabilities' :: CUInt
capabilities' = [SeatCapabilities] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SeatCapabilities]
capabilities
let ownerEvents' :: CInt
ownerEvents' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
ownerEvents
Ptr Cursor
maybeCursor <- case Maybe c
cursor of
Maybe c
Nothing -> Ptr Cursor -> IO (Ptr Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
forall a. Ptr a
nullPtr
Just c
jCursor -> do
Ptr Cursor
jCursor' <- c -> IO (Ptr Cursor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCursor
Ptr Cursor -> IO (Ptr Cursor)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cursor
jCursor'
Ptr Event
maybeEvent <- case Maybe Event
event of
Maybe Event
Nothing -> Ptr Event -> IO (Ptr Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Event
forall a. Ptr a
nullPtr
Just Event
jEvent -> do
Ptr Event
jEvent' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
jEvent
Ptr Event -> IO (Ptr Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Event
jEvent'
FunPtr C_SeatGrabPrepareFunc
maybePrepareFunc <- case Maybe SeatGrabPrepareFunc
prepareFunc of
Maybe SeatGrabPrepareFunc
Nothing -> FunPtr C_SeatGrabPrepareFunc -> IO (FunPtr C_SeatGrabPrepareFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_SeatGrabPrepareFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just SeatGrabPrepareFunc
jPrepareFunc -> do
FunPtr C_SeatGrabPrepareFunc
jPrepareFunc' <- C_SeatGrabPrepareFunc -> IO (FunPtr C_SeatGrabPrepareFunc)
Gdk.Callbacks.mk_SeatGrabPrepareFunc (Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
-> SeatGrabPrepareFunc_WithClosures -> C_SeatGrabPrepareFunc
Gdk.Callbacks.wrap_SeatGrabPrepareFunc Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
forall a. Maybe a
Nothing (SeatGrabPrepareFunc -> SeatGrabPrepareFunc_WithClosures
Gdk.Callbacks.drop_closures_SeatGrabPrepareFunc SeatGrabPrepareFunc
jPrepareFunc))
FunPtr C_SeatGrabPrepareFunc -> IO (FunPtr C_SeatGrabPrepareFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_SeatGrabPrepareFunc
jPrepareFunc'
let prepareFuncData :: Ptr a
prepareFuncData = Ptr a
forall a. Ptr a
nullPtr
CUInt
result <- Ptr Seat
-> Ptr Window
-> CUInt
-> CInt
-> Ptr Cursor
-> Ptr Event
-> FunPtr C_SeatGrabPrepareFunc
-> Ptr ()
-> IO CUInt
gdk_seat_grab Ptr Seat
seat' Ptr Window
window' CUInt
capabilities' CInt
ownerEvents' Ptr Cursor
maybeCursor Ptr Event
maybeEvent FunPtr C_SeatGrabPrepareFunc
maybePrepareFunc Ptr ()
forall a. Ptr a
prepareFuncData
let result' :: GrabStatus
result' = (Int -> GrabStatus
forall a. Enum a => Int -> a
toEnum (Int -> GrabStatus) -> (CUInt -> Int) -> CUInt -> GrabStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_SeatGrabPrepareFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_SeatGrabPrepareFunc
maybePrepareFunc
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
seat
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
window
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cursor c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Event -> (Event -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Event
event Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
GrabStatus -> IO GrabStatus
forall (m :: * -> *) a. Monad m => a -> m a
return GrabStatus
result'
#if defined(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 :: a -> m ()
seatUngrab a
seat = 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 Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
Ptr Seat -> IO ()
gdk_seat_ungrab Ptr Seat
seat'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
seat
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SeatUngrabMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSeat a) => O.MethodInfo SeatUngrabMethodInfo a signature where
overloadedMethod = seatUngrab
#endif