-- | 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.HarfBuzz.Callbacks
    ( 

 -- * Signals
-- ** BufferMessageFuncT #signal:BufferMessageFuncT#

    BufferMessageFuncT                      ,
    BufferMessageFuncT_WithClosures         ,
    C_BufferMessageFuncT                    ,
    drop_closures_BufferMessageFuncT        ,
    dynamic_BufferMessageFuncT              ,
    genClosure_BufferMessageFuncT           ,
    mk_BufferMessageFuncT                   ,
    noBufferMessageFuncT                    ,
    noBufferMessageFuncT_WithClosures       ,
    wrap_BufferMessageFuncT                 ,


-- ** DestroyFuncT #signal:DestroyFuncT#

    C_DestroyFuncT                          ,
    DestroyFuncT                            ,
    DestroyFuncT_WithClosures               ,
    drop_closures_DestroyFuncT              ,
    dynamic_DestroyFuncT                    ,
    genClosure_DestroyFuncT                 ,
    mk_DestroyFuncT                         ,
    noDestroyFuncT                          ,
    noDestroyFuncT_WithClosures             ,
    wrap_DestroyFuncT                       ,


-- ** FontGetFontExtentsFuncT #signal:FontGetFontExtentsFuncT#

    C_FontGetFontExtentsFuncT               ,
    FontGetFontExtentsFuncT                 ,
    FontGetFontExtentsFuncT_WithClosures    ,
    drop_closures_FontGetFontExtentsFuncT   ,
    dynamic_FontGetFontExtentsFuncT         ,
    genClosure_FontGetFontExtentsFuncT      ,
    mk_FontGetFontExtentsFuncT              ,
    noFontGetFontExtentsFuncT               ,
    noFontGetFontExtentsFuncT_WithClosures  ,
    wrap_FontGetFontExtentsFuncT            ,


-- ** FontGetGlyphAdvanceFuncT #signal:FontGetGlyphAdvanceFuncT#

    C_FontGetGlyphAdvanceFuncT              ,
    FontGetGlyphAdvanceFuncT                ,
    FontGetGlyphAdvanceFuncT_WithClosures   ,
    drop_closures_FontGetGlyphAdvanceFuncT  ,
    dynamic_FontGetGlyphAdvanceFuncT        ,
    genClosure_FontGetGlyphAdvanceFuncT     ,
    mk_FontGetGlyphAdvanceFuncT             ,
    noFontGetGlyphAdvanceFuncT              ,
    noFontGetGlyphAdvanceFuncT_WithClosures ,
    wrap_FontGetGlyphAdvanceFuncT           ,


-- ** FontGetGlyphAdvancesFuncT #signal:FontGetGlyphAdvancesFuncT#

    C_FontGetGlyphAdvancesFuncT             ,
    FontGetGlyphAdvancesFuncT               ,
    FontGetGlyphAdvancesFuncT_WithClosures  ,
    drop_closures_FontGetGlyphAdvancesFuncT ,
    dynamic_FontGetGlyphAdvancesFuncT       ,
    genClosure_FontGetGlyphAdvancesFuncT    ,
    mk_FontGetGlyphAdvancesFuncT            ,
    noFontGetGlyphAdvancesFuncT             ,
    noFontGetGlyphAdvancesFuncT_WithClosures,
    wrap_FontGetGlyphAdvancesFuncT          ,


-- ** FontGetGlyphContourPointFuncT #signal:FontGetGlyphContourPointFuncT#

    C_FontGetGlyphContourPointFuncT         ,
    FontGetGlyphContourPointFuncT           ,
    FontGetGlyphContourPointFuncT_WithClosures,
    drop_closures_FontGetGlyphContourPointFuncT,
    dynamic_FontGetGlyphContourPointFuncT   ,
    genClosure_FontGetGlyphContourPointFuncT,
    mk_FontGetGlyphContourPointFuncT        ,
    noFontGetGlyphContourPointFuncT         ,
    noFontGetGlyphContourPointFuncT_WithClosures,
    wrap_FontGetGlyphContourPointFuncT      ,


-- ** FontGetGlyphExtentsFuncT #signal:FontGetGlyphExtentsFuncT#

    C_FontGetGlyphExtentsFuncT              ,
    FontGetGlyphExtentsFuncT                ,
    FontGetGlyphExtentsFuncT_WithClosures   ,
    drop_closures_FontGetGlyphExtentsFuncT  ,
    dynamic_FontGetGlyphExtentsFuncT        ,
    genClosure_FontGetGlyphExtentsFuncT     ,
    mk_FontGetGlyphExtentsFuncT             ,
    noFontGetGlyphExtentsFuncT              ,
    noFontGetGlyphExtentsFuncT_WithClosures ,
    wrap_FontGetGlyphExtentsFuncT           ,


-- ** FontGetGlyphFromNameFuncT #signal:FontGetGlyphFromNameFuncT#

    C_FontGetGlyphFromNameFuncT             ,
    FontGetGlyphFromNameFuncT               ,
    FontGetGlyphFromNameFuncT_WithClosures  ,
    drop_closures_FontGetGlyphFromNameFuncT ,
    dynamic_FontGetGlyphFromNameFuncT       ,
    genClosure_FontGetGlyphFromNameFuncT    ,
    mk_FontGetGlyphFromNameFuncT            ,
    noFontGetGlyphFromNameFuncT             ,
    noFontGetGlyphFromNameFuncT_WithClosures,
    wrap_FontGetGlyphFromNameFuncT          ,


-- ** FontGetGlyphFuncT #signal:FontGetGlyphFuncT#

    C_FontGetGlyphFuncT                     ,
    FontGetGlyphFuncT                       ,
    FontGetGlyphFuncT_WithClosures          ,
    drop_closures_FontGetGlyphFuncT         ,
    dynamic_FontGetGlyphFuncT               ,
    genClosure_FontGetGlyphFuncT            ,
    mk_FontGetGlyphFuncT                    ,
    noFontGetGlyphFuncT                     ,
    noFontGetGlyphFuncT_WithClosures        ,
    wrap_FontGetGlyphFuncT                  ,


-- ** FontGetGlyphKerningFuncT #signal:FontGetGlyphKerningFuncT#

    C_FontGetGlyphKerningFuncT              ,
    FontGetGlyphKerningFuncT                ,
    FontGetGlyphKerningFuncT_WithClosures   ,
    drop_closures_FontGetGlyphKerningFuncT  ,
    dynamic_FontGetGlyphKerningFuncT        ,
    genClosure_FontGetGlyphKerningFuncT     ,
    mk_FontGetGlyphKerningFuncT             ,
    noFontGetGlyphKerningFuncT              ,
    noFontGetGlyphKerningFuncT_WithClosures ,
    wrap_FontGetGlyphKerningFuncT           ,


-- ** FontGetGlyphNameFuncT #signal:FontGetGlyphNameFuncT#

    C_FontGetGlyphNameFuncT                 ,
    FontGetGlyphNameFuncT                   ,
    FontGetGlyphNameFuncT_WithClosures      ,
    drop_closures_FontGetGlyphNameFuncT     ,
    dynamic_FontGetGlyphNameFuncT           ,
    genClosure_FontGetGlyphNameFuncT        ,
    mk_FontGetGlyphNameFuncT                ,
    noFontGetGlyphNameFuncT                 ,
    noFontGetGlyphNameFuncT_WithClosures    ,
    wrap_FontGetGlyphNameFuncT              ,


-- ** FontGetGlyphOriginFuncT #signal:FontGetGlyphOriginFuncT#

    C_FontGetGlyphOriginFuncT               ,
    FontGetGlyphOriginFuncT                 ,
    FontGetGlyphOriginFuncT_WithClosures    ,
    drop_closures_FontGetGlyphOriginFuncT   ,
    dynamic_FontGetGlyphOriginFuncT         ,
    genClosure_FontGetGlyphOriginFuncT      ,
    mk_FontGetGlyphOriginFuncT              ,
    noFontGetGlyphOriginFuncT               ,
    noFontGetGlyphOriginFuncT_WithClosures  ,
    wrap_FontGetGlyphOriginFuncT            ,


-- ** FontGetNominalGlyphFuncT #signal:FontGetNominalGlyphFuncT#

    C_FontGetNominalGlyphFuncT              ,
    FontGetNominalGlyphFuncT                ,
    FontGetNominalGlyphFuncT_WithClosures   ,
    drop_closures_FontGetNominalGlyphFuncT  ,
    dynamic_FontGetNominalGlyphFuncT        ,
    genClosure_FontGetNominalGlyphFuncT     ,
    mk_FontGetNominalGlyphFuncT             ,
    noFontGetNominalGlyphFuncT              ,
    noFontGetNominalGlyphFuncT_WithClosures ,
    wrap_FontGetNominalGlyphFuncT           ,


-- ** FontGetNominalGlyphsFuncT #signal:FontGetNominalGlyphsFuncT#

    C_FontGetNominalGlyphsFuncT             ,
    FontGetNominalGlyphsFuncT               ,
    FontGetNominalGlyphsFuncT_WithClosures  ,
    drop_closures_FontGetNominalGlyphsFuncT ,
    dynamic_FontGetNominalGlyphsFuncT       ,
    genClosure_FontGetNominalGlyphsFuncT    ,
    mk_FontGetNominalGlyphsFuncT            ,
    noFontGetNominalGlyphsFuncT             ,
    noFontGetNominalGlyphsFuncT_WithClosures,
    wrap_FontGetNominalGlyphsFuncT          ,


-- ** FontGetVariationGlyphFuncT #signal:FontGetVariationGlyphFuncT#

    C_FontGetVariationGlyphFuncT            ,
    FontGetVariationGlyphFuncT              ,
    FontGetVariationGlyphFuncT_WithClosures ,
    drop_closures_FontGetVariationGlyphFuncT,
    dynamic_FontGetVariationGlyphFuncT      ,
    genClosure_FontGetVariationGlyphFuncT   ,
    mk_FontGetVariationGlyphFuncT           ,
    noFontGetVariationGlyphFuncT            ,
    noFontGetVariationGlyphFuncT_WithClosures,
    wrap_FontGetVariationGlyphFuncT         ,


-- ** ReferenceTableFuncT #signal:ReferenceTableFuncT#

    C_ReferenceTableFuncT                   ,
    ReferenceTableFuncT                     ,
    ReferenceTableFuncT_WithClosures        ,
    drop_closures_ReferenceTableFuncT       ,
    dynamic_ReferenceTableFuncT             ,
    genClosure_ReferenceTableFuncT          ,
    mk_ReferenceTableFuncT                  ,
    noReferenceTableFuncT                   ,
    noReferenceTableFuncT_WithClosures      ,
    wrap_ReferenceTableFuncT                ,


-- ** UnicodeCombiningClassFuncT #signal:UnicodeCombiningClassFuncT#

    C_UnicodeCombiningClassFuncT            ,
    UnicodeCombiningClassFuncT              ,
    UnicodeCombiningClassFuncT_WithClosures ,
    drop_closures_UnicodeCombiningClassFuncT,
    dynamic_UnicodeCombiningClassFuncT      ,
    genClosure_UnicodeCombiningClassFuncT   ,
    mk_UnicodeCombiningClassFuncT           ,
    noUnicodeCombiningClassFuncT            ,
    noUnicodeCombiningClassFuncT_WithClosures,
    wrap_UnicodeCombiningClassFuncT         ,


-- ** UnicodeComposeFuncT #signal:UnicodeComposeFuncT#

    C_UnicodeComposeFuncT                   ,
    UnicodeComposeFuncT                     ,
    UnicodeComposeFuncT_WithClosures        ,
    drop_closures_UnicodeComposeFuncT       ,
    dynamic_UnicodeComposeFuncT             ,
    genClosure_UnicodeComposeFuncT          ,
    mk_UnicodeComposeFuncT                  ,
    noUnicodeComposeFuncT                   ,
    noUnicodeComposeFuncT_WithClosures      ,
    wrap_UnicodeComposeFuncT                ,


-- ** UnicodeDecomposeCompatibilityFuncT #signal:UnicodeDecomposeCompatibilityFuncT#

    C_UnicodeDecomposeCompatibilityFuncT    ,
    UnicodeDecomposeCompatibilityFuncT      ,
    UnicodeDecomposeCompatibilityFuncT_WithClosures,
    drop_closures_UnicodeDecomposeCompatibilityFuncT,
    dynamic_UnicodeDecomposeCompatibilityFuncT,
    genClosure_UnicodeDecomposeCompatibilityFuncT,
    mk_UnicodeDecomposeCompatibilityFuncT   ,
    noUnicodeDecomposeCompatibilityFuncT    ,
    noUnicodeDecomposeCompatibilityFuncT_WithClosures,
    wrap_UnicodeDecomposeCompatibilityFuncT ,


-- ** UnicodeDecomposeFuncT #signal:UnicodeDecomposeFuncT#

    C_UnicodeDecomposeFuncT                 ,
    UnicodeDecomposeFuncT                   ,
    UnicodeDecomposeFuncT_WithClosures      ,
    drop_closures_UnicodeDecomposeFuncT     ,
    dynamic_UnicodeDecomposeFuncT           ,
    genClosure_UnicodeDecomposeFuncT        ,
    mk_UnicodeDecomposeFuncT                ,
    noUnicodeDecomposeFuncT                 ,
    noUnicodeDecomposeFuncT_WithClosures    ,
    wrap_UnicodeDecomposeFuncT              ,


-- ** UnicodeEastasianWidthFuncT #signal:UnicodeEastasianWidthFuncT#

    C_UnicodeEastasianWidthFuncT            ,
    UnicodeEastasianWidthFuncT              ,
    UnicodeEastasianWidthFuncT_WithClosures ,
    drop_closures_UnicodeEastasianWidthFuncT,
    dynamic_UnicodeEastasianWidthFuncT      ,
    genClosure_UnicodeEastasianWidthFuncT   ,
    mk_UnicodeEastasianWidthFuncT           ,
    noUnicodeEastasianWidthFuncT            ,
    noUnicodeEastasianWidthFuncT_WithClosures,
    wrap_UnicodeEastasianWidthFuncT         ,


-- ** UnicodeGeneralCategoryFuncT #signal:UnicodeGeneralCategoryFuncT#

    C_UnicodeGeneralCategoryFuncT           ,
    UnicodeGeneralCategoryFuncT             ,
    UnicodeGeneralCategoryFuncT_WithClosures,
    drop_closures_UnicodeGeneralCategoryFuncT,
    dynamic_UnicodeGeneralCategoryFuncT     ,
    genClosure_UnicodeGeneralCategoryFuncT  ,
    mk_UnicodeGeneralCategoryFuncT          ,
    noUnicodeGeneralCategoryFuncT           ,
    noUnicodeGeneralCategoryFuncT_WithClosures,
    wrap_UnicodeGeneralCategoryFuncT        ,


-- ** UnicodeMirroringFuncT #signal:UnicodeMirroringFuncT#

    C_UnicodeMirroringFuncT                 ,
    UnicodeMirroringFuncT                   ,
    UnicodeMirroringFuncT_WithClosures      ,
    drop_closures_UnicodeMirroringFuncT     ,
    dynamic_UnicodeMirroringFuncT           ,
    genClosure_UnicodeMirroringFuncT        ,
    mk_UnicodeMirroringFuncT                ,
    noUnicodeMirroringFuncT                 ,
    noUnicodeMirroringFuncT_WithClosures    ,
    wrap_UnicodeMirroringFuncT              ,


-- ** UnicodeScriptFuncT #signal:UnicodeScriptFuncT#

    C_UnicodeScriptFuncT                    ,
    UnicodeScriptFuncT                      ,
    UnicodeScriptFuncT_WithClosures         ,
    drop_closures_UnicodeScriptFuncT        ,
    dynamic_UnicodeScriptFuncT              ,
    genClosure_UnicodeScriptFuncT           ,
    mk_UnicodeScriptFuncT                   ,
    noUnicodeScriptFuncT                    ,
    noUnicodeScriptFuncT_WithClosures       ,
    wrap_UnicodeScriptFuncT                 ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.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 {-# SOURCE #-} qualified GI.HarfBuzz.Enums as HarfBuzz.Enums
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.BlobT as HarfBuzz.BlobT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.BufferT as HarfBuzz.BufferT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FaceT as HarfBuzz.FaceT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontExtentsT as HarfBuzz.FontExtentsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontT as HarfBuzz.FontT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphExtentsT as HarfBuzz.GlyphExtentsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.UnicodeFuncsT as HarfBuzz.UnicodeFuncsT

-- callback UnicodeScriptFuncT
{- Callable
  { returnType =
      Just
        (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , 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_UnicodeScriptFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Ptr () ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeScriptFuncT :: FunPtr C_UnicodeScriptFuncT -> C_UnicodeScriptFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeScriptFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeScriptFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> m HarfBuzz.Enums.ScriptT
dynamic_UnicodeScriptFuncT :: FunPtr C_UnicodeScriptFuncT
-> UnicodeFuncsT -> Word32 -> Ptr () -> m ScriptT
dynamic_UnicodeScriptFuncT FunPtr C_UnicodeScriptFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = IO ScriptT -> m ScriptT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ScriptT -> m ScriptT) -> IO ScriptT -> m ScriptT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    CUInt
result <- (FunPtr C_UnicodeScriptFuncT -> C_UnicodeScriptFuncT
__dynamic_C_UnicodeScriptFuncT FunPtr C_UnicodeScriptFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
    let result' :: ScriptT
result' = (Int -> ScriptT
forall a. Enum a => Int -> a
toEnum (Int -> ScriptT) -> (CUInt -> Int) -> CUInt -> ScriptT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    ScriptT -> IO ScriptT
forall (m :: * -> *) a. Monad m => a -> m a
return ScriptT
result'

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

-- | /No description available in the introspection data./
type UnicodeScriptFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> IO HarfBuzz.Enums.ScriptT

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeScriptFuncT`@.
noUnicodeScriptFuncT :: Maybe UnicodeScriptFuncT
noUnicodeScriptFuncT :: Maybe UnicodeScriptFuncT
noUnicodeScriptFuncT = Maybe UnicodeScriptFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeScriptFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> IO HarfBuzz.Enums.ScriptT

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeScriptFuncT_WithClosures`@.
noUnicodeScriptFuncT_WithClosures :: Maybe UnicodeScriptFuncT_WithClosures
noUnicodeScriptFuncT_WithClosures :: Maybe UnicodeScriptFuncT_WithClosures
noUnicodeScriptFuncT_WithClosures = Maybe UnicodeScriptFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeScriptFuncT :: UnicodeScriptFuncT -> UnicodeScriptFuncT_WithClosures
drop_closures_UnicodeScriptFuncT :: UnicodeScriptFuncT -> UnicodeScriptFuncT_WithClosures
drop_closures_UnicodeScriptFuncT UnicodeScriptFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
_ = UnicodeScriptFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeScriptFuncT :: MonadIO m => UnicodeScriptFuncT -> m (GClosure C_UnicodeScriptFuncT)
genClosure_UnicodeScriptFuncT :: UnicodeScriptFuncT -> m (GClosure C_UnicodeScriptFuncT)
genClosure_UnicodeScriptFuncT UnicodeScriptFuncT
cb = IO (GClosure C_UnicodeScriptFuncT)
-> m (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeScriptFuncT)
 -> m (GClosure C_UnicodeScriptFuncT))
-> IO (GClosure C_UnicodeScriptFuncT)
-> m (GClosure C_UnicodeScriptFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeScriptFuncT_WithClosures
cb' = UnicodeScriptFuncT -> UnicodeScriptFuncT_WithClosures
drop_closures_UnicodeScriptFuncT UnicodeScriptFuncT
cb
    let cb'' :: C_UnicodeScriptFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
-> UnicodeScriptFuncT_WithClosures -> C_UnicodeScriptFuncT
wrap_UnicodeScriptFuncT Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
forall a. Maybe a
Nothing UnicodeScriptFuncT_WithClosures
cb'
    C_UnicodeScriptFuncT -> IO (FunPtr C_UnicodeScriptFuncT)
mk_UnicodeScriptFuncT C_UnicodeScriptFuncT
cb'' IO (FunPtr C_UnicodeScriptFuncT)
-> (FunPtr C_UnicodeScriptFuncT
    -> IO (GClosure C_UnicodeScriptFuncT))
-> IO (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeScriptFuncT -> IO (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeScriptFuncT` into a `C_UnicodeScriptFuncT`.
wrap_UnicodeScriptFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeScriptFuncT)) ->
    UnicodeScriptFuncT_WithClosures ->
    C_UnicodeScriptFuncT
wrap_UnicodeScriptFuncT :: Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
-> UnicodeScriptFuncT_WithClosures -> C_UnicodeScriptFuncT
wrap_UnicodeScriptFuncT Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
funptrptr UnicodeScriptFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO CUInt) -> IO CUInt)
-> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        ScriptT
result <- UnicodeScriptFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeScriptFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
funptrptr
        let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (ScriptT -> Int) -> ScriptT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ScriptT -> Int
forall a. Enum a => a -> Int
fromEnum) ScriptT
result
        CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback UnicodeMirroringFuncT
{- Callable
  { returnType = Just (TBasicType TUInt32)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , 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_UnicodeMirroringFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Ptr () ->
    IO Word32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeMirroringFuncT :: FunPtr C_UnicodeMirroringFuncT -> C_UnicodeMirroringFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeMirroringFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeMirroringFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> m Word32
dynamic_UnicodeMirroringFuncT :: FunPtr C_UnicodeMirroringFuncT
-> UnicodeFuncsT -> Word32 -> Ptr () -> m Word32
dynamic_UnicodeMirroringFuncT FunPtr C_UnicodeMirroringFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Word32
result <- (FunPtr C_UnicodeMirroringFuncT -> C_UnicodeMirroringFuncT
__dynamic_C_UnicodeMirroringFuncT FunPtr C_UnicodeMirroringFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

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

-- | /No description available in the introspection data./
type UnicodeMirroringFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> IO Word32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeMirroringFuncT`@.
noUnicodeMirroringFuncT :: Maybe UnicodeMirroringFuncT
noUnicodeMirroringFuncT :: Maybe UnicodeMirroringFuncT
noUnicodeMirroringFuncT = Maybe UnicodeMirroringFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeMirroringFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> IO Word32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeMirroringFuncT_WithClosures`@.
noUnicodeMirroringFuncT_WithClosures :: Maybe UnicodeMirroringFuncT_WithClosures
noUnicodeMirroringFuncT_WithClosures :: Maybe UnicodeMirroringFuncT_WithClosures
noUnicodeMirroringFuncT_WithClosures = Maybe UnicodeMirroringFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeMirroringFuncT :: UnicodeMirroringFuncT -> UnicodeMirroringFuncT_WithClosures
drop_closures_UnicodeMirroringFuncT :: UnicodeMirroringFuncT -> UnicodeMirroringFuncT_WithClosures
drop_closures_UnicodeMirroringFuncT UnicodeMirroringFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
_ = UnicodeMirroringFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeMirroringFuncT :: MonadIO m => UnicodeMirroringFuncT -> m (GClosure C_UnicodeMirroringFuncT)
genClosure_UnicodeMirroringFuncT :: UnicodeMirroringFuncT -> m (GClosure C_UnicodeMirroringFuncT)
genClosure_UnicodeMirroringFuncT UnicodeMirroringFuncT
cb = IO (GClosure C_UnicodeMirroringFuncT)
-> m (GClosure C_UnicodeMirroringFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeMirroringFuncT)
 -> m (GClosure C_UnicodeMirroringFuncT))
-> IO (GClosure C_UnicodeMirroringFuncT)
-> m (GClosure C_UnicodeMirroringFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeMirroringFuncT_WithClosures
cb' = UnicodeMirroringFuncT -> UnicodeMirroringFuncT_WithClosures
drop_closures_UnicodeMirroringFuncT UnicodeMirroringFuncT
cb
    let cb'' :: C_UnicodeMirroringFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
-> UnicodeMirroringFuncT_WithClosures -> C_UnicodeMirroringFuncT
wrap_UnicodeMirroringFuncT Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
forall a. Maybe a
Nothing UnicodeMirroringFuncT_WithClosures
cb'
    C_UnicodeMirroringFuncT -> IO (FunPtr C_UnicodeMirroringFuncT)
mk_UnicodeMirroringFuncT C_UnicodeMirroringFuncT
cb'' IO (FunPtr C_UnicodeMirroringFuncT)
-> (FunPtr C_UnicodeMirroringFuncT
    -> IO (GClosure C_UnicodeMirroringFuncT))
-> IO (GClosure C_UnicodeMirroringFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeMirroringFuncT
-> IO (GClosure C_UnicodeMirroringFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeMirroringFuncT` into a `C_UnicodeMirroringFuncT`.
wrap_UnicodeMirroringFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT)) ->
    UnicodeMirroringFuncT_WithClosures ->
    C_UnicodeMirroringFuncT
wrap_UnicodeMirroringFuncT :: Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
-> UnicodeMirroringFuncT_WithClosures -> C_UnicodeMirroringFuncT
wrap_UnicodeMirroringFuncT Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
funptrptr UnicodeMirroringFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO Word32) -> IO Word32)
-> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        Word32
result <- UnicodeMirroringFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
funptrptr
        Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- callback UnicodeGeneralCategoryFuncT
{- Callable
  { returnType =
      Just
        (TInterface
           Name
             { namespace = "HarfBuzz" , name = "unicode_general_category_t" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , 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_UnicodeGeneralCategoryFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Ptr () ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "unicode_general_category_t" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeGeneralCategoryFuncT :: FunPtr C_UnicodeGeneralCategoryFuncT -> C_UnicodeGeneralCategoryFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeGeneralCategoryFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeGeneralCategoryFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> m HarfBuzz.Enums.UnicodeGeneralCategoryT
dynamic_UnicodeGeneralCategoryFuncT :: FunPtr C_UnicodeScriptFuncT
-> UnicodeFuncsT -> Word32 -> Ptr () -> m UnicodeGeneralCategoryT
dynamic_UnicodeGeneralCategoryFuncT FunPtr C_UnicodeScriptFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = IO UnicodeGeneralCategoryT -> m UnicodeGeneralCategoryT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeGeneralCategoryT -> m UnicodeGeneralCategoryT)
-> IO UnicodeGeneralCategoryT -> m UnicodeGeneralCategoryT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    CUInt
result <- (FunPtr C_UnicodeScriptFuncT -> C_UnicodeScriptFuncT
__dynamic_C_UnicodeGeneralCategoryFuncT FunPtr C_UnicodeScriptFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
    let result' :: UnicodeGeneralCategoryT
result' = (Int -> UnicodeGeneralCategoryT
forall a. Enum a => Int -> a
toEnum (Int -> UnicodeGeneralCategoryT)
-> (CUInt -> Int) -> CUInt -> UnicodeGeneralCategoryT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    UnicodeGeneralCategoryT -> IO UnicodeGeneralCategoryT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeGeneralCategoryT
result'

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

-- | /No description available in the introspection data./
type UnicodeGeneralCategoryFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> IO HarfBuzz.Enums.UnicodeGeneralCategoryT

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeGeneralCategoryFuncT`@.
noUnicodeGeneralCategoryFuncT :: Maybe UnicodeGeneralCategoryFuncT
noUnicodeGeneralCategoryFuncT :: Maybe UnicodeGeneralCategoryFuncT
noUnicodeGeneralCategoryFuncT = Maybe UnicodeGeneralCategoryFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeGeneralCategoryFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> IO HarfBuzz.Enums.UnicodeGeneralCategoryT

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeGeneralCategoryFuncT_WithClosures`@.
noUnicodeGeneralCategoryFuncT_WithClosures :: Maybe UnicodeGeneralCategoryFuncT_WithClosures
noUnicodeGeneralCategoryFuncT_WithClosures :: Maybe UnicodeGeneralCategoryFuncT_WithClosures
noUnicodeGeneralCategoryFuncT_WithClosures = Maybe UnicodeGeneralCategoryFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeGeneralCategoryFuncT :: UnicodeGeneralCategoryFuncT -> UnicodeGeneralCategoryFuncT_WithClosures
drop_closures_UnicodeGeneralCategoryFuncT :: UnicodeGeneralCategoryFuncT
-> UnicodeGeneralCategoryFuncT_WithClosures
drop_closures_UnicodeGeneralCategoryFuncT UnicodeGeneralCategoryFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
_ = UnicodeGeneralCategoryFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeGeneralCategoryFuncT :: MonadIO m => UnicodeGeneralCategoryFuncT -> m (GClosure C_UnicodeGeneralCategoryFuncT)
genClosure_UnicodeGeneralCategoryFuncT :: UnicodeGeneralCategoryFuncT -> m (GClosure C_UnicodeScriptFuncT)
genClosure_UnicodeGeneralCategoryFuncT UnicodeGeneralCategoryFuncT
cb = IO (GClosure C_UnicodeScriptFuncT)
-> m (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeScriptFuncT)
 -> m (GClosure C_UnicodeScriptFuncT))
-> IO (GClosure C_UnicodeScriptFuncT)
-> m (GClosure C_UnicodeScriptFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeGeneralCategoryFuncT_WithClosures
cb' = UnicodeGeneralCategoryFuncT
-> UnicodeGeneralCategoryFuncT_WithClosures
drop_closures_UnicodeGeneralCategoryFuncT UnicodeGeneralCategoryFuncT
cb
    let cb'' :: C_UnicodeScriptFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
-> UnicodeGeneralCategoryFuncT_WithClosures -> C_UnicodeScriptFuncT
wrap_UnicodeGeneralCategoryFuncT Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
forall a. Maybe a
Nothing UnicodeGeneralCategoryFuncT_WithClosures
cb'
    C_UnicodeScriptFuncT -> IO (FunPtr C_UnicodeScriptFuncT)
mk_UnicodeGeneralCategoryFuncT C_UnicodeScriptFuncT
cb'' IO (FunPtr C_UnicodeScriptFuncT)
-> (FunPtr C_UnicodeScriptFuncT
    -> IO (GClosure C_UnicodeScriptFuncT))
-> IO (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeScriptFuncT -> IO (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeGeneralCategoryFuncT` into a `C_UnicodeGeneralCategoryFuncT`.
wrap_UnicodeGeneralCategoryFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeGeneralCategoryFuncT)) ->
    UnicodeGeneralCategoryFuncT_WithClosures ->
    C_UnicodeGeneralCategoryFuncT
wrap_UnicodeGeneralCategoryFuncT :: Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
-> UnicodeGeneralCategoryFuncT_WithClosures -> C_UnicodeScriptFuncT
wrap_UnicodeGeneralCategoryFuncT Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
funptrptr UnicodeGeneralCategoryFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO CUInt) -> IO CUInt)
-> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        UnicodeGeneralCategoryT
result <- UnicodeGeneralCategoryFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeScriptFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
funptrptr
        let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (UnicodeGeneralCategoryT -> Int)
-> UnicodeGeneralCategoryT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnicodeGeneralCategoryT -> Int
forall a. Enum a => a -> Int
fromEnum) UnicodeGeneralCategoryT
result
        CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback UnicodeEastasianWidthFuncT
{- Callable
  { returnType = Just (TBasicType TUInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated =
      Just
        DeprecationInfo
          { deprecatedSinceVersion = Just "2.0.0"
          , deprecationMessage = Nothing
          }
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_UnicodeEastasianWidthFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Ptr () ->
    IO Word32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeEastasianWidthFuncT :: FunPtr C_UnicodeEastasianWidthFuncT -> C_UnicodeEastasianWidthFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeEastasianWidthFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeEastasianWidthFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> m Word32
dynamic_UnicodeEastasianWidthFuncT :: FunPtr C_UnicodeMirroringFuncT
-> UnicodeFuncsT -> Word32 -> Ptr () -> m Word32
dynamic_UnicodeEastasianWidthFuncT FunPtr C_UnicodeMirroringFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Word32
result <- (FunPtr C_UnicodeMirroringFuncT -> C_UnicodeMirroringFuncT
__dynamic_C_UnicodeEastasianWidthFuncT FunPtr C_UnicodeMirroringFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

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

{-# DEPRECATED UnicodeEastasianWidthFuncT ["(Since version 2.0.0)"] #-}
-- | /No description available in the introspection data./
type UnicodeEastasianWidthFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> IO Word32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeEastasianWidthFuncT`@.
noUnicodeEastasianWidthFuncT :: Maybe UnicodeEastasianWidthFuncT
noUnicodeEastasianWidthFuncT :: Maybe UnicodeMirroringFuncT
noUnicodeEastasianWidthFuncT = Maybe UnicodeMirroringFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeEastasianWidthFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> IO Word32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeEastasianWidthFuncT_WithClosures`@.
noUnicodeEastasianWidthFuncT_WithClosures :: Maybe UnicodeEastasianWidthFuncT_WithClosures
noUnicodeEastasianWidthFuncT_WithClosures :: Maybe UnicodeMirroringFuncT_WithClosures
noUnicodeEastasianWidthFuncT_WithClosures = Maybe UnicodeMirroringFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeEastasianWidthFuncT :: UnicodeEastasianWidthFuncT -> UnicodeEastasianWidthFuncT_WithClosures
drop_closures_UnicodeEastasianWidthFuncT :: UnicodeMirroringFuncT -> UnicodeMirroringFuncT_WithClosures
drop_closures_UnicodeEastasianWidthFuncT UnicodeMirroringFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
_ = UnicodeMirroringFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeEastasianWidthFuncT :: MonadIO m => UnicodeEastasianWidthFuncT -> m (GClosure C_UnicodeEastasianWidthFuncT)
genClosure_UnicodeEastasianWidthFuncT :: UnicodeMirroringFuncT -> m (GClosure C_UnicodeMirroringFuncT)
genClosure_UnicodeEastasianWidthFuncT UnicodeMirroringFuncT
cb = IO (GClosure C_UnicodeMirroringFuncT)
-> m (GClosure C_UnicodeMirroringFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeMirroringFuncT)
 -> m (GClosure C_UnicodeMirroringFuncT))
-> IO (GClosure C_UnicodeMirroringFuncT)
-> m (GClosure C_UnicodeMirroringFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeMirroringFuncT_WithClosures
cb' = UnicodeMirroringFuncT -> UnicodeMirroringFuncT_WithClosures
drop_closures_UnicodeEastasianWidthFuncT UnicodeMirroringFuncT
cb
    let cb'' :: C_UnicodeMirroringFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
-> UnicodeMirroringFuncT_WithClosures -> C_UnicodeMirroringFuncT
wrap_UnicodeEastasianWidthFuncT Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
forall a. Maybe a
Nothing UnicodeMirroringFuncT_WithClosures
cb'
    C_UnicodeMirroringFuncT -> IO (FunPtr C_UnicodeMirroringFuncT)
mk_UnicodeEastasianWidthFuncT C_UnicodeMirroringFuncT
cb'' IO (FunPtr C_UnicodeMirroringFuncT)
-> (FunPtr C_UnicodeMirroringFuncT
    -> IO (GClosure C_UnicodeMirroringFuncT))
-> IO (GClosure C_UnicodeMirroringFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeMirroringFuncT
-> IO (GClosure C_UnicodeMirroringFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeEastasianWidthFuncT` into a `C_UnicodeEastasianWidthFuncT`.
wrap_UnicodeEastasianWidthFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeEastasianWidthFuncT)) ->
    UnicodeEastasianWidthFuncT_WithClosures ->
    C_UnicodeEastasianWidthFuncT
wrap_UnicodeEastasianWidthFuncT :: Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
-> UnicodeMirroringFuncT_WithClosures -> C_UnicodeMirroringFuncT
wrap_UnicodeEastasianWidthFuncT Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
funptrptr UnicodeMirroringFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO Word32) -> IO Word32)
-> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        Word32
result <- UnicodeMirroringFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeMirroringFuncT))
funptrptr
        Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- callback UnicodeDecomposeFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "ab"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "a"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "b"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , 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_UnicodeDecomposeFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ab"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "a"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeDecomposeFuncT :: FunPtr C_UnicodeDecomposeFuncT -> C_UnicodeDecomposeFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeDecomposeFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeDecomposeFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_UnicodeDecomposeFuncT :: FunPtr C_UnicodeDecomposeFuncT
-> UnicodeFuncsT -> Word32 -> Word32 -> Word32 -> Ptr () -> m Int32
dynamic_UnicodeDecomposeFuncT FunPtr C_UnicodeDecomposeFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
ab Word32
a Word32
b Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Int32
result <- (FunPtr C_UnicodeDecomposeFuncT -> C_UnicodeDecomposeFuncT
__dynamic_C_UnicodeDecomposeFuncT FunPtr C_UnicodeDecomposeFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
ab Word32
a Word32
b Ptr ()
userData
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type UnicodeDecomposeFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Word32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeDecomposeFuncT`@.
noUnicodeDecomposeFuncT :: Maybe UnicodeDecomposeFuncT
noUnicodeDecomposeFuncT :: Maybe UnicodeDecomposeFuncT
noUnicodeDecomposeFuncT = Maybe UnicodeDecomposeFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeDecomposeFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeDecomposeFuncT_WithClosures`@.
noUnicodeDecomposeFuncT_WithClosures :: Maybe UnicodeDecomposeFuncT_WithClosures
noUnicodeDecomposeFuncT_WithClosures :: Maybe UnicodeDecomposeFuncT_WithClosures
noUnicodeDecomposeFuncT_WithClosures = Maybe UnicodeDecomposeFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeDecomposeFuncT :: UnicodeDecomposeFuncT -> UnicodeDecomposeFuncT_WithClosures
drop_closures_UnicodeDecomposeFuncT :: UnicodeDecomposeFuncT -> UnicodeDecomposeFuncT_WithClosures
drop_closures_UnicodeDecomposeFuncT UnicodeDecomposeFuncT
_f UnicodeFuncsT
ufuncs Word32
ab Word32
a Word32
b Ptr ()
_ = UnicodeDecomposeFuncT
_f UnicodeFuncsT
ufuncs Word32
ab Word32
a Word32
b

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeDecomposeFuncT :: MonadIO m => UnicodeDecomposeFuncT -> m (GClosure C_UnicodeDecomposeFuncT)
genClosure_UnicodeDecomposeFuncT :: UnicodeDecomposeFuncT -> m (GClosure C_UnicodeDecomposeFuncT)
genClosure_UnicodeDecomposeFuncT UnicodeDecomposeFuncT
cb = IO (GClosure C_UnicodeDecomposeFuncT)
-> m (GClosure C_UnicodeDecomposeFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeDecomposeFuncT)
 -> m (GClosure C_UnicodeDecomposeFuncT))
-> IO (GClosure C_UnicodeDecomposeFuncT)
-> m (GClosure C_UnicodeDecomposeFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeDecomposeFuncT_WithClosures
cb' = UnicodeDecomposeFuncT -> UnicodeDecomposeFuncT_WithClosures
drop_closures_UnicodeDecomposeFuncT UnicodeDecomposeFuncT
cb
    let cb'' :: C_UnicodeDecomposeFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
-> UnicodeDecomposeFuncT_WithClosures -> C_UnicodeDecomposeFuncT
wrap_UnicodeDecomposeFuncT Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
forall a. Maybe a
Nothing UnicodeDecomposeFuncT_WithClosures
cb'
    C_UnicodeDecomposeFuncT -> IO (FunPtr C_UnicodeDecomposeFuncT)
mk_UnicodeDecomposeFuncT C_UnicodeDecomposeFuncT
cb'' IO (FunPtr C_UnicodeDecomposeFuncT)
-> (FunPtr C_UnicodeDecomposeFuncT
    -> IO (GClosure C_UnicodeDecomposeFuncT))
-> IO (GClosure C_UnicodeDecomposeFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeDecomposeFuncT
-> IO (GClosure C_UnicodeDecomposeFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeDecomposeFuncT` into a `C_UnicodeDecomposeFuncT`.
wrap_UnicodeDecomposeFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT)) ->
    UnicodeDecomposeFuncT_WithClosures ->
    C_UnicodeDecomposeFuncT
wrap_UnicodeDecomposeFuncT :: Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
-> UnicodeDecomposeFuncT_WithClosures -> C_UnicodeDecomposeFuncT
wrap_UnicodeDecomposeFuncT Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
funptrptr UnicodeDecomposeFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
ab Word32
a Word32
b Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO Int32) -> IO Int32)
-> (UnicodeFuncsT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        Int32
result <- UnicodeDecomposeFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
ab Word32
a Word32
b Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback UnicodeDecomposeCompatibilityFuncT
{- Callable
  { returnType = Just (TBasicType TUInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a Unicode function structure"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "u"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "codepoint to decompose"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "decomposed"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just
                      "address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into"
                , 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 pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated =
      Just
        DeprecationInfo
          { deprecatedSinceVersion = Just "2.0.0"
          , deprecationMessage = Nothing
          }
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.\nThe complete length of the decomposition will be returned.\n\nIf @u has no compatibility decomposition, zero should be returned.\n\nThe Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any\ncompatibility decomposition plus an terminating value of 0.  Consequently, @decompose must be allocated by the caller to be at least this length.  Implementations\nof this function type must ensure that they do not write past the provided array."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_UnicodeDecomposeCompatibilityFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Word32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a Unicode function structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "u"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "codepoint to decompose"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "decomposed"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into"
--                 , 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 pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeDecomposeCompatibilityFuncT :: FunPtr C_UnicodeDecomposeCompatibilityFuncT -> C_UnicodeDecomposeCompatibilityFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeDecomposeCompatibilityFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeDecomposeCompatibilityFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: a Unicode function structure
    -> Word32
    -- ^ /@u@/: codepoint to decompose
    -> Word32
    -- ^ /@decomposed@/: address of codepoint array (of length 'GI.HarfBuzz.Constants.UNICODE_MAX_DECOMPOSITION_LEN') to write decomposition into
    -> Ptr ()
    -- ^ /@userData@/: user data pointer as passed to 'GI.HarfBuzz.Functions.unicodeFuncsSetDecomposeCompatibilityFunc'
    -> m Word32
    -- ^ __Returns:__ number of codepoints in the full compatibility decomposition of /@u@/, or 0 if no decomposition available.
dynamic_UnicodeDecomposeCompatibilityFuncT :: FunPtr C_UnicodeDecomposeCompatibilityFuncT
-> UnicodeFuncsT -> Word32 -> Word32 -> Ptr () -> m Word32
dynamic_UnicodeDecomposeCompatibilityFuncT FunPtr C_UnicodeDecomposeCompatibilityFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
u Word32
decomposed Ptr ()
userData = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Word32
result <- (FunPtr C_UnicodeDecomposeCompatibilityFuncT
-> C_UnicodeDecomposeCompatibilityFuncT
__dynamic_C_UnicodeDecomposeCompatibilityFuncT FunPtr C_UnicodeDecomposeCompatibilityFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
u Word32
decomposed Ptr ()
userData
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

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

{-# DEPRECATED UnicodeDecomposeCompatibilityFuncT ["(Since version 2.0.0)"] #-}
-- | Fully decompose /@u@/ to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to /@decomposed@/.
-- The complete length of the decomposition will be returned.
-- 
-- If /@u@/ has no compatibility decomposition, zero should be returned.
-- 
-- The Unicode standard guarantees that a buffer of length 'GI.HarfBuzz.Constants.UNICODE_MAX_DECOMPOSITION_LEN' codepoints will always be sufficient for any
-- compatibility decomposition plus an terminating value of 0.  Consequently, /@decompose@/ must be allocated by the caller to be at least this length.  Implementations
-- of this function type must ensure that they do not write past the provided array.
type UnicodeDecomposeCompatibilityFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: a Unicode function structure
    -> Word32
    -- ^ /@u@/: codepoint to decompose
    -> Word32
    -- ^ /@decomposed@/: address of codepoint array (of length 'GI.HarfBuzz.Constants.UNICODE_MAX_DECOMPOSITION_LEN') to write decomposition into
    -> IO Word32
    -- ^ __Returns:__ number of codepoints in the full compatibility decomposition of /@u@/, or 0 if no decomposition available.

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeDecomposeCompatibilityFuncT`@.
noUnicodeDecomposeCompatibilityFuncT :: Maybe UnicodeDecomposeCompatibilityFuncT
noUnicodeDecomposeCompatibilityFuncT :: Maybe UnicodeDecomposeCompatibilityFuncT
noUnicodeDecomposeCompatibilityFuncT = Maybe UnicodeDecomposeCompatibilityFuncT
forall a. Maybe a
Nothing

-- | Fully decompose /@u@/ to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to /@decomposed@/.
-- The complete length of the decomposition will be returned.
-- 
-- If /@u@/ has no compatibility decomposition, zero should be returned.
-- 
-- The Unicode standard guarantees that a buffer of length 'GI.HarfBuzz.Constants.UNICODE_MAX_DECOMPOSITION_LEN' codepoints will always be sufficient for any
-- compatibility decomposition plus an terminating value of 0.  Consequently, /@decompose@/ must be allocated by the caller to be at least this length.  Implementations
-- of this function type must ensure that they do not write past the provided array.
type UnicodeDecomposeCompatibilityFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: a Unicode function structure
    -> Word32
    -- ^ /@u@/: codepoint to decompose
    -> Word32
    -- ^ /@decomposed@/: address of codepoint array (of length 'GI.HarfBuzz.Constants.UNICODE_MAX_DECOMPOSITION_LEN') to write decomposition into
    -> Ptr ()
    -- ^ /@userData@/: user data pointer as passed to 'GI.HarfBuzz.Functions.unicodeFuncsSetDecomposeCompatibilityFunc'
    -> IO Word32
    -- ^ __Returns:__ number of codepoints in the full compatibility decomposition of /@u@/, or 0 if no decomposition available.

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeDecomposeCompatibilityFuncT_WithClosures`@.
noUnicodeDecomposeCompatibilityFuncT_WithClosures :: Maybe UnicodeDecomposeCompatibilityFuncT_WithClosures
noUnicodeDecomposeCompatibilityFuncT_WithClosures :: Maybe UnicodeDecomposeCompatibilityFuncT_WithClosures
noUnicodeDecomposeCompatibilityFuncT_WithClosures = Maybe UnicodeDecomposeCompatibilityFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeDecomposeCompatibilityFuncT :: UnicodeDecomposeCompatibilityFuncT -> UnicodeDecomposeCompatibilityFuncT_WithClosures
drop_closures_UnicodeDecomposeCompatibilityFuncT :: UnicodeDecomposeCompatibilityFuncT
-> UnicodeDecomposeCompatibilityFuncT_WithClosures
drop_closures_UnicodeDecomposeCompatibilityFuncT UnicodeDecomposeCompatibilityFuncT
_f UnicodeFuncsT
ufuncs Word32
u Word32
decomposed Ptr ()
_ = UnicodeDecomposeCompatibilityFuncT
_f UnicodeFuncsT
ufuncs Word32
u Word32
decomposed

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeDecomposeCompatibilityFuncT :: MonadIO m => UnicodeDecomposeCompatibilityFuncT -> m (GClosure C_UnicodeDecomposeCompatibilityFuncT)
genClosure_UnicodeDecomposeCompatibilityFuncT :: UnicodeDecomposeCompatibilityFuncT
-> m (GClosure C_UnicodeDecomposeCompatibilityFuncT)
genClosure_UnicodeDecomposeCompatibilityFuncT UnicodeDecomposeCompatibilityFuncT
cb = IO (GClosure C_UnicodeDecomposeCompatibilityFuncT)
-> m (GClosure C_UnicodeDecomposeCompatibilityFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeDecomposeCompatibilityFuncT)
 -> m (GClosure C_UnicodeDecomposeCompatibilityFuncT))
-> IO (GClosure C_UnicodeDecomposeCompatibilityFuncT)
-> m (GClosure C_UnicodeDecomposeCompatibilityFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeDecomposeCompatibilityFuncT_WithClosures
cb' = UnicodeDecomposeCompatibilityFuncT
-> UnicodeDecomposeCompatibilityFuncT_WithClosures
drop_closures_UnicodeDecomposeCompatibilityFuncT UnicodeDecomposeCompatibilityFuncT
cb
    let cb'' :: C_UnicodeDecomposeCompatibilityFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT))
-> UnicodeDecomposeCompatibilityFuncT_WithClosures
-> C_UnicodeDecomposeCompatibilityFuncT
wrap_UnicodeDecomposeCompatibilityFuncT Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT))
forall a. Maybe a
Nothing UnicodeDecomposeCompatibilityFuncT_WithClosures
cb'
    C_UnicodeDecomposeCompatibilityFuncT
-> IO (FunPtr C_UnicodeDecomposeCompatibilityFuncT)
mk_UnicodeDecomposeCompatibilityFuncT C_UnicodeDecomposeCompatibilityFuncT
cb'' IO (FunPtr C_UnicodeDecomposeCompatibilityFuncT)
-> (FunPtr C_UnicodeDecomposeCompatibilityFuncT
    -> IO (GClosure C_UnicodeDecomposeCompatibilityFuncT))
-> IO (GClosure C_UnicodeDecomposeCompatibilityFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeDecomposeCompatibilityFuncT
-> IO (GClosure C_UnicodeDecomposeCompatibilityFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeDecomposeCompatibilityFuncT` into a `C_UnicodeDecomposeCompatibilityFuncT`.
wrap_UnicodeDecomposeCompatibilityFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT)) ->
    UnicodeDecomposeCompatibilityFuncT_WithClosures ->
    C_UnicodeDecomposeCompatibilityFuncT
wrap_UnicodeDecomposeCompatibilityFuncT :: Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT))
-> UnicodeDecomposeCompatibilityFuncT_WithClosures
-> C_UnicodeDecomposeCompatibilityFuncT
wrap_UnicodeDecomposeCompatibilityFuncT Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT))
funptrptr UnicodeDecomposeCompatibilityFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
u Word32
decomposed Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO Word32) -> IO Word32)
-> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        Word32
result <- UnicodeDecomposeCompatibilityFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
u Word32
decomposed Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeDecomposeCompatibilityFuncT))
funptrptr
        Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- callback UnicodeComposeFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "a"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "b"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "ab"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , 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_UnicodeComposeFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "a"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ab"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeComposeFuncT :: FunPtr C_UnicodeComposeFuncT -> C_UnicodeComposeFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeComposeFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeComposeFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_UnicodeComposeFuncT :: FunPtr C_UnicodeDecomposeFuncT
-> UnicodeFuncsT -> Word32 -> Word32 -> Word32 -> Ptr () -> m Int32
dynamic_UnicodeComposeFuncT FunPtr C_UnicodeDecomposeFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
a Word32
b Word32
ab Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Int32
result <- (FunPtr C_UnicodeDecomposeFuncT -> C_UnicodeDecomposeFuncT
__dynamic_C_UnicodeComposeFuncT FunPtr C_UnicodeDecomposeFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
a Word32
b Word32
ab Ptr ()
userData
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type UnicodeComposeFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Word32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeComposeFuncT`@.
noUnicodeComposeFuncT :: Maybe UnicodeComposeFuncT
noUnicodeComposeFuncT :: Maybe UnicodeDecomposeFuncT
noUnicodeComposeFuncT = Maybe UnicodeDecomposeFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeComposeFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeComposeFuncT_WithClosures`@.
noUnicodeComposeFuncT_WithClosures :: Maybe UnicodeComposeFuncT_WithClosures
noUnicodeComposeFuncT_WithClosures :: Maybe UnicodeDecomposeFuncT_WithClosures
noUnicodeComposeFuncT_WithClosures = Maybe UnicodeDecomposeFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeComposeFuncT :: UnicodeComposeFuncT -> UnicodeComposeFuncT_WithClosures
drop_closures_UnicodeComposeFuncT :: UnicodeDecomposeFuncT -> UnicodeDecomposeFuncT_WithClosures
drop_closures_UnicodeComposeFuncT UnicodeDecomposeFuncT
_f UnicodeFuncsT
ufuncs Word32
a Word32
b Word32
ab Ptr ()
_ = UnicodeDecomposeFuncT
_f UnicodeFuncsT
ufuncs Word32
a Word32
b Word32
ab

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeComposeFuncT :: MonadIO m => UnicodeComposeFuncT -> m (GClosure C_UnicodeComposeFuncT)
genClosure_UnicodeComposeFuncT :: UnicodeDecomposeFuncT -> m (GClosure C_UnicodeDecomposeFuncT)
genClosure_UnicodeComposeFuncT UnicodeDecomposeFuncT
cb = IO (GClosure C_UnicodeDecomposeFuncT)
-> m (GClosure C_UnicodeDecomposeFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeDecomposeFuncT)
 -> m (GClosure C_UnicodeDecomposeFuncT))
-> IO (GClosure C_UnicodeDecomposeFuncT)
-> m (GClosure C_UnicodeDecomposeFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeDecomposeFuncT_WithClosures
cb' = UnicodeDecomposeFuncT -> UnicodeDecomposeFuncT_WithClosures
drop_closures_UnicodeComposeFuncT UnicodeDecomposeFuncT
cb
    let cb'' :: C_UnicodeDecomposeFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
-> UnicodeDecomposeFuncT_WithClosures -> C_UnicodeDecomposeFuncT
wrap_UnicodeComposeFuncT Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
forall a. Maybe a
Nothing UnicodeDecomposeFuncT_WithClosures
cb'
    C_UnicodeDecomposeFuncT -> IO (FunPtr C_UnicodeDecomposeFuncT)
mk_UnicodeComposeFuncT C_UnicodeDecomposeFuncT
cb'' IO (FunPtr C_UnicodeDecomposeFuncT)
-> (FunPtr C_UnicodeDecomposeFuncT
    -> IO (GClosure C_UnicodeDecomposeFuncT))
-> IO (GClosure C_UnicodeDecomposeFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeDecomposeFuncT
-> IO (GClosure C_UnicodeDecomposeFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeComposeFuncT` into a `C_UnicodeComposeFuncT`.
wrap_UnicodeComposeFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeComposeFuncT)) ->
    UnicodeComposeFuncT_WithClosures ->
    C_UnicodeComposeFuncT
wrap_UnicodeComposeFuncT :: Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
-> UnicodeDecomposeFuncT_WithClosures -> C_UnicodeDecomposeFuncT
wrap_UnicodeComposeFuncT Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
funptrptr UnicodeDecomposeFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
a Word32
b Word32
ab Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO Int32) -> IO Int32)
-> (UnicodeFuncsT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        Int32
result <- UnicodeDecomposeFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
a Word32
b Word32
ab Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback UnicodeCombiningClassFuncT
{- Callable
  { returnType =
      Just
        (TInterface
           Name
             { namespace = "HarfBuzz" , name = "unicode_combining_class_t" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "ufuncs"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , 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_UnicodeCombiningClassFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Ptr () ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "unicode_combining_class_t" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_UnicodeCombiningClassFuncT :: FunPtr C_UnicodeCombiningClassFuncT -> C_UnicodeCombiningClassFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_UnicodeCombiningClassFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_UnicodeCombiningClassFuncT
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> m HarfBuzz.Enums.UnicodeCombiningClassT
dynamic_UnicodeCombiningClassFuncT :: FunPtr C_UnicodeScriptFuncT
-> UnicodeFuncsT -> Word32 -> Ptr () -> m UnicodeCombiningClassT
dynamic_UnicodeCombiningClassFuncT FunPtr C_UnicodeScriptFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = IO UnicodeCombiningClassT -> m UnicodeCombiningClassT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeCombiningClassT -> m UnicodeCombiningClassT)
-> IO UnicodeCombiningClassT -> m UnicodeCombiningClassT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    CUInt
result <- (FunPtr C_UnicodeScriptFuncT -> C_UnicodeScriptFuncT
__dynamic_C_UnicodeCombiningClassFuncT FunPtr C_UnicodeScriptFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
    let result' :: UnicodeCombiningClassT
result' = (Int -> UnicodeCombiningClassT
forall a. Enum a => Int -> a
toEnum (Int -> UnicodeCombiningClassT)
-> (CUInt -> Int) -> CUInt -> UnicodeCombiningClassT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    UnicodeCombiningClassT -> IO UnicodeCombiningClassT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeCombiningClassT
result'

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

-- | /No description available in the introspection data./
type UnicodeCombiningClassFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> IO HarfBuzz.Enums.UnicodeCombiningClassT

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeCombiningClassFuncT`@.
noUnicodeCombiningClassFuncT :: Maybe UnicodeCombiningClassFuncT
noUnicodeCombiningClassFuncT :: Maybe UnicodeCombiningClassFuncT
noUnicodeCombiningClassFuncT = Maybe UnicodeCombiningClassFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type UnicodeCombiningClassFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -> Word32
    -> Ptr ()
    -> IO HarfBuzz.Enums.UnicodeCombiningClassT

-- | A convenience synonym for @`Nothing` :: `Maybe` `UnicodeCombiningClassFuncT_WithClosures`@.
noUnicodeCombiningClassFuncT_WithClosures :: Maybe UnicodeCombiningClassFuncT_WithClosures
noUnicodeCombiningClassFuncT_WithClosures :: Maybe UnicodeCombiningClassFuncT_WithClosures
noUnicodeCombiningClassFuncT_WithClosures = Maybe UnicodeCombiningClassFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_UnicodeCombiningClassFuncT :: UnicodeCombiningClassFuncT -> UnicodeCombiningClassFuncT_WithClosures
drop_closures_UnicodeCombiningClassFuncT :: UnicodeCombiningClassFuncT
-> UnicodeCombiningClassFuncT_WithClosures
drop_closures_UnicodeCombiningClassFuncT UnicodeCombiningClassFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
_ = UnicodeCombiningClassFuncT
_f UnicodeFuncsT
ufuncs Word32
unicode

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeCombiningClassFuncT :: MonadIO m => UnicodeCombiningClassFuncT -> m (GClosure C_UnicodeCombiningClassFuncT)
genClosure_UnicodeCombiningClassFuncT :: UnicodeCombiningClassFuncT -> m (GClosure C_UnicodeScriptFuncT)
genClosure_UnicodeCombiningClassFuncT UnicodeCombiningClassFuncT
cb = IO (GClosure C_UnicodeScriptFuncT)
-> m (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeScriptFuncT)
 -> m (GClosure C_UnicodeScriptFuncT))
-> IO (GClosure C_UnicodeScriptFuncT)
-> m (GClosure C_UnicodeScriptFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeCombiningClassFuncT_WithClosures
cb' = UnicodeCombiningClassFuncT
-> UnicodeCombiningClassFuncT_WithClosures
drop_closures_UnicodeCombiningClassFuncT UnicodeCombiningClassFuncT
cb
    let cb'' :: C_UnicodeScriptFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
-> UnicodeCombiningClassFuncT_WithClosures -> C_UnicodeScriptFuncT
wrap_UnicodeCombiningClassFuncT Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
forall a. Maybe a
Nothing UnicodeCombiningClassFuncT_WithClosures
cb'
    C_UnicodeScriptFuncT -> IO (FunPtr C_UnicodeScriptFuncT)
mk_UnicodeCombiningClassFuncT C_UnicodeScriptFuncT
cb'' IO (FunPtr C_UnicodeScriptFuncT)
-> (FunPtr C_UnicodeScriptFuncT
    -> IO (GClosure C_UnicodeScriptFuncT))
-> IO (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeScriptFuncT -> IO (GClosure C_UnicodeScriptFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `UnicodeCombiningClassFuncT` into a `C_UnicodeCombiningClassFuncT`.
wrap_UnicodeCombiningClassFuncT ::
    Maybe (Ptr (FunPtr C_UnicodeCombiningClassFuncT)) ->
    UnicodeCombiningClassFuncT_WithClosures ->
    C_UnicodeCombiningClassFuncT
wrap_UnicodeCombiningClassFuncT :: Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
-> UnicodeCombiningClassFuncT_WithClosures -> C_UnicodeScriptFuncT
wrap_UnicodeCombiningClassFuncT Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
funptrptr UnicodeCombiningClassFuncT_WithClosures
_cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    (ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT Ptr UnicodeFuncsT
ufuncs ((UnicodeFuncsT -> IO CUInt) -> IO CUInt)
-> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \UnicodeFuncsT
ufuncs' -> do
        UnicodeCombiningClassT
result <- UnicodeCombiningClassFuncT_WithClosures
_cb  UnicodeFuncsT
ufuncs' Word32
unicode Ptr ()
userData
        Maybe (Ptr (FunPtr C_UnicodeScriptFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeScriptFuncT))
funptrptr
        let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (UnicodeCombiningClassT -> Int)
-> UnicodeCombiningClassT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnicodeCombiningClassT -> Int
forall a. Enum a => a -> Int
fromEnum) UnicodeCombiningClassT
result
        CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback ReferenceTableFuncT
{- Callable
  { returnType =
      Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "face"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "tag"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , 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_ReferenceTableFuncT =
    Ptr HarfBuzz.FaceT.FaceT ->
    Word32 ->
    Ptr () ->
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ReferenceTableFuncT :: FunPtr C_ReferenceTableFuncT -> C_ReferenceTableFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ReferenceTableFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ReferenceTableFuncT
    -> HarfBuzz.FaceT.FaceT
    -> Word32
    -> Ptr ()
    -> m HarfBuzz.BlobT.BlobT
dynamic_ReferenceTableFuncT :: FunPtr C_ReferenceTableFuncT
-> FaceT -> Word32 -> Ptr () -> m BlobT
dynamic_ReferenceTableFuncT FunPtr C_ReferenceTableFuncT
__funPtr FaceT
face Word32
tag Ptr ()
userData = IO BlobT -> m BlobT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BlobT -> m BlobT) -> IO BlobT -> m BlobT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr BlobT
result <- (FunPtr C_ReferenceTableFuncT -> C_ReferenceTableFuncT
__dynamic_C_ReferenceTableFuncT FunPtr C_ReferenceTableFuncT
__funPtr) Ptr FaceT
face' Word32
tag Ptr ()
userData
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"referenceTableFuncT" Ptr BlobT
result
    BlobT
result' <- ((ManagedPtr BlobT -> BlobT) -> Ptr BlobT -> IO BlobT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BlobT -> BlobT
HarfBuzz.BlobT.BlobT) Ptr BlobT
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'

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

-- | /No description available in the introspection data./
type ReferenceTableFuncT =
    HarfBuzz.FaceT.FaceT
    -> Word32
    -> IO HarfBuzz.BlobT.BlobT

-- | A convenience synonym for @`Nothing` :: `Maybe` `ReferenceTableFuncT`@.
noReferenceTableFuncT :: Maybe ReferenceTableFuncT
noReferenceTableFuncT :: Maybe ReferenceTableFuncT
noReferenceTableFuncT = Maybe ReferenceTableFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type ReferenceTableFuncT_WithClosures =
    HarfBuzz.FaceT.FaceT
    -> Word32
    -> Ptr ()
    -> IO HarfBuzz.BlobT.BlobT

-- | A convenience synonym for @`Nothing` :: `Maybe` `ReferenceTableFuncT_WithClosures`@.
noReferenceTableFuncT_WithClosures :: Maybe ReferenceTableFuncT_WithClosures
noReferenceTableFuncT_WithClosures :: Maybe ReferenceTableFuncT_WithClosures
noReferenceTableFuncT_WithClosures = Maybe ReferenceTableFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_ReferenceTableFuncT :: ReferenceTableFuncT -> ReferenceTableFuncT_WithClosures
drop_closures_ReferenceTableFuncT :: ReferenceTableFuncT -> ReferenceTableFuncT_WithClosures
drop_closures_ReferenceTableFuncT ReferenceTableFuncT
_f FaceT
face Word32
tag Ptr ()
_ = ReferenceTableFuncT
_f FaceT
face Word32
tag

-- | Wrap the callback into a `GClosure`.
genClosure_ReferenceTableFuncT :: MonadIO m => ReferenceTableFuncT -> m (GClosure C_ReferenceTableFuncT)
genClosure_ReferenceTableFuncT :: ReferenceTableFuncT -> m (GClosure C_ReferenceTableFuncT)
genClosure_ReferenceTableFuncT ReferenceTableFuncT
cb = IO (GClosure C_ReferenceTableFuncT)
-> m (GClosure C_ReferenceTableFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ReferenceTableFuncT)
 -> m (GClosure C_ReferenceTableFuncT))
-> IO (GClosure C_ReferenceTableFuncT)
-> m (GClosure C_ReferenceTableFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: ReferenceTableFuncT_WithClosures
cb' = ReferenceTableFuncT -> ReferenceTableFuncT_WithClosures
drop_closures_ReferenceTableFuncT ReferenceTableFuncT
cb
    let cb'' :: C_ReferenceTableFuncT
cb'' = Maybe (Ptr (FunPtr C_ReferenceTableFuncT))
-> ReferenceTableFuncT_WithClosures -> C_ReferenceTableFuncT
wrap_ReferenceTableFuncT Maybe (Ptr (FunPtr C_ReferenceTableFuncT))
forall a. Maybe a
Nothing ReferenceTableFuncT_WithClosures
cb'
    C_ReferenceTableFuncT -> IO (FunPtr C_ReferenceTableFuncT)
mk_ReferenceTableFuncT C_ReferenceTableFuncT
cb'' IO (FunPtr C_ReferenceTableFuncT)
-> (FunPtr C_ReferenceTableFuncT
    -> IO (GClosure C_ReferenceTableFuncT))
-> IO (GClosure C_ReferenceTableFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ReferenceTableFuncT -> IO (GClosure C_ReferenceTableFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ReferenceTableFuncT` into a `C_ReferenceTableFuncT`.
wrap_ReferenceTableFuncT ::
    Maybe (Ptr (FunPtr C_ReferenceTableFuncT)) ->
    ReferenceTableFuncT_WithClosures ->
    C_ReferenceTableFuncT
wrap_ReferenceTableFuncT :: Maybe (Ptr (FunPtr C_ReferenceTableFuncT))
-> ReferenceTableFuncT_WithClosures -> C_ReferenceTableFuncT
wrap_ReferenceTableFuncT Maybe (Ptr (FunPtr C_ReferenceTableFuncT))
funptrptr ReferenceTableFuncT_WithClosures
_cb Ptr FaceT
face Word32
tag Ptr ()
userData = do
    (ManagedPtr FaceT -> FaceT)
-> Ptr FaceT -> (FaceT -> IO (Ptr BlobT)) -> IO (Ptr BlobT)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FaceT -> FaceT
HarfBuzz.FaceT.FaceT Ptr FaceT
face ((FaceT -> IO (Ptr BlobT)) -> IO (Ptr BlobT))
-> (FaceT -> IO (Ptr BlobT)) -> IO (Ptr BlobT)
forall a b. (a -> b) -> a -> b
$ \FaceT
face' -> do
        BlobT
result <- ReferenceTableFuncT_WithClosures
_cb  FaceT
face' Word32
tag Ptr ()
userData
        Maybe (Ptr (FunPtr C_ReferenceTableFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ReferenceTableFuncT))
funptrptr
        Ptr BlobT
result' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed BlobT
result
        Ptr BlobT -> IO (Ptr BlobT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr BlobT
result'


-- callback FontGetVariationGlyphFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "variation_selector"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , 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_FontGetVariationGlyphFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variation_selector"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetVariationGlyphFuncT :: FunPtr C_FontGetVariationGlyphFuncT -> C_FontGetVariationGlyphFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetVariationGlyphFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetVariationGlyphFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetVariationGlyphFuncT :: FunPtr C_FontGetVariationGlyphFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Word32
-> Ptr ()
-> m Int32
dynamic_FontGetVariationGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetVariationGlyphFuncT -> C_FontGetVariationGlyphFuncT
__dynamic_C_FontGetVariationGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetVariationGlyphFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetVariationGlyphFuncT`@.
noFontGetVariationGlyphFuncT :: Maybe FontGetVariationGlyphFuncT
noFontGetVariationGlyphFuncT :: Maybe FontGetVariationGlyphFuncT
noFontGetVariationGlyphFuncT = Maybe FontGetVariationGlyphFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetVariationGlyphFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetVariationGlyphFuncT_WithClosures`@.
noFontGetVariationGlyphFuncT_WithClosures :: Maybe FontGetVariationGlyphFuncT_WithClosures
noFontGetVariationGlyphFuncT_WithClosures :: Maybe FontGetVariationGlyphFuncT_WithClosures
noFontGetVariationGlyphFuncT_WithClosures = Maybe FontGetVariationGlyphFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetVariationGlyphFuncT :: FontGetVariationGlyphFuncT -> FontGetVariationGlyphFuncT_WithClosures
drop_closures_FontGetVariationGlyphFuncT :: FontGetVariationGlyphFuncT
-> FontGetVariationGlyphFuncT_WithClosures
drop_closures_FontGetVariationGlyphFuncT FontGetVariationGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
_ = FontGetVariationGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetVariationGlyphFuncT :: MonadIO m => FontGetVariationGlyphFuncT -> m (GClosure C_FontGetVariationGlyphFuncT)
genClosure_FontGetVariationGlyphFuncT :: FontGetVariationGlyphFuncT
-> m (GClosure C_FontGetVariationGlyphFuncT)
genClosure_FontGetVariationGlyphFuncT FontGetVariationGlyphFuncT
cb = IO (GClosure C_FontGetVariationGlyphFuncT)
-> m (GClosure C_FontGetVariationGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetVariationGlyphFuncT)
 -> m (GClosure C_FontGetVariationGlyphFuncT))
-> IO (GClosure C_FontGetVariationGlyphFuncT)
-> m (GClosure C_FontGetVariationGlyphFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetVariationGlyphFuncT_WithClosures
cb' = FontGetVariationGlyphFuncT
-> FontGetVariationGlyphFuncT_WithClosures
drop_closures_FontGetVariationGlyphFuncT FontGetVariationGlyphFuncT
cb
    let cb'' :: C_FontGetVariationGlyphFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
-> FontGetVariationGlyphFuncT_WithClosures
-> C_FontGetVariationGlyphFuncT
wrap_FontGetVariationGlyphFuncT Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
forall a. Maybe a
Nothing FontGetVariationGlyphFuncT_WithClosures
cb'
    C_FontGetVariationGlyphFuncT
-> IO (FunPtr C_FontGetVariationGlyphFuncT)
mk_FontGetVariationGlyphFuncT C_FontGetVariationGlyphFuncT
cb'' IO (FunPtr C_FontGetVariationGlyphFuncT)
-> (FunPtr C_FontGetVariationGlyphFuncT
    -> IO (GClosure C_FontGetVariationGlyphFuncT))
-> IO (GClosure C_FontGetVariationGlyphFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetVariationGlyphFuncT
-> IO (GClosure C_FontGetVariationGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetVariationGlyphFuncT` into a `C_FontGetVariationGlyphFuncT`.
wrap_FontGetVariationGlyphFuncT ::
    Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT)) ->
    FontGetVariationGlyphFuncT_WithClosures ->
    C_FontGetVariationGlyphFuncT
wrap_FontGetVariationGlyphFuncT :: Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
-> FontGetVariationGlyphFuncT_WithClosures
-> C_FontGetVariationGlyphFuncT
wrap_FontGetVariationGlyphFuncT Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
funptrptr FontGetVariationGlyphFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetVariationGlyphFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetNominalGlyphsFuncT
{- Callable
  { returnType = Just (TBasicType TUInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "count"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode_stride"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph_stride"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 7
          , 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_FontGetNominalGlyphsFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Word32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "count"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode_stride"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph_stride"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 7
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetNominalGlyphsFuncT :: FunPtr C_FontGetNominalGlyphsFuncT -> C_FontGetNominalGlyphsFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetNominalGlyphsFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetNominalGlyphsFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Word32
dynamic_FontGetNominalGlyphsFuncT :: FunPtr C_FontGetNominalGlyphsFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr ()
-> m Word32
dynamic_FontGetNominalGlyphsFuncT FunPtr C_FontGetNominalGlyphsFuncT
__funPtr FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
firstGlyph Word32
glyphStride Ptr ()
userData = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Word32
result <- (FunPtr C_FontGetNominalGlyphsFuncT -> C_FontGetNominalGlyphsFuncT
__dynamic_C_FontGetNominalGlyphsFuncT FunPtr C_FontGetNominalGlyphsFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
firstGlyph Word32
glyphStride Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

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

-- | /No description available in the introspection data./
type FontGetNominalGlyphsFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Word32
    -> Word32
    -> IO Word32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetNominalGlyphsFuncT`@.
noFontGetNominalGlyphsFuncT :: Maybe FontGetNominalGlyphsFuncT
noFontGetNominalGlyphsFuncT :: Maybe FontGetNominalGlyphsFuncT
noFontGetNominalGlyphsFuncT = Maybe FontGetNominalGlyphsFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetNominalGlyphsFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Word32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetNominalGlyphsFuncT_WithClosures`@.
noFontGetNominalGlyphsFuncT_WithClosures :: Maybe FontGetNominalGlyphsFuncT_WithClosures
noFontGetNominalGlyphsFuncT_WithClosures :: Maybe FontGetNominalGlyphsFuncT_WithClosures
noFontGetNominalGlyphsFuncT_WithClosures = Maybe FontGetNominalGlyphsFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetNominalGlyphsFuncT :: FontGetNominalGlyphsFuncT -> FontGetNominalGlyphsFuncT_WithClosures
drop_closures_FontGetNominalGlyphsFuncT :: FontGetNominalGlyphsFuncT -> FontGetNominalGlyphsFuncT_WithClosures
drop_closures_FontGetNominalGlyphsFuncT FontGetNominalGlyphsFuncT
_f FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
firstGlyph Word32
glyphStride Ptr ()
_ = FontGetNominalGlyphsFuncT
_f FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
firstGlyph Word32
glyphStride

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetNominalGlyphsFuncT :: MonadIO m => FontGetNominalGlyphsFuncT -> m (GClosure C_FontGetNominalGlyphsFuncT)
genClosure_FontGetNominalGlyphsFuncT :: FontGetNominalGlyphsFuncT
-> m (GClosure C_FontGetNominalGlyphsFuncT)
genClosure_FontGetNominalGlyphsFuncT FontGetNominalGlyphsFuncT
cb = IO (GClosure C_FontGetNominalGlyphsFuncT)
-> m (GClosure C_FontGetNominalGlyphsFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetNominalGlyphsFuncT)
 -> m (GClosure C_FontGetNominalGlyphsFuncT))
-> IO (GClosure C_FontGetNominalGlyphsFuncT)
-> m (GClosure C_FontGetNominalGlyphsFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetNominalGlyphsFuncT_WithClosures
cb' = FontGetNominalGlyphsFuncT -> FontGetNominalGlyphsFuncT_WithClosures
drop_closures_FontGetNominalGlyphsFuncT FontGetNominalGlyphsFuncT
cb
    let cb'' :: C_FontGetNominalGlyphsFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT))
-> FontGetNominalGlyphsFuncT_WithClosures
-> C_FontGetNominalGlyphsFuncT
wrap_FontGetNominalGlyphsFuncT Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT))
forall a. Maybe a
Nothing FontGetNominalGlyphsFuncT_WithClosures
cb'
    C_FontGetNominalGlyphsFuncT
-> IO (FunPtr C_FontGetNominalGlyphsFuncT)
mk_FontGetNominalGlyphsFuncT C_FontGetNominalGlyphsFuncT
cb'' IO (FunPtr C_FontGetNominalGlyphsFuncT)
-> (FunPtr C_FontGetNominalGlyphsFuncT
    -> IO (GClosure C_FontGetNominalGlyphsFuncT))
-> IO (GClosure C_FontGetNominalGlyphsFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetNominalGlyphsFuncT
-> IO (GClosure C_FontGetNominalGlyphsFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetNominalGlyphsFuncT` into a `C_FontGetNominalGlyphsFuncT`.
wrap_FontGetNominalGlyphsFuncT ::
    Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT)) ->
    FontGetNominalGlyphsFuncT_WithClosures ->
    C_FontGetNominalGlyphsFuncT
wrap_FontGetNominalGlyphsFuncT :: Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT))
-> FontGetNominalGlyphsFuncT_WithClosures
-> C_FontGetNominalGlyphsFuncT
wrap_FontGetNominalGlyphsFuncT Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT))
funptrptr FontGetNominalGlyphsFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
firstGlyph Word32
glyphStride Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Word32) -> IO Word32)
-> (FontT -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Word32
result <- FontGetNominalGlyphsFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
firstGlyph Word32
glyphStride Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT))
funptrptr
        Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- callback FontGetNominalGlyphFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , 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_FontGetNominalGlyphFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetNominalGlyphFuncT :: FunPtr C_FontGetNominalGlyphFuncT -> C_FontGetNominalGlyphFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetNominalGlyphFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetNominalGlyphFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetNominalGlyphFuncT :: FunPtr C_FontGetNominalGlyphFuncT
-> FontT -> Ptr () -> Word32 -> Word32 -> Ptr () -> m Int32
dynamic_FontGetNominalGlyphFuncT FunPtr C_FontGetNominalGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
unicode Word32
glyph Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetNominalGlyphFuncT -> C_FontGetNominalGlyphFuncT
__dynamic_C_FontGetNominalGlyphFuncT FunPtr C_FontGetNominalGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
unicode Word32
glyph Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetNominalGlyphFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetNominalGlyphFuncT`@.
noFontGetNominalGlyphFuncT :: Maybe FontGetNominalGlyphFuncT
noFontGetNominalGlyphFuncT :: Maybe FontGetNominalGlyphFuncT
noFontGetNominalGlyphFuncT = Maybe FontGetNominalGlyphFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetNominalGlyphFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetNominalGlyphFuncT_WithClosures`@.
noFontGetNominalGlyphFuncT_WithClosures :: Maybe FontGetNominalGlyphFuncT_WithClosures
noFontGetNominalGlyphFuncT_WithClosures :: Maybe FontGetNominalGlyphFuncT_WithClosures
noFontGetNominalGlyphFuncT_WithClosures = Maybe FontGetNominalGlyphFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetNominalGlyphFuncT :: FontGetNominalGlyphFuncT -> FontGetNominalGlyphFuncT_WithClosures
drop_closures_FontGetNominalGlyphFuncT :: FontGetNominalGlyphFuncT -> FontGetNominalGlyphFuncT_WithClosures
drop_closures_FontGetNominalGlyphFuncT FontGetNominalGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
glyph Ptr ()
_ = FontGetNominalGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetNominalGlyphFuncT :: MonadIO m => FontGetNominalGlyphFuncT -> m (GClosure C_FontGetNominalGlyphFuncT)
genClosure_FontGetNominalGlyphFuncT :: FontGetNominalGlyphFuncT -> m (GClosure C_FontGetNominalGlyphFuncT)
genClosure_FontGetNominalGlyphFuncT FontGetNominalGlyphFuncT
cb = IO (GClosure C_FontGetNominalGlyphFuncT)
-> m (GClosure C_FontGetNominalGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetNominalGlyphFuncT)
 -> m (GClosure C_FontGetNominalGlyphFuncT))
-> IO (GClosure C_FontGetNominalGlyphFuncT)
-> m (GClosure C_FontGetNominalGlyphFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetNominalGlyphFuncT_WithClosures
cb' = FontGetNominalGlyphFuncT -> FontGetNominalGlyphFuncT_WithClosures
drop_closures_FontGetNominalGlyphFuncT FontGetNominalGlyphFuncT
cb
    let cb'' :: C_FontGetNominalGlyphFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
-> FontGetNominalGlyphFuncT_WithClosures
-> C_FontGetNominalGlyphFuncT
wrap_FontGetNominalGlyphFuncT Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
forall a. Maybe a
Nothing FontGetNominalGlyphFuncT_WithClosures
cb'
    C_FontGetNominalGlyphFuncT
-> IO (FunPtr C_FontGetNominalGlyphFuncT)
mk_FontGetNominalGlyphFuncT C_FontGetNominalGlyphFuncT
cb'' IO (FunPtr C_FontGetNominalGlyphFuncT)
-> (FunPtr C_FontGetNominalGlyphFuncT
    -> IO (GClosure C_FontGetNominalGlyphFuncT))
-> IO (GClosure C_FontGetNominalGlyphFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetNominalGlyphFuncT
-> IO (GClosure C_FontGetNominalGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetNominalGlyphFuncT` into a `C_FontGetNominalGlyphFuncT`.
wrap_FontGetNominalGlyphFuncT ::
    Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT)) ->
    FontGetNominalGlyphFuncT_WithClosures ->
    C_FontGetNominalGlyphFuncT
wrap_FontGetNominalGlyphFuncT :: Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
-> FontGetNominalGlyphFuncT_WithClosures
-> C_FontGetNominalGlyphFuncT
wrap_FontGetNominalGlyphFuncT Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
funptrptr FontGetNominalGlyphFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
unicode Word32
glyph Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetNominalGlyphFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
unicode Word32
glyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphOriginFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "x"
          , argType = TBasicType TInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "y"
          , argType = TBasicType TInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , 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_FontGetGlyphOriginFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Int32 ->
    Int32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphOriginFuncT :: FunPtr C_FontGetGlyphOriginFuncT -> C_FontGetGlyphOriginFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphOriginFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphOriginFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Int32
    -> Int32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphOriginFuncT :: FunPtr C_FontGetGlyphOriginFuncT
-> FontT -> Ptr () -> Word32 -> Int32 -> Int32 -> Ptr () -> m Int32
dynamic_FontGetGlyphOriginFuncT FunPtr C_FontGetGlyphOriginFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Int32
x Int32
y Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetGlyphOriginFuncT -> C_FontGetGlyphOriginFuncT
__dynamic_C_FontGetGlyphOriginFuncT FunPtr C_FontGetGlyphOriginFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Int32
x Int32
y Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphOriginFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Int32
    -> Int32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphOriginFuncT`@.
noFontGetGlyphOriginFuncT :: Maybe FontGetGlyphOriginFuncT
noFontGetGlyphOriginFuncT :: Maybe FontGetGlyphOriginFuncT
noFontGetGlyphOriginFuncT = Maybe FontGetGlyphOriginFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphOriginFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Int32
    -> Int32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphOriginFuncT_WithClosures`@.
noFontGetGlyphOriginFuncT_WithClosures :: Maybe FontGetGlyphOriginFuncT_WithClosures
noFontGetGlyphOriginFuncT_WithClosures :: Maybe FontGetGlyphOriginFuncT_WithClosures
noFontGetGlyphOriginFuncT_WithClosures = Maybe FontGetGlyphOriginFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphOriginFuncT :: FontGetGlyphOriginFuncT -> FontGetGlyphOriginFuncT_WithClosures
drop_closures_FontGetGlyphOriginFuncT :: FontGetGlyphOriginFuncT -> FontGetGlyphOriginFuncT_WithClosures
drop_closures_FontGetGlyphOriginFuncT FontGetGlyphOriginFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Int32
x Int32
y Ptr ()
_ = FontGetGlyphOriginFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Int32
x Int32
y

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphOriginFuncT :: MonadIO m => FontGetGlyphOriginFuncT -> m (GClosure C_FontGetGlyphOriginFuncT)
genClosure_FontGetGlyphOriginFuncT :: FontGetGlyphOriginFuncT -> m (GClosure C_FontGetGlyphOriginFuncT)
genClosure_FontGetGlyphOriginFuncT FontGetGlyphOriginFuncT
cb = IO (GClosure C_FontGetGlyphOriginFuncT)
-> m (GClosure C_FontGetGlyphOriginFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphOriginFuncT)
 -> m (GClosure C_FontGetGlyphOriginFuncT))
-> IO (GClosure C_FontGetGlyphOriginFuncT)
-> m (GClosure C_FontGetGlyphOriginFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphOriginFuncT_WithClosures
cb' = FontGetGlyphOriginFuncT -> FontGetGlyphOriginFuncT_WithClosures
drop_closures_FontGetGlyphOriginFuncT FontGetGlyphOriginFuncT
cb
    let cb'' :: C_FontGetGlyphOriginFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT))
-> FontGetGlyphOriginFuncT_WithClosures
-> C_FontGetGlyphOriginFuncT
wrap_FontGetGlyphOriginFuncT Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT))
forall a. Maybe a
Nothing FontGetGlyphOriginFuncT_WithClosures
cb'
    C_FontGetGlyphOriginFuncT -> IO (FunPtr C_FontGetGlyphOriginFuncT)
mk_FontGetGlyphOriginFuncT C_FontGetGlyphOriginFuncT
cb'' IO (FunPtr C_FontGetGlyphOriginFuncT)
-> (FunPtr C_FontGetGlyphOriginFuncT
    -> IO (GClosure C_FontGetGlyphOriginFuncT))
-> IO (GClosure C_FontGetGlyphOriginFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphOriginFuncT
-> IO (GClosure C_FontGetGlyphOriginFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphOriginFuncT` into a `C_FontGetGlyphOriginFuncT`.
wrap_FontGetGlyphOriginFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT)) ->
    FontGetGlyphOriginFuncT_WithClosures ->
    C_FontGetGlyphOriginFuncT
wrap_FontGetGlyphOriginFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT))
-> FontGetGlyphOriginFuncT_WithClosures
-> C_FontGetGlyphOriginFuncT
wrap_FontGetGlyphOriginFuncT Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT))
funptrptr FontGetGlyphOriginFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
glyph Int32
x Int32
y Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetGlyphOriginFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
glyph Int32
x Int32
y Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphNameFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "name"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "size"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , 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_FontGetGlyphNameFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    CString ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphNameFuncT :: FunPtr C_FontGetGlyphNameFuncT -> C_FontGetGlyphNameFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphNameFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphNameFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> T.Text
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphNameFuncT :: FunPtr C_FontGetGlyphNameFuncT
-> FontT -> Ptr () -> Word32 -> Text -> Word32 -> Ptr () -> m Int32
dynamic_FontGetGlyphNameFuncT FunPtr C_FontGetGlyphNameFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Text
name Word32
size Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    CString
name' <- Text -> IO CString
textToCString Text
name
    Int32
result <- (FunPtr C_FontGetGlyphNameFuncT -> C_FontGetGlyphNameFuncT
__dynamic_C_FontGetGlyphNameFuncT FunPtr C_FontGetGlyphNameFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph CString
name' Word32
size Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphNameFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> T.Text
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphNameFuncT`@.
noFontGetGlyphNameFuncT :: Maybe FontGetGlyphNameFuncT
noFontGetGlyphNameFuncT :: Maybe FontGetGlyphNameFuncT
noFontGetGlyphNameFuncT = Maybe FontGetGlyphNameFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphNameFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> T.Text
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphNameFuncT_WithClosures`@.
noFontGetGlyphNameFuncT_WithClosures :: Maybe FontGetGlyphNameFuncT_WithClosures
noFontGetGlyphNameFuncT_WithClosures :: Maybe FontGetGlyphNameFuncT_WithClosures
noFontGetGlyphNameFuncT_WithClosures = Maybe FontGetGlyphNameFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphNameFuncT :: FontGetGlyphNameFuncT -> FontGetGlyphNameFuncT_WithClosures
drop_closures_FontGetGlyphNameFuncT :: FontGetGlyphNameFuncT -> FontGetGlyphNameFuncT_WithClosures
drop_closures_FontGetGlyphNameFuncT FontGetGlyphNameFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Text
name Word32
size Ptr ()
_ = FontGetGlyphNameFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Text
name Word32
size

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphNameFuncT :: MonadIO m => FontGetGlyphNameFuncT -> m (GClosure C_FontGetGlyphNameFuncT)
genClosure_FontGetGlyphNameFuncT :: FontGetGlyphNameFuncT -> m (GClosure C_FontGetGlyphNameFuncT)
genClosure_FontGetGlyphNameFuncT FontGetGlyphNameFuncT
cb = IO (GClosure C_FontGetGlyphNameFuncT)
-> m (GClosure C_FontGetGlyphNameFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphNameFuncT)
 -> m (GClosure C_FontGetGlyphNameFuncT))
-> IO (GClosure C_FontGetGlyphNameFuncT)
-> m (GClosure C_FontGetGlyphNameFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphNameFuncT_WithClosures
cb' = FontGetGlyphNameFuncT -> FontGetGlyphNameFuncT_WithClosures
drop_closures_FontGetGlyphNameFuncT FontGetGlyphNameFuncT
cb
    let cb'' :: C_FontGetGlyphNameFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT))
-> FontGetGlyphNameFuncT_WithClosures -> C_FontGetGlyphNameFuncT
wrap_FontGetGlyphNameFuncT Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT))
forall a. Maybe a
Nothing FontGetGlyphNameFuncT_WithClosures
cb'
    C_FontGetGlyphNameFuncT -> IO (FunPtr C_FontGetGlyphNameFuncT)
mk_FontGetGlyphNameFuncT C_FontGetGlyphNameFuncT
cb'' IO (FunPtr C_FontGetGlyphNameFuncT)
-> (FunPtr C_FontGetGlyphNameFuncT
    -> IO (GClosure C_FontGetGlyphNameFuncT))
-> IO (GClosure C_FontGetGlyphNameFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphNameFuncT
-> IO (GClosure C_FontGetGlyphNameFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphNameFuncT` into a `C_FontGetGlyphNameFuncT`.
wrap_FontGetGlyphNameFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT)) ->
    FontGetGlyphNameFuncT_WithClosures ->
    C_FontGetGlyphNameFuncT
wrap_FontGetGlyphNameFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT))
-> FontGetGlyphNameFuncT_WithClosures -> C_FontGetGlyphNameFuncT
wrap_FontGetGlyphNameFuncT Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT))
funptrptr FontGetGlyphNameFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
glyph CString
name Word32
size Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Text
name' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
name
        Int32
result <- FontGetGlyphNameFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
glyph Text
name' Word32
size Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphKerningFuncT
{- Callable
  { returnType = Just (TBasicType TInt32)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "second_glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , 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_FontGetGlyphKerningFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "second_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphKerningFuncT :: FunPtr C_FontGetGlyphKerningFuncT -> C_FontGetGlyphKerningFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphKerningFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphKerningFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphKerningFuncT :: FunPtr C_FontGetNominalGlyphFuncT
-> FontT -> Ptr () -> Word32 -> Word32 -> Ptr () -> m Int32
dynamic_FontGetGlyphKerningFuncT FunPtr C_FontGetNominalGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetNominalGlyphFuncT -> C_FontGetNominalGlyphFuncT
__dynamic_C_FontGetGlyphKerningFuncT FunPtr C_FontGetNominalGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphKerningFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphKerningFuncT`@.
noFontGetGlyphKerningFuncT :: Maybe FontGetGlyphKerningFuncT
noFontGetGlyphKerningFuncT :: Maybe FontGetNominalGlyphFuncT
noFontGetGlyphKerningFuncT = Maybe FontGetNominalGlyphFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphKerningFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphKerningFuncT_WithClosures`@.
noFontGetGlyphKerningFuncT_WithClosures :: Maybe FontGetGlyphKerningFuncT_WithClosures
noFontGetGlyphKerningFuncT_WithClosures :: Maybe FontGetNominalGlyphFuncT_WithClosures
noFontGetGlyphKerningFuncT_WithClosures = Maybe FontGetNominalGlyphFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphKerningFuncT :: FontGetGlyphKerningFuncT -> FontGetGlyphKerningFuncT_WithClosures
drop_closures_FontGetGlyphKerningFuncT :: FontGetNominalGlyphFuncT -> FontGetNominalGlyphFuncT_WithClosures
drop_closures_FontGetGlyphKerningFuncT FontGetNominalGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
_ = FontGetNominalGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphKerningFuncT :: MonadIO m => FontGetGlyphKerningFuncT -> m (GClosure C_FontGetGlyphKerningFuncT)
genClosure_FontGetGlyphKerningFuncT :: FontGetNominalGlyphFuncT -> m (GClosure C_FontGetNominalGlyphFuncT)
genClosure_FontGetGlyphKerningFuncT FontGetNominalGlyphFuncT
cb = IO (GClosure C_FontGetNominalGlyphFuncT)
-> m (GClosure C_FontGetNominalGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetNominalGlyphFuncT)
 -> m (GClosure C_FontGetNominalGlyphFuncT))
-> IO (GClosure C_FontGetNominalGlyphFuncT)
-> m (GClosure C_FontGetNominalGlyphFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetNominalGlyphFuncT_WithClosures
cb' = FontGetNominalGlyphFuncT -> FontGetNominalGlyphFuncT_WithClosures
drop_closures_FontGetGlyphKerningFuncT FontGetNominalGlyphFuncT
cb
    let cb'' :: C_FontGetNominalGlyphFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
-> FontGetNominalGlyphFuncT_WithClosures
-> C_FontGetNominalGlyphFuncT
wrap_FontGetGlyphKerningFuncT Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
forall a. Maybe a
Nothing FontGetNominalGlyphFuncT_WithClosures
cb'
    C_FontGetNominalGlyphFuncT
-> IO (FunPtr C_FontGetNominalGlyphFuncT)
mk_FontGetGlyphKerningFuncT C_FontGetNominalGlyphFuncT
cb'' IO (FunPtr C_FontGetNominalGlyphFuncT)
-> (FunPtr C_FontGetNominalGlyphFuncT
    -> IO (GClosure C_FontGetNominalGlyphFuncT))
-> IO (GClosure C_FontGetNominalGlyphFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetNominalGlyphFuncT
-> IO (GClosure C_FontGetNominalGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphKerningFuncT` into a `C_FontGetGlyphKerningFuncT`.
wrap_FontGetGlyphKerningFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphKerningFuncT)) ->
    FontGetGlyphKerningFuncT_WithClosures ->
    C_FontGetGlyphKerningFuncT
wrap_FontGetGlyphKerningFuncT :: Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
-> FontGetNominalGlyphFuncT_WithClosures
-> C_FontGetNominalGlyphFuncT
wrap_FontGetGlyphKerningFuncT Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
funptrptr FontGetNominalGlyphFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetNominalGlyphFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "unicode"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "variation_selector"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , 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_FontGetGlyphFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variation_selector"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphFuncT :: FunPtr C_FontGetGlyphFuncT -> C_FontGetGlyphFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphFuncT :: FunPtr C_FontGetVariationGlyphFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Word32
-> Ptr ()
-> m Int32
dynamic_FontGetGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetVariationGlyphFuncT -> C_FontGetVariationGlyphFuncT
__dynamic_C_FontGetGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphFuncT`@.
noFontGetGlyphFuncT :: Maybe FontGetGlyphFuncT
noFontGetGlyphFuncT :: Maybe FontGetVariationGlyphFuncT
noFontGetGlyphFuncT = Maybe FontGetVariationGlyphFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphFuncT_WithClosures`@.
noFontGetGlyphFuncT_WithClosures :: Maybe FontGetGlyphFuncT_WithClosures
noFontGetGlyphFuncT_WithClosures :: Maybe FontGetVariationGlyphFuncT_WithClosures
noFontGetGlyphFuncT_WithClosures = Maybe FontGetVariationGlyphFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphFuncT :: FontGetGlyphFuncT -> FontGetGlyphFuncT_WithClosures
drop_closures_FontGetGlyphFuncT :: FontGetVariationGlyphFuncT
-> FontGetVariationGlyphFuncT_WithClosures
drop_closures_FontGetGlyphFuncT FontGetVariationGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
_ = FontGetVariationGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphFuncT :: MonadIO m => FontGetGlyphFuncT -> m (GClosure C_FontGetGlyphFuncT)
genClosure_FontGetGlyphFuncT :: FontGetVariationGlyphFuncT
-> m (GClosure C_FontGetVariationGlyphFuncT)
genClosure_FontGetGlyphFuncT FontGetVariationGlyphFuncT
cb = IO (GClosure C_FontGetVariationGlyphFuncT)
-> m (GClosure C_FontGetVariationGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetVariationGlyphFuncT)
 -> m (GClosure C_FontGetVariationGlyphFuncT))
-> IO (GClosure C_FontGetVariationGlyphFuncT)
-> m (GClosure C_FontGetVariationGlyphFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetVariationGlyphFuncT_WithClosures
cb' = FontGetVariationGlyphFuncT
-> FontGetVariationGlyphFuncT_WithClosures
drop_closures_FontGetGlyphFuncT FontGetVariationGlyphFuncT
cb
    let cb'' :: C_FontGetVariationGlyphFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
-> FontGetVariationGlyphFuncT_WithClosures
-> C_FontGetVariationGlyphFuncT
wrap_FontGetGlyphFuncT Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
forall a. Maybe a
Nothing FontGetVariationGlyphFuncT_WithClosures
cb'
    C_FontGetVariationGlyphFuncT
-> IO (FunPtr C_FontGetVariationGlyphFuncT)
mk_FontGetGlyphFuncT C_FontGetVariationGlyphFuncT
cb'' IO (FunPtr C_FontGetVariationGlyphFuncT)
-> (FunPtr C_FontGetVariationGlyphFuncT
    -> IO (GClosure C_FontGetVariationGlyphFuncT))
-> IO (GClosure C_FontGetVariationGlyphFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetVariationGlyphFuncT
-> IO (GClosure C_FontGetVariationGlyphFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphFuncT` into a `C_FontGetGlyphFuncT`.
wrap_FontGetGlyphFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphFuncT)) ->
    FontGetGlyphFuncT_WithClosures ->
    C_FontGetGlyphFuncT
wrap_FontGetGlyphFuncT :: Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
-> FontGetVariationGlyphFuncT_WithClosures
-> C_FontGetVariationGlyphFuncT
wrap_FontGetGlyphFuncT Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
funptrptr FontGetVariationGlyphFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetVariationGlyphFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Word32
glyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphFromNameFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "name"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "len"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , 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_FontGetGlyphFromNameFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    CString ->
    Int32 ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "len"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphFromNameFuncT :: FunPtr C_FontGetGlyphFromNameFuncT -> C_FontGetGlyphFromNameFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphFromNameFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphFromNameFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> T.Text
    -> Int32
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphFromNameFuncT :: FunPtr C_FontGetGlyphFromNameFuncT
-> FontT -> Ptr () -> Text -> Int32 -> Word32 -> Ptr () -> m Int32
dynamic_FontGetGlyphFromNameFuncT FunPtr C_FontGetGlyphFromNameFuncT
__funPtr FontT
font Ptr ()
fontData Text
name Int32
len Word32
glyph Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    CString
name' <- Text -> IO CString
textToCString Text
name
    Int32
result <- (FunPtr C_FontGetGlyphFromNameFuncT -> C_FontGetGlyphFromNameFuncT
__dynamic_C_FontGetGlyphFromNameFuncT FunPtr C_FontGetGlyphFromNameFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData CString
name' Int32
len Word32
glyph Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphFromNameFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> T.Text
    -> Int32
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphFromNameFuncT`@.
noFontGetGlyphFromNameFuncT :: Maybe FontGetGlyphFromNameFuncT
noFontGetGlyphFromNameFuncT :: Maybe FontGetGlyphFromNameFuncT
noFontGetGlyphFromNameFuncT = Maybe FontGetGlyphFromNameFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphFromNameFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> T.Text
    -> Int32
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphFromNameFuncT_WithClosures`@.
noFontGetGlyphFromNameFuncT_WithClosures :: Maybe FontGetGlyphFromNameFuncT_WithClosures
noFontGetGlyphFromNameFuncT_WithClosures :: Maybe FontGetGlyphFromNameFuncT_WithClosures
noFontGetGlyphFromNameFuncT_WithClosures = Maybe FontGetGlyphFromNameFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphFromNameFuncT :: FontGetGlyphFromNameFuncT -> FontGetGlyphFromNameFuncT_WithClosures
drop_closures_FontGetGlyphFromNameFuncT :: FontGetGlyphFromNameFuncT -> FontGetGlyphFromNameFuncT_WithClosures
drop_closures_FontGetGlyphFromNameFuncT FontGetGlyphFromNameFuncT
_f FontT
font Ptr ()
fontData Text
name Int32
len Word32
glyph Ptr ()
_ = FontGetGlyphFromNameFuncT
_f FontT
font Ptr ()
fontData Text
name Int32
len Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphFromNameFuncT :: MonadIO m => FontGetGlyphFromNameFuncT -> m (GClosure C_FontGetGlyphFromNameFuncT)
genClosure_FontGetGlyphFromNameFuncT :: FontGetGlyphFromNameFuncT
-> m (GClosure C_FontGetGlyphFromNameFuncT)
genClosure_FontGetGlyphFromNameFuncT FontGetGlyphFromNameFuncT
cb = IO (GClosure C_FontGetGlyphFromNameFuncT)
-> m (GClosure C_FontGetGlyphFromNameFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphFromNameFuncT)
 -> m (GClosure C_FontGetGlyphFromNameFuncT))
-> IO (GClosure C_FontGetGlyphFromNameFuncT)
-> m (GClosure C_FontGetGlyphFromNameFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphFromNameFuncT_WithClosures
cb' = FontGetGlyphFromNameFuncT -> FontGetGlyphFromNameFuncT_WithClosures
drop_closures_FontGetGlyphFromNameFuncT FontGetGlyphFromNameFuncT
cb
    let cb'' :: C_FontGetGlyphFromNameFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT))
-> FontGetGlyphFromNameFuncT_WithClosures
-> C_FontGetGlyphFromNameFuncT
wrap_FontGetGlyphFromNameFuncT Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT))
forall a. Maybe a
Nothing FontGetGlyphFromNameFuncT_WithClosures
cb'
    C_FontGetGlyphFromNameFuncT
-> IO (FunPtr C_FontGetGlyphFromNameFuncT)
mk_FontGetGlyphFromNameFuncT C_FontGetGlyphFromNameFuncT
cb'' IO (FunPtr C_FontGetGlyphFromNameFuncT)
-> (FunPtr C_FontGetGlyphFromNameFuncT
    -> IO (GClosure C_FontGetGlyphFromNameFuncT))
-> IO (GClosure C_FontGetGlyphFromNameFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphFromNameFuncT
-> IO (GClosure C_FontGetGlyphFromNameFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphFromNameFuncT` into a `C_FontGetGlyphFromNameFuncT`.
wrap_FontGetGlyphFromNameFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT)) ->
    FontGetGlyphFromNameFuncT_WithClosures ->
    C_FontGetGlyphFromNameFuncT
wrap_FontGetGlyphFromNameFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT))
-> FontGetGlyphFromNameFuncT_WithClosures
-> C_FontGetGlyphFromNameFuncT
wrap_FontGetGlyphFromNameFuncT Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT))
funptrptr FontGetGlyphFromNameFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData CString
name Int32
len Word32
glyph Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Text
name' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
name
        Int32
result <- FontGetGlyphFromNameFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Text
name' Int32
len Word32
glyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphExtentsFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "extents"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "glyph_extents_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , 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_FontGetGlyphExtentsFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "extents"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "glyph_extents_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphExtentsFuncT :: FunPtr C_FontGetGlyphExtentsFuncT -> C_FontGetGlyphExtentsFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphExtentsFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphExtentsFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> HarfBuzz.GlyphExtentsT.GlyphExtentsT
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphExtentsFuncT :: FunPtr C_FontGetGlyphExtentsFuncT
-> FontT -> Ptr () -> Word32 -> GlyphExtentsT -> Ptr () -> m Int32
dynamic_FontGetGlyphExtentsFuncT FunPtr C_FontGetGlyphExtentsFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph GlyphExtentsT
extents Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr GlyphExtentsT
extents' <- GlyphExtentsT -> IO (Ptr GlyphExtentsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphExtentsT
extents
    Int32
result <- (FunPtr C_FontGetGlyphExtentsFuncT -> C_FontGetGlyphExtentsFuncT
__dynamic_C_FontGetGlyphExtentsFuncT FunPtr C_FontGetGlyphExtentsFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Ptr GlyphExtentsT
extents' Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    GlyphExtentsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphExtentsT
extents
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphExtentsFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> HarfBuzz.GlyphExtentsT.GlyphExtentsT
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphExtentsFuncT`@.
noFontGetGlyphExtentsFuncT :: Maybe FontGetGlyphExtentsFuncT
noFontGetGlyphExtentsFuncT :: Maybe FontGetGlyphExtentsFuncT
noFontGetGlyphExtentsFuncT = Maybe FontGetGlyphExtentsFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphExtentsFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> HarfBuzz.GlyphExtentsT.GlyphExtentsT
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphExtentsFuncT_WithClosures`@.
noFontGetGlyphExtentsFuncT_WithClosures :: Maybe FontGetGlyphExtentsFuncT_WithClosures
noFontGetGlyphExtentsFuncT_WithClosures :: Maybe FontGetGlyphExtentsFuncT_WithClosures
noFontGetGlyphExtentsFuncT_WithClosures = Maybe FontGetGlyphExtentsFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphExtentsFuncT :: FontGetGlyphExtentsFuncT -> FontGetGlyphExtentsFuncT_WithClosures
drop_closures_FontGetGlyphExtentsFuncT :: FontGetGlyphExtentsFuncT -> FontGetGlyphExtentsFuncT_WithClosures
drop_closures_FontGetGlyphExtentsFuncT FontGetGlyphExtentsFuncT
_f FontT
font Ptr ()
fontData Word32
glyph GlyphExtentsT
extents Ptr ()
_ = FontGetGlyphExtentsFuncT
_f FontT
font Ptr ()
fontData Word32
glyph GlyphExtentsT
extents

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphExtentsFuncT :: MonadIO m => FontGetGlyphExtentsFuncT -> m (GClosure C_FontGetGlyphExtentsFuncT)
genClosure_FontGetGlyphExtentsFuncT :: FontGetGlyphExtentsFuncT -> m (GClosure C_FontGetGlyphExtentsFuncT)
genClosure_FontGetGlyphExtentsFuncT FontGetGlyphExtentsFuncT
cb = IO (GClosure C_FontGetGlyphExtentsFuncT)
-> m (GClosure C_FontGetGlyphExtentsFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphExtentsFuncT)
 -> m (GClosure C_FontGetGlyphExtentsFuncT))
-> IO (GClosure C_FontGetGlyphExtentsFuncT)
-> m (GClosure C_FontGetGlyphExtentsFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphExtentsFuncT_WithClosures
cb' = FontGetGlyphExtentsFuncT -> FontGetGlyphExtentsFuncT_WithClosures
drop_closures_FontGetGlyphExtentsFuncT FontGetGlyphExtentsFuncT
cb
    let cb'' :: C_FontGetGlyphExtentsFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT))
-> FontGetGlyphExtentsFuncT_WithClosures
-> C_FontGetGlyphExtentsFuncT
wrap_FontGetGlyphExtentsFuncT Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT))
forall a. Maybe a
Nothing FontGetGlyphExtentsFuncT_WithClosures
cb'
    C_FontGetGlyphExtentsFuncT
-> IO (FunPtr C_FontGetGlyphExtentsFuncT)
mk_FontGetGlyphExtentsFuncT C_FontGetGlyphExtentsFuncT
cb'' IO (FunPtr C_FontGetGlyphExtentsFuncT)
-> (FunPtr C_FontGetGlyphExtentsFuncT
    -> IO (GClosure C_FontGetGlyphExtentsFuncT))
-> IO (GClosure C_FontGetGlyphExtentsFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphExtentsFuncT
-> IO (GClosure C_FontGetGlyphExtentsFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphExtentsFuncT` into a `C_FontGetGlyphExtentsFuncT`.
wrap_FontGetGlyphExtentsFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT)) ->
    FontGetGlyphExtentsFuncT_WithClosures ->
    C_FontGetGlyphExtentsFuncT
wrap_FontGetGlyphExtentsFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT))
-> FontGetGlyphExtentsFuncT_WithClosures
-> C_FontGetGlyphExtentsFuncT
wrap_FontGetGlyphExtentsFuncT Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT))
funptrptr FontGetGlyphExtentsFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
glyph Ptr GlyphExtentsT
extents Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        GlyphExtentsT
extents' <- ((ManagedPtr GlyphExtentsT -> GlyphExtentsT)
-> Ptr GlyphExtentsT -> IO GlyphExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr GlyphExtentsT -> GlyphExtentsT
HarfBuzz.GlyphExtentsT.GlyphExtentsT) Ptr GlyphExtentsT
extents
        Int32
result <- FontGetGlyphExtentsFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
glyph GlyphExtentsT
extents' Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphExtentsFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphContourPointFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "point_index"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "x"
          , argType = TBasicType TInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "y"
          , argType = TBasicType TInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 6
          , 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_FontGetGlyphContourPointFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Int32 ->
    Int32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 6
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphContourPointFuncT :: FunPtr C_FontGetGlyphContourPointFuncT -> C_FontGetGlyphContourPointFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphContourPointFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphContourPointFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Int32
    -> Int32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphContourPointFuncT :: FunPtr C_FontGetGlyphContourPointFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Int32
-> Int32
-> Ptr ()
-> m Int32
dynamic_FontGetGlyphContourPointFuncT FunPtr C_FontGetGlyphContourPointFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex Int32
x Int32
y Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetGlyphContourPointFuncT
-> C_FontGetGlyphContourPointFuncT
__dynamic_C_FontGetGlyphContourPointFuncT FunPtr C_FontGetGlyphContourPointFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Word32
pointIndex Int32
x Int32
y Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphContourPointFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Int32
    -> Int32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphContourPointFuncT`@.
noFontGetGlyphContourPointFuncT :: Maybe FontGetGlyphContourPointFuncT
noFontGetGlyphContourPointFuncT :: Maybe FontGetGlyphContourPointFuncT
noFontGetGlyphContourPointFuncT = Maybe FontGetGlyphContourPointFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphContourPointFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Int32
    -> Int32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphContourPointFuncT_WithClosures`@.
noFontGetGlyphContourPointFuncT_WithClosures :: Maybe FontGetGlyphContourPointFuncT_WithClosures
noFontGetGlyphContourPointFuncT_WithClosures :: Maybe FontGetGlyphContourPointFuncT_WithClosures
noFontGetGlyphContourPointFuncT_WithClosures = Maybe FontGetGlyphContourPointFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphContourPointFuncT :: FontGetGlyphContourPointFuncT -> FontGetGlyphContourPointFuncT_WithClosures
drop_closures_FontGetGlyphContourPointFuncT :: FontGetGlyphContourPointFuncT
-> FontGetGlyphContourPointFuncT_WithClosures
drop_closures_FontGetGlyphContourPointFuncT FontGetGlyphContourPointFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex Int32
x Int32
y Ptr ()
_ = FontGetGlyphContourPointFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex Int32
x Int32
y

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphContourPointFuncT :: MonadIO m => FontGetGlyphContourPointFuncT -> m (GClosure C_FontGetGlyphContourPointFuncT)
genClosure_FontGetGlyphContourPointFuncT :: FontGetGlyphContourPointFuncT
-> m (GClosure C_FontGetGlyphContourPointFuncT)
genClosure_FontGetGlyphContourPointFuncT FontGetGlyphContourPointFuncT
cb = IO (GClosure C_FontGetGlyphContourPointFuncT)
-> m (GClosure C_FontGetGlyphContourPointFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphContourPointFuncT)
 -> m (GClosure C_FontGetGlyphContourPointFuncT))
-> IO (GClosure C_FontGetGlyphContourPointFuncT)
-> m (GClosure C_FontGetGlyphContourPointFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphContourPointFuncT_WithClosures
cb' = FontGetGlyphContourPointFuncT
-> FontGetGlyphContourPointFuncT_WithClosures
drop_closures_FontGetGlyphContourPointFuncT FontGetGlyphContourPointFuncT
cb
    let cb'' :: C_FontGetGlyphContourPointFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT))
-> FontGetGlyphContourPointFuncT_WithClosures
-> C_FontGetGlyphContourPointFuncT
wrap_FontGetGlyphContourPointFuncT Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT))
forall a. Maybe a
Nothing FontGetGlyphContourPointFuncT_WithClosures
cb'
    C_FontGetGlyphContourPointFuncT
-> IO (FunPtr C_FontGetGlyphContourPointFuncT)
mk_FontGetGlyphContourPointFuncT C_FontGetGlyphContourPointFuncT
cb'' IO (FunPtr C_FontGetGlyphContourPointFuncT)
-> (FunPtr C_FontGetGlyphContourPointFuncT
    -> IO (GClosure C_FontGetGlyphContourPointFuncT))
-> IO (GClosure C_FontGetGlyphContourPointFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphContourPointFuncT
-> IO (GClosure C_FontGetGlyphContourPointFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphContourPointFuncT` into a `C_FontGetGlyphContourPointFuncT`.
wrap_FontGetGlyphContourPointFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT)) ->
    FontGetGlyphContourPointFuncT_WithClosures ->
    C_FontGetGlyphContourPointFuncT
wrap_FontGetGlyphContourPointFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT))
-> FontGetGlyphContourPointFuncT_WithClosures
-> C_FontGetGlyphContourPointFuncT
wrap_FontGetGlyphContourPointFuncT Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT))
funptrptr FontGetGlyphContourPointFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex Int32
x Int32
y Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetGlyphContourPointFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
glyph Word32
pointIndex Int32
x Int32
y Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetGlyphAdvancesFuncT
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "count"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph_stride"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_advance"
          , argType = TBasicType TInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "advance_stride"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 7
          , 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_FontGetGlyphAdvancesFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Word32 ->
    Int32 ->
    Word32 ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "count"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph_stride"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_advance"
--           , argType = TBasicType TInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "advance_stride"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 7
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphAdvancesFuncT :: FunPtr C_FontGetGlyphAdvancesFuncT -> C_FontGetGlyphAdvancesFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphAdvancesFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphAdvancesFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Int32
    -> Word32
    -> Ptr ()
    -> m ()
dynamic_FontGetGlyphAdvancesFuncT :: FunPtr C_FontGetGlyphAdvancesFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Word32
-> Int32
-> Word32
-> Ptr ()
-> m ()
dynamic_FontGetGlyphAdvancesFuncT FunPtr C_FontGetGlyphAdvancesFuncT
__funPtr FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Int32
firstAdvance Word32
advanceStride Ptr ()
userData = 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 FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    (FunPtr C_FontGetGlyphAdvancesFuncT -> C_FontGetGlyphAdvancesFuncT
__dynamic_C_FontGetGlyphAdvancesFuncT FunPtr C_FontGetGlyphAdvancesFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Int32
firstAdvance Word32
advanceStride Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type FontGetGlyphAdvancesFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Int32
    -> Word32
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphAdvancesFuncT`@.
noFontGetGlyphAdvancesFuncT :: Maybe FontGetGlyphAdvancesFuncT
noFontGetGlyphAdvancesFuncT :: Maybe FontGetGlyphAdvancesFuncT
noFontGetGlyphAdvancesFuncT = Maybe FontGetGlyphAdvancesFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphAdvancesFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Word32
    -> Word32
    -> Int32
    -> Word32
    -> Ptr ()
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphAdvancesFuncT_WithClosures`@.
noFontGetGlyphAdvancesFuncT_WithClosures :: Maybe FontGetGlyphAdvancesFuncT_WithClosures
noFontGetGlyphAdvancesFuncT_WithClosures :: Maybe FontGetGlyphAdvancesFuncT_WithClosures
noFontGetGlyphAdvancesFuncT_WithClosures = Maybe FontGetGlyphAdvancesFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphAdvancesFuncT :: FontGetGlyphAdvancesFuncT -> FontGetGlyphAdvancesFuncT_WithClosures
drop_closures_FontGetGlyphAdvancesFuncT :: FontGetGlyphAdvancesFuncT -> FontGetGlyphAdvancesFuncT_WithClosures
drop_closures_FontGetGlyphAdvancesFuncT FontGetGlyphAdvancesFuncT
_f FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Int32
firstAdvance Word32
advanceStride Ptr ()
_ = FontGetGlyphAdvancesFuncT
_f FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Int32
firstAdvance Word32
advanceStride

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphAdvancesFuncT :: MonadIO m => FontGetGlyphAdvancesFuncT -> m (GClosure C_FontGetGlyphAdvancesFuncT)
genClosure_FontGetGlyphAdvancesFuncT :: FontGetGlyphAdvancesFuncT
-> m (GClosure C_FontGetGlyphAdvancesFuncT)
genClosure_FontGetGlyphAdvancesFuncT FontGetGlyphAdvancesFuncT
cb = IO (GClosure C_FontGetGlyphAdvancesFuncT)
-> m (GClosure C_FontGetGlyphAdvancesFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphAdvancesFuncT)
 -> m (GClosure C_FontGetGlyphAdvancesFuncT))
-> IO (GClosure C_FontGetGlyphAdvancesFuncT)
-> m (GClosure C_FontGetGlyphAdvancesFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphAdvancesFuncT_WithClosures
cb' = FontGetGlyphAdvancesFuncT -> FontGetGlyphAdvancesFuncT_WithClosures
drop_closures_FontGetGlyphAdvancesFuncT FontGetGlyphAdvancesFuncT
cb
    let cb'' :: C_FontGetGlyphAdvancesFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT))
-> FontGetGlyphAdvancesFuncT_WithClosures
-> C_FontGetGlyphAdvancesFuncT
wrap_FontGetGlyphAdvancesFuncT Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT))
forall a. Maybe a
Nothing FontGetGlyphAdvancesFuncT_WithClosures
cb'
    C_FontGetGlyphAdvancesFuncT
-> IO (FunPtr C_FontGetGlyphAdvancesFuncT)
mk_FontGetGlyphAdvancesFuncT C_FontGetGlyphAdvancesFuncT
cb'' IO (FunPtr C_FontGetGlyphAdvancesFuncT)
-> (FunPtr C_FontGetGlyphAdvancesFuncT
    -> IO (GClosure C_FontGetGlyphAdvancesFuncT))
-> IO (GClosure C_FontGetGlyphAdvancesFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphAdvancesFuncT
-> IO (GClosure C_FontGetGlyphAdvancesFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphAdvancesFuncT` into a `C_FontGetGlyphAdvancesFuncT`.
wrap_FontGetGlyphAdvancesFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT)) ->
    FontGetGlyphAdvancesFuncT_WithClosures ->
    C_FontGetGlyphAdvancesFuncT
wrap_FontGetGlyphAdvancesFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT))
-> FontGetGlyphAdvancesFuncT_WithClosures
-> C_FontGetGlyphAdvancesFuncT
wrap_FontGetGlyphAdvancesFuncT Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT))
funptrptr FontGetGlyphAdvancesFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Int32
firstAdvance Word32
advanceStride Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO ()) -> IO ()) -> (FontT -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        FontGetGlyphAdvancesFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Int32
firstAdvance Word32
advanceStride Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT))
funptrptr


-- callback FontGetGlyphAdvanceFuncT
{- Callable
  { returnType = Just (TBasicType TInt32)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , 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_FontGetGlyphAdvanceFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetGlyphAdvanceFuncT :: FunPtr C_FontGetGlyphAdvanceFuncT -> C_FontGetGlyphAdvanceFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetGlyphAdvanceFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetGlyphAdvanceFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Ptr ()
    -> m Int32
dynamic_FontGetGlyphAdvanceFuncT :: FunPtr C_FontGetGlyphAdvanceFuncT
-> FontT -> Ptr () -> Word32 -> Ptr () -> m Int32
dynamic_FontGetGlyphAdvanceFuncT FunPtr C_FontGetGlyphAdvanceFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Int32
result <- (FunPtr C_FontGetGlyphAdvanceFuncT -> C_FontGetGlyphAdvanceFuncT
__dynamic_C_FontGetGlyphAdvanceFuncT FunPtr C_FontGetGlyphAdvanceFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetGlyphAdvanceFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphAdvanceFuncT`@.
noFontGetGlyphAdvanceFuncT :: Maybe FontGetGlyphAdvanceFuncT
noFontGetGlyphAdvanceFuncT :: Maybe FontGetGlyphAdvanceFuncT
noFontGetGlyphAdvanceFuncT = Maybe FontGetGlyphAdvanceFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetGlyphAdvanceFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> Word32
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetGlyphAdvanceFuncT_WithClosures`@.
noFontGetGlyphAdvanceFuncT_WithClosures :: Maybe FontGetGlyphAdvanceFuncT_WithClosures
noFontGetGlyphAdvanceFuncT_WithClosures :: Maybe FontGetGlyphAdvanceFuncT_WithClosures
noFontGetGlyphAdvanceFuncT_WithClosures = Maybe FontGetGlyphAdvanceFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphAdvanceFuncT :: FontGetGlyphAdvanceFuncT -> FontGetGlyphAdvanceFuncT_WithClosures
drop_closures_FontGetGlyphAdvanceFuncT :: FontGetGlyphAdvanceFuncT -> FontGetGlyphAdvanceFuncT_WithClosures
drop_closures_FontGetGlyphAdvanceFuncT FontGetGlyphAdvanceFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Ptr ()
_ = FontGetGlyphAdvanceFuncT
_f FontT
font Ptr ()
fontData Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphAdvanceFuncT :: MonadIO m => FontGetGlyphAdvanceFuncT -> m (GClosure C_FontGetGlyphAdvanceFuncT)
genClosure_FontGetGlyphAdvanceFuncT :: FontGetGlyphAdvanceFuncT -> m (GClosure C_FontGetGlyphAdvanceFuncT)
genClosure_FontGetGlyphAdvanceFuncT FontGetGlyphAdvanceFuncT
cb = IO (GClosure C_FontGetGlyphAdvanceFuncT)
-> m (GClosure C_FontGetGlyphAdvanceFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphAdvanceFuncT)
 -> m (GClosure C_FontGetGlyphAdvanceFuncT))
-> IO (GClosure C_FontGetGlyphAdvanceFuncT)
-> m (GClosure C_FontGetGlyphAdvanceFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphAdvanceFuncT_WithClosures
cb' = FontGetGlyphAdvanceFuncT -> FontGetGlyphAdvanceFuncT_WithClosures
drop_closures_FontGetGlyphAdvanceFuncT FontGetGlyphAdvanceFuncT
cb
    let cb'' :: C_FontGetGlyphAdvanceFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT))
-> FontGetGlyphAdvanceFuncT_WithClosures
-> C_FontGetGlyphAdvanceFuncT
wrap_FontGetGlyphAdvanceFuncT Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT))
forall a. Maybe a
Nothing FontGetGlyphAdvanceFuncT_WithClosures
cb'
    C_FontGetGlyphAdvanceFuncT
-> IO (FunPtr C_FontGetGlyphAdvanceFuncT)
mk_FontGetGlyphAdvanceFuncT C_FontGetGlyphAdvanceFuncT
cb'' IO (FunPtr C_FontGetGlyphAdvanceFuncT)
-> (FunPtr C_FontGetGlyphAdvanceFuncT
    -> IO (GClosure C_FontGetGlyphAdvanceFuncT))
-> IO (GClosure C_FontGetGlyphAdvanceFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphAdvanceFuncT
-> IO (GClosure C_FontGetGlyphAdvanceFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetGlyphAdvanceFuncT` into a `C_FontGetGlyphAdvanceFuncT`.
wrap_FontGetGlyphAdvanceFuncT ::
    Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT)) ->
    FontGetGlyphAdvanceFuncT_WithClosures ->
    C_FontGetGlyphAdvanceFuncT
wrap_FontGetGlyphAdvanceFuncT :: Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT))
-> FontGetGlyphAdvanceFuncT_WithClosures
-> C_FontGetGlyphAdvanceFuncT
wrap_FontGetGlyphAdvanceFuncT Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT))
funptrptr FontGetGlyphAdvanceFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Word32
glyph Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
result <- FontGetGlyphAdvanceFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData Word32
glyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphAdvanceFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback FontGetFontExtentsFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "extents"
          , argType =
              TInterface
                Name { namespace = "HarfBuzz" , name = "font_extents_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , 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_FontGetFontExtentsFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Ptr HarfBuzz.FontExtentsT.FontExtentsT ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "extents"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "font_extents_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FontGetFontExtentsFuncT :: FunPtr C_FontGetFontExtentsFuncT -> C_FontGetFontExtentsFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FontGetFontExtentsFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_FontGetFontExtentsFuncT
    -> HarfBuzz.FontT.FontT
    -> Ptr ()
    -> HarfBuzz.FontExtentsT.FontExtentsT
    -> Ptr ()
    -> m Int32
dynamic_FontGetFontExtentsFuncT :: FunPtr C_FontGetFontExtentsFuncT
-> FontT -> Ptr () -> FontExtentsT -> Ptr () -> m Int32
dynamic_FontGetFontExtentsFuncT FunPtr C_FontGetFontExtentsFuncT
__funPtr FontT
font Ptr ()
fontData FontExtentsT
extents Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontExtentsT
extents' <- FontExtentsT -> IO (Ptr FontExtentsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontExtentsT
extents
    Int32
result <- (FunPtr C_FontGetFontExtentsFuncT -> C_FontGetFontExtentsFuncT
__dynamic_C_FontGetFontExtentsFuncT FunPtr C_FontGetFontExtentsFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Ptr FontExtentsT
extents' Ptr ()
userData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FontExtentsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontExtentsT
extents
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type FontGetFontExtentsFuncT =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> HarfBuzz.FontExtentsT.FontExtentsT
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetFontExtentsFuncT`@.
noFontGetFontExtentsFuncT :: Maybe FontGetFontExtentsFuncT
noFontGetFontExtentsFuncT :: Maybe FontGetFontExtentsFuncT
noFontGetFontExtentsFuncT = Maybe FontGetFontExtentsFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type FontGetFontExtentsFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -> Ptr ()
    -> HarfBuzz.FontExtentsT.FontExtentsT
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `FontGetFontExtentsFuncT_WithClosures`@.
noFontGetFontExtentsFuncT_WithClosures :: Maybe FontGetFontExtentsFuncT_WithClosures
noFontGetFontExtentsFuncT_WithClosures :: Maybe FontGetFontExtentsFuncT_WithClosures
noFontGetFontExtentsFuncT_WithClosures = Maybe FontGetFontExtentsFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetFontExtentsFuncT :: FontGetFontExtentsFuncT -> FontGetFontExtentsFuncT_WithClosures
drop_closures_FontGetFontExtentsFuncT :: FontGetFontExtentsFuncT -> FontGetFontExtentsFuncT_WithClosures
drop_closures_FontGetFontExtentsFuncT FontGetFontExtentsFuncT
_f FontT
font Ptr ()
fontData FontExtentsT
extents Ptr ()
_ = FontGetFontExtentsFuncT
_f FontT
font Ptr ()
fontData FontExtentsT
extents

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetFontExtentsFuncT :: MonadIO m => FontGetFontExtentsFuncT -> m (GClosure C_FontGetFontExtentsFuncT)
genClosure_FontGetFontExtentsFuncT :: FontGetFontExtentsFuncT -> m (GClosure C_FontGetFontExtentsFuncT)
genClosure_FontGetFontExtentsFuncT FontGetFontExtentsFuncT
cb = IO (GClosure C_FontGetFontExtentsFuncT)
-> m (GClosure C_FontGetFontExtentsFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetFontExtentsFuncT)
 -> m (GClosure C_FontGetFontExtentsFuncT))
-> IO (GClosure C_FontGetFontExtentsFuncT)
-> m (GClosure C_FontGetFontExtentsFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetFontExtentsFuncT_WithClosures
cb' = FontGetFontExtentsFuncT -> FontGetFontExtentsFuncT_WithClosures
drop_closures_FontGetFontExtentsFuncT FontGetFontExtentsFuncT
cb
    let cb'' :: C_FontGetFontExtentsFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT))
-> FontGetFontExtentsFuncT_WithClosures
-> C_FontGetFontExtentsFuncT
wrap_FontGetFontExtentsFuncT Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT))
forall a. Maybe a
Nothing FontGetFontExtentsFuncT_WithClosures
cb'
    C_FontGetFontExtentsFuncT -> IO (FunPtr C_FontGetFontExtentsFuncT)
mk_FontGetFontExtentsFuncT C_FontGetFontExtentsFuncT
cb'' IO (FunPtr C_FontGetFontExtentsFuncT)
-> (FunPtr C_FontGetFontExtentsFuncT
    -> IO (GClosure C_FontGetFontExtentsFuncT))
-> IO (GClosure C_FontGetFontExtentsFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetFontExtentsFuncT
-> IO (GClosure C_FontGetFontExtentsFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FontGetFontExtentsFuncT` into a `C_FontGetFontExtentsFuncT`.
wrap_FontGetFontExtentsFuncT ::
    Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT)) ->
    FontGetFontExtentsFuncT_WithClosures ->
    C_FontGetFontExtentsFuncT
wrap_FontGetFontExtentsFuncT :: Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT))
-> FontGetFontExtentsFuncT_WithClosures
-> C_FontGetFontExtentsFuncT
wrap_FontGetFontExtentsFuncT Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT))
funptrptr FontGetFontExtentsFuncT_WithClosures
_cb Ptr FontT
font Ptr ()
fontData Ptr FontExtentsT
extents Ptr ()
userData = do
    (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        FontExtentsT
extents' <- ((ManagedPtr FontExtentsT -> FontExtentsT)
-> Ptr FontExtentsT -> IO FontExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr FontExtentsT -> FontExtentsT
HarfBuzz.FontExtentsT.FontExtentsT) Ptr FontExtentsT
extents
        Int32
result <- FontGetFontExtentsFuncT_WithClosures
_cb  FontT
font' Ptr ()
fontData FontExtentsT
extents' Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetFontExtentsFuncT))
funptrptr
        Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- callback DestroyFuncT
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 0
          , 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_DestroyFuncT =
    Ptr () ->
    IO ()

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

foreign import ccall "dynamic" __dynamic_C_DestroyFuncT :: FunPtr C_DestroyFuncT -> C_DestroyFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_DestroyFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_DestroyFuncT
    -> Ptr ()
    -> m ()
dynamic_DestroyFuncT :: FunPtr C_DestroyFuncT -> Ptr () -> m ()
dynamic_DestroyFuncT FunPtr C_DestroyFuncT
__funPtr Ptr ()
userData = 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 C_DestroyFuncT -> C_DestroyFuncT
__dynamic_C_DestroyFuncT FunPtr C_DestroyFuncT
__funPtr) Ptr ()
userData
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

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

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

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

-- | A convenience synonym for @`Nothing` :: `Maybe` `DestroyFuncT_WithClosures`@.
noDestroyFuncT_WithClosures :: Maybe DestroyFuncT_WithClosures
noDestroyFuncT_WithClosures :: Maybe C_DestroyFuncT
noDestroyFuncT_WithClosures = Maybe C_DestroyFuncT
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_DestroyFuncT :: DestroyFuncT -> DestroyFuncT_WithClosures
drop_closures_DestroyFuncT :: IO () -> C_DestroyFuncT
drop_closures_DestroyFuncT IO ()
_f Ptr ()
_ = IO ()
_f 

-- | Wrap the callback into a `GClosure`.
genClosure_DestroyFuncT :: MonadIO m => DestroyFuncT -> m (GClosure C_DestroyFuncT)
genClosure_DestroyFuncT :: IO () -> m (GClosure C_DestroyFuncT)
genClosure_DestroyFuncT IO ()
cb = IO (GClosure C_DestroyFuncT) -> m (GClosure C_DestroyFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DestroyFuncT) -> m (GClosure C_DestroyFuncT))
-> IO (GClosure C_DestroyFuncT) -> m (GClosure C_DestroyFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_DestroyFuncT
cb' = IO () -> C_DestroyFuncT
drop_closures_DestroyFuncT IO ()
cb
    let cb'' :: C_DestroyFuncT
cb'' = Maybe (Ptr (FunPtr C_DestroyFuncT))
-> C_DestroyFuncT -> C_DestroyFuncT
wrap_DestroyFuncT Maybe (Ptr (FunPtr C_DestroyFuncT))
forall a. Maybe a
Nothing C_DestroyFuncT
cb'
    C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
mk_DestroyFuncT C_DestroyFuncT
cb'' IO (FunPtr C_DestroyFuncT)
-> (FunPtr C_DestroyFuncT -> IO (GClosure C_DestroyFuncT))
-> IO (GClosure C_DestroyFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DestroyFuncT -> IO (GClosure C_DestroyFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `DestroyFuncT` into a `C_DestroyFuncT`.
wrap_DestroyFuncT ::
    Maybe (Ptr (FunPtr C_DestroyFuncT)) ->
    DestroyFuncT_WithClosures ->
    C_DestroyFuncT
wrap_DestroyFuncT :: Maybe (Ptr (FunPtr C_DestroyFuncT))
-> C_DestroyFuncT -> C_DestroyFuncT
wrap_DestroyFuncT Maybe (Ptr (FunPtr C_DestroyFuncT))
funptrptr C_DestroyFuncT
_cb Ptr ()
userData = do
    C_DestroyFuncT
_cb  Ptr ()
userData
    Maybe (Ptr (FunPtr C_DestroyFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_DestroyFuncT))
funptrptr


-- callback BufferMessageFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "buffer"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "message"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , 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_BufferMessageFuncT =
    Ptr HarfBuzz.BufferT.BufferT ->
    Ptr HarfBuzz.FontT.FontT ->
    CString ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BufferMessageFuncT :: FunPtr C_BufferMessageFuncT -> C_BufferMessageFuncT

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BufferMessageFuncT ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_BufferMessageFuncT
    -> HarfBuzz.BufferT.BufferT
    -> HarfBuzz.FontT.FontT
    -> T.Text
    -> Ptr ()
    -> m Int32
dynamic_BufferMessageFuncT :: FunPtr C_BufferMessageFuncT
-> BufferT -> FontT -> Text -> Ptr () -> m Int32
dynamic_BufferMessageFuncT FunPtr C_BufferMessageFuncT
__funPtr BufferT
buffer FontT
font Text
message Ptr ()
userData = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    CString
message' <- Text -> IO CString
textToCString Text
message
    Int32
result <- (FunPtr C_BufferMessageFuncT -> C_BufferMessageFuncT
__dynamic_C_BufferMessageFuncT FunPtr C_BufferMessageFuncT
__funPtr) Ptr BufferT
buffer' Ptr FontT
font' CString
message' Ptr ()
userData
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
message'
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result

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

-- | /No description available in the introspection data./
type BufferMessageFuncT =
    HarfBuzz.BufferT.BufferT
    -> HarfBuzz.FontT.FontT
    -> T.Text
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `BufferMessageFuncT`@.
noBufferMessageFuncT :: Maybe BufferMessageFuncT
noBufferMessageFuncT :: Maybe BufferMessageFuncT
noBufferMessageFuncT = Maybe BufferMessageFuncT
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type BufferMessageFuncT_WithClosures =
    HarfBuzz.BufferT.BufferT
    -> HarfBuzz.FontT.FontT
    -> T.Text
    -> Ptr ()
    -> IO Int32

-- | A convenience synonym for @`Nothing` :: `Maybe` `BufferMessageFuncT_WithClosures`@.
noBufferMessageFuncT_WithClosures :: Maybe BufferMessageFuncT_WithClosures
noBufferMessageFuncT_WithClosures :: Maybe BufferMessageFuncT_WithClosures
noBufferMessageFuncT_WithClosures = Maybe BufferMessageFuncT_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_BufferMessageFuncT :: BufferMessageFuncT -> BufferMessageFuncT_WithClosures
drop_closures_BufferMessageFuncT :: BufferMessageFuncT -> BufferMessageFuncT_WithClosures
drop_closures_BufferMessageFuncT BufferMessageFuncT
_f BufferT
buffer FontT
font Text
message Ptr ()
_ = BufferMessageFuncT
_f BufferT
buffer FontT
font Text
message

-- | Wrap the callback into a `GClosure`.
genClosure_BufferMessageFuncT :: MonadIO m => BufferMessageFuncT -> m (GClosure C_BufferMessageFuncT)
genClosure_BufferMessageFuncT :: BufferMessageFuncT -> m (GClosure C_BufferMessageFuncT)
genClosure_BufferMessageFuncT BufferMessageFuncT
cb = IO (GClosure C_BufferMessageFuncT)
-> m (GClosure C_BufferMessageFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BufferMessageFuncT)
 -> m (GClosure C_BufferMessageFuncT))
-> IO (GClosure C_BufferMessageFuncT)
-> m (GClosure C_BufferMessageFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: BufferMessageFuncT_WithClosures
cb' = BufferMessageFuncT -> BufferMessageFuncT_WithClosures
drop_closures_BufferMessageFuncT BufferMessageFuncT
cb
    let cb'' :: C_BufferMessageFuncT
cb'' = Maybe (Ptr (FunPtr C_BufferMessageFuncT))
-> BufferMessageFuncT_WithClosures -> C_BufferMessageFuncT
wrap_BufferMessageFuncT Maybe (Ptr (FunPtr C_BufferMessageFuncT))
forall a. Maybe a
Nothing BufferMessageFuncT_WithClosures
cb'
    C_BufferMessageFuncT -> IO (FunPtr C_BufferMessageFuncT)
mk_BufferMessageFuncT C_BufferMessageFuncT
cb'' IO (FunPtr C_BufferMessageFuncT)
-> (FunPtr C_BufferMessageFuncT
    -> IO (GClosure C_BufferMessageFuncT))
-> IO (GClosure C_BufferMessageFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BufferMessageFuncT -> IO (GClosure C_BufferMessageFuncT)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BufferMessageFuncT` into a `C_BufferMessageFuncT`.
wrap_BufferMessageFuncT ::
    Maybe (Ptr (FunPtr C_BufferMessageFuncT)) ->
    BufferMessageFuncT_WithClosures ->
    C_BufferMessageFuncT
wrap_BufferMessageFuncT :: Maybe (Ptr (FunPtr C_BufferMessageFuncT))
-> BufferMessageFuncT_WithClosures -> C_BufferMessageFuncT
wrap_BufferMessageFuncT Maybe (Ptr (FunPtr C_BufferMessageFuncT))
funptrptr BufferMessageFuncT_WithClosures
_cb Ptr BufferT
buffer Ptr FontT
font CString
message Ptr ()
userData = do
    (ManagedPtr BufferT -> BufferT)
-> Ptr BufferT -> (BufferT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr BufferT -> BufferT
HarfBuzz.BufferT.BufferT Ptr BufferT
buffer ((BufferT -> IO Int32) -> IO Int32)
-> (BufferT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \BufferT
buffer' -> do
        (ManagedPtr FontT -> FontT)
-> Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT Ptr FontT
font ((FontT -> IO Int32) -> IO Int32)
-> (FontT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
            Text
message' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
message
            Int32
result <- BufferMessageFuncT_WithClosures
_cb  BufferT
buffer' FontT
font' Text
message' Ptr ()
userData
            Maybe (Ptr (FunPtr C_BufferMessageFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BufferMessageFuncT))
funptrptr
            Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result