#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2WebExtension.Objects.DOMBlob
(
DOMBlob(..) ,
IsDOMBlob ,
toDOMBlob ,
noDOMBlob ,
#if ENABLE_OVERLOADING
DOMBlobGetSizeMethodInfo ,
#endif
dOMBlobGetSize ,
#if ENABLE_OVERLOADING
DOMBlobSizePropertyInfo ,
#endif
#if ENABLE_OVERLOADING
dOMBlobSize ,
#endif
getDOMBlobSize ,
) 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.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.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 DOMBlob = DOMBlob (ManagedPtr DOMBlob)
foreign import ccall "webkit_dom_blob_get_type"
c_webkit_dom_blob_get_type :: IO GType
instance GObject DOMBlob where
gobjectType = c_webkit_dom_blob_get_type
class (GObject o, O.IsDescendantOf DOMBlob o) => IsDOMBlob o
instance (GObject o, O.IsDescendantOf DOMBlob o) => IsDOMBlob o
instance O.HasParentTypes DOMBlob
type instance O.ParentTypes DOMBlob = '[WebKit2WebExtension.DOMObject.DOMObject, GObject.Object.Object]
toDOMBlob :: (MonadIO m, IsDOMBlob o) => o -> m DOMBlob
toDOMBlob = liftIO . unsafeCastTo DOMBlob
noDOMBlob :: Maybe DOMBlob
noDOMBlob = Nothing
#if ENABLE_OVERLOADING
type family ResolveDOMBlobMethod (t :: Symbol) (o :: *) :: * where
ResolveDOMBlobMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDOMBlobMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDOMBlobMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDOMBlobMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDOMBlobMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDOMBlobMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDOMBlobMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDOMBlobMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDOMBlobMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDOMBlobMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDOMBlobMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDOMBlobMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDOMBlobMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDOMBlobMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDOMBlobMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDOMBlobMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDOMBlobMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDOMBlobMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDOMBlobMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDOMBlobMethod "getSize" o = DOMBlobGetSizeMethodInfo
ResolveDOMBlobMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDOMBlobMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDOMBlobMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDOMBlobMethod t DOMBlob, O.MethodInfo info DOMBlob p) => OL.IsLabel t (DOMBlob -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getDOMBlobSize :: (MonadIO m, IsDOMBlob o) => o -> m Word64
getDOMBlobSize obj = liftIO $ B.Properties.getObjectPropertyUInt64 obj "size"
#if ENABLE_OVERLOADING
data DOMBlobSizePropertyInfo
instance AttrInfo DOMBlobSizePropertyInfo where
type AttrAllowedOps DOMBlobSizePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMBlobSizePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMBlobSizePropertyInfo = IsDOMBlob
type AttrGetType DOMBlobSizePropertyInfo = Word64
type AttrLabel DOMBlobSizePropertyInfo = "size"
type AttrOrigin DOMBlobSizePropertyInfo = DOMBlob
attrGet _ = getDOMBlobSize
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DOMBlob
type instance O.AttributeList DOMBlob = DOMBlobAttributeList
type DOMBlobAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("size", DOMBlobSizePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
dOMBlobSize :: AttrLabelProxy "size"
dOMBlobSize = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList DOMBlob = DOMBlobSignalList
type DOMBlobSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_dom_blob_get_size" webkit_dom_blob_get_size ::
Ptr DOMBlob ->
IO Word64
{-# DEPRECATED dOMBlobGetSize ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
dOMBlobGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsDOMBlob a) =>
a
-> m Word64
dOMBlobGetSize self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- webkit_dom_blob_get_size self'
touchManagedPtr self
return result
#if ENABLE_OVERLOADING
data DOMBlobGetSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsDOMBlob a) => O.MethodInfo DOMBlobGetSizeMethodInfo a signature where
overloadedMethod _ = dOMBlobGetSize
#endif