#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2WebExtension.Objects.Frame
(
Frame(..) ,
IsFrame ,
toFrame ,
noFrame ,
#if ENABLE_OVERLOADING
FrameGetJsContextMethodInfo ,
#endif
frameGetJsContext ,
#if ENABLE_OVERLOADING
FrameGetJsContextForScriptWorldMethodInfo,
#endif
frameGetJsContextForScriptWorld ,
#if ENABLE_OVERLOADING
FrameGetJsValueForDomObjectMethodInfo ,
#endif
frameGetJsValueForDomObject ,
#if ENABLE_OVERLOADING
FrameGetJsValueForDomObjectInScriptWorldMethodInfo,
#endif
frameGetJsValueForDomObjectInScriptWorld,
#if ENABLE_OVERLOADING
FrameGetUriMethodInfo ,
#endif
frameGetUri ,
#if ENABLE_OVERLOADING
FrameIsMainFrameMethodInfo ,
#endif
frameIsMainFrame ,
) 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 qualified GI.JavaScriptCore.Objects.Context as JavaScriptCore.Context
import qualified GI.JavaScriptCore.Objects.Value as JavaScriptCore.Value
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.ScriptWorld as WebKit2WebExtension.ScriptWorld
newtype Frame = Frame (ManagedPtr Frame)
foreign import ccall "webkit_frame_get_type"
c_webkit_frame_get_type :: IO GType
instance GObject Frame where
gobjectType = c_webkit_frame_get_type
class (GObject o, O.IsDescendantOf Frame o) => IsFrame o
instance (GObject o, O.IsDescendantOf Frame o) => IsFrame o
instance O.HasParentTypes Frame
type instance O.ParentTypes Frame = '[GObject.Object.Object]
toFrame :: (MonadIO m, IsFrame o) => o -> m Frame
toFrame = liftIO . unsafeCastTo Frame
noFrame :: Maybe Frame
noFrame = Nothing
#if ENABLE_OVERLOADING
type family ResolveFrameMethod (t :: Symbol) (o :: *) :: * where
ResolveFrameMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFrameMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFrameMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFrameMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFrameMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFrameMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFrameMethod "isMainFrame" o = FrameIsMainFrameMethodInfo
ResolveFrameMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFrameMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFrameMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFrameMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFrameMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFrameMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFrameMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFrameMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFrameMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFrameMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFrameMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFrameMethod "getJsContext" o = FrameGetJsContextMethodInfo
ResolveFrameMethod "getJsContextForScriptWorld" o = FrameGetJsContextForScriptWorldMethodInfo
ResolveFrameMethod "getJsValueForDomObject" o = FrameGetJsValueForDomObjectMethodInfo
ResolveFrameMethod "getJsValueForDomObjectInScriptWorld" o = FrameGetJsValueForDomObjectInScriptWorldMethodInfo
ResolveFrameMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFrameMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFrameMethod "getUri" o = FrameGetUriMethodInfo
ResolveFrameMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFrameMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFrameMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFrameMethod t Frame, O.MethodInfo info Frame p) => OL.IsLabel t (Frame -> 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
#if ENABLE_OVERLOADING
instance O.HasAttributeList Frame
type instance O.AttributeList Frame = FrameAttributeList
type FrameAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Frame = FrameSignalList
type FrameSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_frame_get_js_context" webkit_frame_get_js_context ::
Ptr Frame ->
IO (Ptr JavaScriptCore.Context.Context)
frameGetJsContext ::
(B.CallStack.HasCallStack, MonadIO m, IsFrame a) =>
a
-> m JavaScriptCore.Context.Context
frameGetJsContext frame = liftIO $ do
frame' <- unsafeManagedPtrCastPtr frame
result <- webkit_frame_get_js_context frame'
checkUnexpectedReturnNULL "frameGetJsContext" result
result' <- (wrapObject JavaScriptCore.Context.Context) result
touchManagedPtr frame
return result'
#if ENABLE_OVERLOADING
data FrameGetJsContextMethodInfo
instance (signature ~ (m JavaScriptCore.Context.Context), MonadIO m, IsFrame a) => O.MethodInfo FrameGetJsContextMethodInfo a signature where
overloadedMethod _ = frameGetJsContext
#endif
foreign import ccall "webkit_frame_get_js_context_for_script_world" webkit_frame_get_js_context_for_script_world ::
Ptr Frame ->
Ptr WebKit2WebExtension.ScriptWorld.ScriptWorld ->
IO (Ptr JavaScriptCore.Context.Context)
frameGetJsContextForScriptWorld ::
(B.CallStack.HasCallStack, MonadIO m, IsFrame a, WebKit2WebExtension.ScriptWorld.IsScriptWorld b) =>
a
-> b
-> m JavaScriptCore.Context.Context
frameGetJsContextForScriptWorld frame world = liftIO $ do
frame' <- unsafeManagedPtrCastPtr frame
world' <- unsafeManagedPtrCastPtr world
result <- webkit_frame_get_js_context_for_script_world frame' world'
checkUnexpectedReturnNULL "frameGetJsContextForScriptWorld" result
result' <- (wrapObject JavaScriptCore.Context.Context) result
touchManagedPtr frame
touchManagedPtr world
return result'
#if ENABLE_OVERLOADING
data FrameGetJsContextForScriptWorldMethodInfo
instance (signature ~ (b -> m JavaScriptCore.Context.Context), MonadIO m, IsFrame a, WebKit2WebExtension.ScriptWorld.IsScriptWorld b) => O.MethodInfo FrameGetJsContextForScriptWorldMethodInfo a signature where
overloadedMethod _ = frameGetJsContextForScriptWorld
#endif
foreign import ccall "webkit_frame_get_js_value_for_dom_object" webkit_frame_get_js_value_for_dom_object ::
Ptr Frame ->
Ptr WebKit2WebExtension.DOMObject.DOMObject ->
IO (Ptr JavaScriptCore.Value.Value)
frameGetJsValueForDomObject ::
(B.CallStack.HasCallStack, MonadIO m, IsFrame a, WebKit2WebExtension.DOMObject.IsDOMObject b) =>
a
-> b
-> m JavaScriptCore.Value.Value
frameGetJsValueForDomObject frame domObject = liftIO $ do
frame' <- unsafeManagedPtrCastPtr frame
domObject' <- unsafeManagedPtrCastPtr domObject
result <- webkit_frame_get_js_value_for_dom_object frame' domObject'
checkUnexpectedReturnNULL "frameGetJsValueForDomObject" result
result' <- (wrapObject JavaScriptCore.Value.Value) result
touchManagedPtr frame
touchManagedPtr domObject
return result'
#if ENABLE_OVERLOADING
data FrameGetJsValueForDomObjectMethodInfo
instance (signature ~ (b -> m JavaScriptCore.Value.Value), MonadIO m, IsFrame a, WebKit2WebExtension.DOMObject.IsDOMObject b) => O.MethodInfo FrameGetJsValueForDomObjectMethodInfo a signature where
overloadedMethod _ = frameGetJsValueForDomObject
#endif
foreign import ccall "webkit_frame_get_js_value_for_dom_object_in_script_world" webkit_frame_get_js_value_for_dom_object_in_script_world ::
Ptr Frame ->
Ptr WebKit2WebExtension.DOMObject.DOMObject ->
Ptr WebKit2WebExtension.ScriptWorld.ScriptWorld ->
IO (Ptr JavaScriptCore.Value.Value)
frameGetJsValueForDomObjectInScriptWorld ::
(B.CallStack.HasCallStack, MonadIO m, IsFrame a, WebKit2WebExtension.DOMObject.IsDOMObject b, WebKit2WebExtension.ScriptWorld.IsScriptWorld c) =>
a
-> b
-> c
-> m JavaScriptCore.Value.Value
frameGetJsValueForDomObjectInScriptWorld frame domObject world = liftIO $ do
frame' <- unsafeManagedPtrCastPtr frame
domObject' <- unsafeManagedPtrCastPtr domObject
world' <- unsafeManagedPtrCastPtr world
result <- webkit_frame_get_js_value_for_dom_object_in_script_world frame' domObject' world'
checkUnexpectedReturnNULL "frameGetJsValueForDomObjectInScriptWorld" result
result' <- (wrapObject JavaScriptCore.Value.Value) result
touchManagedPtr frame
touchManagedPtr domObject
touchManagedPtr world
return result'
#if ENABLE_OVERLOADING
data FrameGetJsValueForDomObjectInScriptWorldMethodInfo
instance (signature ~ (b -> c -> m JavaScriptCore.Value.Value), MonadIO m, IsFrame a, WebKit2WebExtension.DOMObject.IsDOMObject b, WebKit2WebExtension.ScriptWorld.IsScriptWorld c) => O.MethodInfo FrameGetJsValueForDomObjectInScriptWorldMethodInfo a signature where
overloadedMethod _ = frameGetJsValueForDomObjectInScriptWorld
#endif
foreign import ccall "webkit_frame_get_uri" webkit_frame_get_uri ::
Ptr Frame ->
IO CString
frameGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsFrame a) =>
a
-> m (Maybe T.Text)
frameGetUri frame = liftIO $ do
frame' <- unsafeManagedPtrCastPtr frame
result <- webkit_frame_get_uri frame'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- cstringToText result'
return result''
touchManagedPtr frame
return maybeResult
#if ENABLE_OVERLOADING
data FrameGetUriMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsFrame a) => O.MethodInfo FrameGetUriMethodInfo a signature where
overloadedMethod _ = frameGetUri
#endif
foreign import ccall "webkit_frame_is_main_frame" webkit_frame_is_main_frame ::
Ptr Frame ->
IO CInt
frameIsMainFrame ::
(B.CallStack.HasCallStack, MonadIO m, IsFrame a) =>
a
-> m Bool
frameIsMainFrame frame = liftIO $ do
frame' <- unsafeManagedPtrCastPtr frame
result <- webkit_frame_is_main_frame frame'
let result' = (/= 0) result
touchManagedPtr frame
return result'
#if ENABLE_OVERLOADING
data FrameIsMainFrameMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFrame a) => O.MethodInfo FrameIsMainFrameMethodInfo a signature where
overloadedMethod _ = frameIsMainFrame
#endif