{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Pango.Callbacks
    ( 

 -- * Signals
-- ** AttrClassDestroyFieldCallback #signal:AttrClassDestroyFieldCallback#
    AttrClassDestroyFieldCallback           ,
    C_AttrClassDestroyFieldCallback         ,
    dynamic_AttrClassDestroyFieldCallback   ,
    genClosure_AttrClassDestroyFieldCallback,
    mk_AttrClassDestroyFieldCallback        ,
    noAttrClassDestroyFieldCallback         ,
    wrap_AttrClassDestroyFieldCallback      ,


-- ** AttrClassEqualFieldCallback #signal:AttrClassEqualFieldCallback#
    AttrClassEqualFieldCallback             ,
    C_AttrClassEqualFieldCallback           ,
    dynamic_AttrClassEqualFieldCallback     ,
    genClosure_AttrClassEqualFieldCallback  ,
    mk_AttrClassEqualFieldCallback          ,
    noAttrClassEqualFieldCallback           ,
    wrap_AttrClassEqualFieldCallback        ,


-- ** AttrDataCopyFunc #signal:AttrDataCopyFunc#
    AttrDataCopyFunc                        ,
    AttrDataCopyFunc_WithClosures           ,
    C_AttrDataCopyFunc                      ,
    drop_closures_AttrDataCopyFunc          ,
    dynamic_AttrDataCopyFunc                ,
    genClosure_AttrDataCopyFunc             ,
    mk_AttrDataCopyFunc                     ,
    noAttrDataCopyFunc                      ,
    noAttrDataCopyFunc_WithClosures         ,
    wrap_AttrDataCopyFunc                   ,


-- ** AttrFilterFunc #signal:AttrFilterFunc#
    AttrFilterFunc                          ,
    AttrFilterFunc_WithClosures             ,
    C_AttrFilterFunc                        ,
    drop_closures_AttrFilterFunc            ,
    dynamic_AttrFilterFunc                  ,
    genClosure_AttrFilterFunc               ,
    mk_AttrFilterFunc                       ,
    noAttrFilterFunc                        ,
    noAttrFilterFunc_WithClosures           ,
    wrap_AttrFilterFunc                     ,


-- ** FontsetForeachFunc #signal:FontsetForeachFunc#
    C_FontsetForeachFunc                    ,
    FontsetForeachFunc                      ,
    FontsetForeachFunc_WithClosures         ,
    drop_closures_FontsetForeachFunc        ,
    dynamic_FontsetForeachFunc              ,
    genClosure_FontsetForeachFunc           ,
    mk_FontsetForeachFunc                   ,
    noFontsetForeachFunc                    ,
    noFontsetForeachFunc_WithClosures       ,
    wrap_FontsetForeachFunc                 ,


-- ** IncludedModuleExitFieldCallback #signal:IncludedModuleExitFieldCallback#
    C_IncludedModuleExitFieldCallback       ,
    IncludedModuleExitFieldCallback         ,
    dynamic_IncludedModuleExitFieldCallback ,
    genClosure_IncludedModuleExitFieldCallback,
    mk_IncludedModuleExitFieldCallback      ,
    noIncludedModuleExitFieldCallback       ,
    wrap_IncludedModuleExitFieldCallback    ,


-- ** IncludedModuleInitFieldCallback #signal:IncludedModuleInitFieldCallback#
    C_IncludedModuleInitFieldCallback       ,
    IncludedModuleInitFieldCallback         ,
    dynamic_IncludedModuleInitFieldCallback ,
    genClosure_IncludedModuleInitFieldCallback,
    mk_IncludedModuleInitFieldCallback      ,
    noIncludedModuleInitFieldCallback       ,
    wrap_IncludedModuleInitFieldCallback    ,


-- ** IncludedModuleListFieldCallback #signal:IncludedModuleListFieldCallback#
    C_IncludedModuleListFieldCallback       ,
    IncludedModuleListFieldCallback         ,
    dynamic_IncludedModuleListFieldCallback ,
    genClosure_IncludedModuleListFieldCallback,
    mk_IncludedModuleListFieldCallback      ,
    noIncludedModuleListFieldCallback       ,
    wrap_IncludedModuleListFieldCallback    ,




    ) 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.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.GObject.Objects.TypeModule as GObject.TypeModule
import {-# SOURCE #-} qualified GI.Pango.Objects.Font as Pango.Font
import {-# SOURCE #-} qualified GI.Pango.Objects.Fontset as Pango.Fontset
import {-# SOURCE #-} qualified GI.Pango.Structs.Attribute as Pango.Attribute
import {-# SOURCE #-} qualified GI.Pango.Structs.EngineInfo as Pango.EngineInfo

-- callback IncludedModuleListFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "engines", argType = TInterface (Name {namespace = "Pango", name = "EngineInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_engines", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_IncludedModuleListFieldCallback =
    Ptr Pango.EngineInfo.EngineInfo ->
    Int32 ->
    IO ()

-- Args : [Arg {argCName = "engines", argType = TInterface (Name {namespace = "Pango", name = "EngineInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "n_engines", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IncludedModuleListFieldCallback :: FunPtr C_IncludedModuleListFieldCallback -> C_IncludedModuleListFieldCallback

dynamic_IncludedModuleListFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IncludedModuleListFieldCallback
    -> Pango.EngineInfo.EngineInfo
    -> Int32
    -> m ()
dynamic_IncludedModuleListFieldCallback __funPtr engines nEngines = liftIO $ do
    engines' <- unsafeManagedPtrGetPtr engines
    (__dynamic_C_IncludedModuleListFieldCallback __funPtr) engines' nEngines
    touchManagedPtr engines
    return ()

foreign import ccall "wrapper"
    mk_IncludedModuleListFieldCallback :: C_IncludedModuleListFieldCallback -> IO (FunPtr C_IncludedModuleListFieldCallback)

type IncludedModuleListFieldCallback =
    Pango.EngineInfo.EngineInfo ->
    Int32 ->
    IO ()

noIncludedModuleListFieldCallback :: Maybe IncludedModuleListFieldCallback
noIncludedModuleListFieldCallback = Nothing

genClosure_IncludedModuleListFieldCallback :: IncludedModuleListFieldCallback -> IO Closure
genClosure_IncludedModuleListFieldCallback cb = do
    let cb' = wrap_IncludedModuleListFieldCallback Nothing cb
    mk_IncludedModuleListFieldCallback cb' >>= newCClosure


wrap_IncludedModuleListFieldCallback ::
    Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback)) ->
    IncludedModuleListFieldCallback ->
    Ptr Pango.EngineInfo.EngineInfo ->
    Int32 ->
    IO ()
wrap_IncludedModuleListFieldCallback funptrptr _cb engines nEngines = do
    engines' <- (newPtr Pango.EngineInfo.EngineInfo) engines
    _cb  engines' nEngines
    maybeReleaseFunPtr funptrptr


-- callback IncludedModuleInitFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "module", argType = TInterface (Name {namespace = "GObject", name = "TypeModule"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_IncludedModuleInitFieldCallback =
    Ptr GObject.TypeModule.TypeModule ->
    IO ()

-- Args : [Arg {argCName = "module", argType = TInterface (Name {namespace = "GObject", name = "TypeModule"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IncludedModuleInitFieldCallback :: FunPtr C_IncludedModuleInitFieldCallback -> C_IncludedModuleInitFieldCallback

dynamic_IncludedModuleInitFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.TypeModule.IsTypeModule a) =>
    FunPtr C_IncludedModuleInitFieldCallback
    -> a
    -> m ()
dynamic_IncludedModuleInitFieldCallback __funPtr module_ = liftIO $ do
    module_' <- unsafeManagedPtrCastPtr module_
    (__dynamic_C_IncludedModuleInitFieldCallback __funPtr) module_'
    touchManagedPtr module_
    return ()

foreign import ccall "wrapper"
    mk_IncludedModuleInitFieldCallback :: C_IncludedModuleInitFieldCallback -> IO (FunPtr C_IncludedModuleInitFieldCallback)

type IncludedModuleInitFieldCallback =
    GObject.TypeModule.TypeModule ->
    IO ()

noIncludedModuleInitFieldCallback :: Maybe IncludedModuleInitFieldCallback
noIncludedModuleInitFieldCallback = Nothing

genClosure_IncludedModuleInitFieldCallback :: IncludedModuleInitFieldCallback -> IO Closure
genClosure_IncludedModuleInitFieldCallback cb = do
    let cb' = wrap_IncludedModuleInitFieldCallback Nothing cb
    mk_IncludedModuleInitFieldCallback cb' >>= newCClosure


wrap_IncludedModuleInitFieldCallback ::
    Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback)) ->
    IncludedModuleInitFieldCallback ->
    Ptr GObject.TypeModule.TypeModule ->
    IO ()
wrap_IncludedModuleInitFieldCallback funptrptr _cb module_ = do
    module_' <- (newObject GObject.TypeModule.TypeModule) module_
    _cb  module_'
    maybeReleaseFunPtr funptrptr


-- callback IncludedModuleExitFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_IncludedModuleExitFieldCallback =
    IO ()

-- Args : []
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IncludedModuleExitFieldCallback :: FunPtr C_IncludedModuleExitFieldCallback -> C_IncludedModuleExitFieldCallback

dynamic_IncludedModuleExitFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IncludedModuleExitFieldCallback
    -> m ()
dynamic_IncludedModuleExitFieldCallback __funPtr = liftIO $ do
    (__dynamic_C_IncludedModuleExitFieldCallback __funPtr)
    return ()

foreign import ccall "wrapper"
    mk_IncludedModuleExitFieldCallback :: C_IncludedModuleExitFieldCallback -> IO (FunPtr C_IncludedModuleExitFieldCallback)

type IncludedModuleExitFieldCallback =
    IO ()

noIncludedModuleExitFieldCallback :: Maybe IncludedModuleExitFieldCallback
noIncludedModuleExitFieldCallback = Nothing

genClosure_IncludedModuleExitFieldCallback :: IncludedModuleExitFieldCallback -> IO Closure
genClosure_IncludedModuleExitFieldCallback cb = do
    let cb' = wrap_IncludedModuleExitFieldCallback Nothing cb
    mk_IncludedModuleExitFieldCallback cb' >>= newCClosure


wrap_IncludedModuleExitFieldCallback ::
    Maybe (Ptr (FunPtr C_IncludedModuleExitFieldCallback)) ->
    IncludedModuleExitFieldCallback ->
    IO ()
wrap_IncludedModuleExitFieldCallback funptrptr _cb = do
    _cb 
    maybeReleaseFunPtr funptrptr


-- callback FontsetForeachFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "if %TRUE, stop iteration and return immediately.", sinceVersion = Nothing}, args = [Arg {argCName = "fontset", argType = TInterface (Name {namespace = "Pango", name = "Fontset"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoFontset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "font", argType = TInterface (Name {namespace = "Pango", name = "Font"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a font from @fontset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "callback data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A callback function used by pango_fontset_foreach() when enumerating\nthe fonts in a fontset.", sinceVersion = Just "1.4"}}
type C_FontsetForeachFunc =
    Ptr Pango.Fontset.Fontset ->
    Ptr Pango.Font.Font ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "fontset", argType = TInterface (Name {namespace = "Pango", name = "Fontset"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #PangoFontset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "font", argType = TInterface (Name {namespace = "Pango", name = "Font"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a font from @fontset", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "callback data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontsetForeachFunc :: FunPtr C_FontsetForeachFunc -> C_FontsetForeachFunc

dynamic_FontsetForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Fontset.IsFontset a, Pango.Font.IsFont b) =>
    FunPtr C_FontsetForeachFunc
    -> a
    {- ^ /@fontset@/: a 'GI.Pango.Objects.Fontset.Fontset' -}
    -> b
    {- ^ /@font@/: a font from /@fontset@/ -}
    -> Ptr ()
    {- ^ /@userData@/: callback data -}
    -> m Bool
    {- ^ __Returns:__ if 'True', stop iteration and return immediately. -}
dynamic_FontsetForeachFunc __funPtr fontset font userData = liftIO $ do
    fontset' <- unsafeManagedPtrCastPtr fontset
    font' <- unsafeManagedPtrCastPtr font
    result <- (__dynamic_C_FontsetForeachFunc __funPtr) fontset' font' userData
    let result' = (/= 0) result
    touchManagedPtr fontset
    touchManagedPtr font
    return result'

foreign import ccall "wrapper"
    mk_FontsetForeachFunc :: C_FontsetForeachFunc -> IO (FunPtr C_FontsetForeachFunc)

type FontsetForeachFunc =
    Pango.Fontset.Fontset ->
    Pango.Font.Font ->
    IO Bool

noFontsetForeachFunc :: Maybe FontsetForeachFunc
noFontsetForeachFunc = Nothing

type FontsetForeachFunc_WithClosures =
    Pango.Fontset.Fontset ->
    Pango.Font.Font ->
    Ptr () ->
    IO Bool

noFontsetForeachFunc_WithClosures :: Maybe FontsetForeachFunc_WithClosures
noFontsetForeachFunc_WithClosures = Nothing

drop_closures_FontsetForeachFunc :: FontsetForeachFunc -> FontsetForeachFunc_WithClosures
drop_closures_FontsetForeachFunc _f fontset font _ = _f fontset font

genClosure_FontsetForeachFunc :: FontsetForeachFunc -> IO Closure
genClosure_FontsetForeachFunc cb = do
    let cb' = drop_closures_FontsetForeachFunc cb
    let cb'' = wrap_FontsetForeachFunc Nothing cb'
    mk_FontsetForeachFunc cb'' >>= newCClosure


wrap_FontsetForeachFunc ::
    Maybe (Ptr (FunPtr C_FontsetForeachFunc)) ->
    FontsetForeachFunc_WithClosures ->
    Ptr Pango.Fontset.Fontset ->
    Ptr Pango.Font.Font ->
    Ptr () ->
    IO CInt
wrap_FontsetForeachFunc funptrptr _cb fontset font userData = do
    fontset' <- (newObject Pango.Fontset.Fontset) fontset
    font' <- (newObject Pango.Font.Font) font
    result <- _cb  fontset' font' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback AttrFilterFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the attribute should be selected for\nfiltering, %FALSE otherwise.", sinceVersion = Nothing}, args = [Arg {argCName = "attribute", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a Pango attribute", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Type of a function filtering a list of attributes.", sinceVersion = Nothing}}
type C_AttrFilterFunc =
    Ptr Pango.Attribute.Attribute ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "attribute", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a Pango attribute", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_AttrFilterFunc :: FunPtr C_AttrFilterFunc -> C_AttrFilterFunc

dynamic_AttrFilterFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrFilterFunc
    -> Pango.Attribute.Attribute
    {- ^ /@attribute@/: a Pango attribute -}
    -> Ptr ()
    {- ^ /@userData@/: user data passed to the function -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the attribute should be selected for
filtering, 'False' otherwise. -}
dynamic_AttrFilterFunc __funPtr attribute userData = liftIO $ do
    attribute' <- unsafeManagedPtrGetPtr attribute
    result <- (__dynamic_C_AttrFilterFunc __funPtr) attribute' userData
    let result' = (/= 0) result
    touchManagedPtr attribute
    return result'

foreign import ccall "wrapper"
    mk_AttrFilterFunc :: C_AttrFilterFunc -> IO (FunPtr C_AttrFilterFunc)

type AttrFilterFunc =
    Pango.Attribute.Attribute ->
    IO Bool

noAttrFilterFunc :: Maybe AttrFilterFunc
noAttrFilterFunc = Nothing

type AttrFilterFunc_WithClosures =
    Pango.Attribute.Attribute ->
    Ptr () ->
    IO Bool

noAttrFilterFunc_WithClosures :: Maybe AttrFilterFunc_WithClosures
noAttrFilterFunc_WithClosures = Nothing

drop_closures_AttrFilterFunc :: AttrFilterFunc -> AttrFilterFunc_WithClosures
drop_closures_AttrFilterFunc _f attribute _ = _f attribute

genClosure_AttrFilterFunc :: AttrFilterFunc -> IO Closure
genClosure_AttrFilterFunc cb = do
    let cb' = drop_closures_AttrFilterFunc cb
    let cb'' = wrap_AttrFilterFunc Nothing cb'
    mk_AttrFilterFunc cb'' >>= newCClosure


wrap_AttrFilterFunc ::
    Maybe (Ptr (FunPtr C_AttrFilterFunc)) ->
    AttrFilterFunc_WithClosures ->
    Ptr Pango.Attribute.Attribute ->
    Ptr () ->
    IO CInt
wrap_AttrFilterFunc funptrptr _cb attribute userData = do
    attribute' <- (newPtr Pango.Attribute.Attribute) attribute
    result <- _cb  attribute' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback AttrDataCopyFunc
--          -> Callable {returnType = Just (TBasicType TPtr), returnMayBeNull = True, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "new copy of @user_data.", sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data to copy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Type of a function that can duplicate user data for an attribute.", sinceVersion = Nothing}}
type C_AttrDataCopyFunc =
    Ptr () ->
    IO (Ptr ())

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data to copy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_AttrDataCopyFunc :: FunPtr C_AttrDataCopyFunc -> C_AttrDataCopyFunc

dynamic_AttrDataCopyFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrDataCopyFunc
    -> Ptr ()
    {- ^ /@userData@/: user data to copy -}
    -> m (Ptr ())
    {- ^ __Returns:__ new copy of /@userData@/. -}
dynamic_AttrDataCopyFunc __funPtr userData = liftIO $ do
    result <- (__dynamic_C_AttrDataCopyFunc __funPtr) userData
    return result

foreign import ccall "wrapper"
    mk_AttrDataCopyFunc :: C_AttrDataCopyFunc -> IO (FunPtr C_AttrDataCopyFunc)

type AttrDataCopyFunc =
    IO (Ptr ())

noAttrDataCopyFunc :: Maybe AttrDataCopyFunc
noAttrDataCopyFunc = Nothing

type AttrDataCopyFunc_WithClosures =
    Ptr () ->
    IO (Ptr ())

noAttrDataCopyFunc_WithClosures :: Maybe AttrDataCopyFunc_WithClosures
noAttrDataCopyFunc_WithClosures = Nothing

drop_closures_AttrDataCopyFunc :: AttrDataCopyFunc -> AttrDataCopyFunc_WithClosures
drop_closures_AttrDataCopyFunc _f _ = _f 

genClosure_AttrDataCopyFunc :: AttrDataCopyFunc -> IO Closure
genClosure_AttrDataCopyFunc cb = do
    let cb' = drop_closures_AttrDataCopyFunc cb
    let cb'' = wrap_AttrDataCopyFunc Nothing cb'
    mk_AttrDataCopyFunc cb'' >>= newCClosure


wrap_AttrDataCopyFunc ::
    Maybe (Ptr (FunPtr C_AttrDataCopyFunc)) ->
    AttrDataCopyFunc_WithClosures ->
    Ptr () ->
    IO (Ptr ())
wrap_AttrDataCopyFunc funptrptr _cb userData = do
    result <- _cb  userData
    maybeReleaseFunPtr funptrptr
    return result


-- callback AttrClassEqualFieldCallback
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "attr1", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attr2", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_AttrClassEqualFieldCallback =
    Ptr Pango.Attribute.Attribute ->
    Ptr Pango.Attribute.Attribute ->
    IO CInt

-- Args : [Arg {argCName = "attr1", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "attr2", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_AttrClassEqualFieldCallback :: FunPtr C_AttrClassEqualFieldCallback -> C_AttrClassEqualFieldCallback

dynamic_AttrClassEqualFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassEqualFieldCallback
    -> Pango.Attribute.Attribute
    -> Pango.Attribute.Attribute
    -> m Bool
dynamic_AttrClassEqualFieldCallback __funPtr attr1 attr2 = liftIO $ do
    attr1' <- unsafeManagedPtrGetPtr attr1
    attr2' <- unsafeManagedPtrGetPtr attr2
    result <- (__dynamic_C_AttrClassEqualFieldCallback __funPtr) attr1' attr2'
    let result' = (/= 0) result
    touchManagedPtr attr1
    touchManagedPtr attr2
    return result'

foreign import ccall "wrapper"
    mk_AttrClassEqualFieldCallback :: C_AttrClassEqualFieldCallback -> IO (FunPtr C_AttrClassEqualFieldCallback)

type AttrClassEqualFieldCallback =
    Pango.Attribute.Attribute ->
    Pango.Attribute.Attribute ->
    IO Bool

noAttrClassEqualFieldCallback :: Maybe AttrClassEqualFieldCallback
noAttrClassEqualFieldCallback = Nothing

genClosure_AttrClassEqualFieldCallback :: AttrClassEqualFieldCallback -> IO Closure
genClosure_AttrClassEqualFieldCallback cb = do
    let cb' = wrap_AttrClassEqualFieldCallback Nothing cb
    mk_AttrClassEqualFieldCallback cb' >>= newCClosure


wrap_AttrClassEqualFieldCallback ::
    Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback)) ->
    AttrClassEqualFieldCallback ->
    Ptr Pango.Attribute.Attribute ->
    Ptr Pango.Attribute.Attribute ->
    IO CInt
wrap_AttrClassEqualFieldCallback funptrptr _cb attr1 attr2 = do
    attr1' <- (newPtr Pango.Attribute.Attribute) attr1
    attr2' <- (newPtr Pango.Attribute.Attribute) attr2
    result <- _cb  attr1' attr2'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback AttrClassDestroyFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "attr", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
type C_AttrClassDestroyFieldCallback =
    Ptr Pango.Attribute.Attribute ->
    IO ()

-- Args : [Arg {argCName = "attr", argType = TInterface (Name {namespace = "Pango", name = "Attribute"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_AttrClassDestroyFieldCallback :: FunPtr C_AttrClassDestroyFieldCallback -> C_AttrClassDestroyFieldCallback

dynamic_AttrClassDestroyFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassDestroyFieldCallback
    -> Pango.Attribute.Attribute
    -> m ()
dynamic_AttrClassDestroyFieldCallback __funPtr attr = liftIO $ do
    attr' <- unsafeManagedPtrGetPtr attr
    (__dynamic_C_AttrClassDestroyFieldCallback __funPtr) attr'
    touchManagedPtr attr
    return ()

foreign import ccall "wrapper"
    mk_AttrClassDestroyFieldCallback :: C_AttrClassDestroyFieldCallback -> IO (FunPtr C_AttrClassDestroyFieldCallback)

type AttrClassDestroyFieldCallback =
    Pango.Attribute.Attribute ->
    IO ()

noAttrClassDestroyFieldCallback :: Maybe AttrClassDestroyFieldCallback
noAttrClassDestroyFieldCallback = Nothing

genClosure_AttrClassDestroyFieldCallback :: AttrClassDestroyFieldCallback -> IO Closure
genClosure_AttrClassDestroyFieldCallback cb = do
    let cb' = wrap_AttrClassDestroyFieldCallback Nothing cb
    mk_AttrClassDestroyFieldCallback cb' >>= newCClosure


wrap_AttrClassDestroyFieldCallback ::
    Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback)) ->
    AttrClassDestroyFieldCallback ->
    Ptr Pango.Attribute.Attribute ->
    IO ()
wrap_AttrClassDestroyFieldCallback funptrptr _cb attr = do
    attr' <- (newPtr Pango.Attribute.Attribute) attr
    _cb  attr'
    maybeReleaseFunPtr funptrptr