#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GLib.Structs.MarkupParser
(
MarkupParser(..) ,
newZeroMarkupParser ,
noMarkupParser ,
clearMarkupParserEndElement ,
getMarkupParserEndElement ,
#if ENABLE_OVERLOADING
markupParser_endElement ,
#endif
setMarkupParserEndElement ,
clearMarkupParserError ,
getMarkupParserError ,
#if ENABLE_OVERLOADING
markupParser_error ,
#endif
setMarkupParserError ,
clearMarkupParserPassthrough ,
getMarkupParserPassthrough ,
#if ENABLE_OVERLOADING
markupParser_passthrough ,
#endif
setMarkupParserPassthrough ,
clearMarkupParserStartElement ,
getMarkupParserStartElement ,
#if ENABLE_OVERLOADING
markupParser_startElement ,
#endif
setMarkupParserStartElement ,
clearMarkupParserText ,
getMarkupParserText ,
#if ENABLE_OVERLOADING
markupParser_text ,
#endif
setMarkupParserText ,
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GLib.Callbacks as GLib.Callbacks
newtype MarkupParser = MarkupParser (ManagedPtr MarkupParser)
instance WrappedPtr MarkupParser where
wrappedPtrCalloc = callocBytes 40
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 40 >=> wrapPtr MarkupParser)
wrappedPtrFree = Just ptr_to_g_free
newZeroMarkupParser :: MonadIO m => m MarkupParser
newZeroMarkupParser = liftIO $ wrappedPtrCalloc >>= wrapPtr MarkupParser
instance tag ~ 'AttrSet => Constructible MarkupParser tag where
new _ attrs = do
o <- newZeroMarkupParser
GI.Attributes.set o attrs
return o
noMarkupParser :: Maybe MarkupParser
noMarkupParser = Nothing
getMarkupParserStartElement :: MonadIO m => MarkupParser -> m (Maybe GLib.Callbacks.MarkupParserStartElementFieldCallback_WithClosures)
getMarkupParserStartElement s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (FunPtr GLib.Callbacks.C_MarkupParserStartElementFieldCallback)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GLib.Callbacks.dynamic_MarkupParserStartElementFieldCallback val'
return val''
return result
setMarkupParserStartElement :: MonadIO m => MarkupParser -> FunPtr GLib.Callbacks.C_MarkupParserStartElementFieldCallback -> m ()
setMarkupParserStartElement s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: FunPtr GLib.Callbacks.C_MarkupParserStartElementFieldCallback)
clearMarkupParserStartElement :: MonadIO m => MarkupParser -> m ()
clearMarkupParserStartElement s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MarkupParserStartElementFieldCallback)
#if ENABLE_OVERLOADING
data MarkupParserStartElementFieldInfo
instance AttrInfo MarkupParserStartElementFieldInfo where
type AttrAllowedOps MarkupParserStartElementFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MarkupParserStartElementFieldInfo = (~) (FunPtr GLib.Callbacks.C_MarkupParserStartElementFieldCallback)
type AttrBaseTypeConstraint MarkupParserStartElementFieldInfo = (~) MarkupParser
type AttrGetType MarkupParserStartElementFieldInfo = Maybe GLib.Callbacks.MarkupParserStartElementFieldCallback_WithClosures
type AttrLabel MarkupParserStartElementFieldInfo = "start_element"
type AttrOrigin MarkupParserStartElementFieldInfo = MarkupParser
attrGet _ = getMarkupParserStartElement
attrSet _ = setMarkupParserStartElement
attrConstruct = undefined
attrClear _ = clearMarkupParserStartElement
markupParser_startElement :: AttrLabelProxy "startElement"
markupParser_startElement = AttrLabelProxy
#endif
getMarkupParserEndElement :: MonadIO m => MarkupParser -> m (Maybe GLib.Callbacks.MarkupParserEndElementFieldCallback_WithClosures)
getMarkupParserEndElement s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (FunPtr GLib.Callbacks.C_MarkupParserEndElementFieldCallback)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GLib.Callbacks.dynamic_MarkupParserEndElementFieldCallback val'
return val''
return result
setMarkupParserEndElement :: MonadIO m => MarkupParser -> FunPtr GLib.Callbacks.C_MarkupParserEndElementFieldCallback -> m ()
setMarkupParserEndElement s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: FunPtr GLib.Callbacks.C_MarkupParserEndElementFieldCallback)
clearMarkupParserEndElement :: MonadIO m => MarkupParser -> m ()
clearMarkupParserEndElement s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MarkupParserEndElementFieldCallback)
#if ENABLE_OVERLOADING
data MarkupParserEndElementFieldInfo
instance AttrInfo MarkupParserEndElementFieldInfo where
type AttrAllowedOps MarkupParserEndElementFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MarkupParserEndElementFieldInfo = (~) (FunPtr GLib.Callbacks.C_MarkupParserEndElementFieldCallback)
type AttrBaseTypeConstraint MarkupParserEndElementFieldInfo = (~) MarkupParser
type AttrGetType MarkupParserEndElementFieldInfo = Maybe GLib.Callbacks.MarkupParserEndElementFieldCallback_WithClosures
type AttrLabel MarkupParserEndElementFieldInfo = "end_element"
type AttrOrigin MarkupParserEndElementFieldInfo = MarkupParser
attrGet _ = getMarkupParserEndElement
attrSet _ = setMarkupParserEndElement
attrConstruct = undefined
attrClear _ = clearMarkupParserEndElement
markupParser_endElement :: AttrLabelProxy "endElement"
markupParser_endElement = AttrLabelProxy
#endif
getMarkupParserText :: MonadIO m => MarkupParser -> m (Maybe GLib.Callbacks.MarkupParserTextFieldCallback_WithClosures)
getMarkupParserText s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (FunPtr GLib.Callbacks.C_MarkupParserTextFieldCallback)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GLib.Callbacks.dynamic_MarkupParserTextFieldCallback val'
return val''
return result
setMarkupParserText :: MonadIO m => MarkupParser -> FunPtr GLib.Callbacks.C_MarkupParserTextFieldCallback -> m ()
setMarkupParserText s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: FunPtr GLib.Callbacks.C_MarkupParserTextFieldCallback)
clearMarkupParserText :: MonadIO m => MarkupParser -> m ()
clearMarkupParserText s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MarkupParserTextFieldCallback)
#if ENABLE_OVERLOADING
data MarkupParserTextFieldInfo
instance AttrInfo MarkupParserTextFieldInfo where
type AttrAllowedOps MarkupParserTextFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MarkupParserTextFieldInfo = (~) (FunPtr GLib.Callbacks.C_MarkupParserTextFieldCallback)
type AttrBaseTypeConstraint MarkupParserTextFieldInfo = (~) MarkupParser
type AttrGetType MarkupParserTextFieldInfo = Maybe GLib.Callbacks.MarkupParserTextFieldCallback_WithClosures
type AttrLabel MarkupParserTextFieldInfo = "text"
type AttrOrigin MarkupParserTextFieldInfo = MarkupParser
attrGet _ = getMarkupParserText
attrSet _ = setMarkupParserText
attrConstruct = undefined
attrClear _ = clearMarkupParserText
markupParser_text :: AttrLabelProxy "text"
markupParser_text = AttrLabelProxy
#endif
getMarkupParserPassthrough :: MonadIO m => MarkupParser -> m (Maybe GLib.Callbacks.MarkupParserPassthroughFieldCallback_WithClosures)
getMarkupParserPassthrough s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (FunPtr GLib.Callbacks.C_MarkupParserPassthroughFieldCallback)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GLib.Callbacks.dynamic_MarkupParserPassthroughFieldCallback val'
return val''
return result
setMarkupParserPassthrough :: MonadIO m => MarkupParser -> FunPtr GLib.Callbacks.C_MarkupParserPassthroughFieldCallback -> m ()
setMarkupParserPassthrough s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: FunPtr GLib.Callbacks.C_MarkupParserPassthroughFieldCallback)
clearMarkupParserPassthrough :: MonadIO m => MarkupParser -> m ()
clearMarkupParserPassthrough s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MarkupParserPassthroughFieldCallback)
#if ENABLE_OVERLOADING
data MarkupParserPassthroughFieldInfo
instance AttrInfo MarkupParserPassthroughFieldInfo where
type AttrAllowedOps MarkupParserPassthroughFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MarkupParserPassthroughFieldInfo = (~) (FunPtr GLib.Callbacks.C_MarkupParserPassthroughFieldCallback)
type AttrBaseTypeConstraint MarkupParserPassthroughFieldInfo = (~) MarkupParser
type AttrGetType MarkupParserPassthroughFieldInfo = Maybe GLib.Callbacks.MarkupParserPassthroughFieldCallback_WithClosures
type AttrLabel MarkupParserPassthroughFieldInfo = "passthrough"
type AttrOrigin MarkupParserPassthroughFieldInfo = MarkupParser
attrGet _ = getMarkupParserPassthrough
attrSet _ = setMarkupParserPassthrough
attrConstruct = undefined
attrClear _ = clearMarkupParserPassthrough
markupParser_passthrough :: AttrLabelProxy "passthrough"
markupParser_passthrough = AttrLabelProxy
#endif
getMarkupParserError :: MonadIO m => MarkupParser -> m (Maybe GLib.Callbacks.MarkupParserErrorFieldCallback_WithClosures)
getMarkupParserError s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO (FunPtr GLib.Callbacks.C_MarkupParserErrorFieldCallback)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GLib.Callbacks.dynamic_MarkupParserErrorFieldCallback val'
return val''
return result
setMarkupParserError :: MonadIO m => MarkupParser -> FunPtr GLib.Callbacks.C_MarkupParserErrorFieldCallback -> m ()
setMarkupParserError s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: FunPtr GLib.Callbacks.C_MarkupParserErrorFieldCallback)
clearMarkupParserError :: MonadIO m => MarkupParser -> m ()
clearMarkupParserError s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullFunPtr :: FunPtr GLib.Callbacks.C_MarkupParserErrorFieldCallback)
#if ENABLE_OVERLOADING
data MarkupParserErrorFieldInfo
instance AttrInfo MarkupParserErrorFieldInfo where
type AttrAllowedOps MarkupParserErrorFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint MarkupParserErrorFieldInfo = (~) (FunPtr GLib.Callbacks.C_MarkupParserErrorFieldCallback)
type AttrBaseTypeConstraint MarkupParserErrorFieldInfo = (~) MarkupParser
type AttrGetType MarkupParserErrorFieldInfo = Maybe GLib.Callbacks.MarkupParserErrorFieldCallback_WithClosures
type AttrLabel MarkupParserErrorFieldInfo = "error"
type AttrOrigin MarkupParserErrorFieldInfo = MarkupParser
attrGet _ = getMarkupParserError
attrSet _ = setMarkupParserError
attrConstruct = undefined
attrClear _ = clearMarkupParserError
markupParser_error :: AttrLabelProxy "error"
markupParser_error = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList MarkupParser
type instance O.AttributeList MarkupParser = MarkupParserAttributeList
type MarkupParserAttributeList = ('[ '("startElement", MarkupParserStartElementFieldInfo), '("endElement", MarkupParserEndElementFieldInfo), '("text", MarkupParserTextFieldInfo), '("passthrough", MarkupParserPassthroughFieldInfo), '("error", MarkupParserErrorFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveMarkupParserMethod (t :: Symbol) (o :: *) :: * where
ResolveMarkupParserMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMarkupParserMethod t MarkupParser, O.MethodInfo info MarkupParser p) => O.IsLabelProxy t (MarkupParser -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveMarkupParserMethod t MarkupParser, O.MethodInfo info MarkupParser p) => O.IsLabel t (MarkupParser -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif