-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Pango.Callbacks
    ( 

 -- * Signals
-- ** AttrClassCopyFieldCallback #signal:AttrClassCopyFieldCallback#

    AttrClassCopyFieldCallback              ,
    C_AttrClassCopyFieldCallback            ,
    dynamic_AttrClassCopyFieldCallback      ,
    genClosure_AttrClassCopyFieldCallback   ,
    mk_AttrClassCopyFieldCallback           ,
    noAttrClassCopyFieldCallback            ,
    wrap_AttrClassCopyFieldCallback         ,


-- ** 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.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.Text as T
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 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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IncludedModuleListFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IncludedModuleListFieldCallback
    -> Pango.EngineInfo.EngineInfo
    -> Int32
    -> m ()
dynamic_IncludedModuleListFieldCallback :: FunPtr C_IncludedModuleListFieldCallback
-> EngineInfo -> Int32 -> m ()
dynamic_IncludedModuleListFieldCallback FunPtr C_IncludedModuleListFieldCallback
__funPtr EngineInfo
engines Int32
nEngines = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr EngineInfo
engines' <- EngineInfo -> IO (Ptr EngineInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr EngineInfo
engines
    (FunPtr C_IncludedModuleListFieldCallback
-> C_IncludedModuleListFieldCallback
__dynamic_C_IncludedModuleListFieldCallback FunPtr C_IncludedModuleListFieldCallback
__funPtr) Ptr EngineInfo
engines' Int32
nEngines
    EngineInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr EngineInfo
engines
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

-- | Generate a function pointer callable from C code, from a `C_IncludedModuleListFieldCallback`.
foreign import ccall "wrapper"
    mk_IncludedModuleListFieldCallback :: C_IncludedModuleListFieldCallback -> IO (FunPtr C_IncludedModuleListFieldCallback)

-- | /No description available in the introspection data./
type IncludedModuleListFieldCallback =
    Pango.EngineInfo.EngineInfo
    -> Int32
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IncludedModuleListFieldCallback`@.
noIncludedModuleListFieldCallback :: Maybe IncludedModuleListFieldCallback
noIncludedModuleListFieldCallback :: Maybe IncludedModuleListFieldCallback
noIncludedModuleListFieldCallback = Maybe IncludedModuleListFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IncludedModuleListFieldCallback :: MonadIO m => IncludedModuleListFieldCallback -> m (GClosure C_IncludedModuleListFieldCallback)
genClosure_IncludedModuleListFieldCallback :: IncludedModuleListFieldCallback
-> m (GClosure C_IncludedModuleListFieldCallback)
genClosure_IncludedModuleListFieldCallback IncludedModuleListFieldCallback
cb = IO (GClosure C_IncludedModuleListFieldCallback)
-> m (GClosure C_IncludedModuleListFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IncludedModuleListFieldCallback)
 -> m (GClosure C_IncludedModuleListFieldCallback))
-> IO (GClosure C_IncludedModuleListFieldCallback)
-> m (GClosure C_IncludedModuleListFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_IncludedModuleListFieldCallback
cb' = Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback))
-> IncludedModuleListFieldCallback
-> C_IncludedModuleListFieldCallback
wrap_IncludedModuleListFieldCallback Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback))
forall a. Maybe a
Nothing IncludedModuleListFieldCallback
cb
    C_IncludedModuleListFieldCallback
-> IO (FunPtr C_IncludedModuleListFieldCallback)
mk_IncludedModuleListFieldCallback C_IncludedModuleListFieldCallback
cb' IO (FunPtr C_IncludedModuleListFieldCallback)
-> (FunPtr C_IncludedModuleListFieldCallback
    -> IO (GClosure C_IncludedModuleListFieldCallback))
-> IO (GClosure C_IncludedModuleListFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IncludedModuleListFieldCallback
-> IO (GClosure C_IncludedModuleListFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IncludedModuleListFieldCallback` into a `C_IncludedModuleListFieldCallback`.
wrap_IncludedModuleListFieldCallback ::
    Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback)) ->
    IncludedModuleListFieldCallback ->
    C_IncludedModuleListFieldCallback
wrap_IncludedModuleListFieldCallback :: Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback))
-> IncludedModuleListFieldCallback
-> C_IncludedModuleListFieldCallback
wrap_IncludedModuleListFieldCallback Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback))
funptrptr IncludedModuleListFieldCallback
_cb Ptr EngineInfo
engines Int32
nEngines = do
    EngineInfo
engines' <- ((ManagedPtr EngineInfo -> EngineInfo)
-> Ptr EngineInfo -> IO EngineInfo
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EngineInfo -> EngineInfo
Pango.EngineInfo.EngineInfo) Ptr EngineInfo
engines
    IncludedModuleListFieldCallback
_cb  EngineInfo
engines' Int32
nEngines
    Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IncludedModuleListFieldCallback))
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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IncludedModuleInitFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.TypeModule.IsTypeModule a) =>
    FunPtr C_IncludedModuleInitFieldCallback
    -> a
    -> m ()
dynamic_IncludedModuleInitFieldCallback :: FunPtr C_IncludedModuleInitFieldCallback -> a -> m ()
dynamic_IncludedModuleInitFieldCallback FunPtr C_IncludedModuleInitFieldCallback
__funPtr a
module_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr TypeModule
module_' <- a -> IO (Ptr TypeModule)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
module_
    (FunPtr C_IncludedModuleInitFieldCallback
-> C_IncludedModuleInitFieldCallback
__dynamic_C_IncludedModuleInitFieldCallback FunPtr C_IncludedModuleInitFieldCallback
__funPtr) Ptr TypeModule
module_'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
module_
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

-- | Generate a function pointer callable from C code, from a `C_IncludedModuleInitFieldCallback`.
foreign import ccall "wrapper"
    mk_IncludedModuleInitFieldCallback :: C_IncludedModuleInitFieldCallback -> IO (FunPtr C_IncludedModuleInitFieldCallback)

-- | /No description available in the introspection data./
type IncludedModuleInitFieldCallback =
    GObject.TypeModule.TypeModule
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IncludedModuleInitFieldCallback`@.
noIncludedModuleInitFieldCallback :: Maybe IncludedModuleInitFieldCallback
noIncludedModuleInitFieldCallback :: Maybe IncludedModuleInitFieldCallback
noIncludedModuleInitFieldCallback = Maybe IncludedModuleInitFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IncludedModuleInitFieldCallback :: MonadIO m => IncludedModuleInitFieldCallback -> m (GClosure C_IncludedModuleInitFieldCallback)
genClosure_IncludedModuleInitFieldCallback :: IncludedModuleInitFieldCallback
-> m (GClosure C_IncludedModuleInitFieldCallback)
genClosure_IncludedModuleInitFieldCallback IncludedModuleInitFieldCallback
cb = IO (GClosure C_IncludedModuleInitFieldCallback)
-> m (GClosure C_IncludedModuleInitFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IncludedModuleInitFieldCallback)
 -> m (GClosure C_IncludedModuleInitFieldCallback))
-> IO (GClosure C_IncludedModuleInitFieldCallback)
-> m (GClosure C_IncludedModuleInitFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_IncludedModuleInitFieldCallback
cb' = Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback))
-> IncludedModuleInitFieldCallback
-> C_IncludedModuleInitFieldCallback
wrap_IncludedModuleInitFieldCallback Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback))
forall a. Maybe a
Nothing IncludedModuleInitFieldCallback
cb
    C_IncludedModuleInitFieldCallback
-> IO (FunPtr C_IncludedModuleInitFieldCallback)
mk_IncludedModuleInitFieldCallback C_IncludedModuleInitFieldCallback
cb' IO (FunPtr C_IncludedModuleInitFieldCallback)
-> (FunPtr C_IncludedModuleInitFieldCallback
    -> IO (GClosure C_IncludedModuleInitFieldCallback))
-> IO (GClosure C_IncludedModuleInitFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IncludedModuleInitFieldCallback
-> IO (GClosure C_IncludedModuleInitFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IncludedModuleInitFieldCallback` into a `C_IncludedModuleInitFieldCallback`.
wrap_IncludedModuleInitFieldCallback ::
    Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback)) ->
    IncludedModuleInitFieldCallback ->
    C_IncludedModuleInitFieldCallback
wrap_IncludedModuleInitFieldCallback :: Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback))
-> IncludedModuleInitFieldCallback
-> C_IncludedModuleInitFieldCallback
wrap_IncludedModuleInitFieldCallback Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback))
funptrptr IncludedModuleInitFieldCallback
_cb Ptr TypeModule
module_ = do
    TypeModule
module_' <- ((ManagedPtr TypeModule -> TypeModule)
-> Ptr TypeModule -> IO TypeModule
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TypeModule -> TypeModule
GObject.TypeModule.TypeModule) Ptr TypeModule
module_
    IncludedModuleInitFieldCallback
_cb  TypeModule
module_'
    Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IncludedModuleInitFieldCallback))
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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IncludedModuleExitFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IncludedModuleExitFieldCallback
    -> m ()
dynamic_IncludedModuleExitFieldCallback :: FunPtr (IO ()) -> m ()
dynamic_IncludedModuleExitFieldCallback FunPtr (IO ())
__funPtr = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr (IO ()) -> IO ()
__dynamic_C_IncludedModuleExitFieldCallback FunPtr (IO ())
__funPtr)
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

-- | Generate a function pointer callable from C code, from a `C_IncludedModuleExitFieldCallback`.
foreign import ccall "wrapper"
    mk_IncludedModuleExitFieldCallback :: C_IncludedModuleExitFieldCallback -> IO (FunPtr C_IncludedModuleExitFieldCallback)

-- | /No description available in the introspection data./
type IncludedModuleExitFieldCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IncludedModuleExitFieldCallback`@.
noIncludedModuleExitFieldCallback :: Maybe IncludedModuleExitFieldCallback
noIncludedModuleExitFieldCallback :: Maybe (IO ())
noIncludedModuleExitFieldCallback = Maybe (IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IncludedModuleExitFieldCallback :: MonadIO m => IncludedModuleExitFieldCallback -> m (GClosure C_IncludedModuleExitFieldCallback)
genClosure_IncludedModuleExitFieldCallback :: IO () -> m (GClosure (IO ()))
genClosure_IncludedModuleExitFieldCallback IO ()
cb = IO (GClosure (IO ())) -> m (GClosure (IO ()))
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure (IO ())) -> m (GClosure (IO ())))
-> IO (GClosure (IO ())) -> m (GClosure (IO ()))
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: IO ()
cb' = Maybe (Ptr (FunPtr (IO ()))) -> IO () -> IO ()
wrap_IncludedModuleExitFieldCallback Maybe (Ptr (FunPtr (IO ())))
forall a. Maybe a
Nothing IO ()
cb
    IO () -> IO (FunPtr (IO ()))
mk_IncludedModuleExitFieldCallback IO ()
cb' IO (FunPtr (IO ()))
-> (FunPtr (IO ()) -> IO (GClosure (IO ())))
-> IO (GClosure (IO ()))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr (IO ()) -> IO (GClosure (IO ()))
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IncludedModuleExitFieldCallback` into a `C_IncludedModuleExitFieldCallback`.
wrap_IncludedModuleExitFieldCallback ::
    Maybe (Ptr (FunPtr C_IncludedModuleExitFieldCallback)) ->
    IncludedModuleExitFieldCallback ->
    C_IncludedModuleExitFieldCallback
wrap_IncludedModuleExitFieldCallback :: Maybe (Ptr (FunPtr (IO ()))) -> IO () -> IO ()
wrap_IncludedModuleExitFieldCallback Maybe (Ptr (FunPtr (IO ())))
funptrptr IO ()
_cb = do
    IO ()
_cb 
    Maybe (Ptr (FunPtr (IO ()))) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr (IO ())))
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"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontsetForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Pango.Fontset.IsFontset a, Pango.Font.IsFont b) =>
    FunPtr C_FontsetForeachFunc
    -> a
    -- ^ /@fontset@/: a t'GI.Pango.Objects.Fontset.Fontset'
    -> b
    -- ^ /@font@/: a font from /@fontset@/
    -> Ptr ()
    -- ^ /@userData@/: callback data
    -> m Bool
    -- ^ __Returns:__ if 'P.True', stop iteration and return immediately.
dynamic_FontsetForeachFunc :: FunPtr C_FontsetForeachFunc -> a -> b -> Ptr () -> m Bool
dynamic_FontsetForeachFunc FunPtr C_FontsetForeachFunc
__funPtr a
fontset b
font Ptr ()
userData = IO Bool -> m Bool
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
    Ptr Fontset
fontset' <- a -> IO (Ptr Fontset)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
fontset
    Ptr Font
font' <- b -> IO (Ptr Font)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
font
    CInt
result <- (FunPtr C_FontsetForeachFunc -> C_FontsetForeachFunc
__dynamic_C_FontsetForeachFunc FunPtr C_FontsetForeachFunc
__funPtr) Ptr Fontset
fontset' Ptr Font
font' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
fontset
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
font
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

-- | Generate a function pointer callable from C code, from a `C_FontsetForeachFunc`.
foreign import ccall "wrapper"
    mk_FontsetForeachFunc :: C_FontsetForeachFunc -> IO (FunPtr C_FontsetForeachFunc)

-- | A callback function used by 'GI.Pango.Objects.Fontset.fontsetForeach' when enumerating
-- the fonts in a fontset.
-- 
-- /Since: 1.4/
type FontsetForeachFunc =
    Pango.Fontset.Fontset
    -- ^ /@fontset@/: a t'GI.Pango.Objects.Fontset.Fontset'
    -> Pango.Font.Font
    -- ^ /@font@/: a font from /@fontset@/
    -> IO Bool
    -- ^ __Returns:__ if 'P.True', stop iteration and return immediately.

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontsetForeachFunc`@.
noFontsetForeachFunc :: Maybe FontsetForeachFunc
noFontsetForeachFunc :: Maybe FontsetForeachFunc
noFontsetForeachFunc = Maybe FontsetForeachFunc
forall a. Maybe a
Nothing

-- | A callback function used by 'GI.Pango.Objects.Fontset.fontsetForeach' when enumerating
-- the fonts in a fontset.
-- 
-- /Since: 1.4/
type FontsetForeachFunc_WithClosures =
    Pango.Fontset.Fontset
    -- ^ /@fontset@/: a t'GI.Pango.Objects.Fontset.Fontset'
    -> Pango.Font.Font
    -- ^ /@font@/: a font from /@fontset@/
    -> Ptr ()
    -- ^ /@userData@/: callback data
    -> IO Bool
    -- ^ __Returns:__ if 'P.True', stop iteration and return immediately.

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontsetForeachFunc_WithClosures`@.
noFontsetForeachFunc_WithClosures :: Maybe FontsetForeachFunc_WithClosures
noFontsetForeachFunc_WithClosures :: Maybe FontsetForeachFunc_WithClosures
noFontsetForeachFunc_WithClosures = Maybe FontsetForeachFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontsetForeachFunc :: FontsetForeachFunc -> FontsetForeachFunc_WithClosures
drop_closures_FontsetForeachFunc :: FontsetForeachFunc -> FontsetForeachFunc_WithClosures
drop_closures_FontsetForeachFunc FontsetForeachFunc
_f Fontset
fontset Font
font Ptr ()
_ = FontsetForeachFunc
_f Fontset
fontset Font
font

-- | Wrap the callback into a `GClosure`.
genClosure_FontsetForeachFunc :: MonadIO m => FontsetForeachFunc -> m (GClosure C_FontsetForeachFunc)
genClosure_FontsetForeachFunc :: FontsetForeachFunc -> m (GClosure C_FontsetForeachFunc)
genClosure_FontsetForeachFunc FontsetForeachFunc
cb = IO (GClosure C_FontsetForeachFunc)
-> m (GClosure C_FontsetForeachFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontsetForeachFunc)
 -> m (GClosure C_FontsetForeachFunc))
-> IO (GClosure C_FontsetForeachFunc)
-> m (GClosure C_FontsetForeachFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontsetForeachFunc_WithClosures
cb' = FontsetForeachFunc -> FontsetForeachFunc_WithClosures
drop_closures_FontsetForeachFunc FontsetForeachFunc
cb
    let cb'' :: C_FontsetForeachFunc
cb'' = Maybe (Ptr (FunPtr C_FontsetForeachFunc))
-> FontsetForeachFunc_WithClosures -> C_FontsetForeachFunc
wrap_FontsetForeachFunc Maybe (Ptr (FunPtr C_FontsetForeachFunc))
forall a. Maybe a
Nothing FontsetForeachFunc_WithClosures
cb'
    C_FontsetForeachFunc -> IO (FunPtr C_FontsetForeachFunc)
mk_FontsetForeachFunc C_FontsetForeachFunc
cb'' IO (FunPtr C_FontsetForeachFunc)
-> (FunPtr C_FontsetForeachFunc
    -> IO (GClosure C_FontsetForeachFunc))
-> IO (GClosure C_FontsetForeachFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontsetForeachFunc -> IO (GClosure C_FontsetForeachFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontsetForeachFunc` into a `C_FontsetForeachFunc`.
wrap_FontsetForeachFunc ::
    Maybe (Ptr (FunPtr C_FontsetForeachFunc)) ->
    FontsetForeachFunc_WithClosures ->
    C_FontsetForeachFunc
wrap_FontsetForeachFunc :: Maybe (Ptr (FunPtr C_FontsetForeachFunc))
-> FontsetForeachFunc_WithClosures -> C_FontsetForeachFunc
wrap_FontsetForeachFunc Maybe (Ptr (FunPtr C_FontsetForeachFunc))
funptrptr FontsetForeachFunc_WithClosures
_cb Ptr Fontset
fontset Ptr Font
font Ptr ()
userData = do
    Fontset
fontset' <- ((ManagedPtr Fontset -> Fontset) -> Ptr Fontset -> IO Fontset
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Fontset -> Fontset
Pango.Fontset.Fontset) Ptr Fontset
fontset
    Font
font' <- ((ManagedPtr Font -> Font) -> Ptr Font -> IO Font
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Font -> Font
Pango.Font.Font) Ptr Font
font
    Bool
result <- FontsetForeachFunc_WithClosures
_cb  Fontset
fontset' Font
font' Ptr ()
userData
    Maybe (Ptr (FunPtr C_FontsetForeachFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontsetForeachFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
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:__ 'P.True' if the attribute should be selected for
    -- filtering, 'P.False' otherwise.
dynamic_AttrFilterFunc :: FunPtr C_AttrFilterFunc -> Attribute -> Ptr () -> m Bool
dynamic_AttrFilterFunc FunPtr C_AttrFilterFunc
__funPtr Attribute
attribute Ptr ()
userData = IO Bool -> m Bool
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
    Ptr Attribute
attribute' <- Attribute -> IO (Ptr Attribute)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Attribute
attribute
    CInt
result <- (FunPtr C_AttrFilterFunc -> C_AttrFilterFunc
__dynamic_C_AttrFilterFunc FunPtr C_AttrFilterFunc
__funPtr) Ptr Attribute
attribute' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Attribute -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attribute
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

-- | Generate a function pointer callable from C code, from a `C_AttrFilterFunc`.
foreign import ccall "wrapper"
    mk_AttrFilterFunc :: C_AttrFilterFunc -> IO (FunPtr C_AttrFilterFunc)

-- | Type of a function filtering a list of attributes.
type AttrFilterFunc =
    Pango.Attribute.Attribute
    -- ^ /@attribute@/: a Pango attribute
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the attribute should be selected for
    -- filtering, 'P.False' otherwise.

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrFilterFunc`@.
noAttrFilterFunc :: Maybe AttrFilterFunc
noAttrFilterFunc :: Maybe AttrFilterFunc
noAttrFilterFunc = Maybe AttrFilterFunc
forall a. Maybe a
Nothing

-- | Type of a function filtering a list of attributes.
type AttrFilterFunc_WithClosures =
    Pango.Attribute.Attribute
    -- ^ /@attribute@/: a Pango attribute
    -> Ptr ()
    -- ^ /@userData@/: user data passed to the function
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the attribute should be selected for
    -- filtering, 'P.False' otherwise.

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrFilterFunc_WithClosures`@.
noAttrFilterFunc_WithClosures :: Maybe AttrFilterFunc_WithClosures
noAttrFilterFunc_WithClosures :: Maybe AttrFilterFunc_WithClosures
noAttrFilterFunc_WithClosures = Maybe AttrFilterFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_AttrFilterFunc :: AttrFilterFunc -> AttrFilterFunc_WithClosures
drop_closures_AttrFilterFunc :: AttrFilterFunc -> AttrFilterFunc_WithClosures
drop_closures_AttrFilterFunc AttrFilterFunc
_f Attribute
attribute Ptr ()
_ = AttrFilterFunc
_f Attribute
attribute

-- | Wrap the callback into a `GClosure`.
genClosure_AttrFilterFunc :: MonadIO m => AttrFilterFunc -> m (GClosure C_AttrFilterFunc)
genClosure_AttrFilterFunc :: AttrFilterFunc -> m (GClosure C_AttrFilterFunc)
genClosure_AttrFilterFunc AttrFilterFunc
cb = IO (GClosure C_AttrFilterFunc) -> m (GClosure C_AttrFilterFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AttrFilterFunc) -> m (GClosure C_AttrFilterFunc))
-> IO (GClosure C_AttrFilterFunc) -> m (GClosure C_AttrFilterFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: AttrFilterFunc_WithClosures
cb' = AttrFilterFunc -> AttrFilterFunc_WithClosures
drop_closures_AttrFilterFunc AttrFilterFunc
cb
    let cb'' :: C_AttrFilterFunc
cb'' = Maybe (Ptr (FunPtr C_AttrFilterFunc))
-> AttrFilterFunc_WithClosures -> C_AttrFilterFunc
wrap_AttrFilterFunc Maybe (Ptr (FunPtr C_AttrFilterFunc))
forall a. Maybe a
Nothing AttrFilterFunc_WithClosures
cb'
    C_AttrFilterFunc -> IO (FunPtr C_AttrFilterFunc)
mk_AttrFilterFunc C_AttrFilterFunc
cb'' IO (FunPtr C_AttrFilterFunc)
-> (FunPtr C_AttrFilterFunc -> IO (GClosure C_AttrFilterFunc))
-> IO (GClosure C_AttrFilterFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AttrFilterFunc -> IO (GClosure C_AttrFilterFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `AttrFilterFunc` into a `C_AttrFilterFunc`.
wrap_AttrFilterFunc ::
    Maybe (Ptr (FunPtr C_AttrFilterFunc)) ->
    AttrFilterFunc_WithClosures ->
    C_AttrFilterFunc
wrap_AttrFilterFunc :: Maybe (Ptr (FunPtr C_AttrFilterFunc))
-> AttrFilterFunc_WithClosures -> C_AttrFilterFunc
wrap_AttrFilterFunc Maybe (Ptr (FunPtr C_AttrFilterFunc))
funptrptr AttrFilterFunc_WithClosures
_cb Ptr Attribute
attribute Ptr ()
userData = do
    (ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> (Attribute -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute Ptr Attribute
attribute ((Attribute -> IO CInt) -> IO CInt)
-> (Attribute -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Attribute
attribute' -> do
        Bool
result <- AttrFilterFunc_WithClosures
_cb  Attribute
attribute' Ptr ()
userData
        Maybe (Ptr (FunPtr C_AttrFilterFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AttrFilterFunc))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
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 C_AttrDataCopyFunc -> Ptr () -> m (Ptr ())
dynamic_AttrDataCopyFunc FunPtr C_AttrDataCopyFunc
__funPtr Ptr ()
userData = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
    Ptr ()
result <- (FunPtr C_AttrDataCopyFunc -> C_AttrDataCopyFunc
__dynamic_C_AttrDataCopyFunc FunPtr C_AttrDataCopyFunc
__funPtr) Ptr ()
userData
    C_AttrDataCopyFunc
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result

-- | Generate a function pointer callable from C code, from a `C_AttrDataCopyFunc`.
foreign import ccall "wrapper"
    mk_AttrDataCopyFunc :: C_AttrDataCopyFunc -> IO (FunPtr C_AttrDataCopyFunc)

-- | Type of a function that can duplicate user data for an attribute.
type AttrDataCopyFunc =
    IO (Ptr ())
    -- ^ __Returns:__ new copy of /@userData@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrDataCopyFunc`@.
noAttrDataCopyFunc :: Maybe AttrDataCopyFunc
noAttrDataCopyFunc :: Maybe (IO (Ptr ()))
noAttrDataCopyFunc = Maybe (IO (Ptr ()))
forall a. Maybe a
Nothing

-- | Type of a function that can duplicate user data for an attribute.
type AttrDataCopyFunc_WithClosures =
    Ptr ()
    -- ^ /@userData@/: user data to copy
    -> IO (Ptr ())
    -- ^ __Returns:__ new copy of /@userData@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrDataCopyFunc_WithClosures`@.
noAttrDataCopyFunc_WithClosures :: Maybe AttrDataCopyFunc_WithClosures
noAttrDataCopyFunc_WithClosures :: Maybe C_AttrDataCopyFunc
noAttrDataCopyFunc_WithClosures = Maybe C_AttrDataCopyFunc
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_AttrDataCopyFunc :: AttrDataCopyFunc -> AttrDataCopyFunc_WithClosures
drop_closures_AttrDataCopyFunc :: IO (Ptr ()) -> C_AttrDataCopyFunc
drop_closures_AttrDataCopyFunc IO (Ptr ())
_f Ptr ()
_ = IO (Ptr ())
_f 

-- | Wrap the callback into a `GClosure`.
genClosure_AttrDataCopyFunc :: MonadIO m => AttrDataCopyFunc -> m (GClosure C_AttrDataCopyFunc)
genClosure_AttrDataCopyFunc :: IO (Ptr ()) -> m (GClosure C_AttrDataCopyFunc)
genClosure_AttrDataCopyFunc IO (Ptr ())
cb = IO (GClosure C_AttrDataCopyFunc) -> m (GClosure C_AttrDataCopyFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AttrDataCopyFunc)
 -> m (GClosure C_AttrDataCopyFunc))
-> IO (GClosure C_AttrDataCopyFunc)
-> m (GClosure C_AttrDataCopyFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_AttrDataCopyFunc
cb' = IO (Ptr ()) -> C_AttrDataCopyFunc
drop_closures_AttrDataCopyFunc IO (Ptr ())
cb
    let cb'' :: C_AttrDataCopyFunc
cb'' = Maybe (Ptr (FunPtr C_AttrDataCopyFunc))
-> C_AttrDataCopyFunc -> C_AttrDataCopyFunc
wrap_AttrDataCopyFunc Maybe (Ptr (FunPtr C_AttrDataCopyFunc))
forall a. Maybe a
Nothing C_AttrDataCopyFunc
cb'
    C_AttrDataCopyFunc -> IO (FunPtr C_AttrDataCopyFunc)
mk_AttrDataCopyFunc C_AttrDataCopyFunc
cb'' IO (FunPtr C_AttrDataCopyFunc)
-> (FunPtr C_AttrDataCopyFunc -> IO (GClosure C_AttrDataCopyFunc))
-> IO (GClosure C_AttrDataCopyFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AttrDataCopyFunc -> IO (GClosure C_AttrDataCopyFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `AttrDataCopyFunc` into a `C_AttrDataCopyFunc`.
wrap_AttrDataCopyFunc ::
    Maybe (Ptr (FunPtr C_AttrDataCopyFunc)) ->
    AttrDataCopyFunc_WithClosures ->
    C_AttrDataCopyFunc
wrap_AttrDataCopyFunc :: Maybe (Ptr (FunPtr C_AttrDataCopyFunc))
-> C_AttrDataCopyFunc -> C_AttrDataCopyFunc
wrap_AttrDataCopyFunc Maybe (Ptr (FunPtr C_AttrDataCopyFunc))
funptrptr C_AttrDataCopyFunc
_cb Ptr ()
userData = do
    Ptr ()
result <- C_AttrDataCopyFunc
_cb  Ptr ()
userData
    Maybe (Ptr (FunPtr C_AttrDataCopyFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AttrDataCopyFunc))
funptrptr
    C_AttrDataCopyFunc
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_AttrClassEqualFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassEqualFieldCallback
    -> Pango.Attribute.Attribute
    -> Pango.Attribute.Attribute
    -> m Bool
dynamic_AttrClassEqualFieldCallback :: FunPtr C_AttrClassEqualFieldCallback
-> Attribute -> Attribute -> m Bool
dynamic_AttrClassEqualFieldCallback FunPtr C_AttrClassEqualFieldCallback
__funPtr Attribute
attr1 Attribute
attr2 = IO Bool -> m Bool
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
    Ptr Attribute
attr1' <- Attribute -> IO (Ptr Attribute)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Attribute
attr1
    Ptr Attribute
attr2' <- Attribute -> IO (Ptr Attribute)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Attribute
attr2
    CInt
result <- (FunPtr C_AttrClassEqualFieldCallback
-> C_AttrClassEqualFieldCallback
__dynamic_C_AttrClassEqualFieldCallback FunPtr C_AttrClassEqualFieldCallback
__funPtr) Ptr Attribute
attr1' Ptr Attribute
attr2'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Attribute -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr1
    Attribute -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr2
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

-- | Generate a function pointer callable from C code, from a `C_AttrClassEqualFieldCallback`.
foreign import ccall "wrapper"
    mk_AttrClassEqualFieldCallback :: C_AttrClassEqualFieldCallback -> IO (FunPtr C_AttrClassEqualFieldCallback)

-- | /No description available in the introspection data./
type AttrClassEqualFieldCallback =
    Pango.Attribute.Attribute
    -> Pango.Attribute.Attribute
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrClassEqualFieldCallback`@.
noAttrClassEqualFieldCallback :: Maybe AttrClassEqualFieldCallback
noAttrClassEqualFieldCallback :: Maybe AttrClassEqualFieldCallback
noAttrClassEqualFieldCallback = Maybe AttrClassEqualFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_AttrClassEqualFieldCallback :: MonadIO m => AttrClassEqualFieldCallback -> m (GClosure C_AttrClassEqualFieldCallback)
genClosure_AttrClassEqualFieldCallback :: AttrClassEqualFieldCallback
-> m (GClosure C_AttrClassEqualFieldCallback)
genClosure_AttrClassEqualFieldCallback AttrClassEqualFieldCallback
cb = IO (GClosure C_AttrClassEqualFieldCallback)
-> m (GClosure C_AttrClassEqualFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AttrClassEqualFieldCallback)
 -> m (GClosure C_AttrClassEqualFieldCallback))
-> IO (GClosure C_AttrClassEqualFieldCallback)
-> m (GClosure C_AttrClassEqualFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_AttrClassEqualFieldCallback
cb' = Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback))
-> AttrClassEqualFieldCallback -> C_AttrClassEqualFieldCallback
wrap_AttrClassEqualFieldCallback Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback))
forall a. Maybe a
Nothing AttrClassEqualFieldCallback
cb
    C_AttrClassEqualFieldCallback
-> IO (FunPtr C_AttrClassEqualFieldCallback)
mk_AttrClassEqualFieldCallback C_AttrClassEqualFieldCallback
cb' IO (FunPtr C_AttrClassEqualFieldCallback)
-> (FunPtr C_AttrClassEqualFieldCallback
    -> IO (GClosure C_AttrClassEqualFieldCallback))
-> IO (GClosure C_AttrClassEqualFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AttrClassEqualFieldCallback
-> IO (GClosure C_AttrClassEqualFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `AttrClassEqualFieldCallback` into a `C_AttrClassEqualFieldCallback`.
wrap_AttrClassEqualFieldCallback ::
    Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback)) ->
    AttrClassEqualFieldCallback ->
    C_AttrClassEqualFieldCallback
wrap_AttrClassEqualFieldCallback :: Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback))
-> AttrClassEqualFieldCallback -> C_AttrClassEqualFieldCallback
wrap_AttrClassEqualFieldCallback Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback))
funptrptr AttrClassEqualFieldCallback
_cb Ptr Attribute
attr1 Ptr Attribute
attr2 = do
    (ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> (Attribute -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute Ptr Attribute
attr1 ((Attribute -> IO CInt) -> IO CInt)
-> (Attribute -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Attribute
attr1' -> do
        (ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> (Attribute -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute Ptr Attribute
attr2 ((Attribute -> IO CInt) -> IO CInt)
-> (Attribute -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Attribute
attr2' -> do
            Bool
result <- AttrClassEqualFieldCallback
_cb  Attribute
attr1' Attribute
attr2'
            Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AttrClassEqualFieldCallback))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
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

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_AttrClassDestroyFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassDestroyFieldCallback
    -> Pango.Attribute.Attribute
    -> m ()
dynamic_AttrClassDestroyFieldCallback :: FunPtr C_AttrClassDestroyFieldCallback -> Attribute -> m ()
dynamic_AttrClassDestroyFieldCallback FunPtr C_AttrClassDestroyFieldCallback
__funPtr Attribute
attr = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Attribute
attr' <- Attribute -> IO (Ptr Attribute)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Attribute
attr
    (FunPtr C_AttrClassDestroyFieldCallback
-> C_AttrClassDestroyFieldCallback
__dynamic_C_AttrClassDestroyFieldCallback FunPtr C_AttrClassDestroyFieldCallback
__funPtr) Ptr Attribute
attr'
    Attribute -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

-- | Generate a function pointer callable from C code, from a `C_AttrClassDestroyFieldCallback`.
foreign import ccall "wrapper"
    mk_AttrClassDestroyFieldCallback :: C_AttrClassDestroyFieldCallback -> IO (FunPtr C_AttrClassDestroyFieldCallback)

-- | /No description available in the introspection data./
type AttrClassDestroyFieldCallback =
    Pango.Attribute.Attribute
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrClassDestroyFieldCallback`@.
noAttrClassDestroyFieldCallback :: Maybe AttrClassDestroyFieldCallback
noAttrClassDestroyFieldCallback :: Maybe (Attribute -> IO ())
noAttrClassDestroyFieldCallback = Maybe (Attribute -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_AttrClassDestroyFieldCallback :: MonadIO m => AttrClassDestroyFieldCallback -> m (GClosure C_AttrClassDestroyFieldCallback)
genClosure_AttrClassDestroyFieldCallback :: (Attribute -> IO ())
-> m (GClosure C_AttrClassDestroyFieldCallback)
genClosure_AttrClassDestroyFieldCallback Attribute -> IO ()
cb = IO (GClosure C_AttrClassDestroyFieldCallback)
-> m (GClosure C_AttrClassDestroyFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AttrClassDestroyFieldCallback)
 -> m (GClosure C_AttrClassDestroyFieldCallback))
-> IO (GClosure C_AttrClassDestroyFieldCallback)
-> m (GClosure C_AttrClassDestroyFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_AttrClassDestroyFieldCallback
cb' = Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback))
-> (Attribute -> IO ()) -> C_AttrClassDestroyFieldCallback
wrap_AttrClassDestroyFieldCallback Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback))
forall a. Maybe a
Nothing Attribute -> IO ()
cb
    C_AttrClassDestroyFieldCallback
-> IO (FunPtr C_AttrClassDestroyFieldCallback)
mk_AttrClassDestroyFieldCallback C_AttrClassDestroyFieldCallback
cb' IO (FunPtr C_AttrClassDestroyFieldCallback)
-> (FunPtr C_AttrClassDestroyFieldCallback
    -> IO (GClosure C_AttrClassDestroyFieldCallback))
-> IO (GClosure C_AttrClassDestroyFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AttrClassDestroyFieldCallback
-> IO (GClosure C_AttrClassDestroyFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `AttrClassDestroyFieldCallback` into a `C_AttrClassDestroyFieldCallback`.
wrap_AttrClassDestroyFieldCallback ::
    Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback)) ->
    AttrClassDestroyFieldCallback ->
    C_AttrClassDestroyFieldCallback
wrap_AttrClassDestroyFieldCallback :: Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback))
-> (Attribute -> IO ()) -> C_AttrClassDestroyFieldCallback
wrap_AttrClassDestroyFieldCallback Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback))
funptrptr Attribute -> IO ()
_cb Ptr Attribute
attr = do
    (ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> (Attribute -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute Ptr Attribute
attr ((Attribute -> IO ()) -> IO ()) -> (Attribute -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Attribute
attr' -> do
        Attribute -> IO ()
_cb  Attribute
attr'
        Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AttrClassDestroyFieldCallback))
funptrptr


-- callback AttrClassCopyFieldCallback
{- Callable
  { returnType =
      Just (TInterface Name { namespace = "Pango" , name = "Attribute" })
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , 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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_AttrClassCopyFieldCallback =
    Ptr Pango.Attribute.Attribute ->
    IO (Ptr Pango.Attribute.Attribute)

-- 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: Just (TInterface Name { namespace = "Pango" , name = "Attribute" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_AttrClassCopyFieldCallback :: FunPtr C_AttrClassCopyFieldCallback -> C_AttrClassCopyFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_AttrClassCopyFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassCopyFieldCallback
    -> Pango.Attribute.Attribute
    -> m Pango.Attribute.Attribute
dynamic_AttrClassCopyFieldCallback :: FunPtr C_AttrClassCopyFieldCallback -> Attribute -> m Attribute
dynamic_AttrClassCopyFieldCallback FunPtr C_AttrClassCopyFieldCallback
__funPtr Attribute
attr = IO Attribute -> m Attribute
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
    Ptr Attribute
attr' <- Attribute -> IO (Ptr Attribute)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Attribute
attr
    Ptr Attribute
result <- (FunPtr C_AttrClassCopyFieldCallback -> C_AttrClassCopyFieldCallback
__dynamic_C_AttrClassCopyFieldCallback FunPtr C_AttrClassCopyFieldCallback
__funPtr) Ptr Attribute
attr'
    Text -> C_AttrClassDestroyFieldCallback
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attrClassCopyFieldCallback" Ptr Attribute
result
    Attribute
result' <- ((ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> IO Attribute
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute) Ptr Attribute
result
    Attribute -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Attribute
attr
    Attribute -> IO Attribute
forall (m :: * -> *) a. Monad m => a -> m a
return Attribute
result'

-- | Generate a function pointer callable from C code, from a `C_AttrClassCopyFieldCallback`.
foreign import ccall "wrapper"
    mk_AttrClassCopyFieldCallback :: C_AttrClassCopyFieldCallback -> IO (FunPtr C_AttrClassCopyFieldCallback)

-- | /No description available in the introspection data./
type AttrClassCopyFieldCallback =
    Pango.Attribute.Attribute
    -> IO Pango.Attribute.Attribute

-- | A convenience synonym for @`Nothing` :: `Maybe` `AttrClassCopyFieldCallback`@.
noAttrClassCopyFieldCallback :: Maybe AttrClassCopyFieldCallback
noAttrClassCopyFieldCallback :: Maybe (Attribute -> IO Attribute)
noAttrClassCopyFieldCallback = Maybe (Attribute -> IO Attribute)
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_AttrClassCopyFieldCallback :: MonadIO m => AttrClassCopyFieldCallback -> m (GClosure C_AttrClassCopyFieldCallback)
genClosure_AttrClassCopyFieldCallback :: (Attribute -> IO Attribute)
-> m (GClosure C_AttrClassCopyFieldCallback)
genClosure_AttrClassCopyFieldCallback Attribute -> IO Attribute
cb = IO (GClosure C_AttrClassCopyFieldCallback)
-> m (GClosure C_AttrClassCopyFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_AttrClassCopyFieldCallback)
 -> m (GClosure C_AttrClassCopyFieldCallback))
-> IO (GClosure C_AttrClassCopyFieldCallback)
-> m (GClosure C_AttrClassCopyFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_AttrClassCopyFieldCallback
cb' = Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback))
-> (Attribute -> IO Attribute) -> C_AttrClassCopyFieldCallback
wrap_AttrClassCopyFieldCallback Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback))
forall a. Maybe a
Nothing Attribute -> IO Attribute
cb
    C_AttrClassCopyFieldCallback
-> IO (FunPtr C_AttrClassCopyFieldCallback)
mk_AttrClassCopyFieldCallback C_AttrClassCopyFieldCallback
cb' IO (FunPtr C_AttrClassCopyFieldCallback)
-> (FunPtr C_AttrClassCopyFieldCallback
    -> IO (GClosure C_AttrClassCopyFieldCallback))
-> IO (GClosure C_AttrClassCopyFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_AttrClassCopyFieldCallback
-> IO (GClosure C_AttrClassCopyFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `AttrClassCopyFieldCallback` into a `C_AttrClassCopyFieldCallback`.
wrap_AttrClassCopyFieldCallback ::
    Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback)) ->
    AttrClassCopyFieldCallback ->
    C_AttrClassCopyFieldCallback
wrap_AttrClassCopyFieldCallback :: Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback))
-> (Attribute -> IO Attribute) -> C_AttrClassCopyFieldCallback
wrap_AttrClassCopyFieldCallback Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback))
funptrptr Attribute -> IO Attribute
_cb Ptr Attribute
attr = do
    (ManagedPtr Attribute -> Attribute)
-> Ptr Attribute
-> (Attribute -> IO (Ptr Attribute))
-> IO (Ptr Attribute)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Attribute -> Attribute
Pango.Attribute.Attribute Ptr Attribute
attr ((Attribute -> IO (Ptr Attribute)) -> IO (Ptr Attribute))
-> (Attribute -> IO (Ptr Attribute)) -> IO (Ptr Attribute)
forall a b. (a -> b) -> a -> b
$ \Attribute
attr' -> do
        Attribute
result <- Attribute -> IO Attribute
_cb  Attribute
attr'
        Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_AttrClassCopyFieldCallback))
funptrptr
        Ptr Attribute
result' <- Attribute -> IO (Ptr Attribute)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Attribute
result
        C_AttrClassCopyFieldCallback
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Attribute
result'