-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- 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                       ,


-- ** 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      ,


-- ** 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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

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.FontT as HarfBuzz.FontT
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 = Just "The #hb_script_t of @unicode"
        , 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-functions structure"
                , 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 = Just "The code point to query"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_unicode_funcs_t structure.\n\nThis method should retrieve the Script property for a\nspecified Unicode code point."
        , 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 = Just "A Unicode-functions structure"
--                 , 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 = Just "The code point to query"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.ScriptT' of /@unicode@/
dynamic_UnicodeScriptFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the Script property for a
-- specified Unicode code point.
type UnicodeScriptFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> IO HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.ScriptT' of /@unicode@/

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the Script property for a
-- specified Unicode code point.
type UnicodeScriptFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.ScriptT' of /@unicode@/

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeScriptFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 =
            Just "The #hb_codepoint_t of the Mirroring Glyph for @unicode"
        , 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-functions structure"
                , 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 = Just "The code point to query"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_unicode_funcs_t structure.\n\nThis method should retrieve the Bi-Directional Mirroring Glyph\ncode point for a specified Unicode code point.\n\n<note>Note: If a code point does not have a specified\nBi-Directional Mirroring Glyph defined, the method should\nreturn the original code point.</note>"
        , 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 = Just "A Unicode-functions structure"
--                 , 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 = Just "The code point to query"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m Word32
    -- ^ __Returns:__ The @/hb_codepoint_t/@ of the Mirroring Glyph for /@unicode@/
dynamic_UnicodeMirroringFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the Bi-Directional Mirroring Glyph
-- code point for a specified Unicode code point.
-- 
-- \<note>Note: If a code point does not have a specified
-- Bi-Directional Mirroring Glyph defined, the method should
-- return the original code point.\<\/note>
type UnicodeMirroringFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> IO Word32
    -- ^ __Returns:__ The @/hb_codepoint_t/@ of the Mirroring Glyph for /@unicode@/

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the Bi-Directional Mirroring Glyph
-- code point for a specified Unicode code point.
-- 
-- \<note>Note: If a code point does not have a specified
-- Bi-Directional Mirroring Glyph defined, the method should
-- return the original code point.\<\/note>
type UnicodeMirroringFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO Word32
    -- ^ __Returns:__ The @/hb_codepoint_t/@ of the Mirroring Glyph for /@unicode@/

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeMirroringFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 =
            Just "The #hb_unicode_general_category_t of @unicode"
        , 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-functions structure"
                , 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 = Just "The code point to query"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_unicode_funcs_t structure.\n\nThis method should retrieve the General Category property for\na specified Unicode code point."
        , 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 = Just "A Unicode-functions structure"
--                 , 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 = Just "The code point to query"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m HarfBuzz.Enums.UnicodeGeneralCategoryT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeGeneralCategoryT' of /@unicode@/
dynamic_UnicodeGeneralCategoryFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the General Category property for
-- a specified Unicode code point.
type UnicodeGeneralCategoryFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> IO HarfBuzz.Enums.UnicodeGeneralCategoryT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeGeneralCategoryT' of /@unicode@/

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the General Category property for
-- a specified Unicode code point.
type UnicodeGeneralCategoryFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO HarfBuzz.Enums.UnicodeGeneralCategoryT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeGeneralCategoryT' of /@unicode@/

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeGeneralCategoryFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 = Just "A Unicode-functions structure"
                , 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 = Just "The code point to query"
                , 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 passed by the caller"
                , 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 =
            Just "A virtual method for the #hb_unicode_funcs_t structure."
        , 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 = Just "A Unicode-functions structure"
--                 , 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 = Just "The code point to query"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m Word32
dynamic_UnicodeEastasianWidthFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)"] #-}
-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
type UnicodeEastasianWidthFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> IO Word32

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
type UnicodeEastasianWidthFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeMirroringFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 = Just "%true if @ab decomposed, %false otherwise"
        , 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-functions structure"
                , 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 = Just "The code point to decompose"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "a"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The first decomposed code point"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "b"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The second decomposed code point"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_unicode_funcs_t structure.\n\nThis method should decompose an input Unicode code point,\nreturning the two decomposed code points in #hb_codepoint_t\noutput parameters (if successful). The method must return an\n#hb_bool_t indicating the success of the composition."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_UnicodeDecomposeFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Ptr Word32 ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A Unicode-functions structure"
--                 , 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 = Just "The code point to decompose"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "a"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The first decomposed code point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "b"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The second decomposed code point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data pointer passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@ab@/: The code point to decompose
    -> Ptr ()
    -- ^ /@userData@/: user data pointer passed by the caller
    -> m ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if /@ab@/ decomposed, @/false/@ otherwise
dynamic_UnicodeDecomposeFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_UnicodeDecomposeFuncT
-> UnicodeFuncsT -> Word32 -> Ptr () -> m (Int32, Word32, Word32)
dynamic_UnicodeDecomposeFuncT FunPtr C_UnicodeDecomposeFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
ab Ptr ()
userData = IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32, Word32) -> m (Int32, Word32, Word32))
-> IO (Int32, Word32, Word32) -> m (Int32, Word32, 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
    Ptr Word32
a <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
b <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_UnicodeDecomposeFuncT -> C_UnicodeDecomposeFuncT
__dynamic_C_UnicodeDecomposeFuncT FunPtr C_UnicodeDecomposeFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
ab Ptr Word32
a Ptr Word32
b Ptr ()
userData
    Word32
a' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
a
    Word32
b' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
b
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
a
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
b
    (Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
a', Word32
b')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should decompose an input Unicode code point,
-- returning the two decomposed code points in @/hb_codepoint_t/@
-- output parameters (if successful). The method must return an
-- @/hb_bool_t/@ indicating the success of the composition.
type UnicodeDecomposeFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@ab@/: The code point to decompose
    -> IO ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if /@ab@/ decomposed, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should decompose an input Unicode code point,
-- returning the two decomposed code points in @/hb_codepoint_t/@
-- output parameters (if successful). The method must return an
-- @/hb_bool_t/@ indicating the success of the composition.
type UnicodeDecomposeFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@ab@/: The code point to decompose
    -> Ptr ()
    -- ^ /@userData@/: user data pointer passed by the caller
    -> IO ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if /@ab@/ decomposed, @/false/@ otherwise

-- | 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 Ptr ()
_ = UnicodeDecomposeFuncT
_f UnicodeFuncsT
ufuncs Word32
ab

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeDecomposeFuncT :: MonadIO m => UnicodeDecomposeFuncT -> m (GClosure C_UnicodeDecomposeFuncT)
genClosure_UnicodeDecomposeFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeDecomposeFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
ab Ptr Word32
a Ptr Word32
b Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Word32
outa, Word32
outb) <- UnicodeDecomposeFuncT_WithClosures
gi'cb  UnicodeFuncsT
ufuncs' Word32
ab Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
a Word32
outa
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
b Word32
outb
        Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeDecomposeFuncT))
gi'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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeDecomposeCompatibilityFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
u Word32
decomposed Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 = Just "%true is @a,@b composed, %false otherwise"
        , 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-functions structure"
                , 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 = Just "The first code point to compose"
                , 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 = Just "The second code point to compose"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "ab"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The composed code point"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_unicode_funcs_t structure.\n\nThis method should compose a sequence of two input Unicode code\npoints by canonical equivalence, returning the composed code\npoint in a #hb_codepoint_t output parameter (if successful).\nThe method must return an #hb_bool_t indicating the success\nof the composition."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_UnicodeComposeFuncT =
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT ->
    Word32 ->
    Word32 ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A Unicode-functions structure"
--                 , 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 = Just "The first code point to compose"
--                 , 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 = Just "The second code point to compose"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ab"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The composed code point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data pointer passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@a@/: The first code point to compose
    -> Word32
    -- ^ /@b@/: The second code point to compose
    -> Ptr ()
    -- ^ /@userData@/: user data pointer passed by the caller
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ is /@a@/,/@b@/ composed, @/false/@ otherwise
dynamic_UnicodeComposeFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_UnicodeComposeFuncT
-> UnicodeFuncsT -> Word32 -> Word32 -> Ptr () -> m (Int32, Word32)
dynamic_UnicodeComposeFuncT FunPtr C_UnicodeComposeFuncT
__funPtr UnicodeFuncsT
ufuncs Word32
a Word32
b Ptr ()
userData = IO (Int32, Word32) -> m (Int32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32) -> m (Int32, Word32))
-> IO (Int32, Word32) -> m (Int32, 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
    Ptr Word32
ab <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_UnicodeComposeFuncT -> C_UnicodeComposeFuncT
__dynamic_C_UnicodeComposeFuncT FunPtr C_UnicodeComposeFuncT
__funPtr) Ptr UnicodeFuncsT
ufuncs' Word32
a Word32
b Ptr Word32
ab Ptr ()
userData
    Word32
ab' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
ab
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
ab
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
ab')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should compose a sequence of two input Unicode code
-- points by canonical equivalence, returning the composed code
-- point in a @/hb_codepoint_t/@ output parameter (if successful).
-- The method must return an @/hb_bool_t/@ indicating the success
-- of the composition.
type UnicodeComposeFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@a@/: The first code point to compose
    -> Word32
    -- ^ /@b@/: The second code point to compose
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ is /@a@/,/@b@/ composed, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should compose a sequence of two input Unicode code
-- points by canonical equivalence, returning the composed code
-- point in a @/hb_codepoint_t/@ output parameter (if successful).
-- The method must return an @/hb_bool_t/@ indicating the success
-- of the composition.
type UnicodeComposeFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@a@/: The first code point to compose
    -> Word32
    -- ^ /@b@/: The second code point to compose
    -> Ptr ()
    -- ^ /@userData@/: user data pointer passed by the caller
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ is /@a@/,/@b@/ composed, @/false/@ otherwise

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_UnicodeComposeFuncT :: MonadIO m => UnicodeComposeFuncT -> m (GClosure C_UnicodeComposeFuncT)
genClosure_UnicodeComposeFuncT :: forall (m :: * -> *).
MonadIO m =>
UnicodeComposeFuncT -> m (GClosure C_UnicodeComposeFuncT)
genClosure_UnicodeComposeFuncT UnicodeComposeFuncT
cb = IO (GClosure C_UnicodeComposeFuncT)
-> m (GClosure C_UnicodeComposeFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_UnicodeComposeFuncT)
 -> m (GClosure C_UnicodeComposeFuncT))
-> IO (GClosure C_UnicodeComposeFuncT)
-> m (GClosure C_UnicodeComposeFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: UnicodeComposeFuncT_WithClosures
cb' = UnicodeComposeFuncT -> UnicodeComposeFuncT_WithClosures
drop_closures_UnicodeComposeFuncT UnicodeComposeFuncT
cb
    let cb'' :: C_UnicodeComposeFuncT
cb'' = Maybe (Ptr (FunPtr C_UnicodeComposeFuncT))
-> UnicodeComposeFuncT_WithClosures -> C_UnicodeComposeFuncT
wrap_UnicodeComposeFuncT Maybe (Ptr (FunPtr C_UnicodeComposeFuncT))
forall a. Maybe a
Nothing UnicodeComposeFuncT_WithClosures
cb'
    C_UnicodeComposeFuncT -> IO (FunPtr C_UnicodeComposeFuncT)
mk_UnicodeComposeFuncT C_UnicodeComposeFuncT
cb'' IO (FunPtr C_UnicodeComposeFuncT)
-> (FunPtr C_UnicodeComposeFuncT
    -> IO (GClosure C_UnicodeComposeFuncT))
-> IO (GClosure C_UnicodeComposeFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_UnicodeComposeFuncT -> IO (GClosure C_UnicodeComposeFuncT)
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_UnicodeComposeFuncT))
-> UnicodeComposeFuncT_WithClosures -> C_UnicodeComposeFuncT
wrap_UnicodeComposeFuncT Maybe (Ptr (FunPtr C_UnicodeComposeFuncT))
gi'funptrptr UnicodeComposeFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
a Word32
b Ptr Word32
ab Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Word32
outab) <- UnicodeComposeFuncT_WithClosures
gi'cb  UnicodeFuncsT
ufuncs' Word32
a Word32
b Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
ab Word32
outab
        Maybe (Ptr (FunPtr C_UnicodeComposeFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_UnicodeComposeFuncT))
gi'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 = Just "The #hb_unicode_combining_class_t of @unicode"
        , 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-functions structure"
                , 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 = Just "The code point to query"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_unicode_funcs_t structure.\n\nThis method should retrieve the Canonical Combining Class (ccc)\nproperty for a specified Unicode code point."
        , 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 = Just "A Unicode-functions structure"
--                 , 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 = Just "The code point to query"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m HarfBuzz.Enums.UnicodeCombiningClassT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeCombiningClassT' of /@unicode@/
dynamic_UnicodeCombiningClassFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the Canonical Combining Class (ccc)
-- property for a specified Unicode code point.
type UnicodeCombiningClassFuncT =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> IO HarfBuzz.Enums.UnicodeCombiningClassT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeCombiningClassT' of /@unicode@/

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure.
-- 
-- This method should retrieve the Canonical Combining Class (ccc)
-- property for a specified Unicode code point.
type UnicodeCombiningClassFuncT_WithClosures =
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: A Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO HarfBuzz.Enums.UnicodeCombiningClassT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeCombiningClassT' of /@unicode@/

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr UnicodeCombiningClassFuncT_WithClosures
gi'cb Ptr UnicodeFuncsT
ufuncs Word32
unicode Ptr ()
userData = do
    Ptr UnicodeFuncsT -> (UnicodeFuncsT -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 = Just "A pointer to the @tag table within @face"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "face"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "an #hb_face_t to reference table for"
                , 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 = Just "the tag of the table to reference"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "Callback function for hb_face_create_for_tables()."
        , sinceVersion = Just "0.9.2"
        }
  , 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 = Just "an #hb_face_t to reference table for"
--                 , 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 = Just "the tag of the table to reference"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@face@/: an t'GI.HarfBuzz.Structs.FaceT.FaceT' to reference table for
    -> Word32
    -- ^ /@tag@/: the tag of the table to reference
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ A pointer to the /@tag@/ table within /@face@/
dynamic_ReferenceTableFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | Callback function for 'GI.HarfBuzz.Functions.faceCreateForTables'.
-- 
-- /Since: 0.9.2/
type ReferenceTableFuncT =
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: an t'GI.HarfBuzz.Structs.FaceT.FaceT' to reference table for
    -> Word32
    -- ^ /@tag@/: the tag of the table to reference
    -> IO HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ A pointer to the /@tag@/ table within /@face@/

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

-- | Callback function for 'GI.HarfBuzz.Functions.faceCreateForTables'.
-- 
-- /Since: 0.9.2/
type ReferenceTableFuncT_WithClosures =
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: an t'GI.HarfBuzz.Structs.FaceT.FaceT' to reference table for
    -> Word32
    -- ^ /@tag@/: the tag of the table to reference
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ A pointer to the /@tag@/ table within /@face@/

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr ReferenceTableFuncT_WithClosures
gi'cb Ptr FaceT
face Word32
tag Ptr ()
userData = do
    Ptr FaceT -> (FaceT -> IO (Ptr BlobT)) -> IO (Ptr BlobT)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The Unicode code point to query"
                , 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 = Just "The  variation-selector code point to query"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The glyph ID retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the glyph ID for a specified Unicode code point\nfollowed by a specified Variation Selector code point. Glyph IDs must be\nreturned in a #hb_codepoint_t output parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetVariationGlyphFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The Unicode code point to query"
--                 , 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 = Just "The  variation-selector code point to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The glyph ID retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetVariationGlyphFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetVariationGlyphFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Ptr ()
-> m (Int32, Word32)
dynamic_FontGetVariationGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr ()
userData = IO (Int32, Word32) -> m (Int32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32) -> m (Int32, Word32))
-> IO (Int32, Word32) -> m (Int32, 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
    Ptr Word32
glyph <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_FontGetVariationGlyphFuncT -> C_FontGetVariationGlyphFuncT
__dynamic_C_FontGetVariationGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr Word32
glyph Ptr ()
userData
    Word32
glyph' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
glyph
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
glyph
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
glyph')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph ID for a specified Unicode code point
-- followed by a specified Variation Selector code point. Glyph IDs must be
-- returned in a @/hb_codepoint_t/@ output parameter.
type FontGetVariationGlyphFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph ID for a specified Unicode code point
-- followed by a specified Variation Selector code point. Glyph IDs must be
-- returned in a @/hb_codepoint_t/@ output parameter.
type FontGetVariationGlyphFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetVariationGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetVariationGlyphFuncT :: MonadIO m => FontGetVariationGlyphFuncT -> m (GClosure C_FontGetVariationGlyphFuncT)
genClosure_FontGetVariationGlyphFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetVariationGlyphFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr Word32
glyph Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Word32
outglyph) <- FontGetVariationGlyphFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
glyph Word32
outglyph
        Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
gi'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 = Just "the number of code points processed"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "number of code points to query"
                , 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 = Just "The first Unicode code point to query"
                , 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 = Just "The stride between successive code points"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The first glyph ID retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "glyph_stride"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The stride between successive glyph IDs"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 7
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the nominal glyph IDs for a sequence of\nUnicode code points. Glyph IDs must be returned in a #hb_codepoint_t\noutput parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetNominalGlyphsFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr Word32 ->
    Word32 ->
    Ptr () ->
    IO Word32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "number of code points to query"
--                 , 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 = Just "The first Unicode code point to query"
--                 , 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 = Just "The stride between successive code points"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The first glyph ID retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "glyph_stride"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The stride between successive glyph IDs"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@count@/: number of code points to query
    -> Word32
    -- ^ /@firstUnicode@/: The first Unicode code point to query
    -> Word32
    -- ^ /@unicodeStride@/: The stride between successive code points
    -> Word32
    -- ^ /@glyphStride@/: The stride between successive glyph IDs
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Word32, Word32))
    -- ^ __Returns:__ the number of code points processed
dynamic_FontGetNominalGlyphsFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetNominalGlyphsFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr ()
-> m (Word32, Word32)
dynamic_FontGetNominalGlyphsFuncT FunPtr C_FontGetNominalGlyphsFuncT
__funPtr FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
glyphStride Ptr ()
userData = IO (Word32, Word32) -> m (Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, Word32) -> m (Word32, Word32))
-> IO (Word32, Word32) -> m (Word32, 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
    Ptr Word32
firstGlyph <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    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 Ptr Word32
firstGlyph Word32
glyphStride Ptr ()
userData
    Word32
firstGlyph' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
firstGlyph
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
firstGlyph
    (Word32, Word32) -> IO (Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, Word32
firstGlyph')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the nominal glyph IDs for a sequence of
-- Unicode code points. Glyph IDs must be returned in a @/hb_codepoint_t/@
-- output parameter.
type FontGetNominalGlyphsFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@count@/: number of code points to query
    -> Word32
    -- ^ /@firstUnicode@/: The first Unicode code point to query
    -> Word32
    -- ^ /@unicodeStride@/: The stride between successive code points
    -> Word32
    -- ^ /@glyphStride@/: The stride between successive glyph IDs
    -> IO ((Word32, Word32))
    -- ^ __Returns:__ the number of code points processed

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the nominal glyph IDs for a sequence of
-- Unicode code points. Glyph IDs must be returned in a @/hb_codepoint_t/@
-- output parameter.
type FontGetNominalGlyphsFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@count@/: number of code points to query
    -> Word32
    -- ^ /@firstUnicode@/: The first Unicode code point to query
    -> Word32
    -- ^ /@unicodeStride@/: The stride between successive code points
    -> Word32
    -- ^ /@glyphStride@/: The stride between successive glyph IDs
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Word32, Word32))
    -- ^ __Returns:__ the number of code points processed

-- | 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
glyphStride Ptr ()
_ = FontGetNominalGlyphsFuncT
_f FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
glyphStride

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetNominalGlyphsFuncT :: MonadIO m => FontGetNominalGlyphsFuncT -> m (GClosure C_FontGetNominalGlyphsFuncT)
genClosure_FontGetNominalGlyphsFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetNominalGlyphsFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Ptr Word32
firstGlyph Word32
glyphStride Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Word32) -> IO Word32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Word32
outfirstGlyph) <- FontGetNominalGlyphsFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
count Word32
firstUnicode Word32
unicodeStride Word32
glyphStride Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
firstGlyph Word32
outfirstGlyph
        Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetNominalGlyphsFuncT))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The Unicode code point to query"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The glyph ID retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the nominal glyph ID for a specified Unicode code\npoint. Glyph IDs must be returned in a #hb_codepoint_t output parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetNominalGlyphFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The Unicode code point to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The glyph ID retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetNominalGlyphFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetNominalGlyphFuncT
-> FontT -> Ptr () -> Word32 -> Ptr () -> m (Int32, Word32)
dynamic_FontGetNominalGlyphFuncT FunPtr C_FontGetNominalGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
unicode Ptr ()
userData = IO (Int32, Word32) -> m (Int32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32) -> m (Int32, Word32))
-> IO (Int32, Word32) -> m (Int32, 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
    Ptr Word32
glyph <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_FontGetNominalGlyphFuncT -> C_FontGetNominalGlyphFuncT
__dynamic_C_FontGetNominalGlyphFuncT FunPtr C_FontGetNominalGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
unicode Ptr Word32
glyph Ptr ()
userData
    Word32
glyph' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
glyph
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
glyph
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
glyph')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the nominal glyph ID for a specified Unicode code
-- point. Glyph IDs must be returned in a @/hb_codepoint_t/@ output parameter.
type FontGetNominalGlyphFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the nominal glyph ID for a specified Unicode code
-- point. Glyph IDs must be returned in a @/hb_codepoint_t/@ output parameter.
type FontGetNominalGlyphFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetNominalGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetNominalGlyphFuncT :: MonadIO m => FontGetNominalGlyphFuncT -> m (GClosure C_FontGetNominalGlyphFuncT)
genClosure_FontGetNominalGlyphFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetNominalGlyphFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
unicode Ptr Word32
glyph Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Word32
outglyph) <- FontGetNominalGlyphFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
unicode Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
glyph Word32
outglyph
        Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetNominalGlyphFuncT))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The glyph ID to query"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "x"
          , argType = TBasicType TInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The X coordinate of the origin"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "y"
          , argType = TBasicType TInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The Y coordinate of the origin"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the (X,Y) coordinates (in font units) of the\norigin for a glyph. Each coordinate must be returned in an #hb_position_t\noutput parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetGlyphOriginFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Ptr Int32 ->
    Ptr Int32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The glyph ID to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The X coordinate of the origin"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Y coordinate of the origin"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetGlyphOriginFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetGlyphOriginFuncT
-> FontT -> Ptr () -> Word32 -> Ptr () -> m (Int32, Int32, Int32)
dynamic_FontGetGlyphOriginFuncT FunPtr C_FontGetGlyphOriginFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Ptr ()
userData = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32))
-> IO (Int32, Int32, Int32) -> m (Int32, Int32, 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 Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Int32
result <- (FunPtr C_FontGetGlyphOriginFuncT -> C_FontGetGlyphOriginFuncT
__dynamic_C_FontGetGlyphOriginFuncT FunPtr C_FontGetGlyphOriginFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Ptr Int32
x Ptr Int32
y Ptr ()
userData
    Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
    Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
x
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
y
    (Int32, Int32, Int32) -> IO (Int32, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Int32
x', Int32
y')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the (X,Y) coordinates (in font units) of the
-- origin for a glyph. Each coordinate must be returned in an @/hb_position_t/@
-- output parameter.
type FontGetGlyphOriginFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> IO ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the (X,Y) coordinates (in font units) of the
-- origin for a glyph. Each coordinate must be returned in an @/hb_position_t/@
-- output parameter.
type FontGetGlyphOriginFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetGlyphOriginFuncT
_f FontT
font Ptr ()
fontData Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphOriginFuncT :: MonadIO m => FontGetGlyphOriginFuncT -> m (GClosure C_FontGetGlyphOriginFuncT)
genClosure_FontGetGlyphOriginFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetGlyphOriginFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
glyph Ptr Int32
x Ptr Int32
y Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Int32
outx, Int32
outy) <- FontGetGlyphOriginFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
glyph Ptr ()
userData
        Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
x Int32
outx
        Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
y Int32
outy
        Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphOriginFuncT))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The glyph ID to query"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "name"
          , argType = TCArray False (-1) 4 (TBasicType TUTF8)
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "Name string retrieved for the glyph ID"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "size"
          , argType = TBasicType TUInt
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "Length of the glyph-name string retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the glyph name that corresponds to a\nglyph ID. The name should be returned in a string output parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetGlyphNameFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Ptr (Ptr CString) ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The glyph ID to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TCArray False (-1) 4 (TBasicType TUTF8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Name string retrieved for the glyph ID"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length of the glyph-name string retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Length of the glyph-name string retrieved"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, [T.Text]))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetGlyphNameFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetGlyphNameFuncT
-> FontT -> Ptr () -> Word32 -> Ptr () -> m (Int32, [Text])
dynamic_FontGetGlyphNameFuncT FunPtr C_FontGetGlyphNameFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Ptr ()
userData = IO (Int32, [Text]) -> m (Int32, [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, [Text]) -> m (Int32, [Text]))
-> IO (Int32, [Text]) -> m (Int32, [Text])
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 (Ptr CString)
name <- IO (Ptr (Ptr CString))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr CString))
    Ptr Word32
size <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_FontGetGlyphNameFuncT -> C_FontGetGlyphNameFuncT
__dynamic_C_FontGetGlyphNameFuncT FunPtr C_FontGetGlyphNameFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Ptr (Ptr CString)
name Ptr Word32
size Ptr ()
userData
    Word32
size' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
size
    Ptr CString
name' <- Ptr (Ptr CString) -> IO (Ptr CString)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CString)
name
    [Text]
name'' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
size') Ptr CString
name'
    (Word32 -> (CString -> IO ()) -> Ptr CString -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Word32
size') CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
name'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
name'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
name
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
size
    (Int32, [Text]) -> IO (Int32, [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, [Text]
name'')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph name that corresponds to a
-- glyph ID. The name should be returned in a string output parameter.
type FontGetGlyphNameFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> IO ((Int32, [T.Text]))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph name that corresponds to a
-- glyph ID. The name should be returned in a string output parameter.
type FontGetGlyphNameFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, [T.Text]))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetGlyphNameFuncT
_f FontT
font Ptr ()
fontData Word32
glyph

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphNameFuncT :: MonadIO m => FontGetGlyphNameFuncT -> m (GClosure C_FontGetGlyphNameFuncT)
genClosure_FontGetGlyphNameFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetGlyphNameFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
glyph Ptr (Ptr CString)
name Ptr Word32
size Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, [Text]
outname) <- FontGetGlyphNameFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
glyph Ptr ()
userData
        Ptr CString
outname' <- [Text] -> IO (Ptr CString)
packUTF8CArray [Text]
outname
        Ptr (Ptr CString) -> Ptr CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (Ptr CString)
name Ptr CString
outname'
        Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphNameFuncT))
gi'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 = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 =
                    Just "The glyph ID of the first glyph in the glyph pair"
                , 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 =
                    Just "The glyph ID of the second glyph in the glyph pair"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "This method should retrieve the kerning-adjustment value for a glyph-pair in\nthe specified font, for horizontal text segments."
        , 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 = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 =
--                     Just "The glyph ID of the first glyph in the glyph pair"
--                 , 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 =
--                     Just "The glyph ID of the second glyph in the glyph pair"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@firstGlyph@/: The glyph ID of the first glyph in the glyph pair
    -> Word32
    -- ^ /@secondGlyph@/: The glyph ID of the second glyph in the glyph pair
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m Int32
dynamic_FontGetGlyphKerningFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetGlyphKerningFuncT
-> FontT -> Ptr () -> Word32 -> Word32 -> Ptr () -> m Int32
dynamic_FontGetGlyphKerningFuncT FunPtr C_FontGetGlyphKerningFuncT
__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_FontGetGlyphKerningFuncT -> C_FontGetGlyphKerningFuncT
__dynamic_C_FontGetGlyphKerningFuncT FunPtr C_FontGetGlyphKerningFuncT
__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)

-- | This method should retrieve the kerning-adjustment value for a glyph-pair in
-- the specified font, for horizontal text segments.
type FontGetGlyphKerningFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@firstGlyph@/: The glyph ID of the first glyph in the glyph pair
    -> Word32
    -- ^ /@secondGlyph@/: The glyph ID of the second glyph in the glyph pair
    -> IO Int32

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

-- | This method should retrieve the kerning-adjustment value for a glyph-pair in
-- the specified font, for horizontal text segments.
type FontGetGlyphKerningFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@firstGlyph@/: The glyph ID of the first glyph in the glyph pair
    -> Word32
    -- ^ /@secondGlyph@/: The glyph ID of the second glyph in the glyph pair
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO Int32

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

-- | A simple wrapper that ignores the closure arguments.
drop_closures_FontGetGlyphKerningFuncT :: FontGetGlyphKerningFuncT -> FontGetGlyphKerningFuncT_WithClosures
drop_closures_FontGetGlyphKerningFuncT :: FontGetGlyphKerningFuncT -> FontGetGlyphKerningFuncT_WithClosures
drop_closures_FontGetGlyphKerningFuncT FontGetGlyphKerningFuncT
_f FontT
font Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
_ = FontGetGlyphKerningFuncT
_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 :: forall (m :: * -> *).
MonadIO m =>
FontGetGlyphKerningFuncT -> m (GClosure C_FontGetGlyphKerningFuncT)
genClosure_FontGetGlyphKerningFuncT FontGetGlyphKerningFuncT
cb = IO (GClosure C_FontGetGlyphKerningFuncT)
-> m (GClosure C_FontGetGlyphKerningFuncT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FontGetGlyphKerningFuncT)
 -> m (GClosure C_FontGetGlyphKerningFuncT))
-> IO (GClosure C_FontGetGlyphKerningFuncT)
-> m (GClosure C_FontGetGlyphKerningFuncT)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: FontGetGlyphKerningFuncT_WithClosures
cb' = FontGetGlyphKerningFuncT -> FontGetGlyphKerningFuncT_WithClosures
drop_closures_FontGetGlyphKerningFuncT FontGetGlyphKerningFuncT
cb
    let cb'' :: C_FontGetGlyphKerningFuncT
cb'' = Maybe (Ptr (FunPtr C_FontGetGlyphKerningFuncT))
-> FontGetGlyphKerningFuncT_WithClosures
-> C_FontGetGlyphKerningFuncT
wrap_FontGetGlyphKerningFuncT Maybe (Ptr (FunPtr C_FontGetGlyphKerningFuncT))
forall a. Maybe a
Nothing FontGetGlyphKerningFuncT_WithClosures
cb'
    C_FontGetGlyphKerningFuncT
-> IO (FunPtr C_FontGetGlyphKerningFuncT)
mk_FontGetGlyphKerningFuncT C_FontGetGlyphKerningFuncT
cb'' IO (FunPtr C_FontGetGlyphKerningFuncT)
-> (FunPtr C_FontGetGlyphKerningFuncT
    -> IO (GClosure C_FontGetGlyphKerningFuncT))
-> IO (GClosure C_FontGetGlyphKerningFuncT)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FontGetGlyphKerningFuncT
-> IO (GClosure C_FontGetGlyphKerningFuncT)
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_FontGetGlyphKerningFuncT))
-> FontGetGlyphKerningFuncT_WithClosures
-> C_FontGetGlyphKerningFuncT
wrap_FontGetGlyphKerningFuncT Maybe (Ptr (FunPtr C_FontGetGlyphKerningFuncT))
gi'funptrptr FontGetGlyphKerningFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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 <- FontGetGlyphKerningFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
firstGlyph Word32
secondGlyph Ptr ()
userData
        Maybe (Ptr (FunPtr C_FontGetGlyphKerningFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphKerningFuncT))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The Unicode code point to query"
                , 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 = Just "The  variation-selector code point to query"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The glyph ID retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated =
      Just
        DeprecationInfo
          { deprecatedSinceVersion = Just "1.2.3"
          , deprecationMessage = Nothing
          }
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the glyph ID for a specified Unicode code point\nfont, with an optional variation selector."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetGlyphFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The Unicode code point to query"
--                 , 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 = Just "The  variation-selector code point to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The glyph ID retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetGlyphFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetVariationGlyphFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Ptr ()
-> m (Int32, Word32)
dynamic_FontGetGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr ()
userData = IO (Int32, Word32) -> m (Int32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32) -> m (Int32, Word32))
-> IO (Int32, Word32) -> m (Int32, 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
    Ptr Word32
glyph <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_FontGetVariationGlyphFuncT -> C_FontGetVariationGlyphFuncT
__dynamic_C_FontGetGlyphFuncT FunPtr C_FontGetVariationGlyphFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr Word32
glyph Ptr ()
userData
    Word32
glyph' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
glyph
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
glyph
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
glyph')

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

{-# DEPRECATED FontGetGlyphFuncT ["(Since version 1.2.3)"] #-}
-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph ID for a specified Unicode code point
-- font, with an optional variation selector.
type FontGetGlyphFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph ID for a specified Unicode code point
-- font, with an optional variation selector.
type FontGetGlyphFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetVariationGlyphFuncT
_f FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphFuncT :: MonadIO m => FontGetGlyphFuncT -> m (GClosure C_FontGetGlyphFuncT)
genClosure_FontGetGlyphFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetVariationGlyphFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr Word32
glyph Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Word32
outglyph) <- FontGetVariationGlyphFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
unicode Word32
variationSelector Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
glyph Word32
outglyph
        Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetVariationGlyphFuncT))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "name"
          , argType = TCArray False (-1) 3 (TBasicType TUTF8)
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The name string to query"
                , 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 = Just "The length of the name queried"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "glyph"
          , argType = TBasicType TUInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The glyph ID retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 5
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the glyph ID that corresponds to a glyph-name\nstring."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetGlyphFromNameFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Ptr CString ->
    Int32 ->
    Ptr Word32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TCArray False (-1) 3 (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The name string to query"
--                 , 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 = Just "The length of the name queried"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The glyph ID retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 5
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The length of the name queried"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> [T.Text]
    -- ^ /@name@/: The name string to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetGlyphFromNameFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetGlyphFromNameFuncT
-> FontT -> Ptr () -> [Text] -> Ptr () -> m (Int32, Word32)
dynamic_FontGetGlyphFromNameFuncT FunPtr C_FontGetGlyphFromNameFuncT
__funPtr FontT
font Ptr ()
fontData [Text]
name Ptr ()
userData = IO (Int32, Word32) -> m (Int32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32) -> m (Int32, Word32))
-> IO (Int32, Word32) -> m (Int32, Word32)
forall a b. (a -> b) -> a -> b
$ do
    let len :: Int32
len = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Text] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Text]
name
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr CString
name' <- [Text] -> IO (Ptr CString)
packUTF8CArray [Text]
name
    Ptr Word32
glyph <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- (FunPtr C_FontGetGlyphFromNameFuncT -> C_FontGetGlyphFromNameFuncT
__dynamic_C_FontGetGlyphFromNameFuncT FunPtr C_FontGetGlyphFromNameFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Ptr CString
name' Int32
len Ptr Word32
glyph Ptr ()
userData
    Word32
glyph' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
glyph
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (Int32 -> (CString -> IO ()) -> Ptr CString -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Int32
len) CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
name'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
name'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
glyph
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
glyph')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph ID that corresponds to a glyph-name
-- string.
type FontGetGlyphFromNameFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> [T.Text]
    -- ^ /@name@/: The name string to query
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the glyph ID that corresponds to a glyph-name
-- string.
type FontGetGlyphFromNameFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> [T.Text]
    -- ^ /@name@/: The name string to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetGlyphFromNameFuncT
_f FontT
font Ptr ()
fontData [Text]
name

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphFromNameFuncT :: MonadIO m => FontGetGlyphFromNameFuncT -> m (GClosure C_FontGetGlyphFromNameFuncT)
genClosure_FontGetGlyphFromNameFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetGlyphFromNameFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Ptr CString
name Int32
len Ptr Word32
glyph Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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' <- (Int32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Int32
len) Ptr CString
name
        (Int32
result, Word32
outglyph) <- FontGetGlyphFromNameFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData [Text]
name' Ptr ()
userData
        Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
glyph Word32
outglyph
        Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphFromNameFuncT))
gi'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 = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The glyph ID to query"
                , 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 = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The #hb_glyph_extents_t retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = True
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 4
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the extents for a specified glyph. Extents must be\nreturned in an #hb_glyph_extents output parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- XXX Could not generate callback wrapper for FontGetGlyphExtentsFuncT
-- Not implemented: Unexpected transfer type for "extents"
-- callback FontGetGlyphContourPointFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%true if data found, %false otherwise"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The glyph ID to query"
                , 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 = Just "The contour-point index to query"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "x"
          , argType = TBasicType TInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The X value retrieved for the contour point"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "y"
          , argType = TBasicType TInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The Y value retrieved for the contour point"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 6
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the (X,Y) coordinates (in font units) for a\nspecified contour point in a glyph. Each coordinate must be returned as\nan #hb_position_t output parameter."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetGlyphContourPointFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Ptr Int32 ->
    Ptr Int32 ->
    Ptr () ->
    IO Int32

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The glyph ID to query"
--                 , 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 = Just "The contour-point index to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The X value retrieved for the contour point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Y value retrieved for the contour point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data pointer passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Word32
    -- ^ /@pointIndex@/: The contour-point index to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
dynamic_FontGetGlyphContourPointFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetGlyphContourPointFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Ptr ()
-> m (Int32, Int32, Int32)
dynamic_FontGetGlyphContourPointFuncT FunPtr C_FontGetGlyphContourPointFuncT
__funPtr FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex Ptr ()
userData = IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32, Int32) -> m (Int32, Int32, Int32))
-> IO (Int32, Int32, Int32) -> m (Int32, Int32, 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 Int32
x <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
y <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Int32
result <- (FunPtr C_FontGetGlyphContourPointFuncT
-> C_FontGetGlyphContourPointFuncT
__dynamic_C_FontGetGlyphContourPointFuncT FunPtr C_FontGetGlyphContourPointFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
glyph Word32
pointIndex Ptr Int32
x Ptr Int32
y Ptr ()
userData
    Int32
x' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
x
    Int32
y' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
y
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
x
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
y
    (Int32, Int32, Int32) -> IO (Int32, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Int32
x', Int32
y')

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the (X,Y) coordinates (in font units) for a
-- specified contour point in a glyph. Each coordinate must be returned as
-- an @/hb_position_t/@ output parameter.
type FontGetGlyphContourPointFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Word32
    -- ^ /@pointIndex@/: The contour-point index to query
    -> IO ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the (X,Y) coordinates (in font units) for a
-- specified contour point in a glyph. Each coordinate must be returned as
-- an @/hb_position_t/@ output parameter.
type FontGetGlyphContourPointFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Word32
    -- ^ /@pointIndex@/: The contour-point index to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise

-- | 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 Ptr ()
_ = FontGetGlyphContourPointFuncT
_f FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphContourPointFuncT :: MonadIO m => FontGetGlyphContourPointFuncT -> m (GClosure C_FontGetGlyphContourPointFuncT)
genClosure_FontGetGlyphContourPointFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetGlyphContourPointFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
glyph Word32
pointIndex Ptr Int32
x Ptr Int32
y Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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, Int32
outx, Int32
outy) <- FontGetGlyphContourPointFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
glyph Word32
pointIndex Ptr ()
userData
        Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
x Int32
outx
        Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
y Int32
outy
        Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphContourPointFuncT))
gi'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 = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 =
                    Just "The number of glyph IDs in the sequence queried"
                , 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 = Just "The first glyph ID to query"
                , 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 = Just "The stride between successive glyph IDs"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "first_advance"
          , argType = TBasicType TInt32
          , direction = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The first advance retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "advance_stride"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The stride between successive advances"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 7
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the advances for a sequence of glyphs."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FontGetGlyphAdvancesFuncT =
    Ptr HarfBuzz.FontT.FontT ->
    Ptr () ->
    Word32 ->
    Word32 ->
    Word32 ->
    Ptr Int32 ->
    Word32 ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 =
--                     Just "The number of glyph IDs in the sequence queried"
--                 , 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 = Just "The first glyph ID to query"
--                 , 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 = Just "The stride between successive glyph IDs"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first_advance"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The first advance retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "advance_stride"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The stride between successive advances"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@count@/: The number of glyph IDs in the sequence queried
    -> Word32
    -- ^ /@firstGlyph@/: The first glyph ID to query
    -> Word32
    -- ^ /@glyphStride@/: The stride between successive glyph IDs
    -> Word32
    -- ^ /@advanceStride@/: The stride between successive advances
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m (Int32)
dynamic_FontGetGlyphAdvancesFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_FontGetGlyphAdvancesFuncT
-> FontT
-> Ptr ()
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr ()
-> m Int32
dynamic_FontGetGlyphAdvancesFuncT FunPtr C_FontGetGlyphAdvancesFuncT
__funPtr FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Word32
advanceStride 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 Int32
firstAdvance <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    (FunPtr C_FontGetGlyphAdvancesFuncT -> C_FontGetGlyphAdvancesFuncT
__dynamic_C_FontGetGlyphAdvancesFuncT FunPtr C_FontGetGlyphAdvancesFuncT
__funPtr) Ptr FontT
font' Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Ptr Int32
firstAdvance Word32
advanceStride Ptr ()
userData
    Int32
firstAdvance' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
firstAdvance
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
firstAdvance
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
firstAdvance'

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the advances for a sequence of glyphs.
type FontGetGlyphAdvancesFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@count@/: The number of glyph IDs in the sequence queried
    -> Word32
    -- ^ /@firstGlyph@/: The first glyph ID to query
    -> Word32
    -- ^ /@glyphStride@/: The stride between successive glyph IDs
    -> Word32
    -- ^ /@advanceStride@/: The stride between successive advances
    -> IO (Int32)

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the advances for a sequence of glyphs.
type FontGetGlyphAdvancesFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@count@/: The number of glyph IDs in the sequence queried
    -> Word32
    -- ^ /@firstGlyph@/: The first glyph ID to query
    -> Word32
    -- ^ /@glyphStride@/: The stride between successive glyph IDs
    -> Word32
    -- ^ /@advanceStride@/: The stride between successive advances
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO (Int32)

-- | 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 Word32
advanceStride Ptr ()
_ = FontGetGlyphAdvancesFuncT
_f FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Word32
advanceStride

-- | Wrap the callback into a `GClosure`.
genClosure_FontGetGlyphAdvancesFuncT :: MonadIO m => FontGetGlyphAdvancesFuncT -> m (GClosure C_FontGetGlyphAdvancesFuncT)
genClosure_FontGetGlyphAdvancesFuncT :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetGlyphAdvancesFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Ptr Int32
firstAdvance Word32
advanceStride Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr FontT
font ((FontT -> IO ()) -> IO ()) -> (FontT -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \FontT
font' -> do
        Int32
outfirstAdvance <- FontGetGlyphAdvancesFuncT_WithClosures
gi'cb  FontT
font' Ptr ()
fontData Word32
count Word32
firstGlyph Word32
glyphStride Word32
advanceStride Ptr ()
userData
        Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
firstAdvance Int32
outfirstAdvance
        Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FontGetGlyphAdvancesFuncT))
gi'funptrptr


-- callback FontGetGlyphAdvanceFuncT
{- Callable
  { returnType = Just (TBasicType TInt32)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "The advance of @glyph within @font"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "font"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = Just "The glyph ID to query"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A virtual method for the #hb_font_funcs_t of an #hb_font_t object.\n\nThis method should retrieve the advance for a specified glyph. The\nmethod must return an #hb_position_t."
        , 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 = Just "#hb_font_t to work upon"
--                 , 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 = Just "@font user data pointer"
--                 , 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 = Just "The glyph ID to query"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m Int32
    -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/
dynamic_FontGetGlyphAdvanceFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the advance for a specified glyph. The
-- method must return an @/hb_position_t/@.
type FontGetGlyphAdvanceFuncT =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> IO Int32
    -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/

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

-- | A virtual method for the t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' of an t'GI.HarfBuzz.Structs.FontT.FontT' object.
-- 
-- This method should retrieve the advance for a specified glyph. The
-- method must return an @/hb_position_t/@.
type FontGetGlyphAdvanceFuncT_WithClosures =
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: /@font@/ user data pointer
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO Int32
    -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr FontGetGlyphAdvanceFuncT_WithClosures
gi'cb Ptr FontT
font Ptr ()
fontData Word32
glyph Ptr ()
userData = do
    Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'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 = Just "#hb_font_t to work upon"
                , 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 = Just "@font user data pointer"
                , 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 = DirectionOut
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The font extents retrieved"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = True
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "User data pointer passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "This method should retrieve the extents for a font."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- XXX Could not generate callback wrapper for FontGetFontExtentsFuncT
-- Not implemented: Unexpected transfer type for "extents"
-- 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 = Just "the data to be destroyed"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 0
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "A virtual method for destroy user-data callbacks."
        , 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 = Just "the data to be destroyed"
--                 , 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 ()
    -- ^ /@userData@/: the data to be destroyed
    -> m ()
dynamic_DestroyFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A virtual method for destroy user-data callbacks.
type DestroyFuncT =
    IO ()

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

-- | A virtual method for destroy user-data callbacks.
type DestroyFuncT_WithClosures =
    Ptr ()
    -- ^ /@userData@/: the data to be destroyed
    -> 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr C_DestroyFuncT
gi'cb Ptr ()
userData = do
    C_DestroyFuncT
gi'cb  Ptr ()
userData
    Maybe (Ptr (FunPtr C_DestroyFuncT)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_DestroyFuncT))
gi'funptrptr


-- callback BufferMessageFuncT
{- Callable
  { returnType = Just (TBasicType TInt)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%true to perform the shaping step, %false to skip it."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "buffer"
          , argType =
              TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "An #hb_buffer_t to work upon"
                , 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 = Just "The #hb_font_t the @buffer is shaped with"
                , 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 =
                    Just "%NULL-terminated message passed to the function"
                , 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 passed by the caller"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A callback method for #hb_buffer_t. The method gets called with the\n#hb_buffer_t it was set on, the #hb_font_t the buffer is shaped with and a\nmessage describing what step of the shaping process will be performed.\nReturning %false from this method will skip this shaping step and move to\nthe next one."
        , sinceVersion = Just "1.1.3"
        }
  , 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 = Just "An #hb_buffer_t to work upon"
--                 , 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 = Just "The #hb_font_t the @buffer is shaped with"
--                 , 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 =
--                     Just "%NULL-terminated message passed to the function"
--                 , 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 passed by the caller"
--                 , 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
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' to work upon
    -> HarfBuzz.FontT.FontT
    -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' the /@buffer@/ is shaped with
    -> T.Text
    -- ^ /@message@/: 'P.Nothing'-terminated message passed to the function
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> m Int32
    -- ^ __Returns:__ @/true/@ to perform the shaping step, @/false/@ to skip it.
dynamic_BufferMessageFuncT :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
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)

-- | A callback method for t'GI.HarfBuzz.Structs.BufferT.BufferT'. The method gets called with the
-- t'GI.HarfBuzz.Structs.BufferT.BufferT' it was set on, the t'GI.HarfBuzz.Structs.FontT.FontT' the buffer is shaped with and a
-- message describing what step of the shaping process will be performed.
-- Returning @/false/@ from this method will skip this shaping step and move to
-- the next one.
-- 
-- /Since: 1.1.3/
type BufferMessageFuncT =
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' to work upon
    -> HarfBuzz.FontT.FontT
    -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' the /@buffer@/ is shaped with
    -> T.Text
    -- ^ /@message@/: 'P.Nothing'-terminated message passed to the function
    -> IO Int32
    -- ^ __Returns:__ @/true/@ to perform the shaping step, @/false/@ to skip it.

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

-- | A callback method for t'GI.HarfBuzz.Structs.BufferT.BufferT'. The method gets called with the
-- t'GI.HarfBuzz.Structs.BufferT.BufferT' it was set on, the t'GI.HarfBuzz.Structs.FontT.FontT' the buffer is shaped with and a
-- message describing what step of the shaping process will be performed.
-- Returning @/false/@ from this method will skip this shaping step and move to
-- the next one.
-- 
-- /Since: 1.1.3/
type BufferMessageFuncT_WithClosures =
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT' to work upon
    -> HarfBuzz.FontT.FontT
    -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' the /@buffer@/ is shaped with
    -> T.Text
    -- ^ /@message@/: 'P.Nothing'-terminated message passed to the function
    -> Ptr ()
    -- ^ /@userData@/: User data pointer passed by the caller
    -> IO Int32
    -- ^ __Returns:__ @/true/@ to perform the shaping step, @/false/@ to skip it.

-- | 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 :: forall (m :: * -> *).
MonadIO m =>
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))
gi'funptrptr BufferMessageFuncT_WithClosures
gi'cb Ptr BufferT
buffer Ptr FontT
font CString
message Ptr ()
userData = do
    Ptr BufferT -> (BufferT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr BufferT
buffer ((BufferT -> IO Int32) -> IO Int32)
-> (BufferT -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \BufferT
buffer' -> do
        Ptr FontT -> (FontT -> IO Int32) -> IO Int32
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  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
gi'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))
gi'funptrptr
            Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result