module GI.WebKit.Objects.DOMGamepad
(
DOMGamepad(..) ,
IsDOMGamepad ,
toDOMGamepad ,
noDOMGamepad ,
DOMGamepadGetIdMethodInfo ,
dOMGamepadGetId ,
DOMGamepadGetIndexMethodInfo ,
dOMGamepadGetIndex ,
DOMGamepadGetTimestampMethodInfo ,
dOMGamepadGetTimestamp ,
DOMGamepadIdPropertyInfo ,
dOMGamepadId ,
getDOMGamepadId ,
DOMGamepadIndexPropertyInfo ,
dOMGamepadIndex ,
getDOMGamepadIndex ,
DOMGamepadTimestampPropertyInfo ,
dOMGamepadTimestamp ,
getDOMGamepadTimestamp ,
) 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.WebKit.Objects.DOMObject as WebKit.DOMObject
newtype DOMGamepad = DOMGamepad (ManagedPtr DOMGamepad)
foreign import ccall "webkit_dom_gamepad_get_type"
c_webkit_dom_gamepad_get_type :: IO GType
instance GObject DOMGamepad where
gobjectType _ = c_webkit_dom_gamepad_get_type
class GObject o => IsDOMGamepad o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError DOMGamepad a) =>
IsDOMGamepad a
#endif
instance IsDOMGamepad DOMGamepad
instance WebKit.DOMObject.IsDOMObject DOMGamepad
instance GObject.Object.IsObject DOMGamepad
toDOMGamepad :: IsDOMGamepad o => o -> IO DOMGamepad
toDOMGamepad = unsafeCastTo DOMGamepad
noDOMGamepad :: Maybe DOMGamepad
noDOMGamepad = Nothing
type family ResolveDOMGamepadMethod (t :: Symbol) (o :: *) :: * where
ResolveDOMGamepadMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDOMGamepadMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDOMGamepadMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDOMGamepadMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDOMGamepadMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDOMGamepadMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDOMGamepadMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDOMGamepadMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDOMGamepadMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDOMGamepadMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveDOMGamepadMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveDOMGamepadMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDOMGamepadMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDOMGamepadMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDOMGamepadMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDOMGamepadMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDOMGamepadMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDOMGamepadMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDOMGamepadMethod "getId" o = DOMGamepadGetIdMethodInfo
ResolveDOMGamepadMethod "getIndex" o = DOMGamepadGetIndexMethodInfo
ResolveDOMGamepadMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDOMGamepadMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDOMGamepadMethod "getTimestamp" o = DOMGamepadGetTimestampMethodInfo
ResolveDOMGamepadMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDOMGamepadMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDOMGamepadMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDOMGamepadMethod t DOMGamepad, O.MethodInfo info DOMGamepad p) => O.IsLabelProxy t (DOMGamepad -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDOMGamepadMethod t DOMGamepad, O.MethodInfo info DOMGamepad p) => O.IsLabel t (DOMGamepad -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
getDOMGamepadId :: (MonadIO m, IsDOMGamepad o) => o -> m (Maybe T.Text)
getDOMGamepadId obj = liftIO $ getObjectPropertyString obj "id"
data DOMGamepadIdPropertyInfo
instance AttrInfo DOMGamepadIdPropertyInfo where
type AttrAllowedOps DOMGamepadIdPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DOMGamepadIdPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMGamepadIdPropertyInfo = IsDOMGamepad
type AttrGetType DOMGamepadIdPropertyInfo = (Maybe T.Text)
type AttrLabel DOMGamepadIdPropertyInfo = "id"
type AttrOrigin DOMGamepadIdPropertyInfo = DOMGamepad
attrGet _ = getDOMGamepadId
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
getDOMGamepadIndex :: (MonadIO m, IsDOMGamepad o) => o -> m CULong
getDOMGamepadIndex obj = liftIO $ getObjectPropertyULong obj "index"
data DOMGamepadIndexPropertyInfo
instance AttrInfo DOMGamepadIndexPropertyInfo where
type AttrAllowedOps DOMGamepadIndexPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMGamepadIndexPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMGamepadIndexPropertyInfo = IsDOMGamepad
type AttrGetType DOMGamepadIndexPropertyInfo = CULong
type AttrLabel DOMGamepadIndexPropertyInfo = "index"
type AttrOrigin DOMGamepadIndexPropertyInfo = DOMGamepad
attrGet _ = getDOMGamepadIndex
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
getDOMGamepadTimestamp :: (MonadIO m, IsDOMGamepad o) => o -> m Word64
getDOMGamepadTimestamp obj = liftIO $ getObjectPropertyUInt64 obj "timestamp"
data DOMGamepadTimestampPropertyInfo
instance AttrInfo DOMGamepadTimestampPropertyInfo where
type AttrAllowedOps DOMGamepadTimestampPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMGamepadTimestampPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMGamepadTimestampPropertyInfo = IsDOMGamepad
type AttrGetType DOMGamepadTimestampPropertyInfo = Word64
type AttrLabel DOMGamepadTimestampPropertyInfo = "timestamp"
type AttrOrigin DOMGamepadTimestampPropertyInfo = DOMGamepad
attrGet _ = getDOMGamepadTimestamp
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
instance O.HasAttributeList DOMGamepad
type instance O.AttributeList DOMGamepad = DOMGamepadAttributeList
type DOMGamepadAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("id", DOMGamepadIdPropertyInfo), '("index", DOMGamepadIndexPropertyInfo), '("timestamp", DOMGamepadTimestampPropertyInfo)] :: [(Symbol, *)])
dOMGamepadId :: AttrLabelProxy "id"
dOMGamepadId = AttrLabelProxy
dOMGamepadIndex :: AttrLabelProxy "index"
dOMGamepadIndex = AttrLabelProxy
dOMGamepadTimestamp :: AttrLabelProxy "timestamp"
dOMGamepadTimestamp = AttrLabelProxy
type instance O.SignalList DOMGamepad = DOMGamepadSignalList
type DOMGamepadSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_gamepad_get_id" webkit_dom_gamepad_get_id ::
Ptr DOMGamepad ->
IO CString
dOMGamepadGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMGamepad a) =>
a
-> m T.Text
dOMGamepadGetId self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- webkit_dom_gamepad_get_id self'
checkUnexpectedReturnNULL "dOMGamepadGetId" result
result' <- cstringToText result
freeMem result
touchManagedPtr self
return result'
data DOMGamepadGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMGamepad a) => O.MethodInfo DOMGamepadGetIdMethodInfo a signature where
overloadedMethod _ = dOMGamepadGetId
foreign import ccall "webkit_dom_gamepad_get_index" webkit_dom_gamepad_get_index ::
Ptr DOMGamepad ->
IO CULong
dOMGamepadGetIndex ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMGamepad a) =>
a
-> m CULong
dOMGamepadGetIndex self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- webkit_dom_gamepad_get_index self'
touchManagedPtr self
return result
data DOMGamepadGetIndexMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMGamepad a) => O.MethodInfo DOMGamepadGetIndexMethodInfo a signature where
overloadedMethod _ = dOMGamepadGetIndex
foreign import ccall "webkit_dom_gamepad_get_timestamp" webkit_dom_gamepad_get_timestamp ::
Ptr DOMGamepad ->
IO Word64
dOMGamepadGetTimestamp ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMGamepad a) =>
a
-> m Word64
dOMGamepadGetTimestamp self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- webkit_dom_gamepad_get_timestamp self'
touchManagedPtr self
return result
data DOMGamepadGetTimestampMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDOMGamepad a) => O.MethodInfo DOMGamepadGetTimestampMethodInfo a signature where
overloadedMethod _ = dOMGamepadGetTimestamp