{-# LANGUAGE TypeApplications #-}
#if !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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.Pango.Callbacks as Pango.Callbacks
import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums
import {-# SOURCE #-} qualified GI.Pango.Flags as Pango.Flags
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrClass as Pango.AttrClass
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrColor as Pango.AttrColor
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrFloat as Pango.AttrFloat
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrFontDesc as Pango.AttrFontDesc
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrFontFeatures as Pango.AttrFontFeatures
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrInt as Pango.AttrInt
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrIterator as Pango.AttrIterator
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrLanguage as Pango.AttrLanguage
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrShape as Pango.AttrShape
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrSize as Pango.AttrSize
import {-# SOURCE #-} qualified GI.Pango.Structs.AttrString as Pango.AttrString
import {-# SOURCE #-} qualified GI.Pango.Structs.Attribute as Pango.Attribute
import {-# SOURCE #-} qualified GI.Pango.Structs.Color as Pango.Color
import {-# SOURCE #-} qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import {-# SOURCE #-} qualified GI.Pango.Structs.Language as Pango.Language
import {-# SOURCE #-} qualified GI.Pango.Structs.Rectangle as Pango.Rectangle
#else
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
#endif
newtype AttrList = AttrList (SP.ManagedPtr AttrList)
deriving (AttrList -> AttrList -> Bool
(AttrList -> AttrList -> Bool)
-> (AttrList -> AttrList -> Bool) -> Eq AttrList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AttrList -> AttrList -> Bool
== :: AttrList -> AttrList -> Bool
$c/= :: AttrList -> AttrList -> Bool
/= :: 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 = Ptr GValue -> Ptr AttrList -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr AttrList
forall a. Ptr a
FP.nullPtr :: FP.Ptr AttrList)
gvalueSet_ Ptr GValue
gv (P.Just AttrList
obj) = AttrList -> (Ptr AttrList -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AttrList
obj (Ptr GValue -> Ptr AttrList -> IO ()
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 <- Ptr GValue -> IO (Ptr AttrList)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr AttrList)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newBoxed AttrList ptr
else return 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 = IO AttrList -> m AttrList
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AttrList -> m AttrList) -> IO AttrList -> m AttrList
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr AttrList)
pango_attr_list_new
checkUnexpectedReturnNULL "attrListNew" result
result' <- (wrapBoxed AttrList) result
return 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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
attr' <- B.ManagedPtr.disownBoxed attr
pango_attr_list_change list' attr'
touchManagedPtr list
touchManagedPtr attr
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.30/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) =>
Maybe (AttrList)
-> m (Maybe AttrList)
attrListCopy :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe AttrList -> m (Maybe AttrList)
attrListCopy Maybe AttrList
list = IO (Maybe AttrList) -> m (Maybe AttrList)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe AttrList) -> m (Maybe AttrList))
-> IO (Maybe AttrList) -> m (Maybe AttrList)
forall a b. (a -> b) -> a -> b
$ do
maybeList <- case Maybe AttrList
list of
Maybe AttrList
Nothing -> Ptr AttrList -> IO (Ptr AttrList)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AttrList
forall a. Ptr a
FP.nullPtr
Just AttrList
jList -> do
jList' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
jList
return jList'
result <- pango_attr_list_copy maybeList
maybeResult <- convertIfNonNull result $ \Ptr AttrList
result' -> do
result'' <- ((ManagedPtr AttrList -> AttrList) -> Ptr AttrList -> IO AttrList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result'
return result''
whenJust list touchManagedPtr
return maybeResult
#if defined(ENABLE_OVERLOADING)
data AttrListCopyMethodInfo
instance (signature ~ (m (Maybe AttrList)), MonadIO m) => O.OverloadedMethod AttrListCopyMethodInfo AttrList signature where
overloadedMethod i = attrListCopy (Just i)
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.30/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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
otherList' <- unsafeManagedPtrGetPtr otherList
result <- pango_attr_list_equal list' otherList'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr list
touchManagedPtr otherList
return 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.30/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 = IO (Maybe AttrList) -> m (Maybe AttrList)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe AttrList) -> m (Maybe AttrList))
-> IO (Maybe AttrList) -> m (Maybe AttrList)
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
func' <- Pango.Callbacks.mk_AttrFilterFunc (Pango.Callbacks.wrap_AttrFilterFunc Nothing (Pango.Callbacks.drop_closures_AttrFilterFunc func))
let data_ = Ptr a
forall a. Ptr a
nullPtr
result <- pango_attr_list_filter list' func' data_
maybeResult <- convertIfNonNull result $ \Ptr AttrList
result' -> do
result'' <- ((ManagedPtr AttrList -> AttrList) -> Ptr AttrList -> IO AttrList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result'
return result''
safeFreeFunPtr $ castFunPtrToPtr func'
touchManagedPtr list
return 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.30/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 = IO [Attribute] -> m [Attribute]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Attribute] -> m [Attribute])
-> IO [Attribute] -> m [Attribute]
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
result <- pango_attr_list_get_attributes list'
result' <- unpackGSList result
result'' <- mapM (wrapBoxed Pango.Attribute.Attribute) result'
g_slist_free result
touchManagedPtr list
return 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.30/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 = IO AttrIterator -> m AttrIterator
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AttrIterator -> m AttrIterator)
-> IO AttrIterator -> m AttrIterator
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
result <- pango_attr_list_get_iterator list'
checkUnexpectedReturnNULL "attrListGetIterator" result
result' <- (wrapBoxed Pango.AttrIterator.AttrIterator) result
touchManagedPtr list
return 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.30/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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
attr' <- B.ManagedPtr.disownBoxed attr
pango_attr_list_insert list' attr'
touchManagedPtr list
touchManagedPtr attr
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.30/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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
attr' <- B.ManagedPtr.disownBoxed attr
pango_attr_list_insert_before list' attr'
touchManagedPtr list
touchManagedPtr attr
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.30/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) =>
Maybe (AttrList)
-> m AttrList
attrListRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe AttrList -> m AttrList
attrListRef Maybe AttrList
list = IO AttrList -> m AttrList
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AttrList -> m AttrList) -> IO AttrList -> m AttrList
forall a b. (a -> b) -> a -> b
$ do
maybeList <- case Maybe AttrList
list of
Maybe AttrList
Nothing -> Ptr AttrList -> IO (Ptr AttrList)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AttrList
forall a. Ptr a
FP.nullPtr
Just AttrList
jList -> do
jList' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
jList
return jList'
result <- pango_attr_list_ref maybeList
checkUnexpectedReturnNULL "attrListRef" result
result' <- (wrapBoxed AttrList) result
whenJust list touchManagedPtr
return result'
#if defined(ENABLE_OVERLOADING)
data AttrListRefMethodInfo
instance (signature ~ (m AttrList), MonadIO m) => O.OverloadedMethod AttrListRefMethodInfo AttrList signature where
overloadedMethod i = attrListRef (Just i)
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.30/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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
other' <- unsafeManagedPtrGetPtr other
pango_attr_list_splice list' other' pos len
touchManagedPtr list
touchManagedPtr other
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.30/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 = IO Text -> m Text
forall a. IO a -> m a
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
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
result <- pango_attr_list_to_string list'
checkUnexpectedReturnNULL "attrListToString" result
result' <- cstringToText result
freeMem result
touchManagedPtr list
return 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.30/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) =>
Maybe (AttrList)
-> m ()
attrListUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe AttrList -> m ()
attrListUnref Maybe AttrList
list = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
maybeList <- case Maybe AttrList
list of
Maybe AttrList
Nothing -> Ptr AttrList -> IO (Ptr AttrList)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AttrList
forall a. Ptr a
FP.nullPtr
Just AttrList
jList -> do
jList' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
jList
return jList'
pango_attr_list_unref maybeList
whenJust list touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING)
data AttrListUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod AttrListUnrefMethodInfo AttrList signature where
overloadedMethod i = attrListUnref (Just i)
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.30/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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
list' <- AttrList -> IO (Ptr AttrList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr AttrList
list
pango_attr_list_update list' pos remove add
touchManagedPtr list
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.30/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 = IO (Maybe AttrList) -> m (Maybe AttrList)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe AttrList) -> m (Maybe AttrList))
-> IO (Maybe AttrList) -> m (Maybe AttrList)
forall a b. (a -> b) -> a -> b
$ do
text' <- Text -> IO CString
textToCString Text
text
result <- pango_attr_list_from_string text'
maybeResult <- convertIfNonNull result $ \Ptr AttrList
result' -> do
result'' <- ((ManagedPtr AttrList -> AttrList) -> Ptr AttrList -> IO AttrList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr AttrList -> AttrList
AttrList) Ptr AttrList
result'
return result''
freeMem text'
return 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