{-# 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 ,
#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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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 GHC.Records as R
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 (SP.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)
instance SP.ManagedPtrNewtype WebResource where
toManagedPtr :: WebResource -> ManagedPtr WebResource
toManagedPtr (WebResource ManagedPtr WebResource
p) = ManagedPtr WebResource
p
foreign import ccall "webkit_web_resource_get_type"
c_webkit_web_resource_get_type :: IO B.Types.GType
instance B.Types.TypedObject WebResource where
glibType :: IO GType
glibType = IO GType
c_webkit_web_resource_get_type
instance B.Types.GObject WebResource
class (SP.GObject o, O.IsDescendantOf WebResource o) => IsWebResource o
instance (SP.GObject o, O.IsDescendantOf WebResource o) => IsWebResource o
instance O.HasParentTypes WebResource
type instance O.ParentTypes WebResource = '[GObject.Object.Object]
toWebResource :: (MIO.MonadIO m, IsWebResource o) => o -> m WebResource
toWebResource :: forall (m :: * -> *) o.
(MonadIO m, IsWebResource o) =>
o -> m WebResource
toWebResource = IO WebResource -> m WebResource
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr WebResource -> WebResource
WebResource
instance B.GValue.IsGValue (Maybe WebResource) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_webkit_web_resource_get_type
gvalueSet_ :: Ptr GValue -> Maybe WebResource -> IO ()
gvalueSet_ Ptr GValue
gv Maybe WebResource
P.Nothing = Ptr GValue -> Ptr WebResource -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr WebResource
forall a. Ptr a
FP.nullPtr :: FP.Ptr WebResource)
gvalueSet_ Ptr GValue
gv (P.Just WebResource
obj) = WebResource -> (Ptr WebResource -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr WebResource
obj (Ptr GValue -> Ptr WebResource -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe WebResource)
gvalueGet_ Ptr GValue
gv = do
Ptr WebResource
ptr <- Ptr GValue -> IO (Ptr WebResource)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr WebResource)
if Ptr WebResource
ptr Ptr WebResource -> Ptr WebResource -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr WebResource
forall a. Ptr a
FP.nullPtr
then WebResource -> Maybe WebResource
forall a. a -> Maybe a
P.Just (WebResource -> Maybe WebResource)
-> IO WebResource -> IO (Maybe WebResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (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
else Maybe WebResource -> IO (Maybe WebResource)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe WebResource
forall a. Maybe a
P.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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveWebResourceMethod t WebResource, O.OverloadedMethod info WebResource p, R.HasField t WebResource p) => R.HasField t WebResource p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveWebResourceMethod t WebResource, O.OverloadedMethodInfo info WebResource) => OL.IsLabel t (O.MethodProxy info WebResource) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#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 :: forall (m :: * -> *).
MonadIO m =>
WebResourceFailedCallback
-> m (GClosure C_WebResourceFailedCallback)
genClosure_WebResourceFailed 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 WebResourceFailedCallback
_cb Ptr ()
_ Ptr GError
error_ Ptr ()
_ = do
GError
error_' <- ((ManagedPtr GError -> GError) -> Ptr GError -> IO GError
forall a.
(HasCallStack, GBoxed 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 :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceFailedCallback -> m SignalHandlerId
onWebResourceFailed a
obj 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 Text
"failed" FunPtr C_WebResourceFailedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceFailed :: (IsWebResource a, MonadIO m) => a -> WebResourceFailedCallback -> m SignalHandlerId
afterWebResourceFailed :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceFailedCallback -> m SignalHandlerId
afterWebResourceFailed a
obj 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 Text
"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 :: forall (m :: * -> *).
MonadIO m =>
WebResourceFailedWithTlsErrorsCallback
-> m (GClosure C_WebResourceFailedWithTlsErrorsCallback)
genClosure_WebResourceFailedWithTlsErrors 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 WebResourceFailedWithTlsErrorsCallback
_cb Ptr ()
_ Ptr TlsCertificate
certificate CUInt
errors Ptr ()
_ = 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 :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
onWebResourceFailedWithTlsErrors a
obj 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 Text
"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 :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceFailedWithTlsErrorsCallback -> m SignalHandlerId
afterWebResourceFailedWithTlsErrors a
obj 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 Text
"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 :: forall (m :: * -> *).
MonadIO m =>
IO () -> m (GClosure C_WebResourceFinishedCallback)
genClosure_WebResourceFinished 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 IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId
onWebResourceFinished :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
onWebResourceFinished a
obj 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 Text
"finished" FunPtr C_WebResourceFinishedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterWebResourceFinished :: (IsWebResource a, MonadIO m) => a -> WebResourceFinishedCallback -> m SignalHandlerId
afterWebResourceFinished :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> IO () -> m SignalHandlerId
afterWebResourceFinished a
obj 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 Text
"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 :: forall (m :: * -> *).
MonadIO m =>
WebResourceReceivedDataCallback
-> m (GClosure C_WebResourceReceivedDataCallback)
genClosure_WebResourceReceivedData 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 WebResourceReceivedDataCallback
_cb Ptr ()
_ Word64
dataLength Ptr ()
_ = do
WebResourceReceivedDataCallback
_cb Word64
dataLength
onWebResourceReceivedData :: (IsWebResource a, MonadIO m) => a -> WebResourceReceivedDataCallback -> m SignalHandlerId
onWebResourceReceivedData :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceReceivedDataCallback -> m SignalHandlerId
onWebResourceReceivedData a
obj 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 Text
"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 :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceReceivedDataCallback -> m SignalHandlerId
afterWebResourceReceivedData a
obj 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 Text
"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 :: forall (m :: * -> *).
MonadIO m =>
WebResourceSentRequestCallback
-> m (GClosure C_WebResourceSentRequestCallback)
genClosure_WebResourceSentRequest 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 WebResourceSentRequestCallback
_cb Ptr ()
_ Ptr URIRequest
request Ptr URIResponse
redirectedResponse Ptr ()
_ = 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 :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceSentRequestCallback -> m SignalHandlerId
onWebResourceSentRequest a
obj 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 Text
"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 :: forall a (m :: * -> *).
(IsWebResource a, MonadIO m) =>
a -> WebResourceSentRequestCallback -> m SignalHandlerId
afterWebResourceSentRequest a
obj 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 Text
"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 :: forall (m :: * -> *) o.
(MonadIO m, IsWebResource o) =>
o -> m (Maybe URIResponse)
getWebResourceResponse o
obj = IO (Maybe URIResponse) -> m (Maybe URIResponse)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 String
"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 :: forall (m :: * -> *) o. (MonadIO m, IsWebResource o) => o -> m Text
getWebResourceUri o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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 Text
"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 String
"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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsWebResource a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
webResourceGetData a
resource Maybe b
cancellable 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
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just 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
Maybe AsyncReadyCallback
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 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.OverloadedMethod WebResourceGetDataMethodInfo a signature where
overloadedMethod = webResourceGetData
instance O.OverloadedMethodInfo WebResourceGetDataMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.WebKit2.Objects.WebResource.webResourceGetData",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.27/docs/GI-WebKit2-Objects-WebResource.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsWebResource a, IsAsyncResult b) =>
a -> b -> m ByteString
webResourceGetDataFinish a
resource 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 Text
"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.OverloadedMethod WebResourceGetDataFinishMethodInfo a signature where
overloadedMethod = webResourceGetDataFinish
instance O.OverloadedMethodInfo WebResourceGetDataFinishMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.WebKit2.Objects.WebResource.webResourceGetDataFinish",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.27/docs/GI-WebKit2-Objects-WebResource.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebResource a) =>
a -> m (Maybe URIResponse)
webResourceGetResponse 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
$ \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.OverloadedMethod WebResourceGetResponseMethodInfo a signature where
overloadedMethod = webResourceGetResponse
instance O.OverloadedMethodInfo WebResourceGetResponseMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.WebKit2.Objects.WebResource.webResourceGetResponse",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.27/docs/GI-WebKit2-Objects-WebResource.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsWebResource a) =>
a -> m Text
webResourceGetUri 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 Text
"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.OverloadedMethod WebResourceGetUriMethodInfo a signature where
overloadedMethod = webResourceGetUri
instance O.OverloadedMethodInfo WebResourceGetUriMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.WebKit2.Objects.WebResource.webResourceGetUri",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.27/docs/GI-WebKit2-Objects-WebResource.html#v:webResourceGetUri"
}
#endif