{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) The #PangoAttrList structure represents a list of attributes that apply to a section of text. The attributes are, in general, allowed to overlap in an arbitrary fashion, however, if the attributes are manipulated only through pango_attr_list_change(), the overlap between properties will meet stricter criteria. Since the #PangoAttrList structure is stored as a linear list, it is not suitable for storing attributes for large amounts of text. In general, you should not use a single #PangoAttrList for more than one paragraph of text. -} module GI.Pango.Structs.AttrList ( -- * Exported types AttrList(..) , noAttrList , -- * Methods -- ** attrListChange attrListChange , -- ** attrListCopy attrListCopy , -- ** attrListFilter attrListFilter , -- ** attrListInsert attrListInsert , -- ** attrListInsertBefore attrListInsertBefore , -- ** attrListNew attrListNew , -- ** attrListRef attrListRef , -- ** attrListSplice attrListSplice , -- ** attrListUnref attrListUnref , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.Pango.Types import GI.Pango.Callbacks newtype AttrList = AttrList (ForeignPtr AttrList) foreign import ccall "pango_attr_list_get_type" c_pango_attr_list_get_type :: IO GType instance BoxedObject AttrList where boxedType _ = c_pango_attr_list_get_type noAttrList :: Maybe AttrList noAttrList = Nothing -- method AttrList::new -- method type : Constructor -- Args : [] -- Lengths : [] -- hInArgs : [] -- returnType : TInterface "Pango" "AttrList" -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_new" pango_attr_list_new :: IO (Ptr AttrList) attrListNew :: (MonadIO m) => m AttrList attrListNew = liftIO $ do result <- pango_attr_list_new checkUnexpectedReturnNULL "pango_attr_list_new" result result' <- (wrapBoxed AttrList) result return result' -- method AttrList::change -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "attr", argType = TInterface "Pango" "Attribute", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "attr", argType = TInterface "Pango" "Attribute", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_change" pango_attr_list_change :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" Ptr Attribute -> -- attr : TInterface "Pango" "Attribute" IO () attrListChange :: (MonadIO m) => AttrList -> -- _obj Attribute -> -- attr m () attrListChange _obj attr = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj let attr' = unsafeManagedPtrGetPtr attr pango_attr_list_change _obj' attr' touchManagedPtr _obj touchManagedPtr attr return () -- method AttrList::copy -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Pango" "AttrList" -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_copy" pango_attr_list_copy :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" IO (Ptr AttrList) attrListCopy :: (MonadIO m) => AttrList -> -- _obj m AttrList attrListCopy _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- pango_attr_list_copy _obj' checkUnexpectedReturnNULL "pango_attr_list_copy" result result' <- (wrapBoxed AttrList) result touchManagedPtr _obj return result' -- method AttrList::filter -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "func", argType = TInterface "Pango" "AttrFilterFunc", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeCall, argClosure = 2, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "func", argType = TInterface "Pango" "AttrFilterFunc", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeCall, argClosure = 2, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Pango" "AttrList" -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_filter" pango_attr_list_filter :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" FunPtr AttrFilterFuncC -> -- func : TInterface "Pango" "AttrFilterFunc" Ptr () -> -- data : TBasicType TVoid IO (Ptr AttrList) attrListFilter :: (MonadIO m) => AttrList -> -- _obj AttrFilterFunc -> -- func m AttrList attrListFilter _obj func = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj func' <- mkAttrFilterFunc (attrFilterFuncWrapper Nothing func) let data_ = nullPtr result <- pango_attr_list_filter _obj' func' data_ checkUnexpectedReturnNULL "pango_attr_list_filter" result result' <- (wrapBoxed AttrList) result safeFreeFunPtr $ castFunPtrToPtr func' touchManagedPtr _obj return result' -- method AttrList::insert -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "attr", argType = TInterface "Pango" "Attribute", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "attr", argType = TInterface "Pango" "Attribute", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_insert" pango_attr_list_insert :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" Ptr Attribute -> -- attr : TInterface "Pango" "Attribute" IO () attrListInsert :: (MonadIO m) => AttrList -> -- _obj Attribute -> -- attr m () attrListInsert _obj attr = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj let attr' = unsafeManagedPtrGetPtr attr pango_attr_list_insert _obj' attr' touchManagedPtr _obj touchManagedPtr attr return () -- method AttrList::insert_before -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "attr", argType = TInterface "Pango" "Attribute", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "attr", argType = TInterface "Pango" "Attribute", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_insert_before" pango_attr_list_insert_before :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" Ptr Attribute -> -- attr : TInterface "Pango" "Attribute" IO () attrListInsertBefore :: (MonadIO m) => AttrList -> -- _obj Attribute -> -- attr m () attrListInsertBefore _obj attr = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj let attr' = unsafeManagedPtrGetPtr attr pango_attr_list_insert_before _obj' attr' touchManagedPtr _obj touchManagedPtr attr return () -- method AttrList::ref -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "Pango" "AttrList" -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_ref" pango_attr_list_ref :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" IO (Ptr AttrList) attrListRef :: (MonadIO m) => AttrList -> -- _obj m AttrList attrListRef _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- pango_attr_list_ref _obj' checkUnexpectedReturnNULL "pango_attr_list_ref" result result' <- (wrapBoxed AttrList) result touchManagedPtr _obj return result' -- method AttrList::splice -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "other", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "pos", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "len", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "other", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "pos", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "len", argType = TBasicType TInt32, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_splice" pango_attr_list_splice :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" Ptr AttrList -> -- other : TInterface "Pango" "AttrList" Int32 -> -- pos : TBasicType TInt32 Int32 -> -- len : TBasicType TInt32 IO () attrListSplice :: (MonadIO m) => AttrList -> -- _obj AttrList -> -- other Int32 -> -- pos Int32 -> -- len m () attrListSplice _obj other pos len = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj let other' = unsafeManagedPtrGetPtr other pango_attr_list_splice _obj' other' pos len touchManagedPtr _obj touchManagedPtr other return () -- method AttrList::unref -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "Pango" "AttrList", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "pango_attr_list_unref" pango_attr_list_unref :: Ptr AttrList -> -- _obj : TInterface "Pango" "AttrList" IO () attrListUnref :: (MonadIO m) => AttrList -> -- _obj m () attrListUnref _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj pango_attr_list_unref _obj' touchManagedPtr _obj return ()