{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.MarkupParseContext
(
MarkupParseContext(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveMarkupParseContextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MarkupParseContextEndParseMethodInfo ,
#endif
markupParseContextEndParse ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextFreeMethodInfo ,
#endif
markupParseContextFree ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextGetElementMethodInfo ,
#endif
markupParseContextGetElement ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextGetUserDataMethodInfo ,
#endif
markupParseContextGetUserData ,
markupParseContextNew ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextParseMethodInfo ,
#endif
markupParseContextParse ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextPopMethodInfo ,
#endif
markupParseContextPop ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextPushMethodInfo ,
#endif
markupParseContextPush ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextRefMethodInfo ,
#endif
markupParseContextRef ,
#if defined(ENABLE_OVERLOADING)
MarkupParseContextUnrefMethodInfo ,
#endif
markupParseContextUnref ,
) 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.Coerce as Coerce
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.GLib.Callbacks as GLib.Callbacks
import {-# SOURCE #-} qualified GI.GLib.Flags as GLib.Flags
import {-# SOURCE #-} qualified GI.GLib.Structs.MarkupParser as GLib.MarkupParser
newtype MarkupParseContext = MarkupParseContext (SP.ManagedPtr MarkupParseContext)
deriving (MarkupParseContext -> MarkupParseContext -> Bool
(MarkupParseContext -> MarkupParseContext -> Bool)
-> (MarkupParseContext -> MarkupParseContext -> Bool)
-> Eq MarkupParseContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MarkupParseContext -> MarkupParseContext -> Bool
$c/= :: MarkupParseContext -> MarkupParseContext -> Bool
== :: MarkupParseContext -> MarkupParseContext -> Bool
$c== :: MarkupParseContext -> MarkupParseContext -> Bool
Eq)
instance SP.ManagedPtrNewtype MarkupParseContext where
toManagedPtr :: MarkupParseContext -> ManagedPtr MarkupParseContext
toManagedPtr (MarkupParseContext ManagedPtr MarkupParseContext
p) = ManagedPtr MarkupParseContext
p
foreign import ccall "g_markup_parse_context_get_type" c_g_markup_parse_context_get_type ::
IO GType
type instance O.ParentTypes MarkupParseContext = '[]
instance O.HasParentTypes MarkupParseContext
instance B.Types.TypedObject MarkupParseContext where
glibType :: IO GType
glibType = IO GType
c_g_markup_parse_context_get_type
instance B.Types.GBoxed MarkupParseContext
instance B.GValue.IsGValue (Maybe MarkupParseContext) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_markup_parse_context_get_type
gvalueSet_ :: Ptr GValue -> Maybe MarkupParseContext -> IO ()
gvalueSet_ Ptr GValue
gv Maybe MarkupParseContext
P.Nothing = Ptr GValue -> Ptr MarkupParseContext -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr MarkupParseContext
forall a. Ptr a
FP.nullPtr :: FP.Ptr MarkupParseContext)
gvalueSet_ Ptr GValue
gv (P.Just MarkupParseContext
obj) = MarkupParseContext -> (Ptr MarkupParseContext -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MarkupParseContext
obj (Ptr GValue -> Ptr MarkupParseContext -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe MarkupParseContext)
gvalueGet_ Ptr GValue
gv = do
Ptr MarkupParseContext
ptr <- Ptr GValue -> IO (Ptr MarkupParseContext)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr MarkupParseContext)
if Ptr MarkupParseContext
ptr Ptr MarkupParseContext -> Ptr MarkupParseContext -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr MarkupParseContext
forall a. Ptr a
FP.nullPtr
then MarkupParseContext -> Maybe MarkupParseContext
forall a. a -> Maybe a
P.Just (MarkupParseContext -> Maybe MarkupParseContext)
-> IO MarkupParseContext -> IO (Maybe MarkupParseContext)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr MarkupParseContext -> MarkupParseContext)
-> Ptr MarkupParseContext -> IO MarkupParseContext
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr MarkupParseContext -> MarkupParseContext
MarkupParseContext Ptr MarkupParseContext
ptr
else Maybe MarkupParseContext -> IO (Maybe MarkupParseContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe MarkupParseContext
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MarkupParseContext
type instance O.AttributeList MarkupParseContext = MarkupParseContextAttributeList
type MarkupParseContextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_markup_parse_context_new" g_markup_parse_context_new ::
Ptr GLib.MarkupParser.MarkupParser ->
CUInt ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO (Ptr MarkupParseContext)
markupParseContextNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.MarkupParser.MarkupParser
-> [GLib.Flags.MarkupParseFlags]
-> Ptr ()
-> GLib.Callbacks.DestroyNotify
-> m MarkupParseContext
markupParseContextNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParser
-> [MarkupParseFlags]
-> Ptr ()
-> DestroyNotify
-> m MarkupParseContext
markupParseContextNew MarkupParser
parser [MarkupParseFlags]
flags Ptr ()
userData DestroyNotify
userDataDnotify = IO MarkupParseContext -> m MarkupParseContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MarkupParseContext -> m MarkupParseContext)
-> IO MarkupParseContext -> m MarkupParseContext
forall a b. (a -> b) -> a -> b
$ do
Ptr MarkupParser
parser' <- MarkupParser -> IO (Ptr MarkupParser)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParser
parser
let flags' :: CUInt
flags' = [MarkupParseFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MarkupParseFlags]
flags
Ptr (FunPtr DestroyNotify)
ptruserDataDnotify <- IO (Ptr (FunPtr DestroyNotify))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_DestroyNotify))
FunPtr DestroyNotify
userDataDnotify' <- DestroyNotify -> IO (FunPtr DestroyNotify)
GLib.Callbacks.mk_DestroyNotify (Maybe (Ptr (FunPtr DestroyNotify))
-> DestroyNotify -> DestroyNotify
GLib.Callbacks.wrap_DestroyNotify (Ptr (FunPtr DestroyNotify) -> Maybe (Ptr (FunPtr DestroyNotify))
forall a. a -> Maybe a
Just Ptr (FunPtr DestroyNotify)
ptruserDataDnotify) DestroyNotify
userDataDnotify)
Ptr (FunPtr DestroyNotify) -> FunPtr DestroyNotify -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr DestroyNotify)
ptruserDataDnotify FunPtr DestroyNotify
userDataDnotify'
Ptr MarkupParseContext
result <- Ptr MarkupParser
-> CUInt
-> Ptr ()
-> FunPtr DestroyNotify
-> IO (Ptr MarkupParseContext)
g_markup_parse_context_new Ptr MarkupParser
parser' CUInt
flags' Ptr ()
userData FunPtr DestroyNotify
userDataDnotify'
Text -> Ptr MarkupParseContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"markupParseContextNew" Ptr MarkupParseContext
result
MarkupParseContext
result' <- ((ManagedPtr MarkupParseContext -> MarkupParseContext)
-> Ptr MarkupParseContext -> IO MarkupParseContext
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr MarkupParseContext -> MarkupParseContext
MarkupParseContext) Ptr MarkupParseContext
result
MarkupParser -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParser
parser
MarkupParseContext -> IO MarkupParseContext
forall (m :: * -> *) a. Monad m => a -> m a
return MarkupParseContext
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_markup_parse_context_end_parse" g_markup_parse_context_end_parse ::
Ptr MarkupParseContext ->
Ptr (Ptr GError) ->
IO CInt
markupParseContextEndParse ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m ()
markupParseContextEndParse :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m ()
markupParseContextEndParse MarkupParseContext
context = 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 MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr MarkupParseContext -> Ptr (Ptr GError) -> IO CInt
g_markup_parse_context_end_parse Ptr MarkupParseContext
context'
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextEndParseMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod MarkupParseContextEndParseMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextEndParse
instance O.OverloadedMethodInfo MarkupParseContextEndParseMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextEndParse",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextEndParse"
})
#endif
foreign import ccall "g_markup_parse_context_free" g_markup_parse_context_free ::
Ptr MarkupParseContext ->
IO ()
markupParseContextFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m ()
markupParseContextFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m ()
markupParseContextFree MarkupParseContext
context = 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 MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
Ptr MarkupParseContext -> IO ()
g_markup_parse_context_free Ptr MarkupParseContext
context'
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod MarkupParseContextFreeMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextFree
instance O.OverloadedMethodInfo MarkupParseContextFreeMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextFree"
})
#endif
foreign import ccall "g_markup_parse_context_get_element" g_markup_parse_context_get_element ::
Ptr MarkupParseContext ->
IO CString
markupParseContextGetElement ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m T.Text
markupParseContextGetElement :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m Text
markupParseContextGetElement MarkupParseContext
context = 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 MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
CString
result <- Ptr MarkupParseContext -> IO CString
g_markup_parse_context_get_element Ptr MarkupParseContext
context'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"markupParseContextGetElement" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextGetElementMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod MarkupParseContextGetElementMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextGetElement
instance O.OverloadedMethodInfo MarkupParseContextGetElementMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextGetElement",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextGetElement"
})
#endif
foreign import ccall "g_markup_parse_context_get_user_data" g_markup_parse_context_get_user_data ::
Ptr MarkupParseContext ->
IO (Ptr ())
markupParseContextGetUserData ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m (Ptr ())
markupParseContextGetUserData :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m (Ptr ())
markupParseContextGetUserData MarkupParseContext
context = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
Ptr ()
result <- Ptr MarkupParseContext -> IO (Ptr ())
g_markup_parse_context_get_user_data Ptr MarkupParseContext
context'
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextGetUserDataMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod MarkupParseContextGetUserDataMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextGetUserData
instance O.OverloadedMethodInfo MarkupParseContextGetUserDataMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextGetUserData",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextGetUserData"
})
#endif
foreign import ccall "g_markup_parse_context_parse" g_markup_parse_context_parse ::
Ptr MarkupParseContext ->
CString ->
Int64 ->
Ptr (Ptr GError) ->
IO CInt
markupParseContextParse ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> T.Text
-> Int64
-> m ()
markupParseContextParse :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> Text -> Int64 -> m ()
markupParseContextParse MarkupParseContext
context Text
text Int64
textLen = 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 MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
CString
text' <- Text -> IO CString
textToCString Text
text
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr MarkupParseContext
-> CString -> Int64 -> Ptr (Ptr GError) -> IO CInt
g_markup_parse_context_parse Ptr MarkupParseContext
context' CString
text' Int64
textLen
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
)
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextParseMethodInfo
instance (signature ~ (T.Text -> Int64 -> m ()), MonadIO m) => O.OverloadedMethod MarkupParseContextParseMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextParse
instance O.OverloadedMethodInfo MarkupParseContextParseMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextParse",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextParse"
})
#endif
foreign import ccall "g_markup_parse_context_pop" g_markup_parse_context_pop ::
Ptr MarkupParseContext ->
IO (Ptr ())
markupParseContextPop ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m (Ptr ())
markupParseContextPop :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m (Ptr ())
markupParseContextPop MarkupParseContext
context = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
Ptr ()
result <- Ptr MarkupParseContext -> IO (Ptr ())
g_markup_parse_context_pop Ptr MarkupParseContext
context'
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextPopMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod MarkupParseContextPopMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextPop
instance O.OverloadedMethodInfo MarkupParseContextPopMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextPop",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextPop"
})
#endif
foreign import ccall "g_markup_parse_context_push" g_markup_parse_context_push ::
Ptr MarkupParseContext ->
Ptr GLib.MarkupParser.MarkupParser ->
Ptr () ->
IO ()
markupParseContextPush ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> GLib.MarkupParser.MarkupParser
-> Ptr ()
-> m ()
markupParseContextPush :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> MarkupParser -> Ptr () -> m ()
markupParseContextPush MarkupParseContext
context MarkupParser
parser Ptr ()
userData = 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 MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
Ptr MarkupParser
parser' <- MarkupParser -> IO (Ptr MarkupParser)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParser
parser
Ptr MarkupParseContext -> Ptr MarkupParser -> DestroyNotify
g_markup_parse_context_push Ptr MarkupParseContext
context' Ptr MarkupParser
parser' Ptr ()
userData
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
MarkupParser -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParser
parser
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextPushMethodInfo
instance (signature ~ (GLib.MarkupParser.MarkupParser -> Ptr () -> m ()), MonadIO m) => O.OverloadedMethod MarkupParseContextPushMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextPush
instance O.OverloadedMethodInfo MarkupParseContextPushMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextPush",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextPush"
})
#endif
foreign import ccall "g_markup_parse_context_ref" g_markup_parse_context_ref ::
Ptr MarkupParseContext ->
IO (Ptr MarkupParseContext)
markupParseContextRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m MarkupParseContext
markupParseContextRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m MarkupParseContext
markupParseContextRef MarkupParseContext
context = IO MarkupParseContext -> m MarkupParseContext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MarkupParseContext -> m MarkupParseContext)
-> IO MarkupParseContext -> m MarkupParseContext
forall a b. (a -> b) -> a -> b
$ do
Ptr MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
Ptr MarkupParseContext
result <- Ptr MarkupParseContext -> IO (Ptr MarkupParseContext)
g_markup_parse_context_ref Ptr MarkupParseContext
context'
Text -> Ptr MarkupParseContext -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"markupParseContextRef" Ptr MarkupParseContext
result
MarkupParseContext
result' <- ((ManagedPtr MarkupParseContext -> MarkupParseContext)
-> Ptr MarkupParseContext -> IO MarkupParseContext
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr MarkupParseContext -> MarkupParseContext
MarkupParseContext) Ptr MarkupParseContext
result
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
MarkupParseContext -> IO MarkupParseContext
forall (m :: * -> *) a. Monad m => a -> m a
return MarkupParseContext
result'
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextRefMethodInfo
instance (signature ~ (m MarkupParseContext), MonadIO m) => O.OverloadedMethod MarkupParseContextRefMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextRef
instance O.OverloadedMethodInfo MarkupParseContextRefMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextRef"
})
#endif
foreign import ccall "g_markup_parse_context_unref" g_markup_parse_context_unref ::
Ptr MarkupParseContext ->
IO ()
markupParseContextUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
MarkupParseContext
-> m ()
markupParseContextUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MarkupParseContext -> m ()
markupParseContextUnref MarkupParseContext
context = 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 MarkupParseContext
context' <- MarkupParseContext -> IO (Ptr MarkupParseContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MarkupParseContext
context
Ptr MarkupParseContext -> IO ()
g_markup_parse_context_unref Ptr MarkupParseContext
context'
MarkupParseContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MarkupParseContext
context
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MarkupParseContextUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod MarkupParseContextUnrefMethodInfo MarkupParseContext signature where
overloadedMethod = markupParseContextUnref
instance O.OverloadedMethodInfo MarkupParseContextUnrefMethodInfo MarkupParseContext where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.MarkupParseContext.markupParseContextUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-MarkupParseContext.html#v:markupParseContextUnref"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveMarkupParseContextMethod (t :: Symbol) (o :: *) :: * where
ResolveMarkupParseContextMethod "endParse" o = MarkupParseContextEndParseMethodInfo
ResolveMarkupParseContextMethod "free" o = MarkupParseContextFreeMethodInfo
ResolveMarkupParseContextMethod "parse" o = MarkupParseContextParseMethodInfo
ResolveMarkupParseContextMethod "pop" o = MarkupParseContextPopMethodInfo
ResolveMarkupParseContextMethod "push" o = MarkupParseContextPushMethodInfo
ResolveMarkupParseContextMethod "ref" o = MarkupParseContextRefMethodInfo
ResolveMarkupParseContextMethod "unref" o = MarkupParseContextUnrefMethodInfo
ResolveMarkupParseContextMethod "getElement" o = MarkupParseContextGetElementMethodInfo
ResolveMarkupParseContextMethod "getUserData" o = MarkupParseContextGetUserDataMethodInfo
ResolveMarkupParseContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMarkupParseContextMethod t MarkupParseContext, O.OverloadedMethod info MarkupParseContext p) => OL.IsLabel t (MarkupParseContext -> 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 ~ ResolveMarkupParseContextMethod t MarkupParseContext, O.OverloadedMethod info MarkupParseContext p, R.HasField t MarkupParseContext p) => R.HasField t MarkupParseContext p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveMarkupParseContextMethod t MarkupParseContext, O.OverloadedMethodInfo info MarkupParseContext) => OL.IsLabel t (O.MethodProxy info MarkupParseContext) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif