module GI.WebKit.Objects.DOMPerformance
(
DOMPerformance(..) ,
DOMPerformanceK ,
toDOMPerformance ,
noDOMPerformance ,
dOMPerformanceGetMemory ,
dOMPerformanceGetNavigation ,
dOMPerformanceGetTiming ,
dOMPerformanceNow ,
DOMPerformanceNavigationPropertyInfo ,
getDOMPerformanceNavigation ,
DOMPerformanceTimingPropertyInfo ,
getDOMPerformanceTiming ,
) 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 DOMPerformance = DOMPerformance (ForeignPtr DOMPerformance)
foreign import ccall "webkit_dom_performance_get_type"
c_webkit_dom_performance_get_type :: IO GType
type instance ParentTypes DOMPerformance = DOMPerformanceParentTypes
type DOMPerformanceParentTypes = '[DOMObject, GObject.Object, DOMEventTarget]
instance GObject DOMPerformance where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_performance_get_type
class GObject o => DOMPerformanceK o
instance (GObject o, IsDescendantOf DOMPerformance o) => DOMPerformanceK o
toDOMPerformance :: DOMPerformanceK o => o -> IO DOMPerformance
toDOMPerformance = unsafeCastTo DOMPerformance
noDOMPerformance :: Maybe DOMPerformance
noDOMPerformance = Nothing
getDOMPerformanceNavigation :: (MonadIO m, DOMPerformanceK o) => o -> m DOMPerformanceNavigation
getDOMPerformanceNavigation obj = liftIO $ getObjectPropertyObject obj "navigation" DOMPerformanceNavigation
data DOMPerformanceNavigationPropertyInfo
instance AttrInfo DOMPerformanceNavigationPropertyInfo where
type AttrAllowedOps DOMPerformanceNavigationPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMPerformanceNavigationPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMPerformanceNavigationPropertyInfo = DOMPerformanceK
type AttrGetType DOMPerformanceNavigationPropertyInfo = DOMPerformanceNavigation
type AttrLabel DOMPerformanceNavigationPropertyInfo = "DOMPerformance::navigation"
attrGet _ = getDOMPerformanceNavigation
attrSet _ = undefined
attrConstruct _ = undefined
getDOMPerformanceTiming :: (MonadIO m, DOMPerformanceK o) => o -> m DOMPerformanceTiming
getDOMPerformanceTiming obj = liftIO $ getObjectPropertyObject obj "timing" DOMPerformanceTiming
data DOMPerformanceTimingPropertyInfo
instance AttrInfo DOMPerformanceTimingPropertyInfo where
type AttrAllowedOps DOMPerformanceTimingPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMPerformanceTimingPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMPerformanceTimingPropertyInfo = DOMPerformanceK
type AttrGetType DOMPerformanceTimingPropertyInfo = DOMPerformanceTiming
type AttrLabel DOMPerformanceTimingPropertyInfo = "DOMPerformance::timing"
attrGet _ = getDOMPerformanceTiming
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMPerformance = DOMPerformanceAttributeList
type DOMPerformanceAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("navigation", DOMPerformanceNavigationPropertyInfo), '("timing", DOMPerformanceTimingPropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMPerformance = DOMPerformanceSignalList
type DOMPerformanceSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_performance_get_memory" webkit_dom_performance_get_memory ::
Ptr DOMPerformance ->
IO ()
dOMPerformanceGetMemory ::
(MonadIO m, DOMPerformanceK a) =>
a ->
m ()
dOMPerformanceGetMemory _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
webkit_dom_performance_get_memory _obj'
touchManagedPtr _obj
return ()
foreign import ccall "webkit_dom_performance_get_navigation" webkit_dom_performance_get_navigation ::
Ptr DOMPerformance ->
IO (Ptr DOMPerformanceNavigation)
dOMPerformanceGetNavigation ::
(MonadIO m, DOMPerformanceK a) =>
a ->
m DOMPerformanceNavigation
dOMPerformanceGetNavigation _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_performance_get_navigation _obj'
checkUnexpectedReturnNULL "webkit_dom_performance_get_navigation" result
result' <- (wrapObject DOMPerformanceNavigation) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_performance_get_timing" webkit_dom_performance_get_timing ::
Ptr DOMPerformance ->
IO (Ptr DOMPerformanceTiming)
dOMPerformanceGetTiming ::
(MonadIO m, DOMPerformanceK a) =>
a ->
m DOMPerformanceTiming
dOMPerformanceGetTiming _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_performance_get_timing _obj'
checkUnexpectedReturnNULL "webkit_dom_performance_get_timing" result
result' <- (wrapObject DOMPerformanceTiming) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_performance_now" webkit_dom_performance_now ::
Ptr DOMPerformance ->
IO CDouble
dOMPerformanceNow ::
(MonadIO m, DOMPerformanceK a) =>
a ->
m Double
dOMPerformanceNow _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_performance_now _obj'
let result' = realToFrac result
touchManagedPtr _obj
return result'