#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gdk.Objects.DeviceTool
(
DeviceTool(..) ,
IsDeviceTool ,
toDeviceTool ,
noDeviceTool ,
#if ENABLE_OVERLOADING
DeviceToolGetHardwareIdMethodInfo ,
#endif
deviceToolGetHardwareId ,
#if ENABLE_OVERLOADING
DeviceToolGetSerialMethodInfo ,
#endif
deviceToolGetSerial ,
#if ENABLE_OVERLOADING
DeviceToolGetToolTypeMethodInfo ,
#endif
deviceToolGetToolType ,
#if ENABLE_OVERLOADING
DeviceToolAxesPropertyInfo ,
#endif
constructDeviceToolAxes ,
#if ENABLE_OVERLOADING
deviceToolAxes ,
#endif
getDeviceToolAxes ,
#if ENABLE_OVERLOADING
DeviceToolHardwareIdPropertyInfo ,
#endif
constructDeviceToolHardwareId ,
#if ENABLE_OVERLOADING
deviceToolHardwareId ,
#endif
getDeviceToolHardwareId ,
#if ENABLE_OVERLOADING
DeviceToolSerialPropertyInfo ,
#endif
constructDeviceToolSerial ,
#if ENABLE_OVERLOADING
deviceToolSerial ,
#endif
getDeviceToolSerial ,
#if ENABLE_OVERLOADING
DeviceToolToolTypePropertyInfo ,
#endif
constructDeviceToolToolType ,
#if ENABLE_OVERLOADING
deviceToolToolType ,
#endif
getDeviceToolToolType ,
) 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.Flags as Gdk.Flags
newtype DeviceTool = DeviceTool (ManagedPtr DeviceTool)
foreign import ccall "gdk_device_tool_get_type"
c_gdk_device_tool_get_type :: IO GType
instance GObject DeviceTool where
gobjectType = c_gdk_device_tool_get_type
class (GObject o, O.IsDescendantOf DeviceTool o) => IsDeviceTool o
instance (GObject o, O.IsDescendantOf DeviceTool o) => IsDeviceTool o
instance O.HasParentTypes DeviceTool
type instance O.ParentTypes DeviceTool = '[GObject.Object.Object]
toDeviceTool :: (MonadIO m, IsDeviceTool o) => o -> m DeviceTool
toDeviceTool = liftIO . unsafeCastTo DeviceTool
noDeviceTool :: Maybe DeviceTool
noDeviceTool = Nothing
#if ENABLE_OVERLOADING
type family ResolveDeviceToolMethod (t :: Symbol) (o :: *) :: * where
ResolveDeviceToolMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDeviceToolMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDeviceToolMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDeviceToolMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDeviceToolMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDeviceToolMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDeviceToolMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDeviceToolMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDeviceToolMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDeviceToolMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDeviceToolMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDeviceToolMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDeviceToolMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDeviceToolMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDeviceToolMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDeviceToolMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDeviceToolMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDeviceToolMethod "getHardwareId" o = DeviceToolGetHardwareIdMethodInfo
ResolveDeviceToolMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDeviceToolMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDeviceToolMethod "getSerial" o = DeviceToolGetSerialMethodInfo
ResolveDeviceToolMethod "getToolType" o = DeviceToolGetToolTypeMethodInfo
ResolveDeviceToolMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDeviceToolMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDeviceToolMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDeviceToolMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDeviceToolMethod t DeviceTool, O.MethodInfo info DeviceTool p) => OL.IsLabel t (DeviceTool -> 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
getDeviceToolAxes :: (MonadIO m, IsDeviceTool o) => o -> m [Gdk.Flags.AxisFlags]
getDeviceToolAxes obj = liftIO $ B.Properties.getObjectPropertyFlags obj "axes"
constructDeviceToolAxes :: (IsDeviceTool o) => [Gdk.Flags.AxisFlags] -> IO (GValueConstruct o)
constructDeviceToolAxes val = B.Properties.constructObjectPropertyFlags "axes" val
#if ENABLE_OVERLOADING
data DeviceToolAxesPropertyInfo
instance AttrInfo DeviceToolAxesPropertyInfo where
type AttrAllowedOps DeviceToolAxesPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DeviceToolAxesPropertyInfo = (~) [Gdk.Flags.AxisFlags]
type AttrBaseTypeConstraint DeviceToolAxesPropertyInfo = IsDeviceTool
type AttrGetType DeviceToolAxesPropertyInfo = [Gdk.Flags.AxisFlags]
type AttrLabel DeviceToolAxesPropertyInfo = "axes"
type AttrOrigin DeviceToolAxesPropertyInfo = DeviceTool
attrGet _ = getDeviceToolAxes
attrSet _ = undefined
attrConstruct _ = constructDeviceToolAxes
attrClear _ = undefined
#endif
getDeviceToolHardwareId :: (MonadIO m, IsDeviceTool o) => o -> m Word64
getDeviceToolHardwareId obj = liftIO $ B.Properties.getObjectPropertyUInt64 obj "hardware-id"
constructDeviceToolHardwareId :: (IsDeviceTool o) => Word64 -> IO (GValueConstruct o)
constructDeviceToolHardwareId val = B.Properties.constructObjectPropertyUInt64 "hardware-id" val
#if ENABLE_OVERLOADING
data DeviceToolHardwareIdPropertyInfo
instance AttrInfo DeviceToolHardwareIdPropertyInfo where
type AttrAllowedOps DeviceToolHardwareIdPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DeviceToolHardwareIdPropertyInfo = (~) Word64
type AttrBaseTypeConstraint DeviceToolHardwareIdPropertyInfo = IsDeviceTool
type AttrGetType DeviceToolHardwareIdPropertyInfo = Word64
type AttrLabel DeviceToolHardwareIdPropertyInfo = "hardware-id"
type AttrOrigin DeviceToolHardwareIdPropertyInfo = DeviceTool
attrGet _ = getDeviceToolHardwareId
attrSet _ = undefined
attrConstruct _ = constructDeviceToolHardwareId
attrClear _ = undefined
#endif
getDeviceToolSerial :: (MonadIO m, IsDeviceTool o) => o -> m Word64
getDeviceToolSerial obj = liftIO $ B.Properties.getObjectPropertyUInt64 obj "serial"
constructDeviceToolSerial :: (IsDeviceTool o) => Word64 -> IO (GValueConstruct o)
constructDeviceToolSerial val = B.Properties.constructObjectPropertyUInt64 "serial" val
#if ENABLE_OVERLOADING
data DeviceToolSerialPropertyInfo
instance AttrInfo DeviceToolSerialPropertyInfo where
type AttrAllowedOps DeviceToolSerialPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DeviceToolSerialPropertyInfo = (~) Word64
type AttrBaseTypeConstraint DeviceToolSerialPropertyInfo = IsDeviceTool
type AttrGetType DeviceToolSerialPropertyInfo = Word64
type AttrLabel DeviceToolSerialPropertyInfo = "serial"
type AttrOrigin DeviceToolSerialPropertyInfo = DeviceTool
attrGet _ = getDeviceToolSerial
attrSet _ = undefined
attrConstruct _ = constructDeviceToolSerial
attrClear _ = undefined
#endif
getDeviceToolToolType :: (MonadIO m, IsDeviceTool o) => o -> m Gdk.Enums.DeviceToolType
getDeviceToolToolType obj = liftIO $ B.Properties.getObjectPropertyEnum obj "tool-type"
constructDeviceToolToolType :: (IsDeviceTool o) => Gdk.Enums.DeviceToolType -> IO (GValueConstruct o)
constructDeviceToolToolType val = B.Properties.constructObjectPropertyEnum "tool-type" val
#if ENABLE_OVERLOADING
data DeviceToolToolTypePropertyInfo
instance AttrInfo DeviceToolToolTypePropertyInfo where
type AttrAllowedOps DeviceToolToolTypePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DeviceToolToolTypePropertyInfo = (~) Gdk.Enums.DeviceToolType
type AttrBaseTypeConstraint DeviceToolToolTypePropertyInfo = IsDeviceTool
type AttrGetType DeviceToolToolTypePropertyInfo = Gdk.Enums.DeviceToolType
type AttrLabel DeviceToolToolTypePropertyInfo = "tool-type"
type AttrOrigin DeviceToolToolTypePropertyInfo = DeviceTool
attrGet _ = getDeviceToolToolType
attrSet _ = undefined
attrConstruct _ = constructDeviceToolToolType
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DeviceTool
type instance O.AttributeList DeviceTool = DeviceToolAttributeList
type DeviceToolAttributeList = ('[ '("axes", DeviceToolAxesPropertyInfo), '("hardwareId", DeviceToolHardwareIdPropertyInfo), '("serial", DeviceToolSerialPropertyInfo), '("toolType", DeviceToolToolTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
deviceToolAxes :: AttrLabelProxy "axes"
deviceToolAxes = AttrLabelProxy
deviceToolHardwareId :: AttrLabelProxy "hardwareId"
deviceToolHardwareId = AttrLabelProxy
deviceToolSerial :: AttrLabelProxy "serial"
deviceToolSerial = AttrLabelProxy
deviceToolToolType :: AttrLabelProxy "toolType"
deviceToolToolType = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList DeviceTool = DeviceToolSignalList
type DeviceToolSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_device_tool_get_hardware_id" gdk_device_tool_get_hardware_id ::
Ptr DeviceTool ->
IO Word64
deviceToolGetHardwareId ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceTool a) =>
a
-> m Word64
deviceToolGetHardwareId tool = liftIO $ do
tool' <- unsafeManagedPtrCastPtr tool
result <- gdk_device_tool_get_hardware_id tool'
touchManagedPtr tool
return result
#if ENABLE_OVERLOADING
data DeviceToolGetHardwareIdMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDeviceTool a) => O.MethodInfo DeviceToolGetHardwareIdMethodInfo a signature where
overloadedMethod _ = deviceToolGetHardwareId
#endif
foreign import ccall "gdk_device_tool_get_serial" gdk_device_tool_get_serial ::
Ptr DeviceTool ->
IO Word64
deviceToolGetSerial ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceTool a) =>
a
-> m Word64
deviceToolGetSerial tool = liftIO $ do
tool' <- unsafeManagedPtrCastPtr tool
result <- gdk_device_tool_get_serial tool'
touchManagedPtr tool
return result
#if ENABLE_OVERLOADING
data DeviceToolGetSerialMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDeviceTool a) => O.MethodInfo DeviceToolGetSerialMethodInfo a signature where
overloadedMethod _ = deviceToolGetSerial
#endif
foreign import ccall "gdk_device_tool_get_tool_type" gdk_device_tool_get_tool_type ::
Ptr DeviceTool ->
IO CUInt
deviceToolGetToolType ::
(B.CallStack.HasCallStack, MonadIO m, IsDeviceTool a) =>
a
-> m Gdk.Enums.DeviceToolType
deviceToolGetToolType tool = liftIO $ do
tool' <- unsafeManagedPtrCastPtr tool
result <- gdk_device_tool_get_tool_type tool'
let result' = (toEnum . fromIntegral) result
touchManagedPtr tool
return result'
#if ENABLE_OVERLOADING
data DeviceToolGetToolTypeMethodInfo
instance (signature ~ (m Gdk.Enums.DeviceToolType), MonadIO m, IsDeviceTool a) => O.MethodInfo DeviceToolGetToolTypeMethodInfo a signature where
overloadedMethod _ = deviceToolGetToolType
#endif