module GI.WebKit.Objects.DOMGamepad
(
DOMGamepad(..) ,
DOMGamepadK ,
toDOMGamepad ,
noDOMGamepad ,
dOMGamepadGetId ,
dOMGamepadGetIndex ,
dOMGamepadGetTimestamp ,
DOMGamepadIdPropertyInfo ,
getDOMGamepadId ,
DOMGamepadIndexPropertyInfo ,
getDOMGamepadIndex ,
DOMGamepadTimestampPropertyInfo ,
getDOMGamepadTimestamp ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.WebKit.Types
import GI.WebKit.Callbacks
import qualified GI.GObject as GObject
newtype DOMGamepad = DOMGamepad (ForeignPtr DOMGamepad)
foreign import ccall "webkit_dom_gamepad_get_type"
c_webkit_dom_gamepad_get_type :: IO GType
type instance ParentTypes DOMGamepad = DOMGamepadParentTypes
type DOMGamepadParentTypes = '[DOMObject, GObject.Object]
instance GObject DOMGamepad where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_gamepad_get_type
class GObject o => DOMGamepadK o
instance (GObject o, IsDescendantOf DOMGamepad o) => DOMGamepadK o
toDOMGamepad :: DOMGamepadK o => o -> IO DOMGamepad
toDOMGamepad = unsafeCastTo DOMGamepad
noDOMGamepad :: Maybe DOMGamepad
noDOMGamepad = Nothing
getDOMGamepadId :: (MonadIO m, DOMGamepadK o) => o -> m T.Text
getDOMGamepadId obj = liftIO $ getObjectPropertyString obj "id"
data DOMGamepadIdPropertyInfo
instance AttrInfo DOMGamepadIdPropertyInfo where
type AttrAllowedOps DOMGamepadIdPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMGamepadIdPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMGamepadIdPropertyInfo = DOMGamepadK
type AttrGetType DOMGamepadIdPropertyInfo = T.Text
type AttrLabel DOMGamepadIdPropertyInfo = "DOMGamepad::id"
attrGet _ = getDOMGamepadId
attrSet _ = undefined
attrConstruct _ = undefined
getDOMGamepadIndex :: (MonadIO m, DOMGamepadK o) => o -> m Word64
getDOMGamepadIndex obj = liftIO $ getObjectPropertyUInt64 obj "index"
data DOMGamepadIndexPropertyInfo
instance AttrInfo DOMGamepadIndexPropertyInfo where
type AttrAllowedOps DOMGamepadIndexPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMGamepadIndexPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMGamepadIndexPropertyInfo = DOMGamepadK
type AttrGetType DOMGamepadIndexPropertyInfo = Word64
type AttrLabel DOMGamepadIndexPropertyInfo = "DOMGamepad::index"
attrGet _ = getDOMGamepadIndex
attrSet _ = undefined
attrConstruct _ = undefined
getDOMGamepadTimestamp :: (MonadIO m, DOMGamepadK 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 = DOMGamepadK
type AttrGetType DOMGamepadTimestampPropertyInfo = Word64
type AttrLabel DOMGamepadTimestampPropertyInfo = "DOMGamepad::timestamp"
attrGet _ = getDOMGamepadTimestamp
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMGamepad = DOMGamepadAttributeList
type DOMGamepadAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("id", DOMGamepadIdPropertyInfo), '("index", DOMGamepadIndexPropertyInfo), '("timestamp", DOMGamepadTimestampPropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMGamepad = DOMGamepadSignalList
type DOMGamepadSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_gamepad_get_id" webkit_dom_gamepad_get_id ::
Ptr DOMGamepad ->
IO CString
dOMGamepadGetId ::
(MonadIO m, DOMGamepadK a) =>
a ->
m T.Text
dOMGamepadGetId _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_gamepad_get_id _obj'
checkUnexpectedReturnNULL "webkit_dom_gamepad_get_id" result
result' <- cstringToText result
freeMem result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_gamepad_get_index" webkit_dom_gamepad_get_index ::
Ptr DOMGamepad ->
IO Word64
dOMGamepadGetIndex ::
(MonadIO m, DOMGamepadK a) =>
a ->
m Word64
dOMGamepadGetIndex _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_gamepad_get_index _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_dom_gamepad_get_timestamp" webkit_dom_gamepad_get_timestamp ::
Ptr DOMGamepad ->
IO Word64
dOMGamepadGetTimestamp ::
(MonadIO m, DOMGamepadK a) =>
a ->
m Word64
dOMGamepadGetTimestamp _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_gamepad_get_timestamp _obj'
touchManagedPtr _obj
return result