#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gdk.Objects.DeviceManager
(
DeviceManager(..) ,
IsDeviceManager ,
toDeviceManager ,
noDeviceManager ,
#if ENABLE_OVERLOADING
DeviceManagerGetClientPointerMethodInfo ,
#endif
deviceManagerGetClientPointer ,
#if ENABLE_OVERLOADING
DeviceManagerGetDisplayMethodInfo ,
#endif
deviceManagerGetDisplay ,
#if ENABLE_OVERLOADING
DeviceManagerListDevicesMethodInfo ,
#endif
deviceManagerListDevices ,
#if ENABLE_OVERLOADING
DeviceManagerDisplayPropertyInfo ,
#endif
constructDeviceManagerDisplay ,
#if ENABLE_OVERLOADING
deviceManagerDisplay ,
#endif
getDeviceManagerDisplay ,
C_DeviceManagerDeviceAddedCallback ,
DeviceManagerDeviceAddedCallback ,
#if ENABLE_OVERLOADING
DeviceManagerDeviceAddedSignalInfo ,
#endif
afterDeviceManagerDeviceAdded ,
genClosure_DeviceManagerDeviceAdded ,
mk_DeviceManagerDeviceAddedCallback ,
noDeviceManagerDeviceAddedCallback ,
onDeviceManagerDeviceAdded ,
wrap_DeviceManagerDeviceAddedCallback ,
C_DeviceManagerDeviceChangedCallback ,
DeviceManagerDeviceChangedCallback ,
#if ENABLE_OVERLOADING
DeviceManagerDeviceChangedSignalInfo ,
#endif
afterDeviceManagerDeviceChanged ,
genClosure_DeviceManagerDeviceChanged ,
mk_DeviceManagerDeviceChangedCallback ,
noDeviceManagerDeviceChangedCallback ,
onDeviceManagerDeviceChanged ,
wrap_DeviceManagerDeviceChangedCallback ,
C_DeviceManagerDeviceRemovedCallback ,
DeviceManagerDeviceRemovedCallback ,
#if 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# 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 (ManagedPtr DeviceManager)
foreign import ccall "gdk_device_manager_get_type"
c_gdk_device_manager_get_type :: IO GType
instance GObject DeviceManager where
gobjectType = c_gdk_device_manager_get_type
class (GObject o, O.IsDescendantOf DeviceManager o) => IsDeviceManager o
instance (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 = liftIO . unsafeCastTo DeviceManager
noDeviceManager :: Maybe DeviceManager
noDeviceManager = Nothing
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
type DeviceManagerDeviceAddedCallback =
Gdk.Device.Device
-> IO ()
noDeviceManagerDeviceAddedCallback :: Maybe DeviceManagerDeviceAddedCallback
noDeviceManagerDeviceAddedCallback = 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 cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceAddedCallback cb
mk_DeviceManagerDeviceAddedCallback cb' >>= B.GClosure.newGClosure
wrap_DeviceManagerDeviceAddedCallback ::
DeviceManagerDeviceAddedCallback ->
C_DeviceManagerDeviceAddedCallback
wrap_DeviceManagerDeviceAddedCallback _cb _ device _ = do
device' <- (newObject Gdk.Device.Device) device
_cb device'
onDeviceManagerDeviceAdded :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
onDeviceManagerDeviceAdded obj cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceAddedCallback cb
cb'' <- mk_DeviceManagerDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' SignalConnectBefore
afterDeviceManagerDeviceAdded :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceAddedCallback -> m SignalHandlerId
afterDeviceManagerDeviceAdded obj cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceAddedCallback cb
cb'' <- mk_DeviceManagerDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' SignalConnectAfter
type DeviceManagerDeviceChangedCallback =
Gdk.Device.Device
-> IO ()
noDeviceManagerDeviceChangedCallback :: Maybe DeviceManagerDeviceChangedCallback
noDeviceManagerDeviceChangedCallback = 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 cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceChangedCallback cb
mk_DeviceManagerDeviceChangedCallback cb' >>= B.GClosure.newGClosure
wrap_DeviceManagerDeviceChangedCallback ::
DeviceManagerDeviceChangedCallback ->
C_DeviceManagerDeviceChangedCallback
wrap_DeviceManagerDeviceChangedCallback _cb _ device _ = do
device' <- (newObject Gdk.Device.Device) device
_cb device'
onDeviceManagerDeviceChanged :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceChangedCallback -> m SignalHandlerId
onDeviceManagerDeviceChanged obj cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceChangedCallback cb
cb'' <- mk_DeviceManagerDeviceChangedCallback cb'
connectSignalFunPtr obj "device-changed" cb'' SignalConnectBefore
afterDeviceManagerDeviceChanged :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceChangedCallback -> m SignalHandlerId
afterDeviceManagerDeviceChanged obj cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceChangedCallback cb
cb'' <- mk_DeviceManagerDeviceChangedCallback cb'
connectSignalFunPtr obj "device-changed" cb'' SignalConnectAfter
type DeviceManagerDeviceRemovedCallback =
Gdk.Device.Device
-> IO ()
noDeviceManagerDeviceRemovedCallback :: Maybe DeviceManagerDeviceRemovedCallback
noDeviceManagerDeviceRemovedCallback = 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 cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceRemovedCallback cb
mk_DeviceManagerDeviceRemovedCallback cb' >>= B.GClosure.newGClosure
wrap_DeviceManagerDeviceRemovedCallback ::
DeviceManagerDeviceRemovedCallback ->
C_DeviceManagerDeviceRemovedCallback
wrap_DeviceManagerDeviceRemovedCallback _cb _ device _ = do
device' <- (newObject Gdk.Device.Device) device
_cb device'
onDeviceManagerDeviceRemoved :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceRemovedCallback -> m SignalHandlerId
onDeviceManagerDeviceRemoved obj cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceRemovedCallback cb
cb'' <- mk_DeviceManagerDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' SignalConnectBefore
afterDeviceManagerDeviceRemoved :: (IsDeviceManager a, MonadIO m) => a -> DeviceManagerDeviceRemovedCallback -> m SignalHandlerId
afterDeviceManagerDeviceRemoved obj cb = liftIO $ do
let cb' = wrap_DeviceManagerDeviceRemovedCallback cb
cb'' <- mk_DeviceManagerDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' SignalConnectAfter
getDeviceManagerDisplay :: (MonadIO m, IsDeviceManager o) => o -> m (Maybe Gdk.Display.Display)
getDeviceManagerDisplay obj = liftIO $ B.Properties.getObjectPropertyObject obj "display" Gdk.Display.Display
constructDeviceManagerDisplay :: (IsDeviceManager o, Gdk.Display.IsDisplay a) => a -> IO (GValueConstruct o)
constructDeviceManagerDisplay val = B.Properties.constructObjectPropertyObject "display" (Just val)
#if ENABLE_OVERLOADING
data DeviceManagerDisplayPropertyInfo
instance AttrInfo DeviceManagerDisplayPropertyInfo where
type AttrAllowedOps DeviceManagerDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DeviceManagerDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrBaseTypeConstraint DeviceManagerDisplayPropertyInfo = IsDeviceManager
type AttrGetType DeviceManagerDisplayPropertyInfo = (Maybe Gdk.Display.Display)
type AttrLabel DeviceManagerDisplayPropertyInfo = "display"
type AttrOrigin DeviceManagerDisplayPropertyInfo = DeviceManager
attrGet _ = getDeviceManagerDisplay
attrSet _ = undefined
attrConstruct _ = constructDeviceManagerDisplay
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DeviceManager
type instance O.AttributeList DeviceManager = DeviceManagerAttributeList
type DeviceManagerAttributeList = ('[ '("display", DeviceManagerDisplayPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
deviceManagerDisplay :: AttrLabelProxy "display"
deviceManagerDisplay = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
data DeviceManagerDeviceAddedSignalInfo
instance SignalInfo DeviceManagerDeviceAddedSignalInfo where
type HaskellCallbackType DeviceManagerDeviceAddedSignalInfo = DeviceManagerDeviceAddedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DeviceManagerDeviceAddedCallback cb
cb'' <- mk_DeviceManagerDeviceAddedCallback cb'
connectSignalFunPtr obj "device-added" cb'' connectMode
data DeviceManagerDeviceChangedSignalInfo
instance SignalInfo DeviceManagerDeviceChangedSignalInfo where
type HaskellCallbackType DeviceManagerDeviceChangedSignalInfo = DeviceManagerDeviceChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DeviceManagerDeviceChangedCallback cb
cb'' <- mk_DeviceManagerDeviceChangedCallback cb'
connectSignalFunPtr obj "device-changed" cb'' connectMode
data DeviceManagerDeviceRemovedSignalInfo
instance SignalInfo DeviceManagerDeviceRemovedSignalInfo where
type HaskellCallbackType DeviceManagerDeviceRemovedSignalInfo = DeviceManagerDeviceRemovedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DeviceManagerDeviceRemovedCallback cb
cb'' <- mk_DeviceManagerDeviceRemovedCallback cb'
connectSignalFunPtr obj "device-removed" cb'' connectMode
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 deviceManager = liftIO $ do
deviceManager' <- unsafeManagedPtrCastPtr deviceManager
result <- gdk_device_manager_get_client_pointer deviceManager'
checkUnexpectedReturnNULL "deviceManagerGetClientPointer" result
result' <- (newObject Gdk.Device.Device) result
touchManagedPtr deviceManager
return result'
#if 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 deviceManager = liftIO $ do
deviceManager' <- unsafeManagedPtrCastPtr deviceManager
result <- gdk_device_manager_get_display deviceManager'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gdk.Display.Display) result'
return result''
touchManagedPtr deviceManager
return maybeResult
#if 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 deviceManager type_ = liftIO $ do
deviceManager' <- unsafeManagedPtrCastPtr deviceManager
let type_' = (fromIntegral . fromEnum) type_
result <- gdk_device_manager_list_devices deviceManager' type_'
result' <- unpackGList result
result'' <- mapM (newObject Gdk.Device.Device) result'
g_list_free result
touchManagedPtr deviceManager
return result''
#if 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