module GI.Gdk.Objects.DeviceTool
(
DeviceTool(..) ,
IsDeviceTool ,
toDeviceTool ,
noDeviceTool ,
DeviceToolGetHardwareIdMethodInfo ,
deviceToolGetHardwareId ,
DeviceToolGetSerialMethodInfo ,
deviceToolGetSerial ,
DeviceToolGetToolTypeMethodInfo ,
deviceToolGetToolType ,
DeviceToolAxesPropertyInfo ,
constructDeviceToolAxes ,
deviceToolAxes ,
getDeviceToolAxes ,
DeviceToolHardwareIdPropertyInfo ,
constructDeviceToolHardwareId ,
deviceToolHardwareId ,
getDeviceToolHardwareId ,
DeviceToolSerialPropertyInfo ,
constructDeviceToolSerial ,
deviceToolSerial ,
getDeviceToolSerial ,
DeviceToolToolTypePropertyInfo ,
constructDeviceToolToolType ,
deviceToolToolType ,
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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Enums as Gdk.Enums
import 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 => IsDeviceTool o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError DeviceTool a) =>
IsDeviceTool a
#endif
instance IsDeviceTool DeviceTool
instance GObject.Object.IsObject DeviceTool
toDeviceTool :: IsDeviceTool o => o -> IO DeviceTool
toDeviceTool = unsafeCastTo DeviceTool
noDeviceTool :: Maybe DeviceTool
noDeviceTool = Nothing
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveDeviceToolMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDeviceToolMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDeviceToolMethod t DeviceTool, O.MethodInfo info DeviceTool p) => O.IsLabelProxy t (DeviceTool -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDeviceToolMethod t DeviceTool, O.MethodInfo info DeviceTool p) => O.IsLabel t (DeviceTool -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
getDeviceToolAxes :: (MonadIO m, IsDeviceTool o) => o -> m [Gdk.Flags.AxisFlags]
getDeviceToolAxes obj = liftIO $ getObjectPropertyFlags obj "axes"
constructDeviceToolAxes :: (IsDeviceTool o) => [Gdk.Flags.AxisFlags] -> IO (GValueConstruct o)
constructDeviceToolAxes val = constructObjectPropertyFlags "axes" val
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
getDeviceToolHardwareId :: (MonadIO m, IsDeviceTool o) => o -> m Word64
getDeviceToolHardwareId obj = liftIO $ getObjectPropertyUInt64 obj "hardware-id"
constructDeviceToolHardwareId :: (IsDeviceTool o) => Word64 -> IO (GValueConstruct o)
constructDeviceToolHardwareId val = constructObjectPropertyUInt64 "hardware-id" val
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
getDeviceToolSerial :: (MonadIO m, IsDeviceTool o) => o -> m Word64
getDeviceToolSerial obj = liftIO $ getObjectPropertyUInt64 obj "serial"
constructDeviceToolSerial :: (IsDeviceTool o) => Word64 -> IO (GValueConstruct o)
constructDeviceToolSerial val = constructObjectPropertyUInt64 "serial" val
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
getDeviceToolToolType :: (MonadIO m, IsDeviceTool o) => o -> m Gdk.Enums.DeviceToolType
getDeviceToolToolType obj = liftIO $ getObjectPropertyEnum obj "tool-type"
constructDeviceToolToolType :: (IsDeviceTool o) => Gdk.Enums.DeviceToolType -> IO (GValueConstruct o)
constructDeviceToolToolType val = constructObjectPropertyEnum "tool-type" val
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
instance O.HasAttributeList DeviceTool
type instance O.AttributeList DeviceTool = DeviceToolAttributeList
type DeviceToolAttributeList = ('[ '("axes", DeviceToolAxesPropertyInfo), '("hardwareId", DeviceToolHardwareIdPropertyInfo), '("serial", DeviceToolSerialPropertyInfo), '("toolType", DeviceToolToolTypePropertyInfo)] :: [(Symbol, *)])
deviceToolAxes :: AttrLabelProxy "axes"
deviceToolAxes = AttrLabelProxy
deviceToolHardwareId :: AttrLabelProxy "hardwareId"
deviceToolHardwareId = AttrLabelProxy
deviceToolSerial :: AttrLabelProxy "serial"
deviceToolSerial = AttrLabelProxy
deviceToolToolType :: AttrLabelProxy "toolType"
deviceToolToolType = AttrLabelProxy
type instance O.SignalList DeviceTool = DeviceToolSignalList
type DeviceToolSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
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
data DeviceToolGetHardwareIdMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDeviceTool a) => O.MethodInfo DeviceToolGetHardwareIdMethodInfo a signature where
overloadedMethod _ = deviceToolGetHardwareId
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
data DeviceToolGetSerialMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDeviceTool a) => O.MethodInfo DeviceToolGetSerialMethodInfo a signature where
overloadedMethod _ = deviceToolGetSerial
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'
data DeviceToolGetToolTypeMethodInfo
instance (signature ~ (m Gdk.Enums.DeviceToolType), MonadIO m, IsDeviceTool a) => O.MethodInfo DeviceToolGetToolTypeMethodInfo a signature where
overloadedMethod _ = deviceToolGetToolType