{-# LANGUAGE ImplicitParams, RankNTypes, 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 ,
DeviceManagerDeviceAddedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDeviceAddedSignalInfo ,
#endif
afterDeviceManagerDeviceAdded ,
onDeviceManagerDeviceAdded ,
DeviceManagerDeviceChangedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDeviceChangedSignalInfo ,
#endif
afterDeviceManagerDeviceChanged ,
onDeviceManagerDeviceChanged ,
DeviceManagerDeviceRemovedCallback ,
#if defined(ENABLE_OVERLOADING)
DeviceManagerDeviceRemovedSignalInfo ,
#endif
afterDeviceManagerDeviceRemoved ,
onDeviceManagerDeviceRemoved ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified 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
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
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 :: (MIO.MonadIO m, IsDeviceManager o) => o -> m DeviceManager
toDeviceManager :: forall (m :: * -> *) o.
(MonadIO m, IsDeviceManager o) =>
o -> m DeviceManager
toDeviceManager = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DeviceManager -> DeviceManager
DeviceManager
instance B.GValue.IsGValue (Maybe DeviceManager) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_device_manager_get_type
gvalueSet_ :: Ptr GValue -> Maybe DeviceManager -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DeviceManager
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr DeviceManager)
gvalueSet_ Ptr GValue
gv (P.Just DeviceManager
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DeviceManager
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DeviceManager)
gvalueGet_ Ptr GValue
gv = do
Ptr DeviceManager
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DeviceManager)
if Ptr DeviceManager
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> 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
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDeviceManagerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDeviceManagerMethod t DeviceManager, O.OverloadedMethod info DeviceManager p, R.HasField t DeviceManager p) => R.HasField t DeviceManager p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDeviceManagerMethod t DeviceManager, O.OverloadedMethodInfo info DeviceManager) => OL.IsLabel t (O.MethodProxy info DeviceManager) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type DeviceManagerDeviceAddedCallback =
Gdk.Device.Device
-> IO ()
type C_DeviceManagerDeviceAddedCallback =
Ptr DeviceManager ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceManagerDeviceAddedCallback :: C_DeviceManagerDeviceAddedCallback -> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
wrap_DeviceManagerDeviceAddedCallback ::
GObject a => (a -> DeviceManagerDeviceAddedCallback) ->
C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback :: forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback a -> DeviceManagerDeviceAddedCallback
gi'cb Ptr DeviceManager
gi'selfPtr Ptr Device
device Ptr ()
_ = do
Device
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
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DeviceManager
gi'selfPtr forall a b. (a -> b) -> a -> b
$ \DeviceManager
gi'self -> a -> DeviceManagerDeviceAddedCallback
gi'cb (coerce :: forall a b. Coercible a b => a -> b
Coerce.coerce DeviceManager
gi'self) Device
device'
onDeviceManagerDeviceAdded :: (IsDeviceManager a, MonadIO m) => a -> ((?self :: a) => DeviceManagerDeviceAddedCallback) -> m SignalHandlerId
onDeviceManagerDeviceAdded :: forall a (m :: * -> *).
(IsDeviceManager a, MonadIO m) =>
a
-> ((?self::a) => DeviceManagerDeviceAddedCallback)
-> m SignalHandlerId
onDeviceManagerDeviceAdded a
obj (?self::a) => DeviceManagerDeviceAddedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DeviceManagerDeviceAddedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DeviceManagerDeviceAddedCallback
cb
let wrapped' :: C_DeviceManagerDeviceAddedCallback
wrapped' = forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback a -> DeviceManagerDeviceAddedCallback
wrapped
FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceAddedCallback C_DeviceManagerDeviceAddedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-added" FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' SignalConnectMode
SignalConnectBefore forall a. Maybe a
Nothing
afterDeviceManagerDeviceAdded :: (IsDeviceManager a, MonadIO m) => a -> ((?self :: a) => DeviceManagerDeviceAddedCallback) -> m SignalHandlerId
afterDeviceManagerDeviceAdded :: forall a (m :: * -> *).
(IsDeviceManager a, MonadIO m) =>
a
-> ((?self::a) => DeviceManagerDeviceAddedCallback)
-> m SignalHandlerId
afterDeviceManagerDeviceAdded a
obj (?self::a) => DeviceManagerDeviceAddedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DeviceManagerDeviceAddedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DeviceManagerDeviceAddedCallback
cb
let wrapped' :: C_DeviceManagerDeviceAddedCallback
wrapped' = forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback a -> DeviceManagerDeviceAddedCallback
wrapped
FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceAddedCallback C_DeviceManagerDeviceAddedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-added" FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' SignalConnectMode
SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager::device-added"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#g:signal:deviceAdded"})
#endif
type DeviceManagerDeviceChangedCallback =
Gdk.Device.Device
-> IO ()
type C_DeviceManagerDeviceChangedCallback =
Ptr DeviceManager ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceManagerDeviceChangedCallback :: C_DeviceManagerDeviceChangedCallback -> IO (FunPtr C_DeviceManagerDeviceChangedCallback)
wrap_DeviceManagerDeviceChangedCallback ::
GObject a => (a -> DeviceManagerDeviceChangedCallback) ->
C_DeviceManagerDeviceChangedCallback
wrap_DeviceManagerDeviceChangedCallback :: forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback a -> DeviceManagerDeviceAddedCallback
gi'cb Ptr DeviceManager
gi'selfPtr Ptr Device
device Ptr ()
_ = do
Device
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
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DeviceManager
gi'selfPtr forall a b. (a -> b) -> a -> b
$ \DeviceManager
gi'self -> a -> DeviceManagerDeviceAddedCallback
gi'cb (coerce :: forall a b. Coercible a b => a -> b
Coerce.coerce DeviceManager
gi'self) Device
device'
onDeviceManagerDeviceChanged :: (IsDeviceManager a, MonadIO m) => a -> ((?self :: a) => DeviceManagerDeviceChangedCallback) -> m SignalHandlerId
onDeviceManagerDeviceChanged :: forall a (m :: * -> *).
(IsDeviceManager a, MonadIO m) =>
a
-> ((?self::a) => DeviceManagerDeviceAddedCallback)
-> m SignalHandlerId
onDeviceManagerDeviceChanged a
obj (?self::a) => DeviceManagerDeviceAddedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DeviceManagerDeviceAddedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DeviceManagerDeviceAddedCallback
cb
let wrapped' :: C_DeviceManagerDeviceAddedCallback
wrapped' = forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback a -> DeviceManagerDeviceAddedCallback
wrapped
FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceChangedCallback C_DeviceManagerDeviceAddedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-changed" FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' SignalConnectMode
SignalConnectBefore forall a. Maybe a
Nothing
afterDeviceManagerDeviceChanged :: (IsDeviceManager a, MonadIO m) => a -> ((?self :: a) => DeviceManagerDeviceChangedCallback) -> m SignalHandlerId
afterDeviceManagerDeviceChanged :: forall a (m :: * -> *).
(IsDeviceManager a, MonadIO m) =>
a
-> ((?self::a) => DeviceManagerDeviceAddedCallback)
-> m SignalHandlerId
afterDeviceManagerDeviceChanged a
obj (?self::a) => DeviceManagerDeviceAddedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DeviceManagerDeviceAddedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DeviceManagerDeviceAddedCallback
cb
let wrapped' :: C_DeviceManagerDeviceAddedCallback
wrapped' = forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceChangedCallback a -> DeviceManagerDeviceAddedCallback
wrapped
FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceChangedCallback C_DeviceManagerDeviceAddedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-changed" FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' SignalConnectMode
SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager::device-changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#g:signal:deviceChanged"})
#endif
type DeviceManagerDeviceRemovedCallback =
Gdk.Device.Device
-> IO ()
type C_DeviceManagerDeviceRemovedCallback =
Ptr DeviceManager ->
Ptr Gdk.Device.Device ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DeviceManagerDeviceRemovedCallback :: C_DeviceManagerDeviceRemovedCallback -> IO (FunPtr C_DeviceManagerDeviceRemovedCallback)
wrap_DeviceManagerDeviceRemovedCallback ::
GObject a => (a -> DeviceManagerDeviceRemovedCallback) ->
C_DeviceManagerDeviceRemovedCallback
wrap_DeviceManagerDeviceRemovedCallback :: forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback a -> DeviceManagerDeviceAddedCallback
gi'cb Ptr DeviceManager
gi'selfPtr Ptr Device
device Ptr ()
_ = do
Device
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
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr DeviceManager
gi'selfPtr forall a b. (a -> b) -> a -> b
$ \DeviceManager
gi'self -> a -> DeviceManagerDeviceAddedCallback
gi'cb (coerce :: forall a b. Coercible a b => a -> b
Coerce.coerce DeviceManager
gi'self) Device
device'
onDeviceManagerDeviceRemoved :: (IsDeviceManager a, MonadIO m) => a -> ((?self :: a) => DeviceManagerDeviceRemovedCallback) -> m SignalHandlerId
onDeviceManagerDeviceRemoved :: forall a (m :: * -> *).
(IsDeviceManager a, MonadIO m) =>
a
-> ((?self::a) => DeviceManagerDeviceAddedCallback)
-> m SignalHandlerId
onDeviceManagerDeviceRemoved a
obj (?self::a) => DeviceManagerDeviceAddedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DeviceManagerDeviceAddedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DeviceManagerDeviceAddedCallback
cb
let wrapped' :: C_DeviceManagerDeviceAddedCallback
wrapped' = forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback a -> DeviceManagerDeviceAddedCallback
wrapped
FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceRemovedCallback C_DeviceManagerDeviceAddedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-removed" FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' SignalConnectMode
SignalConnectBefore forall a. Maybe a
Nothing
afterDeviceManagerDeviceRemoved :: (IsDeviceManager a, MonadIO m) => a -> ((?self :: a) => DeviceManagerDeviceRemovedCallback) -> m SignalHandlerId
afterDeviceManagerDeviceRemoved :: forall a (m :: * -> *).
(IsDeviceManager a, MonadIO m) =>
a
-> ((?self::a) => DeviceManagerDeviceAddedCallback)
-> m SignalHandlerId
afterDeviceManagerDeviceRemoved a
obj (?self::a) => DeviceManagerDeviceAddedCallback
cb = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> DeviceManagerDeviceAddedCallback
wrapped a
self = let ?self = a
self in (?self::a) => DeviceManagerDeviceAddedCallback
cb
let wrapped' :: C_DeviceManagerDeviceAddedCallback
wrapped' = forall a.
GObject a =>
(a -> DeviceManagerDeviceAddedCallback)
-> C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceRemovedCallback a -> DeviceManagerDeviceAddedCallback
wrapped
FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' <- C_DeviceManagerDeviceAddedCallback
-> IO (FunPtr C_DeviceManagerDeviceAddedCallback)
mk_DeviceManagerDeviceRemovedCallback C_DeviceManagerDeviceAddedCallback
wrapped'
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"device-removed" FunPtr C_DeviceManagerDeviceAddedCallback
wrapped'' SignalConnectMode
SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager::device-removed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#g:signal:deviceRemoved"})
#endif
getDeviceManagerDisplay :: (MonadIO m, IsDeviceManager o) => o -> m (Maybe Gdk.Display.Display)
getDeviceManagerDisplay :: forall (m :: * -> *) o.
(MonadIO m, IsDeviceManager o) =>
o -> m (Maybe Display)
getDeviceManagerDisplay o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ 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 :: forall o (m :: * -> *) a.
(IsDeviceManager o, MonadIO m, IsDisplay a) =>
a -> m (GValueConstruct o)
constructDeviceManagerDisplay a
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"display" (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
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager.display"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#g:attr:display"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DeviceManager
type instance O.AttributeList DeviceManager = DeviceManagerAttributeList
type DeviceManagerAttributeList = ('[ '("display", DeviceManagerDisplayPropertyInfo)] :: [(Symbol, DK.Type)])
#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, DK.Type)])
#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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceManager a) =>
a -> m Device
deviceManagerGetClientPointer a
deviceManager = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DeviceManager
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'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceManagerGetClientPointer" Ptr Device
result
Device
result' <- (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
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
deviceManager
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.OverloadedMethod DeviceManagerGetClientPointerMethodInfo a signature where
overloadedMethod = deviceManagerGetClientPointer
instance O.OverloadedMethodInfo DeviceManagerGetClientPointerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager.deviceManagerGetClientPointer",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceManager a) =>
a -> m (Maybe Display)
deviceManagerGetDisplay a
deviceManager = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DeviceManager
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 <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Display
result forall a b. (a -> b) -> a -> b
$ \Ptr Display
result' -> do
Display
result'' <- (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'
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
deviceManager
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.OverloadedMethod DeviceManagerGetDisplayMethodInfo a signature where
overloadedMethod = deviceManagerGetDisplay
instance O.OverloadedMethodInfo DeviceManagerGetDisplayMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager.deviceManagerGetDisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceManager a) =>
a -> DeviceType -> m [Device]
deviceManagerListDevices a
deviceManager DeviceType
type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr DeviceManager
deviceManager' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
deviceManager
let type_' :: CUInt
type_' = (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c
. 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' <- forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Device))
result
[Device]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (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'
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Device))
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
deviceManager
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.OverloadedMethod DeviceManagerListDevicesMethodInfo a signature where
overloadedMethod = deviceManagerListDevices
instance O.OverloadedMethodInfo DeviceManagerListDevicesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.DeviceManager.deviceManagerListDevices",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-3.0.26/docs/GI-Gdk-Objects-DeviceManager.html#v:deviceManagerListDevices"
})
#endif