{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Pango.Structs.AttrList
(
AttrList(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveAttrListMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AttrListChangeMethodInfo ,
#endif
attrListChange ,
#if defined(ENABLE_OVERLOADING)
AttrListCopyMethodInfo ,
#endif
attrListCopy ,
#if defined(ENABLE_OVERLOADING)
AttrListEqualMethodInfo ,
#endif
attrListEqual ,
#if defined(ENABLE_OVERLOADING)
AttrListFilterMethodInfo ,
#endif
attrListFilter ,
attrListFromString ,
#if defined(ENABLE_OVERLOADING)
AttrListGetAttributesMethodInfo ,
#endif
attrListGetAttributes ,
#if defined(ENABLE_OVERLOADING)
AttrListGetIteratorMethodInfo ,
#endif
attrListGetIterator ,
#if defined(ENABLE_OVERLOADING)
AttrListInsertMethodInfo ,
#endif
attrListInsert ,
#if defined(ENABLE_OVERLOADING)
AttrListInsertBeforeMethodInfo ,
#endif
attrListInsertBefore ,
attrListNew ,
#if defined(ENABLE_OVERLOADING)
AttrListRefMethodInfo ,
#endif
attrListRef ,
#if defined(ENABLE_OVERLOADING)
AttrListSpliceMethodInfo ,
#endif
attrListSplice ,
#if defined(ENABLE_OVERLOADING)
AttrListToStringMethodInfo ,
#endif
attrListToString ,
#if defined(ENABLE_OVERLOADING)
AttrListUnrefMethodInfo ,
#endif
attrListUnref ,
#if defined(ENABLE_OVERLOADING)
AttrListUpdateMethodInfo ,
#endif
attrListUpdate ,
) 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.GHashTable as B.GHT
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.Kind as DK
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.Pango.Callbacks as Pango.Callbacks
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrIterator as Pango.AttrIterator
import {-# SOURCE #-} qualified GI.Pango.Structs.Attribute as Pango.Attribute
newtype AttrList = AttrList (SP.ManagedPtr AttrList)
deriving (AttrList -> AttrList -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttrList -> AttrList -> Bool
$c/= :: AttrList -> AttrList -> Bool
== :: AttrList -> AttrList -> Bool
$c== :: AttrList -> AttrList -> Bool
Eq)
instance SP.ManagedPtrNewtype AttrList where
toManagedPtr :: AttrList -> ManagedPtr AttrList
toManagedPtr (AttrList ManagedPtr AttrList
p) = ManagedPtr AttrList
p
foreign import ccall "pango_attr_list_get_type" c_pango_attr_list_get_type ::
IO GType
type instance O.ParentTypes AttrList = '[]
instance O.HasParentTypes AttrList
instance B.Types.TypedObject AttrList where
glibType :: IO GType
glibType = IO GType
c_pango_attr_list_get_type
instance B.Types.GBoxed AttrList
instance B.GValue.IsGValue (Maybe AttrList) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_pango_attr_list_get_type
gvalueSet_ :: Ptr GValue -> Maybe AttrList -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AttrList
P.Nothing = forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr AttrList)
gvalueSet_ Ptr GValue
gv (P.Just AttrList
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AttrList
obj (forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe AttrList)
gvalueGet_ Ptr GValue
gv = do
Ptr AttrList
ptr <- forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr AttrList)
if Ptr AttrList
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr AttrList -> AttrList
AttrList Ptr AttrList
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AttrList
type instance O.AttributeList AttrList = AttrListAttributeList
type AttrListAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "pango_attr_list_new" pango_attr_list_new ::
IO (Ptr AttrList)
attrListNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AttrList
attrListNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m AttrList
attrListNew = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
result <- IO (Ptr AttrList)
pango_attr_list_new
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrListNew" Ptr AttrList
result
AttrList
result' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "pango_attr_list_change" pango_attr_list_change ::
Ptr AttrList ->
Ptr Pango.Attribute.Attribute ->
IO ()
attrListChange ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> Pango.Attribute.Attribute
-> m ()
attrListChange :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> Attribute -> m ()
attrListChange AttrList
list Attribute
attr = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr Attribute
attr' <- forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Attribute
attr
Ptr AttrList -> Ptr Attribute -> IO ()
pango_attr_list_change Ptr AttrList
list' Ptr Attribute
attr'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListChangeMethodInfo
instance (signature ~ (Pango.Attribute.Attribute -> m ()), MonadIO m) => O.OverloadedMethod AttrListChangeMethodInfo AttrList signature where
overloadedMethod = attrListChange
instance O.OverloadedMethodInfo AttrListChangeMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListChange",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListChange"
})
#endif
foreign import ccall "pango_attr_list_copy" pango_attr_list_copy ::
Ptr AttrList ->
IO (Ptr AttrList)
attrListCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> m (Maybe AttrList)
attrListCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> m (Maybe AttrList)
attrListCopy AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrList
result <- Ptr AttrList -> IO (Ptr AttrList)
pango_attr_list_copy Ptr AttrList
list'
Maybe AttrList
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr AttrList
result forall a b. (a -> b) -> a -> b
$ \Ptr AttrList
result' -> do
AttrList
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result'
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AttrList
maybeResult
#if defined(ENABLE_OVERLOADING)
data AttrListCopyMethodInfo
instance (signature ~ (m (Maybe AttrList)), MonadIO m) => O.OverloadedMethod AttrListCopyMethodInfo AttrList signature where
overloadedMethod = attrListCopy
instance O.OverloadedMethodInfo AttrListCopyMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListCopy"
})
#endif
foreign import ccall "pango_attr_list_equal" pango_attr_list_equal ::
Ptr AttrList ->
Ptr AttrList ->
IO CInt
attrListEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> AttrList
-> m Bool
attrListEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> AttrList -> m Bool
attrListEqual AttrList
list AttrList
otherList = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrList
otherList' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
otherList
CInt
result <- Ptr AttrList -> Ptr AttrList -> IO CInt
pango_attr_list_equal Ptr AttrList
list' Ptr AttrList
otherList'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
otherList
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AttrListEqualMethodInfo
instance (signature ~ (AttrList -> m Bool), MonadIO m) => O.OverloadedMethod AttrListEqualMethodInfo AttrList signature where
overloadedMethod = attrListEqual
instance O.OverloadedMethodInfo AttrListEqualMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListEqual"
})
#endif
foreign import ccall "pango_attr_list_filter" pango_attr_list_filter ::
Ptr AttrList ->
FunPtr Pango.Callbacks.C_AttrFilterFunc ->
Ptr () ->
IO (Ptr AttrList)
attrListFilter ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> Pango.Callbacks.AttrFilterFunc
-> m (Maybe AttrList)
attrListFilter :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> AttrFilterFunc -> m (Maybe AttrList)
attrListFilter AttrList
list AttrFilterFunc
func = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
FunPtr C_AttrFilterFunc
func' <- C_AttrFilterFunc -> IO (FunPtr C_AttrFilterFunc)
Pango.Callbacks.mk_AttrFilterFunc (Maybe (Ptr (FunPtr C_AttrFilterFunc))
-> AttrFilterFunc_WithClosures -> C_AttrFilterFunc
Pango.Callbacks.wrap_AttrFilterFunc forall a. Maybe a
Nothing (AttrFilterFunc -> AttrFilterFunc_WithClosures
Pango.Callbacks.drop_closures_AttrFilterFunc AttrFilterFunc
func))
let data_ :: Ptr a
data_ = forall a. Ptr a
nullPtr
Ptr AttrList
result <- Ptr AttrList
-> FunPtr C_AttrFilterFunc -> Ptr () -> IO (Ptr AttrList)
pango_attr_list_filter Ptr AttrList
list' FunPtr C_AttrFilterFunc
func' forall a. Ptr a
data_
Maybe AttrList
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr AttrList
result forall a b. (a -> b) -> a -> b
$ \Ptr AttrList
result' -> do
AttrList
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result'
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result''
forall a. Ptr a -> IO ()
safeFreeFunPtr forall a b. (a -> b) -> a -> b
$ forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_AttrFilterFunc
func'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AttrList
maybeResult
#if defined(ENABLE_OVERLOADING)
data AttrListFilterMethodInfo
instance (signature ~ (Pango.Callbacks.AttrFilterFunc -> m (Maybe AttrList)), MonadIO m) => O.OverloadedMethod AttrListFilterMethodInfo AttrList signature where
overloadedMethod = attrListFilter
instance O.OverloadedMethodInfo AttrListFilterMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListFilter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListFilter"
})
#endif
foreign import ccall "pango_attr_list_get_attributes" pango_attr_list_get_attributes ::
Ptr AttrList ->
IO (Ptr (GSList (Ptr Pango.Attribute.Attribute)))
attrListGetAttributes ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> m [Pango.Attribute.Attribute]
attrListGetAttributes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> m [Attribute]
attrListGetAttributes AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr (GSList (Ptr Attribute))
result <- Ptr AttrList -> IO (Ptr (GSList (Ptr Attribute)))
pango_attr_list_get_attributes Ptr AttrList
list'
[Ptr Attribute]
result' <- forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Attribute))
result
[Attribute]
result'' <- forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute) [Ptr Attribute]
result'
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Attribute))
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return [Attribute]
result''
#if defined(ENABLE_OVERLOADING)
data AttrListGetAttributesMethodInfo
instance (signature ~ (m [Pango.Attribute.Attribute]), MonadIO m) => O.OverloadedMethod AttrListGetAttributesMethodInfo AttrList signature where
overloadedMethod = attrListGetAttributes
instance O.OverloadedMethodInfo AttrListGetAttributesMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListGetAttributes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListGetAttributes"
})
#endif
foreign import ccall "pango_attr_list_get_iterator" pango_attr_list_get_iterator ::
Ptr AttrList ->
IO (Ptr Pango.AttrIterator.AttrIterator)
attrListGetIterator ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> m Pango.AttrIterator.AttrIterator
attrListGetIterator :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> m AttrIterator
attrListGetIterator AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrIterator
result <- Ptr AttrList -> IO (Ptr AttrIterator)
pango_attr_list_get_iterator Ptr AttrList
list'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrListGetIterator" Ptr AttrIterator
result
AttrIterator
result' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrIterator -> AttrIterator
Pango.AttrIterator.AttrIterator) Ptr AttrIterator
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return AttrIterator
result'
#if defined(ENABLE_OVERLOADING)
data AttrListGetIteratorMethodInfo
instance (signature ~ (m Pango.AttrIterator.AttrIterator), MonadIO m) => O.OverloadedMethod AttrListGetIteratorMethodInfo AttrList signature where
overloadedMethod = attrListGetIterator
instance O.OverloadedMethodInfo AttrListGetIteratorMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListGetIterator",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListGetIterator"
})
#endif
foreign import ccall "pango_attr_list_insert" pango_attr_list_insert ::
Ptr AttrList ->
Ptr Pango.Attribute.Attribute ->
IO ()
attrListInsert ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> Pango.Attribute.Attribute
-> m ()
attrListInsert :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> Attribute -> m ()
attrListInsert AttrList
list Attribute
attr = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr Attribute
attr' <- forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Attribute
attr
Ptr AttrList -> Ptr Attribute -> IO ()
pango_attr_list_insert Ptr AttrList
list' Ptr Attribute
attr'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListInsertMethodInfo
instance (signature ~ (Pango.Attribute.Attribute -> m ()), MonadIO m) => O.OverloadedMethod AttrListInsertMethodInfo AttrList signature where
overloadedMethod = attrListInsert
instance O.OverloadedMethodInfo AttrListInsertMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListInsert",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListInsert"
})
#endif
foreign import ccall "pango_attr_list_insert_before" pango_attr_list_insert_before ::
Ptr AttrList ->
Ptr Pango.Attribute.Attribute ->
IO ()
attrListInsertBefore ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> Pango.Attribute.Attribute
-> m ()
attrListInsertBefore :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> Attribute -> m ()
attrListInsertBefore AttrList
list Attribute
attr = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr Attribute
attr' <- forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Attribute
attr
Ptr AttrList -> Ptr Attribute -> IO ()
pango_attr_list_insert_before Ptr AttrList
list' Ptr Attribute
attr'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListInsertBeforeMethodInfo
instance (signature ~ (Pango.Attribute.Attribute -> m ()), MonadIO m) => O.OverloadedMethod AttrListInsertBeforeMethodInfo AttrList signature where
overloadedMethod = attrListInsertBefore
instance O.OverloadedMethodInfo AttrListInsertBeforeMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListInsertBefore",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListInsertBefore"
})
#endif
foreign import ccall "pango_attr_list_ref" pango_attr_list_ref ::
Ptr AttrList ->
IO (Ptr AttrList)
attrListRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> m AttrList
attrListRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> m AttrList
attrListRef AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrList
result <- Ptr AttrList -> IO (Ptr AttrList)
pango_attr_list_ref Ptr AttrList
list'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrListRef" Ptr AttrList
result
AttrList
result' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result'
#if defined(ENABLE_OVERLOADING)
data AttrListRefMethodInfo
instance (signature ~ (m AttrList), MonadIO m) => O.OverloadedMethod AttrListRefMethodInfo AttrList signature where
overloadedMethod = attrListRef
instance O.OverloadedMethodInfo AttrListRefMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListRef"
})
#endif
foreign import ccall "pango_attr_list_splice" pango_attr_list_splice ::
Ptr AttrList ->
Ptr AttrList ->
Int32 ->
Int32 ->
IO ()
attrListSplice ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> AttrList
-> Int32
-> Int32
-> m ()
attrListSplice :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> AttrList -> Int32 -> Int32 -> m ()
attrListSplice AttrList
list AttrList
other Int32
pos Int32
len = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrList
other' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
other
Ptr AttrList -> Ptr AttrList -> Int32 -> Int32 -> IO ()
pango_attr_list_splice Ptr AttrList
list' Ptr AttrList
other' Int32
pos Int32
len
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
other
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListSpliceMethodInfo
instance (signature ~ (AttrList -> Int32 -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod AttrListSpliceMethodInfo AttrList signature where
overloadedMethod = attrListSplice
instance O.OverloadedMethodInfo AttrListSpliceMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListSplice",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListSplice"
})
#endif
foreign import ccall "pango_attr_list_to_string" pango_attr_list_to_string ::
Ptr AttrList ->
IO CString
attrListToString ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> m T.Text
attrListToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> m Text
attrListToString AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
CString
result <- Ptr AttrList -> IO CString
pango_attr_list_to_string Ptr AttrList
list'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrListToString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
forall a. Ptr a -> IO ()
freeMem CString
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AttrListToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod AttrListToStringMethodInfo AttrList signature where
overloadedMethod = attrListToString
instance O.OverloadedMethodInfo AttrListToStringMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListToString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListToString"
})
#endif
foreign import ccall "pango_attr_list_unref" pango_attr_list_unref ::
Ptr AttrList ->
IO ()
attrListUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> m ()
attrListUnref :: forall (m :: * -> *). (HasCallStack, MonadIO m) => AttrList -> m ()
attrListUnref AttrList
list = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrList -> IO ()
pango_attr_list_unref Ptr AttrList
list'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod AttrListUnrefMethodInfo AttrList signature where
overloadedMethod = attrListUnref
instance O.OverloadedMethodInfo AttrListUnrefMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListUnref"
})
#endif
foreign import ccall "pango_attr_list_update" pango_attr_list_update ::
Ptr AttrList ->
Int32 ->
Int32 ->
Int32 ->
IO ()
attrListUpdate ::
(B.CallStack.HasCallStack, MonadIO m) =>
AttrList
-> Int32
-> Int32
-> Int32
-> m ()
attrListUpdate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
AttrList -> Int32 -> Int32 -> Int32 -> m ()
attrListUpdate AttrList
list Int32
pos Int32
remove Int32
add = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr AttrList
list' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
Ptr AttrList -> Int32 -> Int32 -> Int32 -> IO ()
pango_attr_list_update Ptr AttrList
list' Int32
pos Int32
remove Int32
add
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr AttrList
list
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListUpdateMethodInfo
instance (signature ~ (Int32 -> Int32 -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod AttrListUpdateMethodInfo AttrList signature where
overloadedMethod = attrListUpdate
instance O.OverloadedMethodInfo AttrListUpdateMethodInfo AttrList where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Pango.Structs.AttrList.attrListUpdate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.27/docs/GI-Pango-Structs-AttrList.html#v:attrListUpdate"
})
#endif
foreign import ccall "pango_attr_list_from_string" pango_attr_list_from_string ::
CString ->
IO (Ptr AttrList)
attrListFromString ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe AttrList)
attrListFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe AttrList)
attrListFromString Text
text = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr AttrList
result <- CString -> IO (Ptr AttrList)
pango_attr_list_from_string CString
text'
Maybe AttrList
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr AttrList
result forall a b. (a -> b) -> a -> b
$ \Ptr AttrList
result' -> do
AttrList
result'' <- (forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result'
forall (m :: * -> *) a. Monad m => a -> m a
return AttrList
result''
forall a. Ptr a -> IO ()
freeMem CString
text'
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe AttrList
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveAttrListMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveAttrListMethod "change" o = AttrListChangeMethodInfo
ResolveAttrListMethod "copy" o = AttrListCopyMethodInfo
ResolveAttrListMethod "equal" o = AttrListEqualMethodInfo
ResolveAttrListMethod "filter" o = AttrListFilterMethodInfo
ResolveAttrListMethod "insert" o = AttrListInsertMethodInfo
ResolveAttrListMethod "insertBefore" o = AttrListInsertBeforeMethodInfo
ResolveAttrListMethod "ref" o = AttrListRefMethodInfo
ResolveAttrListMethod "splice" o = AttrListSpliceMethodInfo
ResolveAttrListMethod "toString" o = AttrListToStringMethodInfo
ResolveAttrListMethod "unref" o = AttrListUnrefMethodInfo
ResolveAttrListMethod "update" o = AttrListUpdateMethodInfo
ResolveAttrListMethod "getAttributes" o = AttrListGetAttributesMethodInfo
ResolveAttrListMethod "getIterator" o = AttrListGetIteratorMethodInfo
ResolveAttrListMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAttrListMethod t AttrList, O.OverloadedMethod info AttrList p) => OL.IsLabel t (AttrList -> 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 ~ ResolveAttrListMethod t AttrList, O.OverloadedMethod info AttrList p, R.HasField t AttrList p) => R.HasField t AttrList p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAttrListMethod t AttrList, O.OverloadedMethodInfo info AttrList) => OL.IsLabel t (O.MethodProxy info AttrList) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif