{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.DeviceManager
(
DeviceManager(..) ,
IsDeviceManager ,
toDeviceManager ,
#if defined(ENABLE_OVERLOADING)
ResolveDeviceManagerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DeviceManagerGetClientPointerMethodInfo ,
#endif
deviceManagerGetClientPointer ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerGetDisplayMethodInfo ,
#endif
deviceManagerGetDisplay ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerListDevicesMethodInfo ,
#endif
deviceManagerListDevices ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDisplayPropertyInfo ,
#endif
constructDeviceManagerDisplay ,
#if defined(ENABLE_OVERLOADING)
deviceManagerDisplay ,
#endif
getDeviceManagerDisplay ,
C_DeviceManagerDeviceAddedCallback ,
DeviceManagerDeviceAddedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDeviceAddedSignalInfo ,
#endif
afterDeviceManagerDeviceAdded ,
genClosure_DeviceManagerDeviceAdded ,
mk_DeviceManagerDeviceAddedCallback ,
noDeviceManagerDeviceAddedCallback ,
onDeviceManagerDeviceAdded ,
wrap_DeviceManagerDeviceAddedCallback ,
C_DeviceManagerDeviceChangedCallback ,
DeviceManagerDeviceChangedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDeviceChangedSignalInfo ,
#endif
afterDeviceManagerDeviceChanged ,
genClosure_DeviceManagerDeviceChanged ,
mk_DeviceManagerDeviceChangedCallback ,
noDeviceManagerDeviceChangedCallback ,
onDeviceManagerDeviceChanged ,
wrap_DeviceManagerDeviceChangedCallback ,
C_DeviceManagerDeviceRemovedCallback ,
DeviceManagerDeviceRemovedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDeviceRemovedSignalInfo ,
#endif
afterDeviceManagerDeviceRemoved ,
genClosure_DeviceManagerDeviceRemoved ,
mk_DeviceManagerDeviceRemovedCallback ,
noDeviceManagerDeviceRemovedCallback ,
onDeviceManagerDeviceRemoved ,
wrap_DeviceManagerDeviceRemovedCallback ,
) 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.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
newtype DeviceManager = DeviceManager (SP.ManagedPtr DeviceManager)
deriving (DeviceManager -> DeviceManager -> Bool
(DeviceManager -> DeviceManager -> Bool)
-> (DeviceManager -> DeviceManager -> Bool) -> Eq DeviceManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceManager -> DeviceManager -> Bool
$c/= :: DeviceManager -> DeviceManager -> Bool
== :: DeviceManager -> DeviceManager -> Bool
$c== :: DeviceManager -> DeviceManager -> Bool
Eq)
instance SP.ManagedPtrNewtype DeviceManager where
toManagedPtr :: DeviceManager -> ManagedPtr DeviceManager
toManagedPtr (DeviceManager ManagedPtr DeviceManager
p) = ManagedPtr DeviceManager
p
foreign import ccall "gdk_device_manager_get_type"
c_gdk_device_manager_get_type :: IO B.Types.GType
instance B.Types.TypedObject DeviceManager where
glibType :: IO GType
glibType = IO GType
c_gdk_device_manager_get_type
instance B.Types.GObject DeviceManager
instance B.GValue.IsGValue DeviceManager where
toGValue :: DeviceManager -> IO GValue
toGValue DeviceManager
o = do
GType
gtype <- IO GType
c_gdk_device_manager_get_type
DeviceManager -> (Ptr DeviceManager -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DeviceManager
o (GType
-> (GValue -> Ptr DeviceManager -> IO ())
-> Ptr DeviceManager
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DeviceManager -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DeviceManager
fromGValue GValue
gv = do
Ptr DeviceManager
ptr <- GValue -> IO (Ptr DeviceManager)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DeviceManager)
(ManagedPtr DeviceManager -> DeviceManager)
-> Ptr DeviceManager -> IO DeviceManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DeviceManager -> DeviceManager
DeviceManager Ptr DeviceManager
ptr
class (SP.GObject o, O.IsDescendantOf DeviceManager o) => IsDeviceManager o
instance (SP.GObject o, O.IsDescendantOf DeviceManager o) => IsDeviceManager o
instance O.HasParentTypes DeviceManager
type instance O.ParentTypes DeviceManager = '[GObject.Object.Object]
toDeviceManager :: (MonadIO m, IsDeviceManager o) => o -> m DeviceManager
toDeviceManager :: o -> m DeviceManager
toDeviceManager = IO DeviceManager -> m DeviceManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DeviceManager -> m DeviceManager)
-> (o -> IO DeviceManager) -> o -> m DeviceManager
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DeviceManager -> DeviceManager)
-> o -> IO DeviceManager
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DeviceManager -> DeviceManager
DeviceManager
#if defined(ENABLE_OVERLOADING)
type family ResolveDeviceManagerMethod (t :: Symbol) (o :: *) :: * where
ResolveDeviceManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDeviceManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDeviceManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDeviceManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDeviceManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDeviceManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDeviceManagerMethod "listDevices" o = DeviceManagerListDevicesMethodInfo
ResolveDeviceManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDeviceManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDeviceManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDeviceManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDeviceManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDeviceManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDeviceManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDeviceManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDeviceManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDeviceManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDeviceManagerMethod "getClientPointer" o = DeviceManagerGetClientPointerMethodInfo
ResolveDeviceManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDeviceManagerMethod "getDisplay" o = DeviceManagerGetDisplayMethodInfo
ResolveDeviceManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDeviceManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDeviceManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDeviceManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDeviceManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDeviceManagerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDeviceManagerMethod t DeviceManager, O.MethodInfo info DeviceManager p) => OL.IsLabel t (DeviceManager -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DeviceManagerDeviceAddedCallback =
Gdk.Device.Device
-> IO ()
noDeviceManagerDeviceAddedCallback :: Maybe DeviceManagerDeviceAddedCallback
noDeviceManagerDeviceAddedCallback :: Maybe DeviceManagerDeviceAddedCallback
noDeviceManagerDeviceAddedCallback = Maybe DeviceManagerDeviceAddedCallback
forall a. Maybe a
Nothing
type C_DeviceManagerDeviceAddedCallback =
Ptr () ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceManagerDeviceAddedCallback :: C_DeviceManagerDeviceAddedCallback -> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
genClosure_DeviceManagerDeviceAdded :: MonadIO m => DeviceManagerDeviceAddedCallback -> m (GClosure C_DeviceManagerDeviceAddedCallback)
genClosure_DeviceManagerDeviceAdded :: DeviceManagerDeviceAddedCallback
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
genClosure_DeviceManagerDeviceAdded DeviceManagerDeviceAddedCallback
cb = IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback))
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback DeviceManagerDeviceAddedCallback
cb
C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceAddedCallback C_DeviceManagerDeviceAddedCallback
cb' IO (FunPtr C_DeviceManagerDeviceAddedCallback)
-> (FunPtr C_DeviceManagerDeviceAddedCallback
-> IO (GClosure C_DeviceManagerDeviceAddedCallback))
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DeviceManagerDeviceAddedCallback
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DeviceManagerDeviceAddedCallback ::
DeviceManagerDeviceAddedCallback ->
C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback :: DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback DeviceManagerDeviceAddedCallback
_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
DeviceManagerDeviceAddedCallback
_cb Device
device'
onDeviceManagerDeviceAdded :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
onDeviceManagerDeviceAdded :: a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
onDeviceManagerDeviceAdded a
obj DeviceManagerDeviceAddedCallback
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_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback DeviceManagerDeviceAddedCallback
cb
FunPtr C_DeviceManagerDeviceAddedCallback
cb'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceAddedCallback C_DeviceManagerDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_DeviceManagerDeviceAddedCallback
-> 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_DeviceManagerDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDeviceManagerDeviceAdded :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
afterDeviceManagerDeviceAdded :: a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
afterDeviceManagerDeviceAdded a
obj DeviceManagerDeviceAddedCallback
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_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback DeviceManagerDeviceAddedCallback
cb
FunPtr C_DeviceManagerDeviceAddedCallback
cb'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceAddedCallback C_DeviceManagerDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_DeviceManagerDeviceAddedCallback
-> 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_DeviceManagerDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DeviceManagerDeviceAddedSignalInfo
instance SignalInfo DeviceManagerDeviceAddedSignalInfo where
type HaskellCallbackType DeviceManagerDeviceAddedSignalInfo = DeviceManagerDeviceAddedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DeviceManagerDeviceAddedCallback cb
cb'' <- mk_DeviceManagerDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' connectMode detail
#endif
type DeviceManagerDeviceChangedCallback =
Gdk.Device.Device
-> IO ()
noDeviceManagerDeviceChangedCallback :: Maybe DeviceManagerDeviceChangedCallback
noDeviceManagerDeviceChangedCallback :: Maybe DeviceManagerDeviceAddedCallback
noDeviceManagerDeviceChangedCallback = Maybe DeviceManagerDeviceAddedCallback
forall a. Maybe a
Nothing
type C_DeviceManagerDeviceChangedCallback =
Ptr () ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceManagerDeviceChangedCallback :: C_DeviceManagerDeviceChangedCallback -> IO (FunPtr C_DeviceManagerDeviceChangedCallback)
genClosure_DeviceManagerDeviceChanged :: MonadIO m => DeviceManagerDeviceChangedCallback -> m (GClosure C_DeviceManagerDeviceChangedCallback)
genClosure_DeviceManagerDeviceChanged :: DeviceManagerDeviceAddedCallback
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
genClosure_DeviceManagerDeviceChanged DeviceManagerDeviceAddedCallback
cb = IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback))
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback DeviceManagerDeviceAddedCallback
cb
C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceChangedCallback C_DeviceManagerDeviceAddedCallback
cb' IO (FunPtr C_DeviceManagerDeviceAddedCallback)
-> (FunPtr C_DeviceManagerDeviceAddedCallback
-> IO (GClosure C_DeviceManagerDeviceAddedCallback))
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DeviceManagerDeviceAddedCallback
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DeviceManagerDeviceChangedCallback ::
DeviceManagerDeviceChangedCallback ->
C_DeviceManagerDeviceChangedCallback
wrap_DeviceManagerDeviceChangedCallback :: DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback DeviceManagerDeviceAddedCallback
_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
DeviceManagerDeviceAddedCallback
_cb Device
device'
onDeviceManagerDeviceChanged :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceChangedCallback -> m SignalHandlerId
onDeviceManagerDeviceChanged :: a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
onDeviceManagerDeviceChanged a
obj DeviceManagerDeviceAddedCallback
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_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback DeviceManagerDeviceAddedCallback
cb
FunPtr C_DeviceManagerDeviceAddedCallback
cb'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceChangedCallback C_DeviceManagerDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_DeviceManagerDeviceAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-changed" FunPtr C_DeviceManagerDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDeviceManagerDeviceChanged :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceChangedCallback -> m SignalHandlerId
afterDeviceManagerDeviceChanged :: a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
afterDeviceManagerDeviceChanged a
obj DeviceManagerDeviceAddedCallback
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_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback DeviceManagerDeviceAddedCallback
cb
FunPtr C_DeviceManagerDeviceAddedCallback
cb'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceChangedCallback C_DeviceManagerDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_DeviceManagerDeviceAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-changed" FunPtr C_DeviceManagerDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DeviceManagerDeviceChangedSignalInfo
instance SignalInfo DeviceManagerDeviceChangedSignalInfo where
type HaskellCallbackType DeviceManagerDeviceChangedSignalInfo = DeviceManagerDeviceChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DeviceManagerDeviceChangedCallback cb
cb'' <- mk_DeviceManagerDeviceChangedCallback cb'
connectSignalFunPtr obj "device-changed" cb'' connectMode detail
#endif
type DeviceManagerDeviceRemovedCallback =
Gdk.Device.Device
-> IO ()
noDeviceManagerDeviceRemovedCallback :: Maybe DeviceManagerDeviceRemovedCallback
noDeviceManagerDeviceRemovedCallback :: Maybe DeviceManagerDeviceAddedCallback
noDeviceManagerDeviceRemovedCallback = Maybe DeviceManagerDeviceAddedCallback
forall a. Maybe a
Nothing
type C_DeviceManagerDeviceRemovedCallback =
Ptr () ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceManagerDeviceRemovedCallback :: C_DeviceManagerDeviceRemovedCallback -> IO (FunPtr C_DeviceManagerDeviceRemovedCallback)
genClosure_DeviceManagerDeviceRemoved :: MonadIO m => DeviceManagerDeviceRemovedCallback -> m (GClosure C_DeviceManagerDeviceRemovedCallback)
genClosure_DeviceManagerDeviceRemoved :: DeviceManagerDeviceAddedCallback
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
genClosure_DeviceManagerDeviceRemoved DeviceManagerDeviceAddedCallback
cb = IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback))
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
-> m (GClosure C_DeviceManagerDeviceAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback DeviceManagerDeviceAddedCallback
cb
C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceRemovedCallback C_DeviceManagerDeviceAddedCallback
cb' IO (FunPtr C_DeviceManagerDeviceAddedCallback)
-> (FunPtr C_DeviceManagerDeviceAddedCallback
-> IO (GClosure C_DeviceManagerDeviceAddedCallback))
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DeviceManagerDeviceAddedCallback
-> IO (GClosure C_DeviceManagerDeviceAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DeviceManagerDeviceRemovedCallback ::
DeviceManagerDeviceRemovedCallback ->
C_DeviceManagerDeviceRemovedCallback
wrap_DeviceManagerDeviceRemovedCallback :: DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback DeviceManagerDeviceAddedCallback
_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
DeviceManagerDeviceAddedCallback
_cb Device
device'
onDeviceManagerDeviceRemoved :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceRemovedCallback -> m SignalHandlerId
onDeviceManagerDeviceRemoved :: a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
onDeviceManagerDeviceRemoved a
obj DeviceManagerDeviceAddedCallback
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_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback DeviceManagerDeviceAddedCallback
cb
FunPtr C_DeviceManagerDeviceAddedCallback
cb'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceRemovedCallback C_DeviceManagerDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_DeviceManagerDeviceAddedCallback
-> 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_DeviceManagerDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDeviceManagerDeviceRemoved :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceRemovedCallback -> m SignalHandlerId
afterDeviceManagerDeviceRemoved :: a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
afterDeviceManagerDeviceRemoved a
obj DeviceManagerDeviceAddedCallback
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_DeviceManagerDeviceAddedCallback
cb' = DeviceManagerDeviceAddedCallback
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback DeviceManagerDeviceAddedCallback
cb
FunPtr C_DeviceManagerDeviceAddedCallback
cb'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceRemovedCallback C_DeviceManagerDeviceAddedCallback
cb'
a
-> Text
-> FunPtr C_DeviceManagerDeviceAddedCallback
-> 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_DeviceManagerDeviceAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DeviceManagerDeviceRemovedSignalInfo
instance SignalInfo DeviceManagerDeviceRemovedSignalInfo where
type HaskellCallbackType DeviceManagerDeviceRemovedSignalInfo = DeviceManagerDeviceRemovedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DeviceManagerDeviceRemovedCallback cb
cb'' <- mk_DeviceManagerDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' connectMode detail
#endif
getDeviceManagerDisplay :: (MonadIO m, IsDeviceManager o) => o -> m (Maybe Gdk.Display.Display)
getDeviceManagerDisplay :: o -> m (Maybe Display)
getDeviceManagerDisplay o
obj = IO (Maybe Display) -> m (Maybe Display)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Display) -> m (Maybe Display))
-> IO (Maybe Display) -> m (Maybe 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
constructDeviceManagerDisplay :: (IsDeviceManager o, MIO.MonadIO m, Gdk.Display.IsDisplay a) => a -> m (GValueConstruct o)
constructDeviceManagerDisplay :: a -> m (GValueConstruct o)
constructDeviceManagerDisplay 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 DeviceManagerDisplayPropertyInfo
instance AttrInfo DeviceManagerDisplayPropertyInfo where
type AttrAllowedOps DeviceManagerDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DeviceManagerDisplayPropertyInfo = IsDeviceManager
type AttrSetTypeConstraint DeviceManagerDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferTypeConstraint DeviceManagerDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferType DeviceManagerDisplayPropertyInfo = Gdk.Display.Display
type AttrGetType DeviceManagerDisplayPropertyInfo = (Maybe Gdk.Display.Display)
type AttrLabel DeviceManagerDisplayPropertyInfo = "display"
type AttrOrigin DeviceManagerDisplayPropertyInfo = DeviceManager
attrGet = getDeviceManagerDisplay
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Display.Display v
attrConstruct = constructDeviceManagerDisplay
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DeviceManager
type instance O.AttributeList DeviceManager = DeviceManagerAttributeList
type DeviceManagerAttributeList = ('[ '("display", DeviceManagerDisplayPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
deviceManagerDisplay :: AttrLabelProxy "display"
deviceManagerDisplay = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DeviceManager = DeviceManagerSignalList
type DeviceManagerSignalList = ('[ '("deviceAdded", DeviceManagerDeviceAddedSignalInfo), '("deviceChanged", DeviceManagerDeviceChangedSignalInfo), '("deviceRemoved", DeviceManagerDeviceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_device_manager_get_client_pointer" gdk_device_manager_get_client_pointer ::
Ptr DeviceManager ->
IO (Ptr Gdk.Device.Device)
{-# DEPRECATED deviceManagerGetClientPointer ["(Since version 3.20)","Use 'GI.Gdk.Objects.Seat.seatGetPointer' instead."] #-}
deviceManagerGetClientPointer ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceManager a) =>
a
-> m Gdk.Device.Device
deviceManagerGetClientPointer :: a -> m Device
deviceManagerGetClientPointer a
deviceManager = 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 DeviceManager
deviceManager' <- a -> IO (Ptr DeviceManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
deviceManager
Ptr Device
result <- Ptr DeviceManager -> IO (Ptr Device)
gdk_device_manager_get_client_pointer Ptr DeviceManager
deviceManager'
Text -> Ptr Device -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceManagerGetClientPointer" Ptr Device
result
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
deviceManager
Device -> IO Device
forall (m :: * -> *) a. Monad m => a -> m a
return Device
result'
#if defined(ENABLE_OVERLOADING)
data DeviceManagerGetClientPointerMethodInfo
instance (signature ~ (m Gdk.Device.Device), MonadIO m, IsDeviceManager a) => O.MethodInfo DeviceManagerGetClientPointerMethodInfo a signature where
overloadedMethod = deviceManagerGetClientPointer
#endif
foreign import ccall "gdk_device_manager_get_display" gdk_device_manager_get_display ::
Ptr DeviceManager ->
IO (Ptr Gdk.Display.Display)
deviceManagerGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceManager a) =>
a
-> m (Maybe Gdk.Display.Display)
deviceManagerGetDisplay :: a -> m (Maybe Display)
deviceManagerGetDisplay a
deviceManager = IO (Maybe Display) -> m (Maybe Display)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Display) -> m (Maybe Display))
-> IO (Maybe Display) -> m (Maybe Display)
forall a b. (a -> b) -> a -> b
$ do
Ptr DeviceManager
deviceManager' <- a -> IO (Ptr DeviceManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
deviceManager
Ptr Display
result <- Ptr DeviceManager -> IO (Ptr Display)
gdk_device_manager_get_display Ptr DeviceManager
deviceManager'
Maybe Display
maybeResult <- Ptr Display -> (Ptr Display -> IO Display) -> IO (Maybe Display)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Display
result ((Ptr Display -> IO Display) -> IO (Maybe Display))
-> (Ptr Display -> IO Display) -> IO (Maybe Display)
forall a b. (a -> b) -> a -> b
$ \Ptr Display
result' -> do
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'
Display -> IO Display
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
deviceManager
Maybe Display -> IO (Maybe Display)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Display
maybeResult
#if defined(ENABLE_OVERLOADING)
data DeviceManagerGetDisplayMethodInfo
instance (signature ~ (m (Maybe Gdk.Display.Display)), MonadIO m, IsDeviceManager a) => O.MethodInfo DeviceManagerGetDisplayMethodInfo a signature where
overloadedMethod = deviceManagerGetDisplay
#endif
foreign import ccall "gdk_device_manager_list_devices" gdk_device_manager_list_devices ::
Ptr DeviceManager ->
CUInt ->
IO (Ptr (GList (Ptr Gdk.Device.Device)))
{-# DEPRECATED deviceManagerListDevices ["(Since version 3.20)",", use 'GI.Gdk.Objects.Seat.seatGetPointer', 'GI.Gdk.Objects.Seat.seatGetKeyboard'"," and 'GI.Gdk.Objects.Seat.seatGetSlaves' instead."] #-}
deviceManagerListDevices ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceManager a) =>
a
-> Gdk.Enums.DeviceType
-> m [Gdk.Device.Device]
deviceManagerListDevices :: a -> DeviceType -> m [Device]
deviceManagerListDevices a
deviceManager DeviceType
type_ = 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 DeviceManager
deviceManager' <- a -> IO (Ptr DeviceManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
deviceManager
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DeviceType -> Int) -> DeviceType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DeviceType -> Int
forall a. Enum a => a -> Int
fromEnum) DeviceType
type_
Ptr (GList (Ptr Device))
result <- Ptr DeviceManager -> CUInt -> IO (Ptr (GList (Ptr Device)))
gdk_device_manager_list_devices Ptr DeviceManager
deviceManager' CUInt
type_'
[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
deviceManager
[Device] -> IO [Device]
forall (m :: * -> *) a. Monad m => a -> m a
return [Device]
result''
#if defined(ENABLE_OVERLOADING)
data DeviceManagerListDevicesMethodInfo
instance (signature ~ (Gdk.Enums.DeviceType -> m [Gdk.Device.Device]), MonadIO m, IsDeviceManager a) => O.MethodInfo DeviceManagerListDevicesMethodInfo a signature where
overloadedMethod = deviceManagerListDevices
#endif