{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2WebExtension.Objects.DOMCSSValue
(
DOMCSSValue(..) ,
IsDOMCSSValue ,
toDOMCSSValue ,
#if defined(ENABLE_OVERLOADING)
ResolveDOMCSSValueMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DOMCSSValueGetCssTextMethodInfo ,
#endif
dOMCSSValueGetCssText ,
#if defined(ENABLE_OVERLOADING)
DOMCSSValueGetCssValueTypeMethodInfo ,
#endif
dOMCSSValueGetCssValueType ,
#if defined(ENABLE_OVERLOADING)
DOMCSSValueSetCssTextMethodInfo ,
#endif
dOMCSSValueSetCssText ,
#if defined(ENABLE_OVERLOADING)
DOMCSSValueCssTextPropertyInfo ,
#endif
clearDOMCSSValueCssText ,
constructDOMCSSValueCssText ,
#if defined(ENABLE_OVERLOADING)
dOMCSSValueCssText ,
#endif
getDOMCSSValueCssText ,
setDOMCSSValueCssText ,
#if defined(ENABLE_OVERLOADING)
DOMCSSValueCssValueTypePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
dOMCSSValueCssValueType ,
#endif
getDOMCSSValueCssValueType ,
) 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.BasicTypes as B.Types
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject
newtype DOMCSSValue = DOMCSSValue (SP.ManagedPtr DOMCSSValue)
deriving (DOMCSSValue -> DOMCSSValue -> Bool
(DOMCSSValue -> DOMCSSValue -> Bool)
-> (DOMCSSValue -> DOMCSSValue -> Bool) -> Eq DOMCSSValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DOMCSSValue -> DOMCSSValue -> Bool
$c/= :: DOMCSSValue -> DOMCSSValue -> Bool
== :: DOMCSSValue -> DOMCSSValue -> Bool
$c== :: DOMCSSValue -> DOMCSSValue -> Bool
Eq)
instance SP.ManagedPtrNewtype DOMCSSValue where
toManagedPtr :: DOMCSSValue -> ManagedPtr DOMCSSValue
toManagedPtr (DOMCSSValue ManagedPtr DOMCSSValue
p) = ManagedPtr DOMCSSValue
p
foreign import ccall "webkit_dom_css_value_get_type"
c_webkit_dom_css_value_get_type :: IO B.Types.GType
instance B.Types.TypedObject DOMCSSValue where
glibType :: IO GType
glibType = IO GType
c_webkit_dom_css_value_get_type
instance B.Types.GObject DOMCSSValue
instance B.GValue.IsGValue DOMCSSValue where
toGValue :: DOMCSSValue -> IO GValue
toGValue DOMCSSValue
o = do
GType
gtype <- IO GType
c_webkit_dom_css_value_get_type
DOMCSSValue -> (Ptr DOMCSSValue -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DOMCSSValue
o (GType
-> (GValue -> Ptr DOMCSSValue -> IO ())
-> Ptr DOMCSSValue
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DOMCSSValue -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DOMCSSValue
fromGValue GValue
gv = do
Ptr DOMCSSValue
ptr <- GValue -> IO (Ptr DOMCSSValue)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DOMCSSValue)
(ManagedPtr DOMCSSValue -> DOMCSSValue)
-> Ptr DOMCSSValue -> IO DOMCSSValue
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DOMCSSValue -> DOMCSSValue
DOMCSSValue Ptr DOMCSSValue
ptr
class (SP.GObject o, O.IsDescendantOf DOMCSSValue o) => IsDOMCSSValue o
instance (SP.GObject o, O.IsDescendantOf DOMCSSValue o) => IsDOMCSSValue o
instance O.HasParentTypes DOMCSSValue
type instance O.ParentTypes DOMCSSValue = '[WebKit2WebExtension.DOMObject.DOMObject, GObject.Object.Object]
toDOMCSSValue :: (MonadIO m, IsDOMCSSValue o) => o -> m DOMCSSValue
toDOMCSSValue :: o -> m DOMCSSValue
toDOMCSSValue = IO DOMCSSValue -> m DOMCSSValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DOMCSSValue -> m DOMCSSValue)
-> (o -> IO DOMCSSValue) -> o -> m DOMCSSValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DOMCSSValue -> DOMCSSValue) -> o -> IO DOMCSSValue
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DOMCSSValue -> DOMCSSValue
DOMCSSValue
#if defined(ENABLE_OVERLOADING)
type family ResolveDOMCSSValueMethod (t :: Symbol) (o :: *) :: * where
ResolveDOMCSSValueMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDOMCSSValueMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDOMCSSValueMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDOMCSSValueMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDOMCSSValueMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDOMCSSValueMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDOMCSSValueMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDOMCSSValueMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDOMCSSValueMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDOMCSSValueMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDOMCSSValueMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDOMCSSValueMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDOMCSSValueMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDOMCSSValueMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDOMCSSValueMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDOMCSSValueMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDOMCSSValueMethod "getCssText" o = DOMCSSValueGetCssTextMethodInfo
ResolveDOMCSSValueMethod "getCssValueType" o = DOMCSSValueGetCssValueTypeMethodInfo
ResolveDOMCSSValueMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDOMCSSValueMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDOMCSSValueMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDOMCSSValueMethod "setCssText" o = DOMCSSValueSetCssTextMethodInfo
ResolveDOMCSSValueMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDOMCSSValueMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDOMCSSValueMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDOMCSSValueMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDOMCSSValueMethod t DOMCSSValue, O.MethodInfo info DOMCSSValue p) => OL.IsLabel t (DOMCSSValue -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getDOMCSSValueCssText :: (MonadIO m, IsDOMCSSValue o) => o -> m (Maybe T.Text)
getDOMCSSValueCssText :: o -> m (Maybe Text)
getDOMCSSValueCssText o
obj = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"css-text"
setDOMCSSValueCssText :: (MonadIO m, IsDOMCSSValue o) => o -> T.Text -> m ()
setDOMCSSValueCssText :: o -> Text -> m ()
setDOMCSSValueCssText o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"css-text" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructDOMCSSValueCssText :: (IsDOMCSSValue o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDOMCSSValueCssText :: Text -> m (GValueConstruct o)
constructDOMCSSValueCssText Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"css-text" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
clearDOMCSSValueCssText :: (MonadIO m, IsDOMCSSValue o) => o -> m ()
clearDOMCSSValueCssText :: o -> m ()
clearDOMCSSValueCssText o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"css-text" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data DOMCSSValueCssTextPropertyInfo
instance AttrInfo DOMCSSValueCssTextPropertyInfo where
type AttrAllowedOps DOMCSSValueCssTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DOMCSSValueCssTextPropertyInfo = IsDOMCSSValue
type AttrSetTypeConstraint DOMCSSValueCssTextPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DOMCSSValueCssTextPropertyInfo = (~) T.Text
type AttrTransferType DOMCSSValueCssTextPropertyInfo = T.Text
type AttrGetType DOMCSSValueCssTextPropertyInfo = (Maybe T.Text)
type AttrLabel DOMCSSValueCssTextPropertyInfo = "css-text"
type AttrOrigin DOMCSSValueCssTextPropertyInfo = DOMCSSValue
attrGet = getDOMCSSValueCssText
attrSet = setDOMCSSValueCssText
attrTransfer _ v = do
return v
attrConstruct = constructDOMCSSValueCssText
attrClear = clearDOMCSSValueCssText
#endif
getDOMCSSValueCssValueType :: (MonadIO m, IsDOMCSSValue o) => o -> m Word32
getDOMCSSValueCssValueType :: o -> m Word32
getDOMCSSValueCssValueType o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"css-value-type"
#if defined(ENABLE_OVERLOADING)
data DOMCSSValueCssValueTypePropertyInfo
instance AttrInfo DOMCSSValueCssValueTypePropertyInfo where
type AttrAllowedOps DOMCSSValueCssValueTypePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint DOMCSSValueCssValueTypePropertyInfo = IsDOMCSSValue
type AttrSetTypeConstraint DOMCSSValueCssValueTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint DOMCSSValueCssValueTypePropertyInfo = (~) ()
type AttrTransferType DOMCSSValueCssValueTypePropertyInfo = ()
type AttrGetType DOMCSSValueCssValueTypePropertyInfo = Word32
type AttrLabel DOMCSSValueCssValueTypePropertyInfo = "css-value-type"
type AttrOrigin DOMCSSValueCssValueTypePropertyInfo = DOMCSSValue
attrGet = getDOMCSSValueCssValueType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DOMCSSValue
type instance O.AttributeList DOMCSSValue = DOMCSSValueAttributeList
type DOMCSSValueAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("cssText", DOMCSSValueCssTextPropertyInfo), '("cssValueType", DOMCSSValueCssValueTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
dOMCSSValueCssText :: AttrLabelProxy "cssText"
dOMCSSValueCssText = AttrLabelProxy
dOMCSSValueCssValueType :: AttrLabelProxy "cssValueType"
dOMCSSValueCssValueType = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DOMCSSValue = DOMCSSValueSignalList
type DOMCSSValueSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_dom_css_value_get_css_text" webkit_dom_css_value_get_css_text ::
Ptr DOMCSSValue ->
IO CString
{-# DEPRECATED dOMCSSValueGetCssText ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
dOMCSSValueGetCssText ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMCSSValue a) =>
a
-> m T.Text
dOMCSSValueGetCssText :: a -> m Text
dOMCSSValueGetCssText a
self = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr DOMCSSValue
self' <- a -> IO (Ptr DOMCSSValue)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
result <- Ptr DOMCSSValue -> IO CString
webkit_dom_css_value_get_css_text Ptr DOMCSSValue
self'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"dOMCSSValueGetCssText" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DOMCSSValueGetCssTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMCSSValue a) => O.MethodInfo DOMCSSValueGetCssTextMethodInfo a signature where
overloadedMethod = dOMCSSValueGetCssText
#endif
foreign import ccall "webkit_dom_css_value_get_css_value_type" webkit_dom_css_value_get_css_value_type ::
Ptr DOMCSSValue ->
IO Word16
{-# DEPRECATED dOMCSSValueGetCssValueType ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
dOMCSSValueGetCssValueType ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMCSSValue a) =>
a
-> m Word16
dOMCSSValueGetCssValueType :: a -> m Word16
dOMCSSValueGetCssValueType a
self = IO Word16 -> m Word16
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word16 -> m Word16) -> IO Word16 -> m Word16
forall a b. (a -> b) -> a -> b
$ do
Ptr DOMCSSValue
self' <- a -> IO (Ptr DOMCSSValue)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Word16
result <- Ptr DOMCSSValue -> IO Word16
webkit_dom_css_value_get_css_value_type Ptr DOMCSSValue
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Word16 -> IO Word16
forall (m :: * -> *) a. Monad m => a -> m a
return Word16
result
#if defined(ENABLE_OVERLOADING)
data DOMCSSValueGetCssValueTypeMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsDOMCSSValue a) => O.MethodInfo DOMCSSValueGetCssValueTypeMethodInfo a signature where
overloadedMethod = dOMCSSValueGetCssValueType
#endif
foreign import ccall "webkit_dom_css_value_set_css_text" webkit_dom_css_value_set_css_text ::
Ptr DOMCSSValue ->
CString ->
Ptr (Ptr GError) ->
IO ()
{-# DEPRECATED dOMCSSValueSetCssText ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
dOMCSSValueSetCssText ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMCSSValue a) =>
a
-> T.Text
-> m ()
dOMCSSValueSetCssText :: a -> Text -> m ()
dOMCSSValueSetCssText a
self Text
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DOMCSSValue
self' <- a -> IO (Ptr DOMCSSValue)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
CString
value' <- Text -> IO CString
textToCString Text
value
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
(Ptr (Ptr GError) -> IO ()) -> IO ()
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO ()) -> IO ())
-> (Ptr (Ptr GError) -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ Ptr DOMCSSValue -> CString -> Ptr (Ptr GError) -> IO ()
webkit_dom_css_value_set_css_text Ptr DOMCSSValue
self' CString
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
)
#if defined(ENABLE_OVERLOADING)
data DOMCSSValueSetCssTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDOMCSSValue a) => O.MethodInfo DOMCSSValueSetCssTextMethodInfo a signature where
overloadedMethod = dOMCSSValueSetCssText
#endif