{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2.Objects.WebResource
(
WebResource(..) ,
IsWebResource ,
toWebResource ,
noWebResource ,
#if defined(ENABLE_OVERLOADING)
ResolveWebResourceMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
WebResourceGetDataMethodInfo ,
#endif
webResourceGetData ,
#if defined(ENABLE_OVERLOADING)
WebResourceGetDataFinishMethodInfo ,
#endif
webResourceGetDataFinish ,
#if defined(ENABLE_OVERLOADING)
WebResourceGetResponseMethodInfo ,
#endif
webResourceGetResponse ,
#if defined(ENABLE_OVERLOADING)
WebResourceGetUriMethodInfo ,
#endif
webResourceGetUri ,
#if defined(ENABLE_OVERLOADING)
WebResourceResponsePropertyInfo ,
#endif
getWebResourceResponse ,
#if defined(ENABLE_OVERLOADING)
webResourceResponse ,
#endif
#if defined(ENABLE_OVERLOADING)
WebResourceUriPropertyInfo ,
#endif
getWebResourceUri ,
#if defined(ENABLE_OVERLOADING)
webResourceUri ,
#endif
C_WebResourceFailedCallback ,
WebResourceFailedCallback ,
#if defined(ENABLE_OVERLOADING)
WebResourceFailedSignalInfo ,
#endif
afterWebResourceFailed ,
genClosure_WebResourceFailed ,
mk_WebResourceFailedCallback ,
noWebResourceFailedCallback ,
onWebResourceFailed ,
wrap_WebResourceFailedCallback ,
C_WebResourceFailedWithTlsErrorsCallback,
WebResourceFailedWithTlsErrorsCallback ,
#if defined(ENABLE_OVERLOADING)
WebResourceFailedWithTlsErrorsSignalInfo,
#endif
afterWebResourceFailedWithTlsErrors ,
genClosure_WebResourceFailedWithTlsErrors,
mk_WebResourceFailedWithTlsErrorsCallback,
noWebResourceFailedWithTlsErrorsCallback,
onWebResourceFailedWithTlsErrors ,
wrap_WebResourceFailedWithTlsErrorsCallback,
C_WebResourceFinishedCallback ,
WebResourceFinishedCallback ,
#if defined(ENABLE_OVERLOADING)
WebResourceFinishedSignalInfo ,
#endif
afterWebResourceFinished ,
genClosure_WebResourceFinished ,
mk_WebResourceFinishedCallback ,
noWebResourceFinishedCallback ,
onWebResourceFinished ,
wrap_WebResourceFinishedCallback ,
C_WebResourceReceivedDataCallback ,
WebResourceReceivedDataCallback ,
#if defined(ENABLE_OVERLOADING)
WebResourceReceivedDataSignalInfo ,
#endif
afterWebResourceReceivedData ,
genClosure_WebResourceReceivedData ,
mk_WebResourceReceivedDataCallback ,
noWebResourceReceivedDataCallback ,
onWebResourceReceivedData ,
wrap_WebResourceReceivedDataCallback ,
C_WebResourceSentRequestCallback ,
WebResourceSentRequestCallback ,
#if defined(ENABLE_OVERLOADING)
WebResourceSentRequestSignalInfo ,
#endif
afterWebResourceSentRequest ,
genClosure_WebResourceSentRequest ,
mk_WebResourceSentRequestCallback ,
noWebResourceSentRequestCallback ,
onWebResourceSentRequest ,
wrap_WebResourceSentRequestCallback ,
) 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.GI.Base.Signals as B.Signals
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.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import {-# SOURCE #-} qualified GI.WebKit2.Objects.URIRequest as WebKit2.URIRequest
import {-# SOURCE #-} qualified GI.WebKit2.Objects.URIResponse as WebKit2.URIResponse
newtype WebResource = WebResource (ManagedPtr WebResource)
deriving (WebResource -> WebResource -> Bool
(WebResource -> WebResource -> Bool)
-> (WebResource -> WebResource -> Bool) -> Eq WebResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebResource -> WebResource -> Bool
$c/= :: WebResource -> WebResource -> Bool
== :: WebResource -> WebResource -> Bool
$c== :: WebResource -> WebResource -> Bool
Eq)
foreign import ccall "webkit_web_resource_get_type"
c_webkit_web_resource_get_type :: IO GType
instance GObject WebResource where
gobjectType :: IO GType
gobjectType = IO GType
c_webkit_web_resource_get_type
instance B.GValue.IsGValue WebResource where
toGValue :: WebResource -> IO GValue
toGValue o :: WebResource
o = do
GType
gtype <- IO GType
c_webkit_web_resource_get_type
WebResource -> (Ptr WebResource -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr WebResource
o (GType
-> (GValue -> Ptr WebResource -> IO ())
-> Ptr WebResource
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr WebResource -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO WebResource
fromGValue gv :: GValue
gv = do
Ptr WebResource
ptr <- GValue -> IO (Ptr WebResource)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr WebResource)
(ManagedPtr WebResource -> WebResource)
-> Ptr WebResource -> IO WebResource
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr WebResource -> WebResource
WebResource Ptr WebResource
ptr
class (GObject o, O.IsDescendantOf WebResource o) => IsWebResource o
instance (GObject o, O.IsDescendantOf WebResource o) => IsWebResource o
instance O.HasParentTypes WebResource
type instance O.ParentTypes WebResource = '[GObject.Object.Object]
toWebResource :: (MonadIO m, IsWebResource o) => o -> m WebResource
toWebResource :: o -> m WebResource
toWebResource = IO WebResource -> m WebResource
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WebResource -> m WebResource)
-> (o -> IO WebResource) -> o -> m WebResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr WebResource -> WebResource) -> o -> IO WebResource
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr WebResource -> WebResource
WebResource
noWebResource :: Maybe WebResource
noWebResource :: Maybe WebResource
noWebResource = Maybe WebResource
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveWebResourceMethod (t :: Symbol) (o :: *) :: * where
ResolveWebResourceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveWebResourceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveWebResourceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveWebResourceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveWebResourceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveWebResourceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveWebResourceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveWebResourceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveWebResourceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveWebResourceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveWebResourceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveWebResourceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveWebResourceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveWebResourceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveWebResourceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveWebResourceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveWebResourceMethod "getData" o = WebResourceGetDataMethodInfo
ResolveWebResourceMethod "getDataFinish" o = WebResourceGetDataFinishMethodInfo
ResolveWebResourceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveWebResourceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveWebResourceMethod "getResponse" o = WebResourceGetResponseMethodInfo
ResolveWebResourceMethod "getUri" o = WebResourceGetUriMethodInfo
ResolveWebResourceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveWebResourceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveWebResourceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveWebResourceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveWebResourceMethod t WebResource, O.MethodInfo info WebResource p) => OL.IsLabel t (WebResource -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type WebResourceFailedCallback =
GError
-> IO ()
noWebResourceFailedCallback :: Maybe WebResourceFailedCallback
noWebResourceFailedCallback :: Maybe WebResourceFailedCallback
noWebResourceFailedCallback = Maybe WebResourceFailedCallback
forall a. Maybe a
Nothing
type C_WebResourceFailedCallback =
Ptr () ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebResourceFailedCallback :: C_WebResourceFailedCallback -> IO (FunPtr C_WebResourceFailedCallback)
genClosure_WebResourceFailed :: MonadIO m => WebResourceFailedCallback -> m (GClosure C_WebResourceFailedCallback)
genClosure_WebResourceFailed :: WebResourceFailedCallback
-> m (GClosure C_WebResourceFailedCallback)
genClosure_WebResourceFailed cb :: WebResourceFailedCallback
cb = IO (GClosure C_WebResourceFailedCallback)
-> m (GClosure C_WebResourceFailedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebResourceFailedCallback)
-> m (GClosure C_WebResourceFailedCallback))
-> IO (GClosure C_WebResourceFailedCallback)
-> m (GClosure C_WebResourceFailedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFailedCallback
cb' = WebResourceFailedCallback -> C_WebResourceFailedCallback
wrap_WebResourceFailedCallback WebResourceFailedCallback
cb
C_WebResourceFailedCallback
-> IO (FunPtr C_WebResourceFailedCallback)
mk_WebResourceFailedCallback C_WebResourceFailedCallback
cb' IO (FunPtr C_WebResourceFailedCallback)
-> (FunPtr C_WebResourceFailedCallback
-> IO (GClosure C_WebResourceFailedCallback))
-> IO (GClosure C_WebResourceFailedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebResourceFailedCallback
-> IO (GClosure C_WebResourceFailedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebResourceFailedCallback ::
WebResourceFailedCallback ->
C_WebResourceFailedCallback
wrap_WebResourceFailedCallback :: WebResourceFailedCallback -> C_WebResourceFailedCallback
wrap_WebResourceFailedCallback _cb :: WebResourceFailedCallback
_cb _ error_ :: Ptr GError
error_ _ = do
GError
error_' <- ((ManagedPtr GError -> GError) -> Ptr GError -> IO GError
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GError -> GError
GError) Ptr GError
error_
WebResourceFailedCallback
_cb GError
error_'
onWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId
onWebResourceFailed :: a -> WebResourceFailedCallback -> m SignalHandlerId
onWebResourceFailed obj :: a
obj cb :: WebResourceFailedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFailedCallback
cb' = WebResourceFailedCallback -> C_WebResourceFailedCallback
wrap_WebResourceFailedCallback WebResourceFailedCallback
cb
FunPtr C_WebResourceFailedCallback
cb'' <- C_WebResourceFailedCallback
-> IO (FunPtr C_WebResourceFailedCallback)
mk_WebResourceFailedCallback C_WebResourceFailedCallback
cb'
a
-> Text
-> FunPtr C_WebResourceFailedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "failed" FunPtr C_WebResourceFailedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId
afterWebResourceFailed :: a -> WebResourceFailedCallback -> m SignalHandlerId
afterWebResourceFailed obj :: a
obj cb :: WebResourceFailedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFailedCallback
cb' = WebResourceFailedCallback -> C_WebResourceFailedCallback
wrap_WebResourceFailedCallback WebResourceFailedCallback
cb
FunPtr C_WebResourceFailedCallback
cb'' <- C_WebResourceFailedCallback
-> IO (FunPtr C_WebResourceFailedCallback)
mk_WebResourceFailedCallback C_WebResourceFailedCallback
cb'
a
-> Text
-> FunPtr C_WebResourceFailedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "failed" FunPtr C_WebResourceFailedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebResourceFailedSignalInfo
instance SignalInfo WebResourceFailedSignalInfo where
type HaskellCallbackType WebResourceFailedSignalInfo = WebResourceFailedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebResourceFailedCallback cb
cb'' <- mk_WebResourceFailedCallback cb'
connectSignalFunPtr obj "failed" cb'' connectMode detail
#endif
type WebResourceFailedWithTlsErrorsCallback =
Gio.TlsCertificate.TlsCertificate
-> [Gio.Flags.TlsCertificateFlags]
-> IO ()
noWebResourceFailedWithTlsErrorsCallback :: Maybe WebResourceFailedWithTlsErrorsCallback
noWebResourceFailedWithTlsErrorsCallback :: Maybe WebResourceFailedWithTlsErrorsCallback
noWebResourceFailedWithTlsErrorsCallback = Maybe WebResourceFailedWithTlsErrorsCallback
forall a. Maybe a
Nothing
type C_WebResourceFailedWithTlsErrorsCallback =
Ptr () ->
Ptr Gio.TlsCertificate.TlsCertificate ->
CUInt ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebResourceFailedWithTlsErrorsCallback :: C_WebResourceFailedWithTlsErrorsCallback -> IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback)
genClosure_WebResourceFailedWithTlsErrors :: MonadIO m => WebResourceFailedWithTlsErrorsCallback -> m (GClosure C_WebResourceFailedWithTlsErrorsCallback)
genClosure_WebResourceFailedWithTlsErrors :: WebResourceFailedWithTlsErrorsCallback
-> m (GClosure C_WebResourceFailedWithTlsErrorsCallback)
genClosure_WebResourceFailedWithTlsErrors cb :: WebResourceFailedWithTlsErrorsCallback
cb = IO (GClosure C_WebResourceFailedWithTlsErrorsCallback)
-> m (GClosure C_WebResourceFailedWithTlsErrorsCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebResourceFailedWithTlsErrorsCallback)
-> m (GClosure C_WebResourceFailedWithTlsErrorsCallback))
-> IO (GClosure C_WebResourceFailedWithTlsErrorsCallback)
-> m (GClosure C_WebResourceFailedWithTlsErrorsCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFailedWithTlsErrorsCallback
cb' = WebResourceFailedWithTlsErrorsCallback
-> C_WebResourceFailedWithTlsErrorsCallback
wrap_WebResourceFailedWithTlsErrorsCallback WebResourceFailedWithTlsErrorsCallback
cb
C_WebResourceFailedWithTlsErrorsCallback
-> IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback)
mk_WebResourceFailedWithTlsErrorsCallback C_WebResourceFailedWithTlsErrorsCallback
cb' IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback)
-> (FunPtr C_WebResourceFailedWithTlsErrorsCallback
-> IO (GClosure C_WebResourceFailedWithTlsErrorsCallback))
-> IO (GClosure C_WebResourceFailedWithTlsErrorsCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebResourceFailedWithTlsErrorsCallback
-> IO (GClosure C_WebResourceFailedWithTlsErrorsCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebResourceFailedWithTlsErrorsCallback ::
WebResourceFailedWithTlsErrorsCallback ->
C_WebResourceFailedWithTlsErrorsCallback
wrap_WebResourceFailedWithTlsErrorsCallback :: WebResourceFailedWithTlsErrorsCallback
-> C_WebResourceFailedWithTlsErrorsCallback
wrap_WebResourceFailedWithTlsErrorsCallback _cb :: WebResourceFailedWithTlsErrorsCallback
_cb _ certificate :: Ptr TlsCertificate
certificate errors :: CUInt
errors _ = do
TlsCertificate
certificate' <- ((ManagedPtr TlsCertificate -> TlsCertificate)
-> Ptr TlsCertificate -> IO TlsCertificate
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TlsCertificate -> TlsCertificate
Gio.TlsCertificate.TlsCertificate) Ptr TlsCertificate
certificate
let errors' :: [TlsCertificateFlags]
errors' = CUInt -> [TlsCertificateFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
errors
WebResourceFailedWithTlsErrorsCallback
_cb TlsCertificate
certificate' [TlsCertificateFlags]
errors'
onWebResourceFailedWithTlsErrors :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
onWebResourceFailedWithTlsErrors :: a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
onWebResourceFailedWithTlsErrors obj :: a
obj cb :: WebResourceFailedWithTlsErrorsCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFailedWithTlsErrorsCallback
cb' = WebResourceFailedWithTlsErrorsCallback
-> C_WebResourceFailedWithTlsErrorsCallback
wrap_WebResourceFailedWithTlsErrorsCallback WebResourceFailedWithTlsErrorsCallback
cb
FunPtr C_WebResourceFailedWithTlsErrorsCallback
cb'' <- C_WebResourceFailedWithTlsErrorsCallback
-> IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback)
mk_WebResourceFailedWithTlsErrorsCallback C_WebResourceFailedWithTlsErrorsCallback
cb'
a
-> Text
-> FunPtr C_WebResourceFailedWithTlsErrorsCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "failed-with-tls-errors" FunPtr C_WebResourceFailedWithTlsErrorsCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceFailedWithTlsErrors :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
afterWebResourceFailedWithTlsErrors :: a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
afterWebResourceFailedWithTlsErrors obj :: a
obj cb :: WebResourceFailedWithTlsErrorsCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFailedWithTlsErrorsCallback
cb' = WebResourceFailedWithTlsErrorsCallback
-> C_WebResourceFailedWithTlsErrorsCallback
wrap_WebResourceFailedWithTlsErrorsCallback WebResourceFailedWithTlsErrorsCallback
cb
FunPtr C_WebResourceFailedWithTlsErrorsCallback
cb'' <- C_WebResourceFailedWithTlsErrorsCallback
-> IO (FunPtr C_WebResourceFailedWithTlsErrorsCallback)
mk_WebResourceFailedWithTlsErrorsCallback C_WebResourceFailedWithTlsErrorsCallback
cb'
a
-> Text
-> FunPtr C_WebResourceFailedWithTlsErrorsCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "failed-with-tls-errors" FunPtr C_WebResourceFailedWithTlsErrorsCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebResourceFailedWithTlsErrorsSignalInfo
instance SignalInfo WebResourceFailedWithTlsErrorsSignalInfo where
type HaskellCallbackType WebResourceFailedWithTlsErrorsSignalInfo = WebResourceFailedWithTlsErrorsCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebResourceFailedWithTlsErrorsCallback cb
cb'' <- mk_WebResourceFailedWithTlsErrorsCallback cb'
connectSignalFunPtr obj "failed-with-tls-errors" cb'' connectMode detail
#endif
type WebResourceFinishedCallback =
IO ()
noWebResourceFinishedCallback :: Maybe WebResourceFinishedCallback
noWebResourceFinishedCallback :: Maybe (IO ())
noWebResourceFinishedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_WebResourceFinishedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebResourceFinishedCallback :: C_WebResourceFinishedCallback -> IO (FunPtr C_WebResourceFinishedCallback)
genClosure_WebResourceFinished :: MonadIO m => WebResourceFinishedCallback -> m (GClosure C_WebResourceFinishedCallback)
genClosure_WebResourceFinished :: IO () -> m (GClosure C_WebResourceFinishedCallback)
genClosure_WebResourceFinished cb :: IO ()
cb = IO (GClosure C_WebResourceFinishedCallback)
-> m (GClosure C_WebResourceFinishedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebResourceFinishedCallback)
-> m (GClosure C_WebResourceFinishedCallback))
-> IO (GClosure C_WebResourceFinishedCallback)
-> m (GClosure C_WebResourceFinishedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFinishedCallback
cb' = IO () -> C_WebResourceFinishedCallback
wrap_WebResourceFinishedCallback IO ()
cb
C_WebResourceFinishedCallback
-> IO (FunPtr C_WebResourceFinishedCallback)
mk_WebResourceFinishedCallback C_WebResourceFinishedCallback
cb' IO (FunPtr C_WebResourceFinishedCallback)
-> (FunPtr C_WebResourceFinishedCallback
-> IO (GClosure C_WebResourceFinishedCallback))
-> IO (GClosure C_WebResourceFinishedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebResourceFinishedCallback
-> IO (GClosure C_WebResourceFinishedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebResourceFinishedCallback ::
WebResourceFinishedCallback ->
C_WebResourceFinishedCallback
wrap_WebResourceFinishedCallback :: IO () -> C_WebResourceFinishedCallback
wrap_WebResourceFinishedCallback _cb :: IO ()
_cb _ _ = do
IO ()
_cb
onWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId
onWebResourceFinished :: a -> IO () -> m SignalHandlerId
onWebResourceFinished obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFinishedCallback
cb' = IO () -> C_WebResourceFinishedCallback
wrap_WebResourceFinishedCallback IO ()
cb
FunPtr C_WebResourceFinishedCallback
cb'' <- C_WebResourceFinishedCallback
-> IO (FunPtr C_WebResourceFinishedCallback)
mk_WebResourceFinishedCallback C_WebResourceFinishedCallback
cb'
a
-> Text
-> FunPtr C_WebResourceFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "finished" FunPtr C_WebResourceFinishedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId
afterWebResourceFinished :: a -> IO () -> m SignalHandlerId
afterWebResourceFinished obj :: a
obj cb :: IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceFinishedCallback
cb' = IO () -> C_WebResourceFinishedCallback
wrap_WebResourceFinishedCallback IO ()
cb
FunPtr C_WebResourceFinishedCallback
cb'' <- C_WebResourceFinishedCallback
-> IO (FunPtr C_WebResourceFinishedCallback)
mk_WebResourceFinishedCallback C_WebResourceFinishedCallback
cb'
a
-> Text
-> FunPtr C_WebResourceFinishedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "finished" FunPtr C_WebResourceFinishedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebResourceFinishedSignalInfo
instance SignalInfo WebResourceFinishedSignalInfo where
type HaskellCallbackType WebResourceFinishedSignalInfo = WebResourceFinishedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebResourceFinishedCallback cb
cb'' <- mk_WebResourceFinishedCallback cb'
connectSignalFunPtr obj "finished" cb'' connectMode detail
#endif
type WebResourceReceivedDataCallback =
Word64
-> IO ()
noWebResourceReceivedDataCallback :: Maybe WebResourceReceivedDataCallback
noWebResourceReceivedDataCallback :: Maybe WebResourceReceivedDataCallback
noWebResourceReceivedDataCallback = Maybe WebResourceReceivedDataCallback
forall a. Maybe a
Nothing
type C_WebResourceReceivedDataCallback =
Ptr () ->
Word64 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebResourceReceivedDataCallback :: C_WebResourceReceivedDataCallback -> IO (FunPtr C_WebResourceReceivedDataCallback)
genClosure_WebResourceReceivedData :: MonadIO m => WebResourceReceivedDataCallback -> m (GClosure C_WebResourceReceivedDataCallback)
genClosure_WebResourceReceivedData :: WebResourceReceivedDataCallback
-> m (GClosure C_WebResourceReceivedDataCallback)
genClosure_WebResourceReceivedData cb :: WebResourceReceivedDataCallback
cb = IO (GClosure C_WebResourceReceivedDataCallback)
-> m (GClosure C_WebResourceReceivedDataCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebResourceReceivedDataCallback)
-> m (GClosure C_WebResourceReceivedDataCallback))
-> IO (GClosure C_WebResourceReceivedDataCallback)
-> m (GClosure C_WebResourceReceivedDataCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceReceivedDataCallback
cb' = WebResourceReceivedDataCallback
-> C_WebResourceReceivedDataCallback
wrap_WebResourceReceivedDataCallback WebResourceReceivedDataCallback
cb
C_WebResourceReceivedDataCallback
-> IO (FunPtr C_WebResourceReceivedDataCallback)
mk_WebResourceReceivedDataCallback C_WebResourceReceivedDataCallback
cb' IO (FunPtr C_WebResourceReceivedDataCallback)
-> (FunPtr C_WebResourceReceivedDataCallback
-> IO (GClosure C_WebResourceReceivedDataCallback))
-> IO (GClosure C_WebResourceReceivedDataCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebResourceReceivedDataCallback
-> IO (GClosure C_WebResourceReceivedDataCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebResourceReceivedDataCallback ::
WebResourceReceivedDataCallback ->
C_WebResourceReceivedDataCallback
wrap_WebResourceReceivedDataCallback :: WebResourceReceivedDataCallback
-> C_WebResourceReceivedDataCallback
wrap_WebResourceReceivedDataCallback _cb :: WebResourceReceivedDataCallback
_cb _ dataLength :: Word64
dataLength _ = do
WebResourceReceivedDataCallback
_cb Word64
dataLength
onWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId
onWebResourceReceivedData :: a -> WebResourceReceivedDataCallback -> m SignalHandlerId
onWebResourceReceivedData obj :: a
obj cb :: WebResourceReceivedDataCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceReceivedDataCallback
cb' = WebResourceReceivedDataCallback
-> C_WebResourceReceivedDataCallback
wrap_WebResourceReceivedDataCallback WebResourceReceivedDataCallback
cb
FunPtr C_WebResourceReceivedDataCallback
cb'' <- C_WebResourceReceivedDataCallback
-> IO (FunPtr C_WebResourceReceivedDataCallback)
mk_WebResourceReceivedDataCallback C_WebResourceReceivedDataCallback
cb'
a
-> Text
-> FunPtr C_WebResourceReceivedDataCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "received-data" FunPtr C_WebResourceReceivedDataCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId
afterWebResourceReceivedData :: a -> WebResourceReceivedDataCallback -> m SignalHandlerId
afterWebResourceReceivedData obj :: a
obj cb :: WebResourceReceivedDataCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceReceivedDataCallback
cb' = WebResourceReceivedDataCallback
-> C_WebResourceReceivedDataCallback
wrap_WebResourceReceivedDataCallback WebResourceReceivedDataCallback
cb
FunPtr C_WebResourceReceivedDataCallback
cb'' <- C_WebResourceReceivedDataCallback
-> IO (FunPtr C_WebResourceReceivedDataCallback)
mk_WebResourceReceivedDataCallback C_WebResourceReceivedDataCallback
cb'
a
-> Text
-> FunPtr C_WebResourceReceivedDataCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "received-data" FunPtr C_WebResourceReceivedDataCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebResourceReceivedDataSignalInfo
instance SignalInfo WebResourceReceivedDataSignalInfo where
type HaskellCallbackType WebResourceReceivedDataSignalInfo = WebResourceReceivedDataCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebResourceReceivedDataCallback cb
cb'' <- mk_WebResourceReceivedDataCallback cb'
connectSignalFunPtr obj "received-data" cb'' connectMode detail
#endif
type WebResourceSentRequestCallback =
WebKit2.URIRequest.URIRequest
-> WebKit2.URIResponse.URIResponse
-> IO ()
noWebResourceSentRequestCallback :: Maybe WebResourceSentRequestCallback
noWebResourceSentRequestCallback :: Maybe WebResourceSentRequestCallback
noWebResourceSentRequestCallback = Maybe WebResourceSentRequestCallback
forall a. Maybe a
Nothing
type C_WebResourceSentRequestCallback =
Ptr () ->
Ptr WebKit2.URIRequest.URIRequest ->
Ptr WebKit2.URIResponse.URIResponse ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_WebResourceSentRequestCallback :: C_WebResourceSentRequestCallback -> IO (FunPtr C_WebResourceSentRequestCallback)
genClosure_WebResourceSentRequest :: MonadIO m => WebResourceSentRequestCallback -> m (GClosure C_WebResourceSentRequestCallback)
genClosure_WebResourceSentRequest :: WebResourceSentRequestCallback
-> m (GClosure C_WebResourceSentRequestCallback)
genClosure_WebResourceSentRequest cb :: WebResourceSentRequestCallback
cb = IO (GClosure C_WebResourceSentRequestCallback)
-> m (GClosure C_WebResourceSentRequestCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WebResourceSentRequestCallback)
-> m (GClosure C_WebResourceSentRequestCallback))
-> IO (GClosure C_WebResourceSentRequestCallback)
-> m (GClosure C_WebResourceSentRequestCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceSentRequestCallback
cb' = WebResourceSentRequestCallback -> C_WebResourceSentRequestCallback
wrap_WebResourceSentRequestCallback WebResourceSentRequestCallback
cb
C_WebResourceSentRequestCallback
-> IO (FunPtr C_WebResourceSentRequestCallback)
mk_WebResourceSentRequestCallback C_WebResourceSentRequestCallback
cb' IO (FunPtr C_WebResourceSentRequestCallback)
-> (FunPtr C_WebResourceSentRequestCallback
-> IO (GClosure C_WebResourceSentRequestCallback))
-> IO (GClosure C_WebResourceSentRequestCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WebResourceSentRequestCallback
-> IO (GClosure C_WebResourceSentRequestCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WebResourceSentRequestCallback ::
WebResourceSentRequestCallback ->
C_WebResourceSentRequestCallback
wrap_WebResourceSentRequestCallback :: WebResourceSentRequestCallback -> C_WebResourceSentRequestCallback
wrap_WebResourceSentRequestCallback _cb :: WebResourceSentRequestCallback
_cb _ request :: Ptr URIRequest
request redirectedResponse :: Ptr URIResponse
redirectedResponse _ = do
URIRequest
request' <- ((ManagedPtr URIRequest -> URIRequest)
-> Ptr URIRequest -> IO URIRequest
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr URIRequest -> URIRequest
WebKit2.URIRequest.URIRequest) Ptr URIRequest
request
URIResponse
redirectedResponse' <- ((ManagedPtr URIResponse -> URIResponse)
-> Ptr URIResponse -> IO URIResponse
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr URIResponse -> URIResponse
WebKit2.URIResponse.URIResponse) Ptr URIResponse
redirectedResponse
WebResourceSentRequestCallback
_cb URIRequest
request' URIResponse
redirectedResponse'
onWebResourceSentRequest :: (IsWebResource a, MonadIO m) => a -> WebResourceSentRequestCallback -> m SignalHandlerId
onWebResourceSentRequest :: a -> WebResourceSentRequestCallback -> m SignalHandlerId
onWebResourceSentRequest obj :: a
obj cb :: WebResourceSentRequestCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceSentRequestCallback
cb' = WebResourceSentRequestCallback -> C_WebResourceSentRequestCallback
wrap_WebResourceSentRequestCallback WebResourceSentRequestCallback
cb
FunPtr C_WebResourceSentRequestCallback
cb'' <- C_WebResourceSentRequestCallback
-> IO (FunPtr C_WebResourceSentRequestCallback)
mk_WebResourceSentRequestCallback C_WebResourceSentRequestCallback
cb'
a
-> Text
-> FunPtr C_WebResourceSentRequestCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "sent-request" FunPtr C_WebResourceSentRequestCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceSentRequest :: (IsWebResource a, MonadIO m) => a -> WebResourceSentRequestCallback -> m SignalHandlerId
afterWebResourceSentRequest :: a -> WebResourceSentRequestCallback -> m SignalHandlerId
afterWebResourceSentRequest obj :: a
obj cb :: WebResourceSentRequestCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WebResourceSentRequestCallback
cb' = WebResourceSentRequestCallback -> C_WebResourceSentRequestCallback
wrap_WebResourceSentRequestCallback WebResourceSentRequestCallback
cb
FunPtr C_WebResourceSentRequestCallback
cb'' <- C_WebResourceSentRequestCallback
-> IO (FunPtr C_WebResourceSentRequestCallback)
mk_WebResourceSentRequestCallback C_WebResourceSentRequestCallback
cb'
a
-> Text
-> FunPtr C_WebResourceSentRequestCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "sent-request" FunPtr C_WebResourceSentRequestCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data WebResourceSentRequestSignalInfo
instance SignalInfo WebResourceSentRequestSignalInfo where
type HaskellCallbackType WebResourceSentRequestSignalInfo = WebResourceSentRequestCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_WebResourceSentRequestCallback cb
cb'' <- mk_WebResourceSentRequestCallback cb'
connectSignalFunPtr obj "sent-request" cb'' connectMode detail
#endif
getWebResourceResponse :: (MonadIO m, IsWebResource o) => o -> m (Maybe WebKit2.URIResponse.URIResponse)
getWebResourceResponse :: o -> m (Maybe URIResponse)
getWebResourceResponse obj :: o
obj = IO (Maybe URIResponse) -> m (Maybe URIResponse)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe URIResponse) -> m (Maybe URIResponse))
-> IO (Maybe URIResponse) -> m (Maybe URIResponse)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr URIResponse -> URIResponse)
-> IO (Maybe URIResponse)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj "response" ManagedPtr URIResponse -> URIResponse
WebKit2.URIResponse.URIResponse
#if defined(ENABLE_OVERLOADING)
data WebResourceResponsePropertyInfo
instance AttrInfo WebResourceResponsePropertyInfo where
type AttrAllowedOps WebResourceResponsePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint WebResourceResponsePropertyInfo = IsWebResource
type AttrSetTypeConstraint WebResourceResponsePropertyInfo = (~) ()
type AttrTransferTypeConstraint WebResourceResponsePropertyInfo = (~) ()
type AttrTransferType WebResourceResponsePropertyInfo = ()
type AttrGetType WebResourceResponsePropertyInfo = (Maybe WebKit2.URIResponse.URIResponse)
type AttrLabel WebResourceResponsePropertyInfo = "response"
type AttrOrigin WebResourceResponsePropertyInfo = WebResource
attrGet = getWebResourceResponse
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getWebResourceUri :: (MonadIO m, IsWebResource o) => o -> m T.Text
getWebResourceUri :: o -> m Text
getWebResourceUri obj :: o
obj = 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
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getWebResourceUri" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO 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 "uri"
#if defined(ENABLE_OVERLOADING)
data WebResourceUriPropertyInfo
instance AttrInfo WebResourceUriPropertyInfo where
type AttrAllowedOps WebResourceUriPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint WebResourceUriPropertyInfo = IsWebResource
type AttrSetTypeConstraint WebResourceUriPropertyInfo = (~) ()
type AttrTransferTypeConstraint WebResourceUriPropertyInfo = (~) ()
type AttrTransferType WebResourceUriPropertyInfo = ()
type AttrGetType WebResourceUriPropertyInfo = T.Text
type AttrLabel WebResourceUriPropertyInfo = "uri"
type AttrOrigin WebResourceUriPropertyInfo = WebResource
attrGet = getWebResourceUri
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList WebResource
type instance O.AttributeList WebResource = WebResourceAttributeList
type WebResourceAttributeList = ('[ '("response", WebResourceResponsePropertyInfo), '("uri", WebResourceUriPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
webResourceResponse :: AttrLabelProxy "response"
webResourceResponse = AttrLabelProxy
webResourceUri :: AttrLabelProxy "uri"
webResourceUri = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList WebResource = WebResourceSignalList
type WebResourceSignalList = ('[ '("failed", WebResourceFailedSignalInfo), '("failedWithTlsErrors", WebResourceFailedWithTlsErrorsSignalInfo), '("finished", WebResourceFinishedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("receivedData", WebResourceReceivedDataSignalInfo), '("sentRequest", WebResourceSentRequestSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_web_resource_get_data" webkit_web_resource_get_data ::
Ptr WebResource ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
webResourceGetData ::
(B.CallStack.HasCallStack, MonadIO m, IsWebResource a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
webResourceGetData :: a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
webResourceGetData resource :: a
resource cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = 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 WebResource
resource' <- a -> IO (Ptr WebResource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resource
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just jCallback :: AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr WebResource
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
webkit_web_resource_get_data Ptr WebResource
resource' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resource
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data WebResourceGetDataMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsWebResource a, Gio.Cancellable.IsCancellable b) => O.MethodInfo WebResourceGetDataMethodInfo a signature where
overloadedMethod = webResourceGetData
#endif
foreign import ccall "webkit_web_resource_get_data_finish" webkit_web_resource_get_data_finish ::
Ptr WebResource ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr Word64 ->
Ptr (Ptr GError) ->
IO (Ptr Word8)
webResourceGetDataFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsWebResource a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ByteString
webResourceGetDataFinish :: a -> b -> m ByteString
webResourceGetDataFinish resource :: a
resource result_ :: b
result_ = IO ByteString -> m ByteString
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ByteString -> m ByteString) -> IO ByteString -> m ByteString
forall a b. (a -> b) -> a -> b
$ do
Ptr WebResource
resource' <- a -> IO (Ptr WebResource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resource
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
IO ByteString -> IO () -> IO ByteString
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Word8
result <- (Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8))
-> (Ptr (Ptr GError) -> IO (Ptr Word8)) -> IO (Ptr Word8)
forall a b. (a -> b) -> a -> b
$ Ptr WebResource
-> Ptr AsyncResult
-> Ptr Word64
-> Ptr (Ptr GError)
-> IO (Ptr Word8)
webkit_web_resource_get_data_finish Ptr WebResource
resource' Ptr AsyncResult
result_' Ptr Word64
length_
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
Text -> Ptr Word8 -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "webResourceGetDataFinish" Ptr Word8
result
ByteString
result' <- (Word64 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word64
length_') Ptr Word8
result
Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resource
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
ByteString -> IO ByteString
forall (m :: * -> *) a. Monad m => a -> m a
return ByteString
result'
) (do
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
)
#if defined(ENABLE_OVERLOADING)
data WebResourceGetDataFinishMethodInfo
instance (signature ~ (b -> m ByteString), MonadIO m, IsWebResource a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo WebResourceGetDataFinishMethodInfo a signature where
overloadedMethod = webResourceGetDataFinish
#endif
foreign import ccall "webkit_web_resource_get_response" webkit_web_resource_get_response ::
Ptr WebResource ->
IO (Ptr WebKit2.URIResponse.URIResponse)
webResourceGetResponse ::
(B.CallStack.HasCallStack, MonadIO m, IsWebResource a) =>
a
-> m (Maybe WebKit2.URIResponse.URIResponse)
webResourceGetResponse :: a -> m (Maybe URIResponse)
webResourceGetResponse resource :: a
resource = IO (Maybe URIResponse) -> m (Maybe URIResponse)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe URIResponse) -> m (Maybe URIResponse))
-> IO (Maybe URIResponse) -> m (Maybe URIResponse)
forall a b. (a -> b) -> a -> b
$ do
Ptr WebResource
resource' <- a -> IO (Ptr WebResource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resource
Ptr URIResponse
result <- Ptr WebResource -> IO (Ptr URIResponse)
webkit_web_resource_get_response Ptr WebResource
resource'
Maybe URIResponse
maybeResult <- Ptr URIResponse
-> (Ptr URIResponse -> IO URIResponse) -> IO (Maybe URIResponse)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr URIResponse
result ((Ptr URIResponse -> IO URIResponse) -> IO (Maybe URIResponse))
-> (Ptr URIResponse -> IO URIResponse) -> IO (Maybe URIResponse)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr URIResponse
result' -> do
URIResponse
result'' <- ((ManagedPtr URIResponse -> URIResponse)
-> Ptr URIResponse -> IO URIResponse
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr URIResponse -> URIResponse
WebKit2.URIResponse.URIResponse) Ptr URIResponse
result'
URIResponse -> IO URIResponse
forall (m :: * -> *) a. Monad m => a -> m a
return URIResponse
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resource
Maybe URIResponse -> IO (Maybe URIResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe URIResponse
maybeResult
#if defined(ENABLE_OVERLOADING)
data WebResourceGetResponseMethodInfo
instance (signature ~ (m (Maybe WebKit2.URIResponse.URIResponse)), MonadIO m, IsWebResource a) => O.MethodInfo WebResourceGetResponseMethodInfo a signature where
overloadedMethod = webResourceGetResponse
#endif
foreign import ccall "webkit_web_resource_get_uri" webkit_web_resource_get_uri ::
Ptr WebResource ->
IO CString
webResourceGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsWebResource a) =>
a
-> m T.Text
webResourceGetUri :: a -> m Text
webResourceGetUri resource :: a
resource = 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 WebResource
resource' <- a -> IO (Ptr WebResource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resource
CString
result <- Ptr WebResource -> IO CString
webkit_web_resource_get_uri Ptr WebResource
resource'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "webResourceGetUri" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resource
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data WebResourceGetUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebResource a) => O.MethodInfo WebResourceGetUriMethodInfo a signature where
overloadedMethod = webResourceGetUri
#endif