-- | 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.Functions
    ( 

 -- * Methods


-- ** aatLayoutFeatureTypeGetNameId #method:aatLayoutFeatureTypeGetNameId#

    aatLayoutFeatureTypeGetNameId           ,


-- ** aatLayoutFeatureTypeGetSelectorInfos #method:aatLayoutFeatureTypeGetSelectorInfos#

    aatLayoutFeatureTypeGetSelectorInfos    ,


-- ** aatLayoutGetFeatureTypes #method:aatLayoutGetFeatureTypes#

    aatLayoutGetFeatureTypes                ,


-- ** aatLayoutHasPositioning #method:aatLayoutHasPositioning#

    aatLayoutHasPositioning                 ,


-- ** aatLayoutHasSubstitution #method:aatLayoutHasSubstitution#

    aatLayoutHasSubstitution                ,


-- ** aatLayoutHasTracking #method:aatLayoutHasTracking#

    aatLayoutHasTracking                    ,


-- ** blobCopyWritableOrFail #method:blobCopyWritableOrFail#

    blobCopyWritableOrFail                  ,


-- ** blobCreateFromFile #method:blobCreateFromFile#

    blobCreateFromFile                      ,


-- ** blobCreateFromFileOrFail #method:blobCreateFromFileOrFail#

    blobCreateFromFileOrFail                ,


-- ** blobCreateSubBlob #method:blobCreateSubBlob#

    blobCreateSubBlob                       ,


-- ** blobGetData #method:blobGetData#

    blobGetData                             ,


-- ** blobGetDataWritable #method:blobGetDataWritable#

    blobGetDataWritable                     ,


-- ** blobGetEmpty #method:blobGetEmpty#

    blobGetEmpty                            ,


-- ** blobGetLength #method:blobGetLength#

    blobGetLength                           ,


-- ** blobIsImmutable #method:blobIsImmutable#

    blobIsImmutable                         ,


-- ** blobMakeImmutable #method:blobMakeImmutable#

    blobMakeImmutable                       ,


-- ** bufferAdd #method:bufferAdd#

    bufferAdd                               ,


-- ** bufferAddCodepoints #method:bufferAddCodepoints#

    bufferAddCodepoints                     ,


-- ** bufferAddLatin1 #method:bufferAddLatin1#

    bufferAddLatin1                         ,


-- ** bufferAddUtf16 #method:bufferAddUtf16#

    bufferAddUtf16                          ,


-- ** bufferAddUtf32 #method:bufferAddUtf32#

    bufferAddUtf32                          ,


-- ** bufferAddUtf8 #method:bufferAddUtf8#

    bufferAddUtf8                           ,


-- ** bufferAllocationSuccessful #method:bufferAllocationSuccessful#

    bufferAllocationSuccessful              ,


-- ** bufferAppend #method:bufferAppend#

    bufferAppend                            ,


-- ** bufferClearContents #method:bufferClearContents#

    bufferClearContents                     ,


-- ** bufferCreate #method:bufferCreate#

    bufferCreate                            ,


-- ** bufferCreateSimilar #method:bufferCreateSimilar#

    bufferCreateSimilar                     ,


-- ** bufferDeserializeGlyphs #method:bufferDeserializeGlyphs#

    bufferDeserializeGlyphs                 ,


-- ** bufferDeserializeUnicode #method:bufferDeserializeUnicode#

    bufferDeserializeUnicode                ,


-- ** bufferDiff #method:bufferDiff#

    bufferDiff                              ,


-- ** bufferGetClusterLevel #method:bufferGetClusterLevel#

    bufferGetClusterLevel                   ,


-- ** bufferGetContentType #method:bufferGetContentType#

    bufferGetContentType                    ,


-- ** bufferGetDirection #method:bufferGetDirection#

    bufferGetDirection                      ,


-- ** bufferGetEmpty #method:bufferGetEmpty#

    bufferGetEmpty                          ,


-- ** bufferGetFlags #method:bufferGetFlags#

    bufferGetFlags                          ,


-- ** bufferGetGlyphInfos #method:bufferGetGlyphInfos#

    bufferGetGlyphInfos                     ,


-- ** bufferGetGlyphPositions #method:bufferGetGlyphPositions#

    bufferGetGlyphPositions                 ,


-- ** bufferGetInvisibleGlyph #method:bufferGetInvisibleGlyph#

    bufferGetInvisibleGlyph                 ,


-- ** bufferGetLanguage #method:bufferGetLanguage#

    bufferGetLanguage                       ,


-- ** bufferGetLength #method:bufferGetLength#

    bufferGetLength                         ,


-- ** bufferGetNotFoundGlyph #method:bufferGetNotFoundGlyph#

    bufferGetNotFoundGlyph                  ,


-- ** bufferGetReplacementCodepoint #method:bufferGetReplacementCodepoint#

    bufferGetReplacementCodepoint           ,


-- ** bufferGetScript #method:bufferGetScript#

    bufferGetScript                         ,


-- ** bufferGetSegmentProperties #method:bufferGetSegmentProperties#

    bufferGetSegmentProperties              ,


-- ** bufferGetUnicodeFuncs #method:bufferGetUnicodeFuncs#

    bufferGetUnicodeFuncs                   ,


-- ** bufferGuessSegmentProperties #method:bufferGuessSegmentProperties#

    bufferGuessSegmentProperties            ,


-- ** bufferHasPositions #method:bufferHasPositions#

    bufferHasPositions                      ,


-- ** bufferNormalizeGlyphs #method:bufferNormalizeGlyphs#

    bufferNormalizeGlyphs                   ,


-- ** bufferPreAllocate #method:bufferPreAllocate#

    bufferPreAllocate                       ,


-- ** bufferReset #method:bufferReset#

    bufferReset                             ,


-- ** bufferReverse #method:bufferReverse#

    bufferReverse                           ,


-- ** bufferReverseClusters #method:bufferReverseClusters#

    bufferReverseClusters                   ,


-- ** bufferReverseRange #method:bufferReverseRange#

    bufferReverseRange                      ,


-- ** bufferSerialize #method:bufferSerialize#

    bufferSerialize                         ,


-- ** bufferSerializeFormatFromString #method:bufferSerializeFormatFromString#

    bufferSerializeFormatFromString         ,


-- ** bufferSerializeFormatToString #method:bufferSerializeFormatToString#

    bufferSerializeFormatToString           ,


-- ** bufferSerializeGlyphs #method:bufferSerializeGlyphs#

    bufferSerializeGlyphs                   ,


-- ** bufferSerializeListFormats #method:bufferSerializeListFormats#

    bufferSerializeListFormats              ,


-- ** bufferSerializeUnicode #method:bufferSerializeUnicode#

    bufferSerializeUnicode                  ,


-- ** bufferSetClusterLevel #method:bufferSetClusterLevel#

    bufferSetClusterLevel                   ,


-- ** bufferSetContentType #method:bufferSetContentType#

    bufferSetContentType                    ,


-- ** bufferSetDirection #method:bufferSetDirection#

    bufferSetDirection                      ,


-- ** bufferSetFlags #method:bufferSetFlags#

    bufferSetFlags                          ,


-- ** bufferSetInvisibleGlyph #method:bufferSetInvisibleGlyph#

    bufferSetInvisibleGlyph                 ,


-- ** bufferSetLanguage #method:bufferSetLanguage#

    bufferSetLanguage                       ,


-- ** bufferSetLength #method:bufferSetLength#

    bufferSetLength                         ,


-- ** bufferSetNotFoundGlyph #method:bufferSetNotFoundGlyph#

    bufferSetNotFoundGlyph                  ,


-- ** bufferSetReplacementCodepoint #method:bufferSetReplacementCodepoint#

    bufferSetReplacementCodepoint           ,


-- ** bufferSetScript #method:bufferSetScript#

    bufferSetScript                         ,


-- ** bufferSetSegmentProperties #method:bufferSetSegmentProperties#

    bufferSetSegmentProperties              ,


-- ** bufferSetUnicodeFuncs #method:bufferSetUnicodeFuncs#

    bufferSetUnicodeFuncs                   ,


-- ** colorGetAlpha #method:colorGetAlpha#

    colorGetAlpha                           ,


-- ** colorGetBlue #method:colorGetBlue#

    colorGetBlue                            ,


-- ** colorGetGreen #method:colorGetGreen#

    colorGetGreen                           ,


-- ** colorGetRed #method:colorGetRed#

    colorGetRed                             ,


-- ** directionFromString #method:directionFromString#

    directionFromString                     ,


-- ** directionToString #method:directionToString#

    directionToString                       ,


-- ** drawClosePath #method:drawClosePath#

    drawClosePath                           ,


-- ** drawCubicTo #method:drawCubicTo#

    drawCubicTo                             ,


-- ** drawFuncsCreate #method:drawFuncsCreate#

    drawFuncsCreate                         ,


-- ** drawFuncsIsImmutable #method:drawFuncsIsImmutable#

    drawFuncsIsImmutable                    ,


-- ** drawFuncsMakeImmutable #method:drawFuncsMakeImmutable#

    drawFuncsMakeImmutable                  ,


-- ** drawLineTo #method:drawLineTo#

    drawLineTo                              ,


-- ** drawMoveTo #method:drawMoveTo#

    drawMoveTo                              ,


-- ** drawQuadraticTo #method:drawQuadraticTo#

    drawQuadraticTo                         ,


-- ** faceBuilderAddTable #method:faceBuilderAddTable#

    faceBuilderAddTable                     ,


-- ** faceBuilderCreate #method:faceBuilderCreate#

    faceBuilderCreate                       ,


-- ** faceCollectUnicodes #method:faceCollectUnicodes#

    faceCollectUnicodes                     ,


-- ** faceCollectVariationSelectors #method:faceCollectVariationSelectors#

    faceCollectVariationSelectors           ,


-- ** faceCollectVariationUnicodes #method:faceCollectVariationUnicodes#

    faceCollectVariationUnicodes            ,


-- ** faceCount #method:faceCount#

    faceCount                               ,


-- ** faceCreate #method:faceCreate#

    faceCreate                              ,


-- ** faceGetEmpty #method:faceGetEmpty#

    faceGetEmpty                            ,


-- ** faceGetGlyphCount #method:faceGetGlyphCount#

    faceGetGlyphCount                       ,


-- ** faceGetIndex #method:faceGetIndex#

    faceGetIndex                            ,


-- ** faceGetTableTags #method:faceGetTableTags#

    faceGetTableTags                        ,


-- ** faceGetUpem #method:faceGetUpem#

    faceGetUpem                             ,


-- ** faceIsImmutable #method:faceIsImmutable#

    faceIsImmutable                         ,


-- ** faceMakeImmutable #method:faceMakeImmutable#

    faceMakeImmutable                       ,


-- ** faceReferenceBlob #method:faceReferenceBlob#

    faceReferenceBlob                       ,


-- ** faceReferenceTable #method:faceReferenceTable#

    faceReferenceTable                      ,


-- ** faceSetGlyphCount #method:faceSetGlyphCount#

    faceSetGlyphCount                       ,


-- ** faceSetIndex #method:faceSetIndex#

    faceSetIndex                            ,


-- ** faceSetUpem #method:faceSetUpem#

    faceSetUpem                             ,


-- ** featureFromString #method:featureFromString#

    featureFromString                       ,


-- ** featureToString #method:featureToString#

    featureToString                         ,


-- ** fontAddGlyphOriginForDirection #method:fontAddGlyphOriginForDirection#

    fontAddGlyphOriginForDirection          ,


-- ** fontCreate #method:fontCreate#

    fontCreate                              ,


-- ** fontCreateSubFont #method:fontCreateSubFont#

    fontCreateSubFont                       ,


-- ** fontFuncsCreate #method:fontFuncsCreate#

    fontFuncsCreate                         ,


-- ** fontFuncsGetEmpty #method:fontFuncsGetEmpty#

    fontFuncsGetEmpty                       ,


-- ** fontFuncsIsImmutable #method:fontFuncsIsImmutable#

    fontFuncsIsImmutable                    ,


-- ** fontFuncsMakeImmutable #method:fontFuncsMakeImmutable#

    fontFuncsMakeImmutable                  ,


-- ** fontGetEmpty #method:fontGetEmpty#

    fontGetEmpty                            ,


-- ** fontGetExtentsForDirection #method:fontGetExtentsForDirection#

    fontGetExtentsForDirection              ,


-- ** fontGetFace #method:fontGetFace#

    fontGetFace                             ,


-- ** fontGetGlyph #method:fontGetGlyph#

    fontGetGlyph                            ,


-- ** fontGetGlyphAdvanceForDirection #method:fontGetGlyphAdvanceForDirection#

    fontGetGlyphAdvanceForDirection         ,


-- ** fontGetGlyphAdvancesForDirection #method:fontGetGlyphAdvancesForDirection#

    fontGetGlyphAdvancesForDirection        ,


-- ** fontGetGlyphContourPoint #method:fontGetGlyphContourPoint#

    fontGetGlyphContourPoint                ,


-- ** fontGetGlyphContourPointForOrigin #method:fontGetGlyphContourPointForOrigin#

    fontGetGlyphContourPointForOrigin       ,


-- ** fontGetGlyphExtents #method:fontGetGlyphExtents#

    fontGetGlyphExtents                     ,


-- ** fontGetGlyphExtentsForOrigin #method:fontGetGlyphExtentsForOrigin#

    fontGetGlyphExtentsForOrigin            ,


-- ** fontGetGlyphFromName #method:fontGetGlyphFromName#

    fontGetGlyphFromName                    ,


-- ** fontGetGlyphHAdvance #method:fontGetGlyphHAdvance#

    fontGetGlyphHAdvance                    ,


-- ** fontGetGlyphHAdvances #method:fontGetGlyphHAdvances#

    fontGetGlyphHAdvances                   ,


-- ** fontGetGlyphHKerning #method:fontGetGlyphHKerning#

    fontGetGlyphHKerning                    ,


-- ** fontGetGlyphHOrigin #method:fontGetGlyphHOrigin#

    fontGetGlyphHOrigin                     ,


-- ** fontGetGlyphKerningForDirection #method:fontGetGlyphKerningForDirection#

    fontGetGlyphKerningForDirection         ,


-- ** fontGetGlyphName #method:fontGetGlyphName#

    fontGetGlyphName                        ,


-- ** fontGetGlyphOriginForDirection #method:fontGetGlyphOriginForDirection#

    fontGetGlyphOriginForDirection          ,


-- ** fontGetGlyphShape #method:fontGetGlyphShape#

    fontGetGlyphShape                       ,


-- ** fontGetGlyphVAdvance #method:fontGetGlyphVAdvance#

    fontGetGlyphVAdvance                    ,


-- ** fontGetGlyphVAdvances #method:fontGetGlyphVAdvances#

    fontGetGlyphVAdvances                   ,


-- ** fontGetGlyphVKerning #method:fontGetGlyphVKerning#

    fontGetGlyphVKerning                    ,


-- ** fontGetGlyphVOrigin #method:fontGetGlyphVOrigin#

    fontGetGlyphVOrigin                     ,


-- ** fontGetHExtents #method:fontGetHExtents#

    fontGetHExtents                         ,


-- ** fontGetNominalGlyph #method:fontGetNominalGlyph#

    fontGetNominalGlyph                     ,


-- ** fontGetNominalGlyphs #method:fontGetNominalGlyphs#

    fontGetNominalGlyphs                    ,


-- ** fontGetParent #method:fontGetParent#

    fontGetParent                           ,


-- ** fontGetPpem #method:fontGetPpem#

    fontGetPpem                             ,


-- ** fontGetPtem #method:fontGetPtem#

    fontGetPtem                             ,


-- ** fontGetScale #method:fontGetScale#

    fontGetScale                            ,


-- ** fontGetSyntheticSlant #method:fontGetSyntheticSlant#

    fontGetSyntheticSlant                   ,


-- ** fontGetVExtents #method:fontGetVExtents#

    fontGetVExtents                         ,


-- ** fontGetVarCoordsDesign #method:fontGetVarCoordsDesign#

    fontGetVarCoordsDesign                  ,


-- ** fontGetVarCoordsNormalized #method:fontGetVarCoordsNormalized#

    fontGetVarCoordsNormalized              ,


-- ** fontGetVariationGlyph #method:fontGetVariationGlyph#

    fontGetVariationGlyph                   ,


-- ** fontGlyphFromString #method:fontGlyphFromString#

    fontGlyphFromString                     ,


-- ** fontGlyphToString #method:fontGlyphToString#

    fontGlyphToString                       ,


-- ** fontIsImmutable #method:fontIsImmutable#

    fontIsImmutable                         ,


-- ** fontMakeImmutable #method:fontMakeImmutable#

    fontMakeImmutable                       ,


-- ** fontSetFace #method:fontSetFace#

    fontSetFace                             ,


-- ** fontSetFuncs #method:fontSetFuncs#

    fontSetFuncs                            ,


-- ** fontSetFuncsData #method:fontSetFuncsData#

    fontSetFuncsData                        ,


-- ** fontSetParent #method:fontSetParent#

    fontSetParent                           ,


-- ** fontSetPpem #method:fontSetPpem#

    fontSetPpem                             ,


-- ** fontSetPtem #method:fontSetPtem#

    fontSetPtem                             ,


-- ** fontSetScale #method:fontSetScale#

    fontSetScale                            ,


-- ** fontSetSyntheticSlant #method:fontSetSyntheticSlant#

    fontSetSyntheticSlant                   ,


-- ** fontSetVarCoordsDesign #method:fontSetVarCoordsDesign#

    fontSetVarCoordsDesign                  ,


-- ** fontSetVarCoordsNormalized #method:fontSetVarCoordsNormalized#

    fontSetVarCoordsNormalized              ,


-- ** fontSetVarNamedInstance #method:fontSetVarNamedInstance#

    fontSetVarNamedInstance                 ,


-- ** fontSetVariations #method:fontSetVariations#

    fontSetVariations                       ,


-- ** fontSubtractGlyphOriginForDirection #method:fontSubtractGlyphOriginForDirection#

    fontSubtractGlyphOriginForDirection     ,


-- ** ftFontChanged #method:ftFontChanged#

    ftFontChanged                           ,


-- ** ftFontGetLoadFlags #method:ftFontGetLoadFlags#

    ftFontGetLoadFlags                      ,


-- ** ftFontSetFuncs #method:ftFontSetFuncs#

    ftFontSetFuncs                          ,


-- ** ftFontSetLoadFlags #method:ftFontSetLoadFlags#

    ftFontSetLoadFlags                      ,


-- ** ftFontUnlockFace #method:ftFontUnlockFace#

    ftFontUnlockFace                        ,


-- ** glibBlobCreate #method:glibBlobCreate#

    glibBlobCreate                          ,


-- ** glibGetUnicodeFuncs #method:glibGetUnicodeFuncs#

    glibGetUnicodeFuncs                     ,


-- ** glibScriptFromScript #method:glibScriptFromScript#

    glibScriptFromScript                    ,


-- ** glibScriptToScript #method:glibScriptToScript#

    glibScriptToScript                      ,


-- ** glyphInfoGetGlyphFlags #method:glyphInfoGetGlyphFlags#

    glyphInfoGetGlyphFlags                  ,


-- ** languageFromString #method:languageFromString#

    languageFromString                      ,


-- ** languageGetDefault #method:languageGetDefault#

    languageGetDefault                      ,


-- ** languageToString #method:languageToString#

    languageToString                        ,


-- ** mapAllocationSuccessful #method:mapAllocationSuccessful#

    mapAllocationSuccessful                 ,


-- ** mapClear #method:mapClear#

    mapClear                                ,


-- ** mapCreate #method:mapCreate#

    mapCreate                               ,


-- ** mapDel #method:mapDel#

    mapDel                                  ,


-- ** mapGet #method:mapGet#

    mapGet                                  ,


-- ** mapGetEmpty #method:mapGetEmpty#

    mapGetEmpty                             ,


-- ** mapGetPopulation #method:mapGetPopulation#

    mapGetPopulation                        ,


-- ** mapHas #method:mapHas#

    mapHas                                  ,


-- ** mapIsEmpty #method:mapIsEmpty#

    mapIsEmpty                              ,


-- ** mapSet #method:mapSet#

    mapSet                                  ,


-- ** otColorGlyphGetLayers #method:otColorGlyphGetLayers#

    otColorGlyphGetLayers                   ,


-- ** otColorGlyphReferencePng #method:otColorGlyphReferencePng#

    otColorGlyphReferencePng                ,


-- ** otColorGlyphReferenceSvg #method:otColorGlyphReferenceSvg#

    otColorGlyphReferenceSvg                ,


-- ** otColorHasLayers #method:otColorHasLayers#

    otColorHasLayers                        ,


-- ** otColorHasPalettes #method:otColorHasPalettes#

    otColorHasPalettes                      ,


-- ** otColorHasPng #method:otColorHasPng#

    otColorHasPng                           ,


-- ** otColorHasSvg #method:otColorHasSvg#

    otColorHasSvg                           ,


-- ** otColorPaletteColorGetNameId #method:otColorPaletteColorGetNameId#

    otColorPaletteColorGetNameId            ,


-- ** otColorPaletteGetColors #method:otColorPaletteGetColors#

    otColorPaletteGetColors                 ,


-- ** otColorPaletteGetCount #method:otColorPaletteGetCount#

    otColorPaletteGetCount                  ,


-- ** otColorPaletteGetFlags #method:otColorPaletteGetFlags#

    otColorPaletteGetFlags                  ,


-- ** otColorPaletteGetNameId #method:otColorPaletteGetNameId#

    otColorPaletteGetNameId                 ,


-- ** otFontSetFuncs #method:otFontSetFuncs#

    otFontSetFuncs                          ,


-- ** otLayoutFeatureGetCharacters #method:otLayoutFeatureGetCharacters#

    otLayoutFeatureGetCharacters            ,


-- ** otLayoutFeatureGetLookups #method:otLayoutFeatureGetLookups#

    otLayoutFeatureGetLookups               ,


-- ** otLayoutFeatureGetNameIds #method:otLayoutFeatureGetNameIds#

    otLayoutFeatureGetNameIds               ,


-- ** otLayoutFeatureWithVariationsGetLookups #method:otLayoutFeatureWithVariationsGetLookups#

    otLayoutFeatureWithVariationsGetLookups ,


-- ** otLayoutGetAttachPoints #method:otLayoutGetAttachPoints#

    otLayoutGetAttachPoints                 ,


-- ** otLayoutGetBaseline #method:otLayoutGetBaseline#

    otLayoutGetBaseline                     ,


-- ** otLayoutGetBaselineWithFallback #method:otLayoutGetBaselineWithFallback#

    otLayoutGetBaselineWithFallback         ,


-- ** otLayoutGetGlyphClass #method:otLayoutGetGlyphClass#

    otLayoutGetGlyphClass                   ,


-- ** otLayoutGetHorizontalBaselineTagForScript #method:otLayoutGetHorizontalBaselineTagForScript#

    otLayoutGetHorizontalBaselineTagForScript,


-- ** otLayoutGetLigatureCarets #method:otLayoutGetLigatureCarets#

    otLayoutGetLigatureCarets               ,


-- ** otLayoutGetSizeParams #method:otLayoutGetSizeParams#

    otLayoutGetSizeParams                   ,


-- ** otLayoutHasGlyphClasses #method:otLayoutHasGlyphClasses#

    otLayoutHasGlyphClasses                 ,


-- ** otLayoutHasPositioning #method:otLayoutHasPositioning#

    otLayoutHasPositioning                  ,


-- ** otLayoutHasSubstitution #method:otLayoutHasSubstitution#

    otLayoutHasSubstitution                 ,


-- ** otLayoutLanguageFindFeature #method:otLayoutLanguageFindFeature#

    otLayoutLanguageFindFeature             ,


-- ** otLayoutLanguageGetFeatureIndexes #method:otLayoutLanguageGetFeatureIndexes#

    otLayoutLanguageGetFeatureIndexes       ,


-- ** otLayoutLanguageGetFeatureTags #method:otLayoutLanguageGetFeatureTags#

    otLayoutLanguageGetFeatureTags          ,


-- ** otLayoutLanguageGetRequiredFeature #method:otLayoutLanguageGetRequiredFeature#

    otLayoutLanguageGetRequiredFeature      ,


-- ** otLayoutLanguageGetRequiredFeatureIndex #method:otLayoutLanguageGetRequiredFeatureIndex#

    otLayoutLanguageGetRequiredFeatureIndex ,


-- ** otLayoutLookupGetGlyphAlternates #method:otLayoutLookupGetGlyphAlternates#

    otLayoutLookupGetGlyphAlternates        ,


-- ** otLayoutLookupWouldSubstitute #method:otLayoutLookupWouldSubstitute#

    otLayoutLookupWouldSubstitute           ,


-- ** otLayoutScriptFindLanguage #method:otLayoutScriptFindLanguage#

    otLayoutScriptFindLanguage              ,


-- ** otLayoutScriptGetLanguageTags #method:otLayoutScriptGetLanguageTags#

    otLayoutScriptGetLanguageTags           ,


-- ** otLayoutScriptSelectLanguage #method:otLayoutScriptSelectLanguage#

    otLayoutScriptSelectLanguage            ,


-- ** otLayoutTableChooseScript #method:otLayoutTableChooseScript#

    otLayoutTableChooseScript               ,


-- ** otLayoutTableFindFeatureVariations #method:otLayoutTableFindFeatureVariations#

    otLayoutTableFindFeatureVariations      ,


-- ** otLayoutTableFindScript #method:otLayoutTableFindScript#

    otLayoutTableFindScript                 ,


-- ** otLayoutTableGetFeatureTags #method:otLayoutTableGetFeatureTags#

    otLayoutTableGetFeatureTags             ,


-- ** otLayoutTableGetLookupCount #method:otLayoutTableGetLookupCount#

    otLayoutTableGetLookupCount             ,


-- ** otLayoutTableGetScriptTags #method:otLayoutTableGetScriptTags#

    otLayoutTableGetScriptTags              ,


-- ** otLayoutTableSelectScript #method:otLayoutTableSelectScript#

    otLayoutTableSelectScript               ,


-- ** otMathGetConstant #method:otMathGetConstant#

    otMathGetConstant                       ,


-- ** otMathGetGlyphAssembly #method:otMathGetGlyphAssembly#

    otMathGetGlyphAssembly                  ,


-- ** otMathGetGlyphItalicsCorrection #method:otMathGetGlyphItalicsCorrection#

    otMathGetGlyphItalicsCorrection         ,


-- ** otMathGetGlyphKerning #method:otMathGetGlyphKerning#

    otMathGetGlyphKerning                   ,


-- ** otMathGetGlyphKernings #method:otMathGetGlyphKernings#

    otMathGetGlyphKernings                  ,


-- ** otMathGetGlyphTopAccentAttachment #method:otMathGetGlyphTopAccentAttachment#

    otMathGetGlyphTopAccentAttachment       ,


-- ** otMathGetGlyphVariants #method:otMathGetGlyphVariants#

    otMathGetGlyphVariants                  ,


-- ** otMathGetMinConnectorOverlap #method:otMathGetMinConnectorOverlap#

    otMathGetMinConnectorOverlap            ,


-- ** otMathHasData #method:otMathHasData#

    otMathHasData                           ,


-- ** otMathIsGlyphExtendedShape #method:otMathIsGlyphExtendedShape#

    otMathIsGlyphExtendedShape              ,


-- ** otMetaGetEntryTags #method:otMetaGetEntryTags#

    otMetaGetEntryTags                      ,


-- ** otMetaReferenceEntry #method:otMetaReferenceEntry#

    otMetaReferenceEntry                    ,


-- ** otMetricsGetPosition #method:otMetricsGetPosition#

    otMetricsGetPosition                    ,


-- ** otMetricsGetPositionWithFallback #method:otMetricsGetPositionWithFallback#

    otMetricsGetPositionWithFallback        ,


-- ** otMetricsGetVariation #method:otMetricsGetVariation#

    otMetricsGetVariation                   ,


-- ** otMetricsGetXVariation #method:otMetricsGetXVariation#

    otMetricsGetXVariation                  ,


-- ** otMetricsGetYVariation #method:otMetricsGetYVariation#

    otMetricsGetYVariation                  ,


-- ** otNameGetUtf16 #method:otNameGetUtf16#

    otNameGetUtf16                          ,


-- ** otNameGetUtf32 #method:otNameGetUtf32#

    otNameGetUtf32                          ,


-- ** otNameGetUtf8 #method:otNameGetUtf8#

    otNameGetUtf8                           ,


-- ** otNameListNames #method:otNameListNames#

    otNameListNames                         ,


-- ** otTagFromLanguage #method:otTagFromLanguage#

    otTagFromLanguage                       ,


-- ** otTagToLanguage #method:otTagToLanguage#

    otTagToLanguage                         ,


-- ** otTagToScript #method:otTagToScript#

    otTagToScript                           ,


-- ** otTagsFromScript #method:otTagsFromScript#

    otTagsFromScript                        ,


-- ** otTagsFromScriptAndLanguage #method:otTagsFromScriptAndLanguage#

    otTagsFromScriptAndLanguage             ,


-- ** otVarFindAxis #method:otVarFindAxis#

    otVarFindAxis                           ,


-- ** otVarFindAxisInfo #method:otVarFindAxisInfo#

    otVarFindAxisInfo                       ,


-- ** otVarGetAxes #method:otVarGetAxes#

    otVarGetAxes                            ,


-- ** otVarGetAxisCount #method:otVarGetAxisCount#

    otVarGetAxisCount                       ,


-- ** otVarGetAxisInfos #method:otVarGetAxisInfos#

    otVarGetAxisInfos                       ,


-- ** otVarGetNamedInstanceCount #method:otVarGetNamedInstanceCount#

    otVarGetNamedInstanceCount              ,


-- ** otVarHasData #method:otVarHasData#

    otVarHasData                            ,


-- ** otVarNamedInstanceGetDesignCoords #method:otVarNamedInstanceGetDesignCoords#

    otVarNamedInstanceGetDesignCoords       ,


-- ** otVarNamedInstanceGetPostscriptNameId #method:otVarNamedInstanceGetPostscriptNameId#

    otVarNamedInstanceGetPostscriptNameId   ,


-- ** otVarNamedInstanceGetSubfamilyNameId #method:otVarNamedInstanceGetSubfamilyNameId#

    otVarNamedInstanceGetSubfamilyNameId    ,


-- ** otVarNormalizeCoords #method:otVarNormalizeCoords#

    otVarNormalizeCoords                    ,


-- ** otVarNormalizeVariations #method:otVarNormalizeVariations#

    otVarNormalizeVariations                ,


-- ** scriptFromIso15924Tag #method:scriptFromIso15924Tag#

    scriptFromIso15924Tag                   ,


-- ** scriptFromString #method:scriptFromString#

    scriptFromString                        ,


-- ** scriptGetHorizontalDirection #method:scriptGetHorizontalDirection#

    scriptGetHorizontalDirection            ,


-- ** scriptToIso15924Tag #method:scriptToIso15924Tag#

    scriptToIso15924Tag                     ,


-- ** segmentPropertiesEqual #method:segmentPropertiesEqual#

    segmentPropertiesEqual                  ,


-- ** segmentPropertiesHash #method:segmentPropertiesHash#

    segmentPropertiesHash                   ,


-- ** segmentPropertiesOverlay #method:segmentPropertiesOverlay#

    segmentPropertiesOverlay                ,


-- ** setAdd #method:setAdd#

    setAdd                                  ,


-- ** setAddRange #method:setAddRange#

    setAddRange                             ,


-- ** setAllocationSuccessful #method:setAllocationSuccessful#

    setAllocationSuccessful                 ,


-- ** setClear #method:setClear#

    setClear                                ,


-- ** setCopy #method:setCopy#

    setCopy                                 ,


-- ** setCreate #method:setCreate#

    setCreate                               ,


-- ** setDel #method:setDel#

    setDel                                  ,


-- ** setDelRange #method:setDelRange#

    setDelRange                             ,


-- ** setGetEmpty #method:setGetEmpty#

    setGetEmpty                             ,


-- ** setGetMax #method:setGetMax#

    setGetMax                               ,


-- ** setGetMin #method:setGetMin#

    setGetMin                               ,


-- ** setGetPopulation #method:setGetPopulation#

    setGetPopulation                        ,


-- ** setHas #method:setHas#

    setHas                                  ,


-- ** setIntersect #method:setIntersect#

    setIntersect                            ,


-- ** setInvert #method:setInvert#

    setInvert                               ,


-- ** setIsEmpty #method:setIsEmpty#

    setIsEmpty                              ,


-- ** setIsEqual #method:setIsEqual#

    setIsEqual                              ,


-- ** setIsSubset #method:setIsSubset#

    setIsSubset                             ,


-- ** setNext #method:setNext#

    setNext                                 ,


-- ** setNextRange #method:setNextRange#

    setNextRange                            ,


-- ** setPrevious #method:setPrevious#

    setPrevious                             ,


-- ** setPreviousRange #method:setPreviousRange#

    setPreviousRange                        ,


-- ** setSet #method:setSet#

    setSet                                  ,


-- ** setSubtract #method:setSubtract#

    setSubtract                             ,


-- ** setSymmetricDifference #method:setSymmetricDifference#

    setSymmetricDifference                  ,


-- ** setUnion #method:setUnion#

    setUnion                                ,


-- ** shape #method:shape#

    shape                                   ,


-- ** shapeFull #method:shapeFull#

    shapeFull                               ,


-- ** shapeListShapers #method:shapeListShapers#

    shapeListShapers                        ,


-- ** shapePlanCreate #method:shapePlanCreate#

    shapePlanCreate                         ,


-- ** shapePlanCreate2 #method:shapePlanCreate2#

    shapePlanCreate2                        ,


-- ** shapePlanCreateCached #method:shapePlanCreateCached#

    shapePlanCreateCached                   ,


-- ** shapePlanCreateCached2 #method:shapePlanCreateCached2#

    shapePlanCreateCached2                  ,


-- ** shapePlanExecute #method:shapePlanExecute#

    shapePlanExecute                        ,


-- ** shapePlanGetEmpty #method:shapePlanGetEmpty#

    shapePlanGetEmpty                       ,


-- ** shapePlanGetShaper #method:shapePlanGetShaper#

    shapePlanGetShaper                      ,


-- ** styleGetValue #method:styleGetValue#

    styleGetValue                           ,


-- ** tagFromString #method:tagFromString#

    tagFromString                           ,


-- ** unicodeCombiningClass #method:unicodeCombiningClass#

    unicodeCombiningClass                   ,


-- ** unicodeCompose #method:unicodeCompose#

    unicodeCompose                          ,


-- ** unicodeDecompose #method:unicodeDecompose#

    unicodeDecompose                        ,


-- ** unicodeDecomposeCompatibility #method:unicodeDecomposeCompatibility#

    unicodeDecomposeCompatibility           ,


-- ** unicodeEastasianWidth #method:unicodeEastasianWidth#

    unicodeEastasianWidth                   ,


-- ** unicodeFuncsCreate #method:unicodeFuncsCreate#

    unicodeFuncsCreate                      ,


-- ** unicodeFuncsGetDefault #method:unicodeFuncsGetDefault#

    unicodeFuncsGetDefault                  ,


-- ** unicodeFuncsGetEmpty #method:unicodeFuncsGetEmpty#

    unicodeFuncsGetEmpty                    ,


-- ** unicodeFuncsGetParent #method:unicodeFuncsGetParent#

    unicodeFuncsGetParent                   ,


-- ** unicodeFuncsIsImmutable #method:unicodeFuncsIsImmutable#

    unicodeFuncsIsImmutable                 ,


-- ** unicodeFuncsMakeImmutable #method:unicodeFuncsMakeImmutable#

    unicodeFuncsMakeImmutable               ,


-- ** unicodeGeneralCategory #method:unicodeGeneralCategory#

    unicodeGeneralCategory                  ,


-- ** unicodeMirroring #method:unicodeMirroring#

    unicodeMirroring                        ,


-- ** unicodeScript #method:unicodeScript#

    unicodeScript                           ,


-- ** variationFromString #method:variationFromString#

    variationFromString                     ,


-- ** variationToString #method:variationToString#

    variationToString                       ,


-- ** version #method:version#

    version                                 ,


-- ** versionAtleast #method:versionAtleast#

    versionAtleast                          ,


-- ** versionString #method:versionString#

    versionString                           ,




    ) 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 qualified GI.GLib.Enums as GLib.Enums
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.HarfBuzz.Callbacks as HarfBuzz.Callbacks
import {-# SOURCE #-} qualified GI.HarfBuzz.Enums as HarfBuzz.Enums
import {-# SOURCE #-} qualified GI.HarfBuzz.Flags as HarfBuzz.Flags
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT as HarfBuzz.AatLayoutFeatureSelectorInfoT
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.DrawFuncsT as HarfBuzz.DrawFuncsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.DrawStateT as HarfBuzz.DrawStateT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FaceT as HarfBuzz.FaceT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FeatureT as HarfBuzz.FeatureT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontExtentsT as HarfBuzz.FontExtentsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontFuncsT as HarfBuzz.FontFuncsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.FontT as HarfBuzz.FontT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphExtentsT as HarfBuzz.GlyphExtentsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphInfoT as HarfBuzz.GlyphInfoT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.GlyphPositionT as HarfBuzz.GlyphPositionT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.LanguageT as HarfBuzz.LanguageT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.MapT as HarfBuzz.MapT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtColorLayerT as HarfBuzz.OtColorLayerT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathGlyphPartT as HarfBuzz.OtMathGlyphPartT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathGlyphVariantT as HarfBuzz.OtMathGlyphVariantT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtMathKernEntryT as HarfBuzz.OtMathKernEntryT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtNameEntryT as HarfBuzz.OtNameEntryT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtVarAxisInfoT as HarfBuzz.OtVarAxisInfoT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.OtVarAxisT as HarfBuzz.OtVarAxisT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.SegmentPropertiesT as HarfBuzz.SegmentPropertiesT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.SetT as HarfBuzz.SetT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.ShapePlanT as HarfBuzz.ShapePlanT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.UnicodeFuncsT as HarfBuzz.UnicodeFuncsT
import {-# SOURCE #-} qualified GI.HarfBuzz.Structs.VariationT as HarfBuzz.VariationT

-- function version_string
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_version_string" hb_version_string :: 
    IO CString

-- | Returns library version as a string with three components.
-- 
-- /Since: 0.9.2/
versionString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m T.Text
    -- ^ __Returns:__ Library version string
versionString :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Text
versionString  = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    CString
result <- IO CString
hb_version_string
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"versionString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function version_atleast
-- Args: [ Arg
--           { argCName = "major"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Library major version component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "minor"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Library minor version component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "micro"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Library micro version component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_version_atleast" hb_version_atleast :: 
    Word32 ->                               -- major : TBasicType TUInt
    Word32 ->                               -- minor : TBasicType TUInt
    Word32 ->                               -- micro : TBasicType TUInt
    IO Int32

-- | Tests the library version against a minimum value,
-- as three integer components.
-- 
-- /Since: 0.9.30/
versionAtleast ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@major@/: Library major version component
    -> Word32
    -- ^ /@minor@/: Library minor version component
    -> Word32
    -- ^ /@micro@/: Library micro version component
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the library is equal to or greater than
    -- the test value, @/false/@ otherwise
versionAtleast :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> Word32 -> Word32 -> m Int32
versionAtleast Word32
major Word32
minor Word32
micro = 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
    Int32
result <- Word32 -> Word32 -> Word32 -> IO Int32
hb_version_atleast Word32
major Word32
minor Word32
micro
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function version
-- Args: [ Arg
--           { argCName = "major"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Library major version component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "minor"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Library minor version component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "micro"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Library micro version component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_version" hb_version :: 
    Ptr Word32 ->                           -- major : TBasicType TUInt
    Ptr Word32 ->                           -- minor : TBasicType TUInt
    Ptr Word32 ->                           -- micro : TBasicType TUInt
    IO ()

-- | Returns library version as three integer components.
-- 
-- /Since: 0.9.2/
version ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ((Word32, Word32, Word32))
version :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m (Word32, Word32, Word32)
version  = IO (Word32, Word32, Word32) -> m (Word32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, Word32, Word32) -> m (Word32, Word32, Word32))
-> IO (Word32, Word32, Word32) -> m (Word32, Word32, Word32)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Word32
major <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
minor <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
micro <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Ptr Word32 -> Ptr Word32 -> IO ()
hb_version Ptr Word32
major Ptr Word32
minor Ptr Word32
micro
    Word32
major' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
major
    Word32
minor' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
minor
    Word32
micro' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
micro
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
major
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
minor
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
micro
    (Word32, Word32, Word32) -> IO (Word32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
major', Word32
minor', Word32
micro')


-- function variation_to_string
-- Args: [ Arg
--           { argCName = "variation"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "variation_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_variation_t to convert"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 2 (TBasicType TUTF8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "output string" , 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 "the allocated size of @buf"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the allocated size of @buf"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_variation_to_string" hb_variation_to_string :: 
    Ptr HarfBuzz.VariationT.VariationT ->   -- variation : TInterface (Name {namespace = "HarfBuzz", name = "variation_t"})
    Ptr (Ptr CString) ->                    -- buf : TCArray False (-1) 2 (TBasicType TUTF8)
    Ptr Word32 ->                           -- size : TBasicType TUInt
    IO ()

-- | Converts an t'GI.HarfBuzz.Structs.VariationT.VariationT' into a 'P.Nothing'-terminated string in the format
-- understood by 'GI.HarfBuzz.Functions.variationFromString'. The client in responsible for
-- allocating big enough size for /@buf@/, 128 bytes is more than enough.
-- 
-- /Since: 1.4.2/
variationToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.VariationT.VariationT
    -- ^ /@variation@/: an t'GI.HarfBuzz.Structs.VariationT.VariationT' to convert
    -> m ([T.Text])
variationToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
VariationT -> m [Text]
variationToString VariationT
variation = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr VariationT
variation' <- VariationT -> IO (Ptr VariationT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariationT
variation
    Ptr (Ptr CString)
buf <- 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)
    Ptr VariationT -> Ptr (Ptr CString) -> Ptr Word32 -> IO ()
hb_variation_to_string Ptr VariationT
variation' Ptr (Ptr CString)
buf Ptr Word32
size
    Word32
size' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
size
    Ptr CString
buf' <- Ptr (Ptr CString) -> IO (Ptr CString)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CString)
buf
    [Text]
buf'' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
size') Ptr CString
buf'
    (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
buf'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
buf'
    VariationT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariationT
variation
    Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
buf
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
size
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
buf''


-- function variation_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a string to parse" , 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 "length of @str, or -1 if string is %NULL terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variation"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "variation_t" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #hb_variation_t to initialize with the parsed values"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "length of @str, or -1 if string is %NULL terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_variation_from_string" hb_variation_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    Ptr HarfBuzz.VariationT.VariationT ->   -- variation : TInterface (Name {namespace = "HarfBuzz", name = "variation_t"})
    IO Int32

-- | Parses a string into a t'GI.HarfBuzz.Structs.VariationT.VariationT'.
-- 
-- The format for specifying variation settings follows. All valid CSS
-- font-variation-settings values other than \'normal\' and \'inherited\' are also
-- accepted, though, not documented below.
-- 
-- The format is a tag, optionally followed by an equals sign, followed by a
-- number. For example @wght=500@, or @slnt=-7.5@.
-- 
-- /Since: 1.4.2/
variationFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: a string to parse
    -> m ((Int32, HarfBuzz.VariationT.VariationT))
    -- ^ __Returns:__ @/true/@ if /@str@/ is successfully parsed, @/false/@ otherwise
variationFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m (Int32, VariationT)
variationFromString ByteString
str = IO (Int32, VariationT) -> m (Int32, VariationT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, VariationT) -> m (Int32, VariationT))
-> IO (Int32, VariationT) -> m (Int32, VariationT)
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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    Ptr VariationT
variation <- Int -> IO (Ptr VariationT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
8 :: IO (Ptr HarfBuzz.VariationT.VariationT)
    Int32
result <- Ptr Word8 -> Int32 -> Ptr VariationT -> IO Int32
hb_variation_from_string Ptr Word8
str' Int32
len Ptr VariationT
variation
    VariationT
variation' <- ((ManagedPtr VariationT -> VariationT)
-> Ptr VariationT -> IO VariationT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr VariationT -> VariationT
HarfBuzz.VariationT.VariationT) Ptr VariationT
variation
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    (Int32, VariationT) -> IO (Int32, VariationT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, VariationT
variation')


-- function unicode_script
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The 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
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_script" hb_unicode_script :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    IO CUInt

-- | Retrieves the t'GI.HarfBuzz.Enums.ScriptT' script to which code
-- point /@unicode@/ belongs.
-- 
-- /Since: 0.9.2/
unicodeScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.ScriptT' of /@unicode@/
unicodeScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m ScriptT
unicodeScript UnicodeFuncsT
ufuncs Word32
unicode = 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 <- Ptr UnicodeFuncsT -> Word32 -> IO CUInt
hb_unicode_script Ptr UnicodeFuncsT
ufuncs' Word32
unicode
    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'


-- function unicode_mirroring
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_mirroring" hb_unicode_mirroring :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    IO Word32

-- | Retrieves the Bi-directional Mirroring Glyph code
-- point defined for code point /@unicode@/.
-- 
-- /Since: 0.9.2/
unicodeMirroring ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> m Word32
    -- ^ __Returns:__ The @/hb_codepoint_t/@ of the Mirroring Glyph for /@unicode@/
unicodeMirroring :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m Word32
unicodeMirroring UnicodeFuncsT
ufuncs Word32
unicode = 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 <- Ptr UnicodeFuncsT -> Word32 -> IO Word32
hb_unicode_mirroring Ptr UnicodeFuncsT
ufuncs' Word32
unicode
    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


-- function unicode_general_category
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The 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
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "unicode_general_category_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_general_category" hb_unicode_general_category :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    IO CUInt

-- | Retrieves the General Category (gc) property
-- of code point /@unicode@/.
-- 
-- /Since: 0.9.2/
unicodeGeneralCategory ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> m HarfBuzz.Enums.UnicodeGeneralCategoryT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeGeneralCategoryT' of /@unicode@/
unicodeGeneralCategory :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m UnicodeGeneralCategoryT
unicodeGeneralCategory UnicodeFuncsT
ufuncs Word32
unicode = 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 <- Ptr UnicodeFuncsT -> Word32 -> IO CUInt
hb_unicode_general_category Ptr UnicodeFuncsT
ufuncs' Word32
unicode
    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'


-- function unicode_funcs_set_script_func
-- XXX Could not generate function unicode_funcs_set_script_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_mirroring_func
-- XXX Could not generate function unicode_funcs_set_mirroring_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_general_category_func
-- XXX Could not generate function unicode_funcs_set_general_category_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_eastasian_width_func
-- XXX Could not generate function unicode_funcs_set_eastasian_width_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_decompose_func
-- XXX Could not generate function unicode_funcs_set_decompose_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_decompose_compatibility_func
-- XXX Could not generate function unicode_funcs_set_decompose_compatibility_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_compose_func
-- XXX Could not generate function unicode_funcs_set_compose_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_set_combining_class_func
-- XXX Could not generate function unicode_funcs_set_combining_class_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function unicode_funcs_make_immutable
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Unicode-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_funcs_make_immutable" hb_unicode_funcs_make_immutable :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    IO ()

-- | Makes the specified Unicode-functions structure
-- immutable.
-- 
-- /Since: 0.9.2/
unicodeFuncsMakeImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> m ()
unicodeFuncsMakeImmutable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> m ()
unicodeFuncsMakeImmutable UnicodeFuncsT
ufuncs = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Ptr UnicodeFuncsT -> IO ()
hb_unicode_funcs_make_immutable Ptr UnicodeFuncsT
ufuncs'
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function unicode_funcs_is_immutable
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Unicode-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_funcs_is_immutable" hb_unicode_funcs_is_immutable :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    IO Int32

-- | Tests whether the specified Unicode-functions structure
-- is immutable.
-- 
-- /Since: 0.9.2/
unicodeFuncsIsImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@ufuncs@/ is immutable, @/false/@ otherwise
unicodeFuncsIsImmutable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> m Int32
unicodeFuncsIsImmutable UnicodeFuncsT
ufuncs = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Int32
result <- Ptr UnicodeFuncsT -> IO Int32
hb_unicode_funcs_is_immutable Ptr UnicodeFuncsT
ufuncs'
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function unicode_funcs_get_parent
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Unicode-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_funcs_get_parent" hb_unicode_funcs_get_parent :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)

-- | Fetches the parent of the Unicode-functions structure
-- /@ufuncs@/.
-- 
-- /Since: 0.9.2/
unicodeFuncsGetParent ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ __Returns:__ The parent Unicode-functions structure
unicodeFuncsGetParent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> m UnicodeFuncsT
unicodeFuncsGetParent UnicodeFuncsT
ufuncs = IO UnicodeFuncsT -> m UnicodeFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT)
-> IO UnicodeFuncsT -> m UnicodeFuncsT
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 UnicodeFuncsT
result <- Ptr UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
hb_unicode_funcs_get_parent Ptr UnicodeFuncsT
ufuncs'
    Text -> Ptr UnicodeFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeFuncsGetParent" Ptr UnicodeFuncsT
result
    UnicodeFuncsT
result' <- ((ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> IO UnicodeFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) Ptr UnicodeFuncsT
result
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    UnicodeFuncsT -> IO UnicodeFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeFuncsT
result'


-- function unicode_funcs_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_funcs_get_empty" hb_unicode_funcs_get_empty :: 
    IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)

-- | Fetches the singleton empty Unicode-functions structure.
-- 
-- /Since: 0.9.2/
unicodeFuncsGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ __Returns:__ The empty Unicode-functions structure
unicodeFuncsGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m UnicodeFuncsT
unicodeFuncsGetEmpty  = IO UnicodeFuncsT -> m UnicodeFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT)
-> IO UnicodeFuncsT -> m UnicodeFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
result <- IO (Ptr UnicodeFuncsT)
hb_unicode_funcs_get_empty
    Text -> Ptr UnicodeFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeFuncsGetEmpty" Ptr UnicodeFuncsT
result
    UnicodeFuncsT
result' <- ((ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> IO UnicodeFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) Ptr UnicodeFuncsT
result
    UnicodeFuncsT -> IO UnicodeFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeFuncsT
result'


-- function unicode_funcs_get_default
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_funcs_get_default" hb_unicode_funcs_get_default :: 
    IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)

-- | Fetches a pointer to the default Unicode-functions structure that is used
-- when no functions are explicitly set on t'GI.HarfBuzz.Structs.BufferT.BufferT'.
-- 
-- /Since: 0.9.2/
unicodeFuncsGetDefault ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ __Returns:__ a pointer to the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' Unicode-functions structure
unicodeFuncsGetDefault :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m UnicodeFuncsT
unicodeFuncsGetDefault  = IO UnicodeFuncsT -> m UnicodeFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT)
-> IO UnicodeFuncsT -> m UnicodeFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
result <- IO (Ptr UnicodeFuncsT)
hb_unicode_funcs_get_default
    Text -> Ptr UnicodeFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeFuncsGetDefault" Ptr UnicodeFuncsT
result
    UnicodeFuncsT
result' <- ((ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> IO UnicodeFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) Ptr UnicodeFuncsT
result
    UnicodeFuncsT -> IO UnicodeFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeFuncsT
result'


-- function unicode_funcs_create
-- Args: [ Arg
--           { argCName = "parent"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Parent Unicode-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_funcs_create" hb_unicode_funcs_create :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- parent : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)

-- | Creates a new t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' structure of Unicode functions.
-- 
-- /Since: 0.9.2/
unicodeFuncsCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe (HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)
    -- ^ /@parent@/: Parent Unicode-functions structure
    -> m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ __Returns:__ The Unicode-functions structure
unicodeFuncsCreate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe UnicodeFuncsT -> m UnicodeFuncsT
unicodeFuncsCreate Maybe UnicodeFuncsT
parent = IO UnicodeFuncsT -> m UnicodeFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT)
-> IO UnicodeFuncsT -> m UnicodeFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
maybeParent <- case Maybe UnicodeFuncsT
parent of
        Maybe UnicodeFuncsT
Nothing -> Ptr UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnicodeFuncsT
forall a. Ptr a
nullPtr
        Just UnicodeFuncsT
jParent -> do
            Ptr UnicodeFuncsT
jParent' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
jParent
            Ptr UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr UnicodeFuncsT
jParent'
    Ptr UnicodeFuncsT
result <- Ptr UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
hb_unicode_funcs_create Ptr UnicodeFuncsT
maybeParent
    Text -> Ptr UnicodeFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeFuncsCreate" Ptr UnicodeFuncsT
result
    UnicodeFuncsT
result' <- ((ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> IO UnicodeFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) Ptr UnicodeFuncsT
result
    Maybe UnicodeFuncsT -> (UnicodeFuncsT -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe UnicodeFuncsT
parent UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    UnicodeFuncsT -> IO UnicodeFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeFuncsT
result'


-- function unicode_eastasian_width
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_eastasian_width" hb_unicode_eastasian_width :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    IO Word32

{-# DEPRECATED unicodeEastasianWidth ["(Since version 2.0.0)"] #-}
-- | Don\'t use. Not used by HarfBuzz.
-- 
-- /Since: 0.9.2/
unicodeEastasianWidth ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: a Unicode-function structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> m Word32
unicodeEastasianWidth :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m Word32
unicodeEastasianWidth UnicodeFuncsT
ufuncs Word32
unicode = 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 <- Ptr UnicodeFuncsT -> Word32 -> IO Word32
hb_unicode_eastasian_width Ptr UnicodeFuncsT
ufuncs' Word32
unicode
    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


-- function unicode_decompose_compatibility
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Unicode-functions 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 "Code point to decompose"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "decomposed"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Compatibility decomposition of @u"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_decompose_compatibility" hb_unicode_decompose_compatibility :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- u : TBasicType TUInt32
    Ptr Word32 ->                           -- decomposed : TBasicType TUInt32
    IO Word32

{-# DEPRECATED unicodeDecomposeCompatibility ["(Since version 2.0.0)"] #-}
-- | Fetches the compatibility decomposition of a Unicode
-- code point. Deprecated.
-- 
-- /Since: 0.9.2/
unicodeDecomposeCompatibility ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@u@/: Code point to decompose
    -> m ((Word32, Word32))
    -- ^ __Returns:__ length of /@decomposed@/.
unicodeDecomposeCompatibility :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m (Word32, Word32)
unicodeDecomposeCompatibility UnicodeFuncsT
ufuncs Word32
u = 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 UnicodeFuncsT
ufuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
ufuncs
    Ptr Word32
decomposed <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Word32
result <- Ptr UnicodeFuncsT -> Word32 -> Ptr Word32 -> IO Word32
hb_unicode_decompose_compatibility Ptr UnicodeFuncsT
ufuncs' Word32
u Ptr Word32
decomposed
    Word32
decomposed' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
decomposed
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
ufuncs
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
decomposed
    (Word32, Word32) -> IO (Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, Word32
decomposed')


-- function unicode_decompose
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The 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 "Unicode 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 code point of the decomposition of @ab"
--                 , 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 code point of the decomposition of @ab"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_decompose" hb_unicode_decompose :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- ab : TBasicType TUInt32
    Ptr Word32 ->                           -- a : TBasicType TUInt32
    Ptr Word32 ->                           -- b : TBasicType TUInt32
    IO Int32

-- | Fetches the decomposition of a Unicode code point.
-- 
-- Calls the decomposition function of the specified
-- Unicode-functions structure /@ufuncs@/.
-- 
-- /Since: 0.9.2/
unicodeDecompose ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@ab@/: Unicode code point to decompose
    -> m ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if /@ab@/ was decomposed, @/false/@ otherwise
unicodeDecompose :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m (Int32, Word32, Word32)
unicodeDecompose UnicodeFuncsT
ufuncs Word32
ab = 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 <- Ptr UnicodeFuncsT -> Word32 -> Ptr Word32 -> Ptr Word32 -> IO Int32
hb_unicode_decompose Ptr UnicodeFuncsT
ufuncs' Word32
ab Ptr Word32
a Ptr Word32
b
    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')


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

foreign import ccall "hb_unicode_compose" hb_unicode_compose :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- a : TBasicType TUInt32
    Word32 ->                               -- b : TBasicType TUInt32
    Ptr Word32 ->                           -- ab : TBasicType TUInt32
    IO Int32

-- | Fetches the composition of a sequence of two Unicode
-- code points.
-- 
-- Calls the composition function of the specified
-- Unicode-functions structure /@ufuncs@/.
-- 
-- /Since: 0.9.2/
unicodeCompose ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@a@/: The first Unicode code point to compose
    -> Word32
    -- ^ /@b@/: The second Unicode code point to compose
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if /@a@/ and /@b@/ composed, @/false/@ otherwise
unicodeCompose :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> Word32 -> m (Int32, Word32)
unicodeCompose UnicodeFuncsT
ufuncs Word32
a Word32
b = 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 <- Ptr UnicodeFuncsT -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_unicode_compose Ptr UnicodeFuncsT
ufuncs' Word32
a Word32
b Ptr Word32
ab
    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')


-- function unicode_combining_class
-- Args: [ Arg
--           { argCName = "ufuncs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The 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
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "unicode_combining_class_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_unicode_combining_class" hb_unicode_combining_class :: 
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- ufuncs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    IO CUInt

-- | Retrieves the Canonical Combining Class (ccc) property
-- of code point /@unicode@/.
-- 
-- /Since: 0.9.2/
unicodeCombiningClass ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@ufuncs@/: The Unicode-functions structure
    -> Word32
    -- ^ /@unicode@/: The code point to query
    -> m HarfBuzz.Enums.UnicodeCombiningClassT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.UnicodeCombiningClassT' of /@unicode@/
unicodeCombiningClass :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeFuncsT -> Word32 -> m UnicodeCombiningClassT
unicodeCombiningClass UnicodeFuncsT
ufuncs Word32
unicode = 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 <- Ptr UnicodeFuncsT -> Word32 -> IO CUInt
hb_unicode_combining_class Ptr UnicodeFuncsT
ufuncs' Word32
unicode
    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'


-- function tag_to_string
-- XXX Could not generate function tag_to_string

-- Not implemented: Don't know how to allocate "buf" of type TCArray False 4 (-1) (TBasicType TUInt8)

-- function tag_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "String to convert" , 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 "Length of @str, or -1 if it is %NULL-terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "Length of @str, or -1 if it is %NULL-terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_tag_from_string" hb_tag_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    IO Word32

-- | Converts a string into an @/hb_tag_t/@. Valid tags
-- are four characters. Shorter input strings will be
-- padded with spaces. Longer input strings will be
-- truncated.
-- 
-- /Since: 0.9.2/
tagFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: String to convert
    -> m Word32
    -- ^ __Returns:__ The @/hb_tag_t/@ corresponding to /@str@/
tagFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m Word32
tagFromString ByteString
str = 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
    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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    Word32
result <- Ptr Word8 -> Int32 -> IO Word32
hb_tag_from_string Ptr Word8
str' Int32
len
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function style_get_value
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #hb_font_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "style_tag"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "style_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a style tag." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "hb_style_get_value" hb_style_get_value :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- style_tag : TInterface (Name {namespace = "HarfBuzz", name = "style_tag_t"})
    IO CFloat

-- | Searches variation axes of a t'GI.HarfBuzz.Structs.FontT.FontT' object for a specific axis first,
-- if not set, then tries to get default style values from different
-- tables of the font.
-- 
-- /Since: 3.0.0/
styleGetValue ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: a t'GI.HarfBuzz.Structs.FontT.FontT' object.
    -> HarfBuzz.Enums.StyleTagT
    -- ^ /@styleTag@/: a style tag.
    -> m Float
    -- ^ __Returns:__ Corresponding axis or default value to a style tag.
styleGetValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> StyleTagT -> m Float
styleGetValue FontT
font StyleTagT
styleTag = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
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
    let styleTag' :: CUInt
styleTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (StyleTagT -> Int) -> StyleTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StyleTagT -> Int
forall a. Enum a => a -> Int
fromEnum) StyleTagT
styleTag
    CFloat
result <- Ptr FontT -> CUInt -> IO CFloat
hb_style_get_value Ptr FontT
font' CUInt
styleTag'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'


-- function shape_plan_get_shaper
-- Args: [ Arg
--           { argCName = "shape_plan"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "shape_plan_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A shaping plan" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_get_shaper" hb_shape_plan_get_shaper :: 
    Ptr HarfBuzz.ShapePlanT.ShapePlanT ->   -- shape_plan : TInterface (Name {namespace = "HarfBuzz", name = "shape_plan_t"})
    IO CString

-- | Fetches the shaper from a given shaping plan.
-- 
-- /Since: 0.9.7/
shapePlanGetShaper ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ /@shapePlan@/: A shaping plan
    -> m T.Text
    -- ^ __Returns:__ The shaper
shapePlanGetShaper :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShapePlanT -> m Text
shapePlanGetShaper ShapePlanT
shapePlan = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ShapePlanT
shapePlan' <- ShapePlanT -> IO (Ptr ShapePlanT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShapePlanT
shapePlan
    CString
result <- Ptr ShapePlanT -> IO CString
hb_shape_plan_get_shaper Ptr ShapePlanT
shapePlan'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapePlanGetShaper" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    ShapePlanT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShapePlanT
shapePlan
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function shape_plan_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "shape_plan_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_get_empty" hb_shape_plan_get_empty :: 
    IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT)

-- | Fetches the singleton empty shaping plan.
-- 
-- /Since: 0.9.7/
shapePlanGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ __Returns:__ The empty shaping plan
shapePlanGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ShapePlanT
shapePlanGetEmpty  = IO ShapePlanT -> m ShapePlanT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT
forall a b. (a -> b) -> a -> b
$ do
    Ptr ShapePlanT
result <- IO (Ptr ShapePlanT)
hb_shape_plan_get_empty
    Text -> Ptr ShapePlanT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapePlanGetEmpty" Ptr ShapePlanT
result
    ShapePlanT
result' <- ((ManagedPtr ShapePlanT -> ShapePlanT)
-> Ptr ShapePlanT -> IO ShapePlanT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShapePlanT -> ShapePlanT
HarfBuzz.ShapePlanT.ShapePlanT) Ptr ShapePlanT
result
    ShapePlanT -> IO ShapePlanT
forall (m :: * -> *) a. Monad m => a -> m a
return ShapePlanT
result'


-- function shape_plan_execute
-- Args: [ Arg
--           { argCName = "shape_plan"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "shape_plan_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A shaping plan" , 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 to use"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_buffer_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 4
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Features to enable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of features to enable"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of features to enable"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_execute" hb_shape_plan_execute :: 
    Ptr HarfBuzz.ShapePlanT.ShapePlanT ->   -- shape_plan : TInterface (Name {namespace = "HarfBuzz", name = "shape_plan_t"})
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- features : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_features : TBasicType TUInt
    IO Int32

-- | Executes the given shaping plan on the specified buffer, using
-- the given /@font@/ and /@features@/.
-- 
-- /Since: 0.9.7/
shapePlanExecute ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ /@shapePlan@/: A shaping plan
    -> HarfBuzz.FontT.FontT
    -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' to use
    -> HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: The t'GI.HarfBuzz.Structs.BufferT.BufferT' to work upon
    -> [HarfBuzz.FeatureT.FeatureT]
    -- ^ /@features@/: Features to enable
    -> m Int32
    -- ^ __Returns:__ @/true/@ if success, @/false/@ otherwise.
shapePlanExecute :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ShapePlanT -> FontT -> BufferT -> [FeatureT] -> m Int32
shapePlanExecute ShapePlanT
shapePlan FontT
font BufferT
buffer [FeatureT]
features = 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
    let numFeatures :: Word32
numFeatures = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
features
    Ptr ShapePlanT
shapePlan' <- ShapePlanT -> IO (Ptr ShapePlanT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ShapePlanT
shapePlan
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    [Ptr FeatureT]
features' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
features
    Ptr FeatureT
features'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
features'
    Int32
result <- Ptr ShapePlanT
-> Ptr FontT -> Ptr BufferT -> Ptr FeatureT -> Word32 -> IO Int32
hb_shape_plan_execute Ptr ShapePlanT
shapePlan' Ptr FontT
font' Ptr BufferT
buffer' Ptr FeatureT
features'' Word32
numFeatures
    ShapePlanT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ShapePlanT
shapePlan
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    (FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [FeatureT]
features
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
features''
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function shape_plan_create_cached2
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_segment_properties_t of the segment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The list of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_user_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords"
--           , argType = TCArray False (-1) 5 (TBasicType TInt)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The list of variation-space coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_coords"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of variation-space coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "shaper_list"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "List of shapers to try"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_coords"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of variation-space coordinates"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          , Arg
--              { argCName = "num_user_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of user-selected features"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "shape_plan_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_create_cached2" hb_shape_plan_create_cached2 :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_user_features : TBasicType TUInt
    Ptr Int32 ->                            -- coords : TCArray False (-1) 5 (TBasicType TInt)
    Word32 ->                               -- num_coords : TBasicType TUInt
    Ptr CString ->                          -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT)

-- | The variable-font version of @/hb_shape_plan_create_cached/@.
-- Creates a cached shaping plan suitable for reuse, for a combination
-- of /@face@/, /@userFeatures@/, /@props@/, and /@shaperList@/, plus the
-- variation-space coordinates /@coords@/.
-- 
-- /Since: 1.4.0/
shapePlanCreateCached2 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment
    -> [HarfBuzz.FeatureT.FeatureT]
    -- ^ /@userFeatures@/: The list of user-selected features
    -> [Int32]
    -- ^ /@coords@/: The list of variation-space coordinates
    -> [T.Text]
    -- ^ /@shaperList@/: List of shapers to try
    -> m HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ __Returns:__ The shaping plan
shapePlanCreateCached2 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> SegmentPropertiesT
-> [FeatureT]
-> [Int32]
-> [Text]
-> m ShapePlanT
shapePlanCreateCached2 FaceT
face SegmentPropertiesT
props [FeatureT]
userFeatures [Int32]
coords [Text]
shaperList = IO ShapePlanT -> m ShapePlanT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT
forall a b. (a -> b) -> a -> b
$ do
    let numCoords :: Word32
numCoords = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Int32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Int32]
coords
    let numUserFeatures :: Word32
numUserFeatures = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
userFeatures
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SegmentPropertiesT
props' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
props
    [Ptr FeatureT]
userFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
userFeatures
    Ptr FeatureT
userFeatures'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
userFeatures'
    Ptr Int32
coords' <- [Int32] -> IO (Ptr Int32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
coords
    Ptr CString
shaperList' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
shaperList
    Ptr ShapePlanT
result <- Ptr FaceT
-> Ptr SegmentPropertiesT
-> Ptr FeatureT
-> Word32
-> Ptr Int32
-> Word32
-> Ptr CString
-> IO (Ptr ShapePlanT)
hb_shape_plan_create_cached2 Ptr FaceT
face' Ptr SegmentPropertiesT
props' Ptr FeatureT
userFeatures'' Word32
numUserFeatures Ptr Int32
coords' Word32
numCoords Ptr CString
shaperList'
    Text -> Ptr ShapePlanT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapePlanCreateCached2" Ptr ShapePlanT
result
    ShapePlanT
result' <- ((ManagedPtr ShapePlanT -> ShapePlanT)
-> Ptr ShapePlanT -> IO ShapePlanT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShapePlanT -> ShapePlanT
HarfBuzz.ShapePlanT.ShapePlanT) Ptr ShapePlanT
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
props
    (FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [FeatureT]
userFeatures
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
userFeatures''
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
coords'
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    ShapePlanT -> IO ShapePlanT
forall (m :: * -> *) a. Monad m => a -> m a
return ShapePlanT
result'


-- function shape_plan_create_cached
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_segment_properties_t of the segment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The list of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_user_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "shaper_list"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "List of shapers to try"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_user_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of user-selected features"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "shape_plan_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_create_cached" hb_shape_plan_create_cached :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_user_features : TBasicType TUInt
    Ptr CString ->                          -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT)

-- | Creates a cached shaping plan suitable for reuse, for a combination
-- of /@face@/, /@userFeatures@/, /@props@/, and /@shaperList@/.
-- 
-- /Since: 0.9.7/
shapePlanCreateCached ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment
    -> [HarfBuzz.FeatureT.FeatureT]
    -- ^ /@userFeatures@/: The list of user-selected features
    -> [T.Text]
    -- ^ /@shaperList@/: List of shapers to try
    -> m HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ __Returns:__ The shaping plan
shapePlanCreateCached :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> SegmentPropertiesT -> [FeatureT] -> [Text] -> m ShapePlanT
shapePlanCreateCached FaceT
face SegmentPropertiesT
props [FeatureT]
userFeatures [Text]
shaperList = IO ShapePlanT -> m ShapePlanT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT
forall a b. (a -> b) -> a -> b
$ do
    let numUserFeatures :: Word32
numUserFeatures = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
userFeatures
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SegmentPropertiesT
props' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
props
    [Ptr FeatureT]
userFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
userFeatures
    Ptr FeatureT
userFeatures'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
userFeatures'
    Ptr CString
shaperList' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
shaperList
    Ptr ShapePlanT
result <- Ptr FaceT
-> Ptr SegmentPropertiesT
-> Ptr FeatureT
-> Word32
-> Ptr CString
-> IO (Ptr ShapePlanT)
hb_shape_plan_create_cached Ptr FaceT
face' Ptr SegmentPropertiesT
props' Ptr FeatureT
userFeatures'' Word32
numUserFeatures Ptr CString
shaperList'
    Text -> Ptr ShapePlanT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapePlanCreateCached" Ptr ShapePlanT
result
    ShapePlanT
result' <- ((ManagedPtr ShapePlanT -> ShapePlanT)
-> Ptr ShapePlanT -> IO ShapePlanT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShapePlanT -> ShapePlanT
HarfBuzz.ShapePlanT.ShapePlanT) Ptr ShapePlanT
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
props
    (FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [FeatureT]
userFeatures
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
userFeatures''
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    ShapePlanT -> IO ShapePlanT
forall (m :: * -> *) a. Monad m => a -> m a
return ShapePlanT
result'


-- function shape_plan_create2
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_segment_properties_t of the segment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The list of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_user_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords"
--           , argType = TCArray False (-1) 5 (TBasicType TInt)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The list of variation-space coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_coords"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of variation-space coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "shaper_list"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "List of shapers to try"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_coords"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of variation-space coordinates"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          , Arg
--              { argCName = "num_user_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of user-selected features"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "shape_plan_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_create2" hb_shape_plan_create2 :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_user_features : TBasicType TUInt
    Ptr Int32 ->                            -- coords : TCArray False (-1) 5 (TBasicType TInt)
    Word32 ->                               -- num_coords : TBasicType TUInt
    Ptr CString ->                          -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT)

-- | The variable-font version of @/hb_shape_plan_create/@.
-- Constructs a shaping plan for a combination of /@face@/, /@userFeatures@/, /@props@/,
-- and /@shaperList@/, plus the variation-space coordinates /@coords@/.
-- 
-- /Since: 1.4.0/
shapePlanCreate2 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment
    -> [HarfBuzz.FeatureT.FeatureT]
    -- ^ /@userFeatures@/: The list of user-selected features
    -> [Int32]
    -- ^ /@coords@/: The list of variation-space coordinates
    -> [T.Text]
    -- ^ /@shaperList@/: List of shapers to try
    -> m HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ __Returns:__ The shaping plan
shapePlanCreate2 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> SegmentPropertiesT
-> [FeatureT]
-> [Int32]
-> [Text]
-> m ShapePlanT
shapePlanCreate2 FaceT
face SegmentPropertiesT
props [FeatureT]
userFeatures [Int32]
coords [Text]
shaperList = IO ShapePlanT -> m ShapePlanT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT
forall a b. (a -> b) -> a -> b
$ do
    let numCoords :: Word32
numCoords = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Int32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Int32]
coords
    let numUserFeatures :: Word32
numUserFeatures = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
userFeatures
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SegmentPropertiesT
props' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
props
    [Ptr FeatureT]
userFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
userFeatures
    Ptr FeatureT
userFeatures'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
userFeatures'
    Ptr Int32
coords' <- [Int32] -> IO (Ptr Int32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
coords
    Ptr CString
shaperList' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
shaperList
    Ptr ShapePlanT
result <- Ptr FaceT
-> Ptr SegmentPropertiesT
-> Ptr FeatureT
-> Word32
-> Ptr Int32
-> Word32
-> Ptr CString
-> IO (Ptr ShapePlanT)
hb_shape_plan_create2 Ptr FaceT
face' Ptr SegmentPropertiesT
props' Ptr FeatureT
userFeatures'' Word32
numUserFeatures Ptr Int32
coords' Word32
numCoords Ptr CString
shaperList'
    Text -> Ptr ShapePlanT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapePlanCreate2" Ptr ShapePlanT
result
    ShapePlanT
result' <- ((ManagedPtr ShapePlanT -> ShapePlanT)
-> Ptr ShapePlanT -> IO ShapePlanT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShapePlanT -> ShapePlanT
HarfBuzz.ShapePlanT.ShapePlanT) Ptr ShapePlanT
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
props
    (FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [FeatureT]
userFeatures
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
userFeatures''
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
coords'
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    ShapePlanT -> IO ShapePlanT
forall (m :: * -> *) a. Monad m => a -> m a
return ShapePlanT
result'


-- function shape_plan_create
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to use" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_segment_properties_t of the segment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The list of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_user_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of user-selected features"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "shaper_list"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "List of shapers to try"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_user_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The number of user-selected features"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "shape_plan_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_plan_create" hb_shape_plan_create :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- user_features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_user_features : TBasicType TUInt
    Ptr CString ->                          -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO (Ptr HarfBuzz.ShapePlanT.ShapePlanT)

-- | Constructs a shaping plan for a combination of /@face@/, /@userFeatures@/, /@props@/,
-- and /@shaperList@/.
-- 
-- /Since: 0.9.7/
shapePlanCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to use
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@props@/: The t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of the segment
    -> [HarfBuzz.FeatureT.FeatureT]
    -- ^ /@userFeatures@/: The list of user-selected features
    -> [T.Text]
    -- ^ /@shaperList@/: List of shapers to try
    -> m HarfBuzz.ShapePlanT.ShapePlanT
    -- ^ __Returns:__ The shaping plan
shapePlanCreate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> SegmentPropertiesT -> [FeatureT] -> [Text] -> m ShapePlanT
shapePlanCreate FaceT
face SegmentPropertiesT
props [FeatureT]
userFeatures [Text]
shaperList = IO ShapePlanT -> m ShapePlanT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ShapePlanT -> m ShapePlanT) -> IO ShapePlanT -> m ShapePlanT
forall a b. (a -> b) -> a -> b
$ do
    let numUserFeatures :: Word32
numUserFeatures = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
userFeatures
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SegmentPropertiesT
props' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
props
    [Ptr FeatureT]
userFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
userFeatures
    Ptr FeatureT
userFeatures'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
userFeatures'
    Ptr CString
shaperList' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
shaperList
    Ptr ShapePlanT
result <- Ptr FaceT
-> Ptr SegmentPropertiesT
-> Ptr FeatureT
-> Word32
-> Ptr CString
-> IO (Ptr ShapePlanT)
hb_shape_plan_create Ptr FaceT
face' Ptr SegmentPropertiesT
props' Ptr FeatureT
userFeatures'' Word32
numUserFeatures Ptr CString
shaperList'
    Text -> Ptr ShapePlanT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapePlanCreate" Ptr ShapePlanT
result
    ShapePlanT
result' <- ((ManagedPtr ShapePlanT -> ShapePlanT)
-> Ptr ShapePlanT -> IO ShapePlanT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ShapePlanT -> ShapePlanT
HarfBuzz.ShapePlanT.ShapePlanT) Ptr ShapePlanT
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
props
    (FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [FeatureT]
userFeatures
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
userFeatures''
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
shaperList'
    ShapePlanT -> IO ShapePlanT
forall (m :: * -> *) a. Monad m => a -> m a
return ShapePlanT
result'


-- function shape_list_shapers
-- Args: []
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_list_shapers" hb_shape_list_shapers :: 
    IO (Ptr CString)

-- | Retrieves the list of shapers supported by HarfBuzz.
-- 
-- /Since: 0.9.2/
shapeListShapers ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [T.Text]
    -- ^ __Returns:__ an array of
    --    constant strings
shapeListShapers :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text]
shapeListShapers  = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr CString
result <- IO (Ptr CString)
hb_shape_list_shapers
    Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"shapeListShapers" Ptr CString
result
    [Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'


-- function shape_full
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t to use for shaping"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t to shape"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an array of user\n   specified #hb_feature_t or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the length of @features array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "shaper_list"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a %NULL-terminated\n   array of shapers to use or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the length of @features array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape_full" hb_shape_full :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_features : TBasicType TUInt
    Ptr CString ->                          -- shaper_list : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO Int32

-- | See 'GI.HarfBuzz.Functions.shape' for details. If /@shaperList@/ is not 'P.Nothing', the specified
-- shapers will be used in the given order, otherwise the default shapers list
-- will be used.
-- 
-- /Since: 0.9.2/
shapeFull ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' to use for shaping
    -> HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' to shape
    -> Maybe ([HarfBuzz.FeatureT.FeatureT])
    -- ^ /@features@/: an array of user
    --    specified t'GI.HarfBuzz.Structs.FeatureT.FeatureT' or 'P.Nothing'
    -> Maybe ([T.Text])
    -- ^ /@shaperList@/: a 'P.Nothing'-terminated
    --    array of shapers to use or 'P.Nothing'
    -> m Int32
    -- ^ __Returns:__ false if all shapers failed, true otherwise
shapeFull :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> BufferT -> Maybe [FeatureT] -> Maybe [Text] -> m Int32
shapeFull FontT
font BufferT
buffer Maybe [FeatureT]
features Maybe [Text]
shaperList = 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
    let numFeatures :: Word32
numFeatures = case Maybe [FeatureT]
features of
            Maybe [FeatureT]
Nothing -> Word32
0
            Just [FeatureT]
jFeatures -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
jFeatures
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr FeatureT
maybeFeatures <- case Maybe [FeatureT]
features of
        Maybe [FeatureT]
Nothing -> Ptr FeatureT -> IO (Ptr FeatureT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FeatureT
forall a. Ptr a
nullPtr
        Just [FeatureT]
jFeatures -> do
            [Ptr FeatureT]
jFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
jFeatures
            Ptr FeatureT
jFeatures'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
jFeatures'
            Ptr FeatureT -> IO (Ptr FeatureT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FeatureT
jFeatures''
    Ptr CString
maybeShaperList <- case Maybe [Text]
shaperList of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
        Just [Text]
jShaperList -> do
            Ptr CString
jShaperList' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jShaperList
            Ptr CString -> IO (Ptr CString)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jShaperList'
    Int32
result <- Ptr FontT
-> Ptr BufferT -> Ptr FeatureT -> Word32 -> Ptr CString -> IO Int32
hb_shape_full Ptr FontT
font' Ptr BufferT
buffer' Ptr FeatureT
maybeFeatures Word32
numFeatures Ptr CString
maybeShaperList
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Maybe [FeatureT] -> ([FeatureT] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [FeatureT]
features ((FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
maybeFeatures
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeShaperList
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeShaperList
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function shape
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t to use for shaping"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t to shape"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface Name { namespace = "HarfBuzz" , name = "feature_t" })
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an array of user\n   specified #hb_feature_t or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_features"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the length of @features array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_features"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the length of @features array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_shape" hb_shape :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- features : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "feature_t"}))
    Word32 ->                               -- num_features : TBasicType TUInt
    IO ()

-- | Shapes /@buffer@/ using /@font@/ turning its Unicode characters content to
-- positioned glyphs. If /@features@/ is not 'P.Nothing', it will be used to control the
-- features applied during shaping. If two /@features@/ have the same tag but
-- overlapping ranges the value of the feature with the higher index takes
-- precedence.
-- 
-- /Since: 0.9.2/
shape ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' to use for shaping
    -> HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' to shape
    -> Maybe ([HarfBuzz.FeatureT.FeatureT])
    -- ^ /@features@/: an array of user
    --    specified t'GI.HarfBuzz.Structs.FeatureT.FeatureT' or 'P.Nothing'
    -> m ()
shape :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> BufferT -> Maybe [FeatureT] -> m ()
shape FontT
font BufferT
buffer Maybe [FeatureT]
features = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let numFeatures :: Word32
numFeatures = case Maybe [FeatureT]
features of
            Maybe [FeatureT]
Nothing -> Word32
0
            Just [FeatureT]
jFeatures -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [FeatureT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [FeatureT]
jFeatures
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr FeatureT
maybeFeatures <- case Maybe [FeatureT]
features of
        Maybe [FeatureT]
Nothing -> Ptr FeatureT -> IO (Ptr FeatureT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FeatureT
forall a. Ptr a
nullPtr
        Just [FeatureT]
jFeatures -> do
            [Ptr FeatureT]
jFeatures' <- (FeatureT -> IO (Ptr FeatureT)) -> [FeatureT] -> IO [Ptr FeatureT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [FeatureT]
jFeatures
            Ptr FeatureT
jFeatures'' <- Int -> [Ptr FeatureT] -> IO (Ptr FeatureT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr FeatureT]
jFeatures'
            Ptr FeatureT -> IO (Ptr FeatureT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FeatureT
jFeatures''
    Ptr FontT -> Ptr BufferT -> Ptr FeatureT -> Word32 -> IO ()
hb_shape Ptr FontT
font' Ptr BufferT
buffer' Ptr FeatureT
maybeFeatures Word32
numFeatures
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Maybe [FeatureT] -> ([FeatureT] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [FeatureT]
features ((FeatureT -> IO ()) -> [FeatureT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
    Ptr FeatureT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr FeatureT
maybeFeatures
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_union
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_union" hb_set_union :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Makes /@set@/ the union of /@set@/ and /@other@/.
-- 
-- /Since: 0.9.2/
setUnion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@other@/: Another set
    -> m ()
setUnion :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m ()
setUnion SetT
set SetT
other = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
other' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
other
    Ptr SetT -> Ptr SetT -> IO ()
hb_set_union Ptr SetT
set' Ptr SetT
other'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
other
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_symmetric_difference
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_symmetric_difference" hb_set_symmetric_difference :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Makes /@set@/ the symmetric difference of /@set@/
-- and /@other@/.
-- 
-- /Since: 0.9.2/
setSymmetricDifference ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@other@/: Another set
    -> m ()
setSymmetricDifference :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m ()
setSymmetricDifference SetT
set SetT
other = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
other' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
other
    Ptr SetT -> Ptr SetT -> IO ()
hb_set_symmetric_difference Ptr SetT
set' Ptr SetT
other'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
other
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_subtract
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_subtract" hb_set_subtract :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Subtracts the contents of /@other@/ from /@set@/.
-- 
-- /Since: 0.9.2/
setSubtract ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@other@/: Another set
    -> m ()
setSubtract :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m ()
setSubtract SetT
set SetT
other = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
other' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
other
    Ptr SetT -> Ptr SetT -> IO ()
hb_set_subtract Ptr SetT
set' Ptr SetT
other'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
other
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_set
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_set" hb_set_set :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Makes the contents of /@set@/ equal to the contents of /@other@/.
-- 
-- /Since: 0.9.2/
setSet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@other@/: Another set
    -> m ()
setSet :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m ()
setSet SetT
set SetT
other = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
other' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
other
    Ptr SetT -> Ptr SetT -> IO ()
hb_set_set Ptr SetT
set' Ptr SetT
other'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
other
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_previous_range
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first"
--           , argType = TBasicType TUInt32
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = The current first code point in the range\n        Output = The first code point in the range"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "last"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The last code point in the range"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_previous_range" hb_set_previous_range :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr Word32 ->                           -- first : TBasicType TUInt32
    Ptr Word32 ->                           -- last : TBasicType TUInt32
    IO Int32

-- | Fetches the previous consecutive range of elements in /@set@/ that
-- are greater than current value of /@last@/.
-- 
-- Set /@first@/ to 'GI.HarfBuzz.Constants.SET_VALUE_INVALID' to get started.
-- 
-- /Since: 1.8.0/
setPreviousRange ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@first@/: Input = The current first code point in the range
    --         Output = The first code point in the range
    -> m ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if there was a previous range, @/false/@ otherwise
setPreviousRange :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m (Int32, Word32, Word32)
setPreviousRange SetT
set Word32
first = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr Word32
first' <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
first' Word32
first
    Ptr Word32
last <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr SetT -> Ptr Word32 -> Ptr Word32 -> IO Int32
hb_set_previous_range Ptr SetT
set' Ptr Word32
first' Ptr Word32
last
    Word32
first'' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
first'
    Word32
last' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
last
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
first'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
last
    (Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
first'', Word32
last')


-- function set_previous
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "codepoint"
--           , argType = TBasicType TUInt32
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = Code point to query\n            Output = Code point retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_previous" hb_set_previous :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr Word32 ->                           -- codepoint : TBasicType TUInt32
    IO Int32

-- | Fetches the previous element in /@set@/ that is lower than current value of /@codepoint@/.
-- 
-- Set /@codepoint@/ to 'GI.HarfBuzz.Constants.SET_VALUE_INVALID' to get started.
-- 
-- /Since: 1.8.0/
setPrevious ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@codepoint@/: Input = Code point to query
    --             Output = Code point retrieved
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if there was a previous value, @/false/@ otherwise
setPrevious :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m (Int32, Word32)
setPrevious SetT
set Word32
codepoint = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr Word32
codepoint' <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
codepoint' Word32
codepoint
    Int32
result <- Ptr SetT -> Ptr Word32 -> IO Int32
hb_set_previous Ptr SetT
set' Ptr Word32
codepoint'
    Word32
codepoint'' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
codepoint'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
codepoint'
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
codepoint'')


-- function set_next_range
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The first code point in the range"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "last"
--           , argType = TBasicType TUInt32
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = The current last code point in the range\n        Output = The last code point in the range"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_next_range" hb_set_next_range :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr Word32 ->                           -- first : TBasicType TUInt32
    Ptr Word32 ->                           -- last : TBasicType TUInt32
    IO Int32

-- | Fetches the next consecutive range of elements in /@set@/ that
-- are greater than current value of /@last@/.
-- 
-- Set /@last@/ to 'GI.HarfBuzz.Constants.SET_VALUE_INVALID' to get started.
-- 
-- /Since: 0.9.7/
setNextRange ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@last@/: Input = The current last code point in the range
    --         Output = The last code point in the range
    -> m ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if there was a next range, @/false/@ otherwise
setNextRange :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m (Int32, Word32, Word32)
setNextRange SetT
set Word32
last = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr Word32
first <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
last' <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
last' Word32
last
    Int32
result <- Ptr SetT -> Ptr Word32 -> Ptr Word32 -> IO Int32
hb_set_next_range Ptr SetT
set' Ptr Word32
first Ptr Word32
last'
    Word32
first' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
first
    Word32
last'' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
last'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
first
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
last'
    (Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
first', Word32
last'')


-- function set_next
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "codepoint"
--           , argType = TBasicType TUInt32
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = Code point to query\n            Output = Code point retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_next" hb_set_next :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr Word32 ->                           -- codepoint : TBasicType TUInt32
    IO Int32

-- | Fetches the next element in /@set@/ that is greater than current value of /@codepoint@/.
-- 
-- Set /@codepoint@/ to 'GI.HarfBuzz.Constants.SET_VALUE_INVALID' to get started.
-- 
-- /Since: 0.9.2/
setNext ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@codepoint@/: Input = Code point to query
    --             Output = Code point retrieved
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if there was a next value, @/false/@ otherwise
setNext :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m (Int32, Word32)
setNext SetT
set Word32
codepoint = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr Word32
codepoint' <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
codepoint' Word32
codepoint
    Int32
result <- Ptr SetT -> Ptr Word32 -> IO Int32
hb_set_next Ptr SetT
set' Ptr Word32
codepoint'
    Word32
codepoint'' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
codepoint'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
codepoint'
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
codepoint'')


-- function set_is_subset
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "larger_set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_is_subset" hb_set_is_subset :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- larger_set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Int32

-- | Tests whether /@set@/ is a subset of /@largerSet@/.
-- 
-- /Since: 1.8.1/
setIsSubset ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@largerSet@/: Another set
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the /@set@/ is a subset of (or equal to) /@largerSet@/, @/false/@ otherwise.
setIsSubset :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m Int32
setIsSubset SetT
set SetT
largerSet = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
largerSet' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
largerSet
    Int32
result <- Ptr SetT -> Ptr SetT -> IO Int32
hb_set_is_subset Ptr SetT
set' Ptr SetT
largerSet'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
largerSet
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function set_is_equal
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_is_equal" hb_set_is_equal :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Int32

-- | Tests whether /@set@/ and /@other@/ are equal (contain the same
-- elements).
-- 
-- /Since: 0.9.7/
setIsEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@other@/: Another set
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the two sets are equal, @/false/@ otherwise.
setIsEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m Int32
setIsEqual SetT
set SetT
other = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
other' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
other
    Int32
result <- Ptr SetT -> Ptr SetT -> IO Int32
hb_set_is_equal Ptr SetT
set' Ptr SetT
other'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
other
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function set_is_empty
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a set." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_is_empty" hb_set_is_empty :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Int32

-- | Tests whether a set is empty (contains no elements).
-- 
-- /Since: 0.9.7/
setIsEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: a set.
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@set@/ is empty
setIsEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Int32
setIsEmpty SetT
set = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Int32
result <- Ptr SetT -> IO Int32
hb_set_is_empty Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function set_invert
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_invert" hb_set_invert :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Inverts the contents of /@set@/.
-- 
-- /Since: 3.0.0/
setInvert ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m ()
setInvert :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m ()
setInvert SetT
set = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT -> IO ()
hb_set_invert Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_intersect
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Another set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_intersect" hb_set_intersect :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- other : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Makes /@set@/ the intersection of /@set@/ and /@other@/.
-- 
-- /Since: 0.9.2/
setIntersect ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> HarfBuzz.SetT.SetT
    -- ^ /@other@/: Another set
    -> m ()
setIntersect :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> SetT -> m ()
setIntersect SetT
set SetT
other = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
other' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
other
    Ptr SetT -> Ptr SetT -> IO ()
hb_set_intersect Ptr SetT
set' Ptr SetT
other'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
other
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_has
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "codepoint"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The element to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_has" hb_set_has :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Word32 ->                               -- codepoint : TBasicType TUInt32
    IO Int32

-- | Tests whether /@codepoint@/ belongs to /@set@/.
-- 
-- /Since: 0.9.2/
setHas ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@codepoint@/: The element to query
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@codepoint@/ is in /@set@/, @/false/@ otherwise
setHas :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m Int32
setHas SetT
set Word32
codepoint = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Int32
result <- Ptr SetT -> Word32 -> IO Int32
hb_set_has Ptr SetT
set' Word32
codepoint
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function set_get_population
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_get_population" hb_set_get_population :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Word32

-- | Returns the number of elements in the set.
-- 
-- /Since: 0.9.7/
setGetPopulation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m Word32
    -- ^ __Returns:__ The population of /@set@/
setGetPopulation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32
setGetPopulation SetT
set = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Word32
result <- Ptr SetT -> IO Word32
hb_set_get_population Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function set_get_min
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_get_min" hb_set_get_min :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Word32

-- | Finds the smallest element in the set.
-- 
-- /Since: 0.9.7/
setGetMin ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m Word32
    -- ^ __Returns:__ minimum of /@set@/, or 'GI.HarfBuzz.Constants.SET_VALUE_INVALID' if /@set@/ is empty.
setGetMin :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32
setGetMin SetT
set = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Word32
result <- Ptr SetT -> IO Word32
hb_set_get_min Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function set_get_max
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_get_max" hb_set_get_max :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Word32

-- | Finds the largest element in the set.
-- 
-- /Since: 0.9.7/
setGetMax ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m Word32
    -- ^ __Returns:__ maximum of /@set@/, or 'GI.HarfBuzz.Constants.SET_VALUE_INVALID' if /@set@/ is empty.
setGetMax :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Word32
setGetMax SetT
set = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Word32
result <- Ptr SetT -> IO Word32
hb_set_get_max Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function set_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "set_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_get_empty" hb_set_get_empty :: 
    IO (Ptr HarfBuzz.SetT.SetT)

-- | Fetches the singleton empty t'GI.HarfBuzz.Structs.SetT.SetT'.
-- 
-- /Since: 0.9.2/
setGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.SetT.SetT
    -- ^ __Returns:__ The empty t'GI.HarfBuzz.Structs.SetT.SetT'
setGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SetT
setGetEmpty  = IO SetT -> m SetT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SetT -> m SetT) -> IO SetT -> m SetT
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
result <- IO (Ptr SetT)
hb_set_get_empty
    Text -> Ptr SetT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"setGetEmpty" Ptr SetT
result
    SetT
result' <- ((ManagedPtr SetT -> SetT) -> Ptr SetT -> IO SetT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SetT -> SetT
HarfBuzz.SetT.SetT) Ptr SetT
result
    SetT -> IO SetT
forall (m :: * -> *) a. Monad m => a -> m a
return SetT
result'


-- function set_del_range
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The first element to remove from @set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "last"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The final element to remove from @set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_del_range" hb_set_del_range :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Word32 ->                               -- first : TBasicType TUInt32
    Word32 ->                               -- last : TBasicType TUInt32
    IO ()

-- | Removes all of the elements from /@first@/ to /@last@/
-- (inclusive) from /@set@/.
-- 
-- If /@last@/ is 'GI.HarfBuzz.Constants.SET_VALUE_INVALID', then all values
-- greater than or equal to /@first@/ are removed.
-- 
-- /Since: 0.9.7/
setDelRange ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@first@/: The first element to remove from /@set@/
    -> Word32
    -- ^ /@last@/: The final element to remove from /@set@/
    -> m ()
setDelRange :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> Word32 -> m ()
setDelRange SetT
set Word32
first Word32
last = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT -> Word32 -> Word32 -> IO ()
hb_set_del_range Ptr SetT
set' Word32
first Word32
last
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_del
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "codepoint"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Removes @codepoint from @set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_del" hb_set_del :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Word32 ->                               -- codepoint : TBasicType TUInt32
    IO ()

-- | Removes /@codepoint@/ from /@set@/.
-- 
-- /Since: 0.9.2/
setDel ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@codepoint@/: Removes /@codepoint@/ from /@set@/
    -> m ()
setDel :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m ()
setDel SetT
set Word32
codepoint = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT -> Word32 -> IO ()
hb_set_del Ptr SetT
set' Word32
codepoint
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_create
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "set_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_create" hb_set_create :: 
    IO (Ptr HarfBuzz.SetT.SetT)

-- | Creates a new, initially empty set.
-- 
-- /Since: 0.9.2/
setCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.SetT.SetT
    -- ^ __Returns:__ The new t'GI.HarfBuzz.Structs.SetT.SetT'
setCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SetT
setCreate  = IO SetT -> m SetT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SetT -> m SetT) -> IO SetT -> m SetT
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
result <- IO (Ptr SetT)
hb_set_create
    Text -> Ptr SetT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"setCreate" Ptr SetT
result
    SetT
result' <- ((ManagedPtr SetT -> SetT) -> Ptr SetT -> IO SetT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SetT -> SetT
HarfBuzz.SetT.SetT) Ptr SetT
result
    SetT -> IO SetT
forall (m :: * -> *) a. Monad m => a -> m a
return SetT
result'


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

foreign import ccall "hb_set_copy" hb_set_copy :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO (Ptr HarfBuzz.SetT.SetT)

-- | Allocate a copy of /@set@/.
-- 
-- /Since: 2.8.2/
setCopy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m HarfBuzz.SetT.SetT
    -- ^ __Returns:__ Newly-allocated set.
setCopy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m SetT
setCopy SetT
set = IO SetT -> m SetT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SetT -> m SetT) -> IO SetT -> m SetT
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT
result <- Ptr SetT -> IO (Ptr SetT)
hb_set_copy Ptr SetT
set'
    Text -> Ptr SetT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"setCopy" Ptr SetT
result
    SetT
result' <- ((ManagedPtr SetT -> SetT) -> Ptr SetT -> IO SetT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SetT -> SetT
HarfBuzz.SetT.SetT) Ptr SetT
result
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    SetT -> IO SetT
forall (m :: * -> *) a. Monad m => a -> m a
return SetT
result'


-- function set_clear
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_clear" hb_set_clear :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Clears out the contents of a set.
-- 
-- /Since: 0.9.2/
setClear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m ()
setClear :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m ()
setClear SetT
set = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT -> IO ()
hb_set_clear Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_allocation_successful
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_allocation_successful" hb_set_allocation_successful :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO Int32

-- | Tests whether memory allocation for a set was successful.
-- 
-- /Since: 0.9.2/
setAllocationSuccessful ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> m Int32
    -- ^ __Returns:__ @/true/@ if allocation succeeded, @/false/@ otherwise
setAllocationSuccessful :: forall (m :: * -> *). (HasCallStack, MonadIO m) => SetT -> m Int32
setAllocationSuccessful SetT
set = 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 SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Int32
result <- Ptr SetT -> IO Int32
hb_set_allocation_successful Ptr SetT
set'
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function set_add_range
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The first element to add to @set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "last"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The final element to add to @set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_add_range" hb_set_add_range :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Word32 ->                               -- first : TBasicType TUInt32
    Word32 ->                               -- last : TBasicType TUInt32
    IO ()

-- | Adds all of the elements from /@first@/ to /@last@/
-- (inclusive) to /@set@/.
-- 
-- /Since: 0.9.7/
setAddRange ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@first@/: The first element to add to /@set@/
    -> Word32
    -- ^ /@last@/: The final element to add to /@set@/
    -> m ()
setAddRange :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> Word32 -> m ()
setAddRange SetT
set Word32
first Word32
last = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT -> Word32 -> Word32 -> IO ()
hb_set_add_range Ptr SetT
set' Word32
first Word32
last
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function set_add
-- Args: [ Arg
--           { argCName = "set"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "codepoint"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The element to add to @set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_set_add" hb_set_add :: 
    Ptr HarfBuzz.SetT.SetT ->               -- set : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    Word32 ->                               -- codepoint : TBasicType TUInt32
    IO ()

-- | Adds /@codepoint@/ to /@set@/.
-- 
-- /Since: 0.9.2/
setAdd ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SetT.SetT
    -- ^ /@set@/: A set
    -> Word32
    -- ^ /@codepoint@/: The element to add to /@set@/
    -> m ()
setAdd :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SetT -> Word32 -> m ()
setAdd SetT
set Word32
codepoint = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SetT
set' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
set
    Ptr SetT -> Word32 -> IO ()
hb_set_add Ptr SetT
set' Word32
codepoint
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
set
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function segment_properties_overlay
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_segment_properties_t to fill in."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "src"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_segment_properties_t to fill in from."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_segment_properties_overlay" hb_segment_properties_overlay :: 
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- p : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- src : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    IO ()

-- | Fills in missing fields of /@p@/ from /@src@/ in a considered manner.
-- 
-- First, if /@p@/ does not have direction set, direction is copied from /@src@/.
-- 
-- Next, if /@p@/ and /@src@/ have the same direction (which can be unset), if /@p@/
-- does not have script set, script is copied from /@src@/.
-- 
-- Finally, if /@p@/ and /@src@/ have the same direction and script (which either
-- can be unset), if /@p@/ does not have language set, language is copied from
-- /@src@/.
-- 
-- /Since: 3.3.0/
segmentPropertiesOverlay ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@p@/: t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to fill in.
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@src@/: t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to fill in from.
    -> m ()
segmentPropertiesOverlay :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SegmentPropertiesT -> SegmentPropertiesT -> m ()
segmentPropertiesOverlay SegmentPropertiesT
p SegmentPropertiesT
src = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr SegmentPropertiesT
p' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
p
    Ptr SegmentPropertiesT
src' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
src
    Ptr SegmentPropertiesT -> Ptr SegmentPropertiesT -> IO ()
hb_segment_properties_overlay Ptr SegmentPropertiesT
p' Ptr SegmentPropertiesT
src'
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
p
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
src
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function segment_properties_hash
-- Args: [ Arg
--           { argCName = "p"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_segment_properties_t to hash."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_segment_properties_hash" hb_segment_properties_hash :: 
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- p : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    IO Word32

-- | Creates a hash representing /@p@/.
-- 
-- /Since: 0.9.7/
segmentPropertiesHash ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@p@/: t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to hash.
    -> m Word32
    -- ^ __Returns:__ A hash of /@p@/.
segmentPropertiesHash :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SegmentPropertiesT -> m Word32
segmentPropertiesHash SegmentPropertiesT
p = 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 SegmentPropertiesT
p' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
p
    Word32
result <- Ptr SegmentPropertiesT -> IO Word32
hb_segment_properties_hash Ptr SegmentPropertiesT
p'
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
p
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function segment_properties_equal
-- Args: [ Arg
--           { argCName = "a"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "first #hb_segment_properties_t to compare."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "b"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "second #hb_segment_properties_t to compare."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_segment_properties_equal" hb_segment_properties_equal :: 
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- a : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- b : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    IO Int32

-- | Checks the equality of two t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT'\'s.
-- 
-- /Since: 0.9.7/
segmentPropertiesEqual ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@a@/: first t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to compare.
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@b@/: second t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to compare.
    -> m Int32
    -- ^ __Returns:__ @/true/@ if all properties of /@a@/ equal those of /@b@/, @/false/@ otherwise.
segmentPropertiesEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
SegmentPropertiesT -> SegmentPropertiesT -> m Int32
segmentPropertiesEqual SegmentPropertiesT
a SegmentPropertiesT
b = 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 SegmentPropertiesT
a' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
a
    Ptr SegmentPropertiesT
b' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
b
    Int32
result <- Ptr SegmentPropertiesT -> Ptr SegmentPropertiesT -> IO Int32
hb_segment_properties_equal Ptr SegmentPropertiesT
a' Ptr SegmentPropertiesT
b'
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
a
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
b
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function script_to_iso15924_tag
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_script_t to convert."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_script_to_iso15924_tag" hb_script_to_iso15924_tag :: 
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    IO Word32

-- | Converts an t'GI.HarfBuzz.Enums.ScriptT' to a corresponding ISO 15924 script tag.
-- 
-- /Since: 0.9.2/
scriptToIso15924Tag ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.ScriptT
    -- ^ /@script@/: an t'GI.HarfBuzz.Enums.ScriptT' to convert.
    -> m Word32
    -- ^ __Returns:__ An @/hb_tag_t/@ representing an ISO 15924 script tag.
scriptToIso15924Tag :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ScriptT -> m Word32
scriptToIso15924Tag ScriptT
script = 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
    let script' :: CUInt
script' = (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
script
    Word32
result <- CUInt -> IO Word32
hb_script_to_iso15924_tag CUInt
script'
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function script_get_horizontal_direction
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_script_t to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "direction_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_script_get_horizontal_direction" hb_script_get_horizontal_direction :: 
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    IO CUInt

-- | Fetches the t'GI.HarfBuzz.Enums.DirectionT' of a script when it is
-- set horizontally. All right-to-left scripts will return
-- @/HB_DIRECTION_RTL/@. All left-to-right scripts will return
-- @/HB_DIRECTION_LTR/@.  Scripts that can be written either
-- horizontally or vertically will return @/HB_DIRECTION_INVALID/@.
-- Unknown scripts will return @/HB_DIRECTION_LTR/@.
-- 
-- /Since: 0.9.2/
scriptGetHorizontalDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.ScriptT
    -- ^ /@script@/: The t'GI.HarfBuzz.Enums.ScriptT' to query
    -> m HarfBuzz.Enums.DirectionT
    -- ^ __Returns:__ The horizontal t'GI.HarfBuzz.Enums.DirectionT' of /@script@/
scriptGetHorizontalDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ScriptT -> m DirectionT
scriptGetHorizontalDirection ScriptT
script = IO DirectionT -> m DirectionT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DirectionT -> m DirectionT) -> IO DirectionT -> m DirectionT
forall a b. (a -> b) -> a -> b
$ do
    let script' :: CUInt
script' = (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
script
    CUInt
result <- CUInt -> IO CUInt
hb_script_get_horizontal_direction CUInt
script'
    let result' :: DirectionT
result' = (Int -> DirectionT
forall a. Enum a => Int -> a
toEnum (Int -> DirectionT) -> (CUInt -> Int) -> CUInt -> DirectionT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    DirectionT -> IO DirectionT
forall (m :: * -> *) a. Monad m => a -> m a
return DirectionT
result'


-- function script_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a string representing an\n      ISO 15924 tag."
--                 , 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 "length of the @str, or -1 if it is %NULL-terminated."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "length of the @str, or -1 if it is %NULL-terminated."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_script_from_string" hb_script_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    IO CUInt

-- | Converts a string /@str@/ representing an ISO 15924 script tag to a
-- corresponding t'GI.HarfBuzz.Enums.ScriptT'. Shorthand for 'GI.HarfBuzz.Functions.tagFromString' then
-- 'GI.HarfBuzz.Functions.scriptFromIso15924Tag'.
-- 
-- /Since: 0.9.2/
scriptFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: a string representing an
    --       ISO 15924 tag.
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ An t'GI.HarfBuzz.Enums.ScriptT' corresponding to the ISO 15924 tag.
scriptFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m ScriptT
scriptFromString ByteString
str = 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
    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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    CUInt
result <- Ptr Word8 -> Int32 -> IO CUInt
hb_script_from_string Ptr Word8
str' Int32
len
    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
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    ScriptT -> IO ScriptT
forall (m :: * -> *) a. Monad m => a -> m a
return ScriptT
result'


-- function script_from_iso15924_tag
-- Args: [ Arg
--           { argCName = "tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_tag_t representing an ISO 15924 tag."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_script_from_iso15924_tag" hb_script_from_iso15924_tag :: 
    Word32 ->                               -- tag : TBasicType TUInt32
    IO CUInt

-- | Converts an ISO 15924 script tag to a corresponding t'GI.HarfBuzz.Enums.ScriptT'.
-- 
-- /Since: 0.9.2/
scriptFromIso15924Tag ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@tag@/: an @/hb_tag_t/@ representing an ISO 15924 tag.
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ An t'GI.HarfBuzz.Enums.ScriptT' corresponding to the ISO 15924 tag.
scriptFromIso15924Tag :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m ScriptT
scriptFromIso15924Tag Word32
tag = 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
    CUInt
result <- Word32 -> IO CUInt
hb_script_from_iso15924_tag Word32
tag
    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
    ScriptT -> IO ScriptT
forall (m :: * -> *) a. Monad m => a -> m a
return ScriptT
result'


-- function ot_var_normalize_variations
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variations"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "variation_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of variations to normalize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variations_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of variations to normalize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords"
--           , argType = TCArray False (-1) 4 (TBasicType TInt)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of normalized coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "coords_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The length of the coordinate array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "coords_length"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The length of the coordinate array"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_normalize_variations" hb_ot_var_normalize_variations :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.VariationT.VariationT ->   -- variations : TInterface (Name {namespace = "HarfBuzz", name = "variation_t"})
    Word32 ->                               -- variations_length : TBasicType TUInt
    Ptr (Ptr Int32) ->                      -- coords : TCArray False (-1) 4 (TBasicType TInt)
    Ptr Word32 ->                           -- coords_length : TBasicType TUInt
    IO ()

-- | Normalizes all of the coordinates in the given list of variation axes.
-- 
-- /Since: 1.4.2/
otVarNormalizeVariations ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> HarfBuzz.VariationT.VariationT
    -- ^ /@variations@/: The array of variations to normalize
    -> Word32
    -- ^ /@variationsLength@/: The number of variations to normalize
    -> m ([Int32])
otVarNormalizeVariations :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> VariationT -> Word32 -> m [Int32]
otVarNormalizeVariations FaceT
face VariationT
variations Word32
variationsLength = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr VariationT
variations' <- VariationT -> IO (Ptr VariationT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariationT
variations
    Ptr (Ptr Int32)
coords <- IO (Ptr (Ptr Int32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Int32))
    Ptr Word32
coordsLength <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr FaceT
-> Ptr VariationT
-> Word32
-> Ptr (Ptr Int32)
-> Ptr Word32
-> IO ()
hb_ot_var_normalize_variations Ptr FaceT
face' Ptr VariationT
variations' Word32
variationsLength Ptr (Ptr Int32)
coords Ptr Word32
coordsLength
    Word32
coordsLength' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
coordsLength
    Ptr Int32
coords' <- Ptr (Ptr Int32) -> IO (Ptr Int32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Int32)
coords
    [Int32]
coords'' <- (Word32 -> Ptr Int32 -> IO [Int32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
coordsLength') Ptr Int32
coords'
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
coords'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    VariationT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariationT
variations
    Ptr (Ptr Int32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Int32)
coords
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
coordsLength
    [Int32] -> IO [Int32]
forall (m :: * -> *) a. Monad m => a -> m a
return [Int32]
coords''


-- function ot_var_normalize_coords
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The length of the coordinate array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "design_coords"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The design-space coordinates to normalize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "normalized_coords"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The normalized coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_normalize_coords" hb_ot_var_normalize_coords :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- coords_length : TBasicType TUInt
    CFloat ->                               -- design_coords : TBasicType TFloat
    Ptr Int32 ->                            -- normalized_coords : TBasicType TInt
    IO ()

-- | Normalizes the given design-space coordinates. The minimum and maximum
-- values for the axis are mapped to the interval [-1,1], with the default
-- axis value mapped to 0.
-- 
-- The normalized values have 14 bits of fixed-point sub-integer precision as per
-- OpenType specification.
-- 
-- Any additional scaling defined in the face\'s @avar@ table is also
-- applied, as described at https:\/\/docs.microsoft.com\/en-us\/typography\/opentype\/spec\/avar
-- 
-- /Since: 1.4.2/
otVarNormalizeCoords ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> Word32
    -- ^ /@coordsLength@/: The length of the coordinate array
    -> Float
    -- ^ /@designCoords@/: The design-space coordinates to normalize
    -> m (Int32)
otVarNormalizeCoords :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Float -> m Int32
otVarNormalizeCoords FaceT
face Word32
coordsLength Float
designCoords = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    let designCoords' :: CFloat
designCoords' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
designCoords
    Ptr Int32
normalizedCoords <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr FaceT -> Word32 -> CFloat -> Ptr Int32 -> IO ()
hb_ot_var_normalize_coords Ptr FaceT
face' Word32
coordsLength CFloat
designCoords' Ptr Int32
normalizedCoords
    Int32
normalizedCoords' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
normalizedCoords
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
normalizedCoords
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
normalizedCoords'


-- function ot_var_named_instance_get_subfamily_name_id
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "instance_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the named instance to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_named_instance_get_subfamily_name_id" hb_ot_var_named_instance_get_subfamily_name_id :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- instance_index : TBasicType TUInt
    IO Word32

-- | Fetches the @name@ table Name ID that provides display names for
-- the \"Subfamily name\" defined for the given named instance in the face.
-- 
-- /Since: 2.2.0/
otVarNamedInstanceGetSubfamilyNameId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> Word32
    -- ^ /@instanceIndex@/: The index of the named instance to query
    -> m Word32
    -- ^ __Returns:__ the Name ID found for the Subfamily name
otVarNamedInstanceGetSubfamilyNameId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m Word32
otVarNamedInstanceGetSubfamilyNameId FaceT
face Word32
instanceIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> Word32 -> IO Word32
hb_ot_var_named_instance_get_subfamily_name_id Ptr FaceT
face' Word32
instanceIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_var_named_instance_get_postscript_name_id
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "instance_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the named instance to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_named_instance_get_postscript_name_id" hb_ot_var_named_instance_get_postscript_name_id :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- instance_index : TBasicType TUInt
    IO Word32

-- | Fetches the @name@ table Name ID that provides display names for
-- the \"PostScript name\" defined for the given named instance in the face.
-- 
-- /Since: 2.2.0/
otVarNamedInstanceGetPostscriptNameId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> Word32
    -- ^ /@instanceIndex@/: The index of the named instance to query
    -> m Word32
    -- ^ __Returns:__ the Name ID found for the PostScript name
otVarNamedInstanceGetPostscriptNameId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m Word32
otVarNamedInstanceGetPostscriptNameId FaceT
face Word32
instanceIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> Word32 -> IO Word32
hb_ot_var_named_instance_get_postscript_name_id Ptr FaceT
face' Word32
instanceIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_var_named_instance_get_design_coords
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "instance_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the named instance to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of coordinates to return;\n                Output = the actual number of coordinates returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "coords"
--           , argType = TCArray False (-1) 2 (TBasicType TFloat)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of coordinates found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "coords_length"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of coordinates to return;\n                Output = the actual number of coordinates returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_named_instance_get_design_coords" hb_ot_var_named_instance_get_design_coords :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- instance_index : TBasicType TUInt
    Ptr Word32 ->                           -- coords_length : TBasicType TUInt
    Ptr (Ptr CFloat) ->                     -- coords : TCArray False (-1) 2 (TBasicType TFloat)
    IO Word32

-- | Fetches the design-space coordinates corresponding to the given
-- named instance in the face.
-- 
-- /Since: 2.2.0/
otVarNamedInstanceGetDesignCoords ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> Word32
    -- ^ /@instanceIndex@/: The index of the named instance to query
    -> m ((Word32, [Float]))
    -- ^ __Returns:__ the number of variation axes in the face
otVarNamedInstanceGetDesignCoords :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m (Word32, [Float])
otVarNamedInstanceGetDesignCoords FaceT
face Word32
instanceIndex = IO (Word32, [Float]) -> m (Word32, [Float])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [Float]) -> m (Word32, [Float]))
-> IO (Word32, [Float]) -> m (Word32, [Float])
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 Word32
coordsLength <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr CFloat)
coords <- IO (Ptr (Ptr CFloat))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr CFloat))
    Word32
result <- Ptr FaceT -> Word32 -> Ptr Word32 -> Ptr (Ptr CFloat) -> IO Word32
hb_ot_var_named_instance_get_design_coords Ptr FaceT
face' Word32
instanceIndex Ptr Word32
coordsLength Ptr (Ptr CFloat)
coords
    Word32
coordsLength' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
coordsLength
    Ptr CFloat
coords' <- Ptr (Ptr CFloat) -> IO (Ptr CFloat)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CFloat)
coords
    [Float]
coords'' <- ((CFloat -> Float) -> Word32 -> Ptr CFloat -> IO [Float]
forall a b c.
(Integral a, Storable b) =>
(b -> c) -> a -> Ptr b -> IO [c]
unpackMapStorableArrayWithLength CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac Word32
coordsLength') Ptr CFloat
coords'
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
coords'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
coordsLength
    Ptr (Ptr CFloat) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CFloat)
coords
    (Word32, [Float]) -> IO (Word32, [Float])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Float]
coords'')


-- function ot_var_has_data
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_has_data" hb_ot_var_has_data :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face includes any OpenType variation data in the @fvar@ table.
-- 
-- /Since: 1.4.2/
otVarHasData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otVarHasData :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otVarHasData FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_var_has_data Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_var_get_named_instance_count
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_get_named_instance_count" hb_ot_var_get_named_instance_count :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Word32

-- | Fetches the number of named instances included in the face.
-- 
-- /Since: 2.2.0/
otVarGetNamedInstanceCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> m Word32
    -- ^ __Returns:__ the number of named instances defined
otVarGetNamedInstanceCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m Word32
otVarGetNamedInstanceCount FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> IO Word32
hb_ot_var_get_named_instance_count Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_var_get_axis_infos
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first lookup to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axes_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of variation axes to return;\n               Output = the actual number of variation axes returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "axes_array"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_var_axis_info_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of variation axes found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "axes_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of variation axes to return;\n               Output = the actual number of variation axes returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_get_axis_infos" hb_ot_var_get_axis_infos :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- axes_count : TBasicType TUInt
    Ptr HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT -> -- axes_array : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_info_t"}))
    IO Word32

-- | Fetches a list of all variation axes in the specified face. The list returned will begin
-- at the offset provided.
-- 
-- /Since: 2.2.0/
otVarGetAxisInfos ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@startOffset@/: offset of the first lookup to retrieve
    -> [HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT]
    -- ^ /@axesArray@/: The array of variation axes found
    -> m ((Word32, [HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT]))
    -- ^ __Returns:__ the number of variation axes in the face
otVarGetAxisInfos :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> [OtVarAxisInfoT] -> m (Word32, [OtVarAxisInfoT])
otVarGetAxisInfos FaceT
face Word32
startOffset [OtVarAxisInfoT]
axesArray = IO (Word32, [OtVarAxisInfoT]) -> m (Word32, [OtVarAxisInfoT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [OtVarAxisInfoT]) -> m (Word32, [OtVarAxisInfoT]))
-> IO (Word32, [OtVarAxisInfoT]) -> m (Word32, [OtVarAxisInfoT])
forall a b. (a -> b) -> a -> b
$ do
    let axesCount :: Word32
axesCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtVarAxisInfoT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtVarAxisInfoT]
axesArray
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    [Ptr OtVarAxisInfoT]
axesArray' <- (OtVarAxisInfoT -> IO (Ptr OtVarAxisInfoT))
-> [OtVarAxisInfoT] -> IO [Ptr OtVarAxisInfoT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OtVarAxisInfoT -> IO (Ptr OtVarAxisInfoT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [OtVarAxisInfoT]
axesArray
    Ptr OtVarAxisInfoT
axesArray'' <- Int -> [Ptr OtVarAxisInfoT] -> IO (Ptr OtVarAxisInfoT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
32 [Ptr OtVarAxisInfoT]
axesArray'
    Word32
result <- Ptr FaceT -> Word32 -> Word32 -> Ptr OtVarAxisInfoT -> IO Word32
hb_ot_var_get_axis_infos Ptr FaceT
face' Word32
startOffset Word32
axesCount Ptr OtVarAxisInfoT
axesArray''
    [Ptr OtVarAxisInfoT]
axesArray''' <- (Int -> Word32 -> Ptr OtVarAxisInfoT -> IO [Ptr OtVarAxisInfoT]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
32 Word32
axesCount) Ptr OtVarAxisInfoT
axesArray''
    [OtVarAxisInfoT]
axesArray'''' <- (Ptr OtVarAxisInfoT -> IO OtVarAxisInfoT)
-> [Ptr OtVarAxisInfoT] -> IO [OtVarAxisInfoT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtVarAxisInfoT -> OtVarAxisInfoT)
-> Ptr OtVarAxisInfoT -> IO OtVarAxisInfoT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OtVarAxisInfoT -> OtVarAxisInfoT
HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT) [Ptr OtVarAxisInfoT]
axesArray'''
    Ptr OtVarAxisInfoT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr OtVarAxisInfoT
axesArray''
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (OtVarAxisInfoT -> IO ()) -> [OtVarAxisInfoT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OtVarAxisInfoT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [OtVarAxisInfoT]
axesArray
    (Word32, [OtVarAxisInfoT]) -> IO (Word32, [OtVarAxisInfoT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [OtVarAxisInfoT]
axesArray'''')


-- function ot_var_get_axis_count
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_get_axis_count" hb_ot_var_get_axis_count :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Word32

-- | Fetches the number of OpenType variation axes included in the face.
-- 
-- /Since: 1.4.2/
otVarGetAxisCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> m Word32
    -- ^ __Returns:__ the number of variation axes defined
otVarGetAxisCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m Word32
otVarGetAxisCount FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> IO Word32
hb_ot_var_get_axis_count Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_var_get_axes
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first lookup to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axes_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of variation axes to return;\n               Output = the actual number of variation axes returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "axes_array"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_var_axis_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of variation axes found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "axes_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of variation axes to return;\n               Output = the actual number of variation axes returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_get_axes" hb_ot_var_get_axes :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- axes_count : TBasicType TUInt
    Ptr HarfBuzz.OtVarAxisT.OtVarAxisT ->   -- axes_array : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_t"}))
    IO Word32

{-# DEPRECATED otVarGetAxes ["(Since version 2.2.0)","use 'GI.HarfBuzz.Functions.otVarGetAxisInfos' instead"] #-}
-- | Fetches a list of all variation axes in the specified face. The list returned will begin
-- at the offset provided.
-- 
-- /Since: 1.4.2/
otVarGetAxes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@startOffset@/: offset of the first lookup to retrieve
    -> [HarfBuzz.OtVarAxisT.OtVarAxisT]
    -- ^ /@axesArray@/: The array of variation axes found
    -> m ((Word32, [HarfBuzz.OtVarAxisT.OtVarAxisT]))
otVarGetAxes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> [OtVarAxisT] -> m (Word32, [OtVarAxisT])
otVarGetAxes FaceT
face Word32
startOffset [OtVarAxisT]
axesArray = IO (Word32, [OtVarAxisT]) -> m (Word32, [OtVarAxisT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [OtVarAxisT]) -> m (Word32, [OtVarAxisT]))
-> IO (Word32, [OtVarAxisT]) -> m (Word32, [OtVarAxisT])
forall a b. (a -> b) -> a -> b
$ do
    let axesCount :: Word32
axesCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtVarAxisT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtVarAxisT]
axesArray
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    [Ptr OtVarAxisT]
axesArray' <- (OtVarAxisT -> IO (Ptr OtVarAxisT))
-> [OtVarAxisT] -> IO [Ptr OtVarAxisT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OtVarAxisT -> IO (Ptr OtVarAxisT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [OtVarAxisT]
axesArray
    Ptr OtVarAxisT
axesArray'' <- Int -> [Ptr OtVarAxisT] -> IO (Ptr OtVarAxisT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
20 [Ptr OtVarAxisT]
axesArray'
    Word32
result <- Ptr FaceT -> Word32 -> Word32 -> Ptr OtVarAxisT -> IO Word32
hb_ot_var_get_axes Ptr FaceT
face' Word32
startOffset Word32
axesCount Ptr OtVarAxisT
axesArray''
    [Ptr OtVarAxisT]
axesArray''' <- (Int -> Word32 -> Ptr OtVarAxisT -> IO [Ptr OtVarAxisT]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
20 Word32
axesCount) Ptr OtVarAxisT
axesArray''
    [OtVarAxisT]
axesArray'''' <- (Ptr OtVarAxisT -> IO OtVarAxisT)
-> [Ptr OtVarAxisT] -> IO [OtVarAxisT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtVarAxisT -> OtVarAxisT)
-> Ptr OtVarAxisT -> IO OtVarAxisT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OtVarAxisT -> OtVarAxisT
HarfBuzz.OtVarAxisT.OtVarAxisT) [Ptr OtVarAxisT]
axesArray'''
    Ptr OtVarAxisT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr OtVarAxisT
axesArray''
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (OtVarAxisT -> IO ()) -> [OtVarAxisT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OtVarAxisT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [OtVarAxisT]
axesArray
    (Word32, [OtVarAxisT]) -> IO (Word32, [OtVarAxisT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [OtVarAxisT]
axesArray'''')


-- function ot_var_find_axis_info
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_tag_t of the variation axis to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis_info"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_var_axis_info_t" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #hb_ot_var_axis_info_t of the axis tag queried"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_find_axis_info" hb_ot_var_find_axis_info :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- axis_tag : TBasicType TUInt32
    Ptr HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT -> -- axis_info : TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_info_t"})
    IO Int32

-- | Fetches the variation-axis information corresponding to the specified axis tag
-- in the specified face.
-- 
-- /Since: 2.2.0/
otVarFindAxisInfo ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@axisTag@/: The @/hb_tag_t/@ of the variation axis to query
    -> m ((Int32, HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otVarFindAxisInfo :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m (Int32, OtVarAxisInfoT)
otVarFindAxisInfo FaceT
face Word32
axisTag = IO (Int32, OtVarAxisInfoT) -> m (Int32, OtVarAxisInfoT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, OtVarAxisInfoT) -> m (Int32, OtVarAxisInfoT))
-> IO (Int32, OtVarAxisInfoT) -> m (Int32, OtVarAxisInfoT)
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 OtVarAxisInfoT
axisInfo <- Int -> IO (Ptr OtVarAxisInfoT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
32 :: IO (Ptr HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT)
    Int32
result <- Ptr FaceT -> Word32 -> Ptr OtVarAxisInfoT -> IO Int32
hb_ot_var_find_axis_info Ptr FaceT
face' Word32
axisTag Ptr OtVarAxisInfoT
axisInfo
    OtVarAxisInfoT
axisInfo' <- ((ManagedPtr OtVarAxisInfoT -> OtVarAxisInfoT)
-> Ptr OtVarAxisInfoT -> IO OtVarAxisInfoT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OtVarAxisInfoT -> OtVarAxisInfoT
HarfBuzz.OtVarAxisInfoT.OtVarAxisInfoT) Ptr OtVarAxisInfoT
axisInfo
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (Int32, OtVarAxisInfoT) -> IO (Int32, OtVarAxisInfoT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, OtVarAxisInfoT
axisInfo')


-- function ot_var_find_axis
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_tag_t of the variation axis to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the variation axis"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "axis_info"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "ot_var_axis_t" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #hb_ot_var_axis_info_t of the axis tag queried"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_var_find_axis" hb_ot_var_find_axis :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- axis_tag : TBasicType TUInt32
    Word32 ->                               -- axis_index : TBasicType TUInt
    Ptr HarfBuzz.OtVarAxisT.OtVarAxisT ->   -- axis_info : TInterface (Name {namespace = "HarfBuzz", name = "ot_var_axis_t"})
    IO Int32

{-# DEPRECATED otVarFindAxis ["(Since version 2.2.0)","- use 'GI.HarfBuzz.Functions.otVarFindAxisInfo' instead"] #-}
-- | Fetches the variation-axis information corresponding to the specified axis tag
-- in the specified face.
-- 
-- /Since: 1.4.2/
otVarFindAxis ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@axisTag@/: The @/hb_tag_t/@ of the variation axis to query
    -> Word32
    -- ^ /@axisIndex@/: The index of the variation axis
    -> m ((Int32, HarfBuzz.OtVarAxisT.OtVarAxisT))
otVarFindAxis :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Int32, OtVarAxisT)
otVarFindAxis FaceT
face Word32
axisTag Word32
axisIndex = IO (Int32, OtVarAxisT) -> m (Int32, OtVarAxisT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, OtVarAxisT) -> m (Int32, OtVarAxisT))
-> IO (Int32, OtVarAxisT) -> m (Int32, OtVarAxisT)
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 OtVarAxisT
axisInfo <- Int -> IO (Ptr OtVarAxisT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
20 :: IO (Ptr HarfBuzz.OtVarAxisT.OtVarAxisT)
    Int32
result <- Ptr FaceT -> Word32 -> Word32 -> Ptr OtVarAxisT -> IO Int32
hb_ot_var_find_axis Ptr FaceT
face' Word32
axisTag Word32
axisIndex Ptr OtVarAxisT
axisInfo
    OtVarAxisT
axisInfo' <- ((ManagedPtr OtVarAxisT -> OtVarAxisT)
-> Ptr OtVarAxisT -> IO OtVarAxisT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OtVarAxisT -> OtVarAxisT
HarfBuzz.OtVarAxisT.OtVarAxisT) Ptr OtVarAxisT
axisInfo
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (Int32, OtVarAxisT) -> IO (Int32, OtVarAxisT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, OtVarAxisT
axisInfo')


-- function ot_tags_to_script_and_language
-- XXX Could not generate function ot_tags_to_script_and_language

-- Not implemented: Don't know how to allocate "language" of type TInterface (Name {namespace = "HarfBuzz", name = "language_t"})

-- function ot_tags_from_script_and_language
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_script_t to convert."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_language_t to convert."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "maximum number of script tags to retrieve (IN)\nand actual number of script tags retrieved (OUT)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "script_tags"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "array of size at least @script_count to store the\nscript tag results"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "language_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "maximum number of language tags to retrieve\n(IN) and actual number of language tags retrieved (OUT)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "language_tags"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "array of size at least @language_count to store\nthe language tag results"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_tags_from_script_and_language" hb_ot_tags_from_script_and_language :: 
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    Ptr Word32 ->                           -- script_count : TBasicType TUInt
    Ptr Word32 ->                           -- script_tags : TBasicType TUInt32
    Ptr Word32 ->                           -- language_count : TBasicType TUInt
    Ptr Word32 ->                           -- language_tags : TBasicType TUInt32
    IO ()

-- | Converts an t'GI.HarfBuzz.Enums.ScriptT' and an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to script and language tags.
-- 
-- /Since: 2.0.0/
otTagsFromScriptAndLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.ScriptT
    -- ^ /@script@/: an t'GI.HarfBuzz.Enums.ScriptT' to convert.
    -> HarfBuzz.LanguageT.LanguageT
    -- ^ /@language@/: an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to convert.
    -> Word32
    -- ^ /@scriptCount@/: maximum number of script tags to retrieve (IN)
    -- and actual number of script tags retrieved (OUT)
    -> Word32
    -- ^ /@languageCount@/: maximum number of language tags to retrieve
    -- (IN) and actual number of language tags retrieved (OUT)
    -> m ((Word32, Word32, Word32, Word32))
otTagsFromScriptAndLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ScriptT
-> LanguageT
-> Word32
-> Word32
-> m (Word32, Word32, Word32, Word32)
otTagsFromScriptAndLanguage ScriptT
script LanguageT
language Word32
scriptCount Word32
languageCount = IO (Word32, Word32, Word32, Word32)
-> m (Word32, Word32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, Word32, Word32, Word32)
 -> m (Word32, Word32, Word32, Word32))
-> IO (Word32, Word32, Word32, Word32)
-> m (Word32, Word32, Word32, Word32)
forall a b. (a -> b) -> a -> b
$ do
    let script' :: CUInt
script' = (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
script
    Ptr LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    Ptr Word32
scriptCount' <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
scriptCount' Word32
scriptCount
    Ptr Word32
scriptTags <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
languageCount' <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Word32
languageCount' Word32
languageCount
    Ptr Word32
languageTags <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CUInt
-> Ptr LanguageT
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> IO ()
hb_ot_tags_from_script_and_language CUInt
script' Ptr LanguageT
language' Ptr Word32
scriptCount' Ptr Word32
scriptTags Ptr Word32
languageCount' Ptr Word32
languageTags
    Word32
scriptCount'' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
scriptCount'
    Word32
scriptTags' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
scriptTags
    Word32
languageCount'' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
languageCount'
    Word32
languageTags' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
languageTags
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptCount'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptTags
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
languageCount'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
languageTags
    (Word32, Word32, Word32, Word32)
-> IO (Word32, Word32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
scriptCount'', Word32
scriptTags', Word32
languageCount'', Word32
languageTags')


-- function ot_tags_from_script
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tag_1"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tag_2"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_tags_from_script" hb_ot_tags_from_script :: 
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    Word32 ->                               -- script_tag_1 : TBasicType TUInt32
    Word32 ->                               -- script_tag_2 : TBasicType TUInt32
    IO ()

-- | /No description available in the introspection data./
otTagsFromScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.ScriptT
    -> Word32
    -> Word32
    -> m ()
otTagsFromScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ScriptT -> Word32 -> Word32 -> m ()
otTagsFromScript ScriptT
script Word32
scriptTag1 Word32
scriptTag2 = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let script' :: CUInt
script' = (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
script
    CUInt -> Word32 -> Word32 -> IO ()
hb_ot_tags_from_script CUInt
script' Word32
scriptTag1 Word32
scriptTag2
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function ot_tag_to_script
-- Args: [ Arg
--           { argCName = "tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a script tag" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_tag_to_script" hb_ot_tag_to_script :: 
    Word32 ->                               -- tag : TBasicType TUInt32
    IO CUInt

-- | Converts a script tag to an t'GI.HarfBuzz.Enums.ScriptT'.
otTagToScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@tag@/: a script tag
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.ScriptT' corresponding to /@tag@/.
otTagToScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m ScriptT
otTagToScript Word32
tag = 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
    CUInt
result <- Word32 -> IO CUInt
hb_ot_tag_to_script Word32
tag
    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
    ScriptT -> IO ScriptT
forall (m :: * -> *) a. Monad m => a -> m a
return ScriptT
result'


-- function ot_tag_to_language
-- Args: [ Arg
--           { argCName = "tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an language tag" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "language_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_tag_to_language" hb_ot_tag_to_language :: 
    Word32 ->                               -- tag : TBasicType TUInt32
    IO (Ptr HarfBuzz.LanguageT.LanguageT)

-- | Converts a language tag to an t'GI.HarfBuzz.Structs.LanguageT.LanguageT'.
-- 
-- /Since: 0.9.2/
otTagToLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@tag@/: an language tag
    -> m (Maybe HarfBuzz.LanguageT.LanguageT)
    -- ^ __Returns:__ 
    -- The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' corresponding to /@tag@/.
otTagToLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m (Maybe LanguageT)
otTagToLanguage Word32
tag = IO (Maybe LanguageT) -> m (Maybe LanguageT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe LanguageT) -> m (Maybe LanguageT))
-> IO (Maybe LanguageT) -> m (Maybe LanguageT)
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageT
result <- Word32 -> IO (Ptr LanguageT)
hb_ot_tag_to_language Word32
tag
    Maybe LanguageT
maybeResult <- Ptr LanguageT
-> (Ptr LanguageT -> IO LanguageT) -> IO (Maybe LanguageT)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr LanguageT
result ((Ptr LanguageT -> IO LanguageT) -> IO (Maybe LanguageT))
-> (Ptr LanguageT -> IO LanguageT) -> IO (Maybe LanguageT)
forall a b. (a -> b) -> a -> b
$ \Ptr LanguageT
result' -> do
        LanguageT
result'' <- ((ManagedPtr LanguageT -> LanguageT)
-> Ptr LanguageT -> IO LanguageT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr LanguageT -> LanguageT
HarfBuzz.LanguageT.LanguageT) Ptr LanguageT
result'
        LanguageT -> IO LanguageT
forall (m :: * -> *) a. Monad m => a -> m a
return LanguageT
result''
    Maybe LanguageT -> IO (Maybe LanguageT)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe LanguageT
maybeResult


-- function ot_tag_from_language
-- Args: [ Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_tag_from_language" hb_ot_tag_from_language :: 
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    IO Word32

-- | /No description available in the introspection data./
otTagFromLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.LanguageT.LanguageT
    -> m Word32
otTagFromLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LanguageT -> m Word32
otTagFromLanguage LanguageT
language = 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 LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    Word32
result <- Ptr LanguageT -> IO Word32
hb_ot_tag_from_language Ptr LanguageT
language'
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_shape_plan_collect_lookups
-- XXX Could not generate function ot_shape_plan_collect_lookups

-- Not implemented: Don't know how to allocate "lookup_indexes" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_shape_glyphs_closure
-- XXX Could not generate function ot_shape_glyphs_closure

-- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_name_list_names
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "font face." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_entries"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "number of returned entries."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "num_entries"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "number of returned entries."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just
--               (TCArray
--                  False
--                  (-1)
--                  1
--                  (TInterface
--                     Name { namespace = "HarfBuzz" , name = "ot_name_entry_t" }))
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_name_list_names" hb_ot_name_list_names :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr Word32 ->                           -- num_entries : TBasicType TUInt
    IO (Ptr HarfBuzz.OtNameEntryT.OtNameEntryT)

-- | Enumerates all available name IDs and language combinations. Returned
-- array is owned by the /@face@/ and should not be modified.  It can be
-- used as long as /@face@/ is alive.
-- 
-- /Since: 2.1.0/
otNameListNames ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: font face.
    -> m [HarfBuzz.OtNameEntryT.OtNameEntryT]
    -- ^ __Returns:__ Array of available name entries.
otNameListNames :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m [OtNameEntryT]
otNameListNames FaceT
face = IO [OtNameEntryT] -> m [OtNameEntryT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [OtNameEntryT] -> m [OtNameEntryT])
-> IO [OtNameEntryT] -> m [OtNameEntryT]
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 Word32
numEntries <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr OtNameEntryT
result <- Ptr FaceT -> Ptr Word32 -> IO (Ptr OtNameEntryT)
hb_ot_name_list_names Ptr FaceT
face' Ptr Word32
numEntries
    Word32
numEntries' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
numEntries
    Text -> Ptr OtNameEntryT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"otNameListNames" Ptr OtNameEntryT
result
    [Ptr OtNameEntryT]
result' <- (Int -> Word32 -> Ptr OtNameEntryT -> IO [Ptr OtNameEntryT]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
16 Word32
numEntries') Ptr OtNameEntryT
result
    [OtNameEntryT]
result'' <- (Ptr OtNameEntryT -> IO OtNameEntryT)
-> [Ptr OtNameEntryT] -> IO [OtNameEntryT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtNameEntryT -> OtNameEntryT)
-> Ptr OtNameEntryT -> IO OtNameEntryT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr OtNameEntryT -> OtNameEntryT
HarfBuzz.OtNameEntryT.OtNameEntryT) [Ptr OtNameEntryT]
result'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
numEntries
    [OtNameEntryT] -> IO [OtNameEntryT]
forall (m :: * -> *) a. Monad m => a -> m a
return [OtNameEntryT]
result''


-- function ot_name_get_utf8
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "font face." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OpenType name identifier to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "language to fetch the name for."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "input size of @text buffer, and output size of\n                                  text written to buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 3 (TBasicType TUTF8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "buffer to write fetched name into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "input size of @text buffer, and output size of\n                                  text written to buffer."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_name_get_utf8" hb_ot_name_get_utf8 :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- name_id : TBasicType TUInt
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    Word32 ->                               -- text_size : TBasicType TUInt
    Ptr CString ->                          -- text : TCArray False (-1) 3 (TBasicType TUTF8)
    IO Word32

-- | Fetches a font name from the OpenType \'name\' table.
-- If /@language@/ is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID', English (\"en\") is assumed.
-- Returns string in UTF-8 encoding. A NUL terminator is always written
-- for convenience, and isn\'t included in the output /@textSize@/.
-- 
-- /Since: 2.1.0/
otNameGetUtf8 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: font face.
    -> Word32
    -- ^ /@nameId@/: OpenType name identifier to fetch.
    -> HarfBuzz.LanguageT.LanguageT
    -- ^ /@language@/: language to fetch the name for.
    -> [T.Text]
    -- ^ /@text@/: buffer to write fetched name into.
    -> m ((Word32, [T.Text]))
    -- ^ __Returns:__ full length of the requested string, or 0 if not found.
otNameGetUtf8 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> LanguageT -> [Text] -> m (Word32, [Text])
otNameGetUtf8 FaceT
face Word32
nameId LanguageT
language [Text]
text = IO (Word32, [Text]) -> m (Word32, [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [Text]) -> m (Word32, [Text]))
-> IO (Word32, [Text]) -> m (Word32, [Text])
forall a b. (a -> b) -> a -> b
$ do
    let textSize :: Word32
textSize = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Text] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Text]
text
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    Ptr CString
text' <- [Text] -> IO (Ptr CString)
packUTF8CArray [Text]
text
    Word32
result <- Ptr FaceT
-> Word32 -> Ptr LanguageT -> Word32 -> Ptr CString -> IO Word32
hb_ot_name_get_utf8 Ptr FaceT
face' Word32
nameId Ptr LanguageT
language' Word32
textSize Ptr CString
text'
    [Text]
text'' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
textSize) Ptr CString
text'
    (Word32 -> (CString -> IO ()) -> Ptr CString -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Word32
textSize) CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
text'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
text'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    (Word32, [Text]) -> IO (Word32, [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Text]
text'')


-- function ot_name_get_utf32
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "font face." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OpenType name identifier to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "language to fetch the name for."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "input size of @text buffer, and output size of\n                                  text written to buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "buffer to write fetched name into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "input size of @text buffer, and output size of\n                                  text written to buffer."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_name_get_utf32" hb_ot_name_get_utf32 :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- name_id : TBasicType TUInt
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    Word32 ->                               -- text_size : TBasicType TUInt
    Ptr Word32 ->                           -- text : TCArray False (-1) 3 (TBasicType TUInt32)
    IO Word32

-- | Fetches a font name from the OpenType \'name\' table.
-- If /@language@/ is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID', English (\"en\") is assumed.
-- Returns string in UTF-32 encoding. A NUL terminator is always written
-- for convenience, and isn\'t included in the output /@textSize@/.
-- 
-- /Since: 2.1.0/
otNameGetUtf32 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: font face.
    -> Word32
    -- ^ /@nameId@/: OpenType name identifier to fetch.
    -> HarfBuzz.LanguageT.LanguageT
    -- ^ /@language@/: language to fetch the name for.
    -> [Word32]
    -- ^ /@text@/: buffer to write fetched name into.
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ full length of the requested string, or 0 if not found.
otNameGetUtf32 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> LanguageT -> [Word32] -> m (Word32, [Word32])
otNameGetUtf32 FaceT
face Word32
nameId LanguageT
language [Word32]
text = 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
    let textSize :: Word32
textSize = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Word32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word32]
text
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    Ptr Word32
text' <- [Word32] -> IO (Ptr Word32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word32]
text
    Word32
result <- Ptr FaceT
-> Word32 -> Ptr LanguageT -> Word32 -> Ptr Word32 -> IO Word32
hb_ot_name_get_utf32 Ptr FaceT
face' Word32
nameId Ptr LanguageT
language' Word32
textSize Ptr Word32
text'
    [Word32]
text'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
textSize) Ptr Word32
text'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
text'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
text'')


-- function ot_name_get_utf16
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "font face." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "OpenType name identifier to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "language to fetch the name for."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "input size of @text buffer, and output size of\n                                  text written to buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt16)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "buffer to write fetched name into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "input size of @text buffer, and output size of\n                                  text written to buffer."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_name_get_utf16" hb_ot_name_get_utf16 :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- name_id : TBasicType TUInt
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    Word32 ->                               -- text_size : TBasicType TUInt
    Ptr Word16 ->                           -- text : TCArray False (-1) 3 (TBasicType TUInt16)
    IO Word32

-- | Fetches a font name from the OpenType \'name\' table.
-- If /@language@/ is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID', English (\"en\") is assumed.
-- Returns string in UTF-16 encoding. A NUL terminator is always written
-- for convenience, and isn\'t included in the output /@textSize@/.
-- 
-- /Since: 2.1.0/
otNameGetUtf16 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: font face.
    -> Word32
    -- ^ /@nameId@/: OpenType name identifier to fetch.
    -> HarfBuzz.LanguageT.LanguageT
    -- ^ /@language@/: language to fetch the name for.
    -> [Word16]
    -- ^ /@text@/: buffer to write fetched name into.
    -> m ((Word32, [Word16]))
    -- ^ __Returns:__ full length of the requested string, or 0 if not found.
otNameGetUtf16 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> LanguageT -> [Word16] -> m (Word32, [Word16])
otNameGetUtf16 FaceT
face Word32
nameId LanguageT
language [Word16]
text = IO (Word32, [Word16]) -> m (Word32, [Word16])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [Word16]) -> m (Word32, [Word16]))
-> IO (Word32, [Word16]) -> m (Word32, [Word16])
forall a b. (a -> b) -> a -> b
$ do
    let textSize :: Word32
textSize = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Word16] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word16]
text
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    Ptr Word16
text' <- [Word16] -> IO (Ptr Word16)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word16]
text
    Word32
result <- Ptr FaceT
-> Word32 -> Ptr LanguageT -> Word32 -> Ptr Word16 -> IO Word32
hb_ot_name_get_utf16 Ptr FaceT
face' Word32
nameId Ptr LanguageT
language' Word32
textSize Ptr Word16
text'
    [Word16]
text'' <- (Word32 -> Ptr Word16 -> IO [Word16]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
textSize) Ptr Word16
text'
    Ptr Word16 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word16
text'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    (Word32, [Word16]) -> IO (Word32, [Word16])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word16]
text'')


-- function ot_metrics_get_y_variation
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metrics_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tag of metrics value you like to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_metrics_get_y_variation" hb_ot_metrics_get_y_variation :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"})
    IO Int32

-- | Fetches vertical metrics value corresponding to /@metricsTag@/ from /@font@/ with
-- the current font variation settings applied.
-- 
-- /Since: 2.6.0/
otMetricsGetYVariation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object.
    -> HarfBuzz.Enums.OtMetricsTagT
    -- ^ /@metricsTag@/: tag of metrics value you like to fetch.
    -> m Int32
    -- ^ __Returns:__ The requested metric value.
otMetricsGetYVariation :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> OtMetricsTagT -> m Int32
otMetricsGetYVariation FontT
font OtMetricsTagT
metricsTag = 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
    let metricsTag' :: CUInt
metricsTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetricsTagT -> Int) -> OtMetricsTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetricsTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMetricsTagT
metricsTag
    Int32
result <- Ptr FontT -> CUInt -> IO Int32
hb_ot_metrics_get_y_variation Ptr FontT
font' CUInt
metricsTag'
    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


-- function ot_metrics_get_x_variation
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metrics_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tag of metrics value you like to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_metrics_get_x_variation" hb_ot_metrics_get_x_variation :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"})
    IO Int32

-- | Fetches horizontal metrics value corresponding to /@metricsTag@/ from /@font@/
-- with the current font variation settings applied.
-- 
-- /Since: 2.6.0/
otMetricsGetXVariation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object.
    -> HarfBuzz.Enums.OtMetricsTagT
    -- ^ /@metricsTag@/: tag of metrics value you like to fetch.
    -> m Int32
    -- ^ __Returns:__ The requested metric value.
otMetricsGetXVariation :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> OtMetricsTagT -> m Int32
otMetricsGetXVariation FontT
font OtMetricsTagT
metricsTag = 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
    let metricsTag' :: CUInt
metricsTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetricsTagT -> Int) -> OtMetricsTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetricsTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMetricsTagT
metricsTag
    Int32
result <- Ptr FontT -> CUInt -> IO Int32
hb_ot_metrics_get_x_variation Ptr FontT
font' CUInt
metricsTag'
    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


-- function ot_metrics_get_variation
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metrics_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tag of metrics value you like to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_metrics_get_variation" hb_ot_metrics_get_variation :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"})
    IO CFloat

-- | Fetches metrics value corresponding to /@metricsTag@/ from /@font@/ with the
-- current font variation settings applied.
-- 
-- /Since: 2.6.0/
otMetricsGetVariation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object.
    -> HarfBuzz.Enums.OtMetricsTagT
    -- ^ /@metricsTag@/: tag of metrics value you like to fetch.
    -> m Float
    -- ^ __Returns:__ The requested metric value.
otMetricsGetVariation :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> OtMetricsTagT -> m Float
otMetricsGetVariation FontT
font OtMetricsTagT
metricsTag = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
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
    let metricsTag' :: CUInt
metricsTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetricsTagT -> Int) -> OtMetricsTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetricsTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMetricsTagT
metricsTag
    CFloat
result <- Ptr FontT -> CUInt -> IO CFloat
hb_ot_metrics_get_variation Ptr FontT
font' CUInt
metricsTag'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'


-- function ot_metrics_get_position_with_fallback
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metrics_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tag of metrics value you like to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "position"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "result of metrics value from the font."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_metrics_get_position_with_fallback" hb_ot_metrics_get_position_with_fallback :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"})
    Ptr Int32 ->                            -- position : TBasicType TInt32
    IO ()

-- | Fetches metrics value corresponding to /@metricsTag@/ from /@font@/,
-- and synthesizes a value if it the value is missing in the font.
-- 
-- /Since: 4.0.0/
otMetricsGetPositionWithFallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object.
    -> HarfBuzz.Enums.OtMetricsTagT
    -- ^ /@metricsTag@/: tag of metrics value you like to fetch.
    -> m (Int32)
otMetricsGetPositionWithFallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> OtMetricsTagT -> m Int32
otMetricsGetPositionWithFallback FontT
font OtMetricsTagT
metricsTag = 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
    let metricsTag' :: CUInt
metricsTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetricsTagT -> Int) -> OtMetricsTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetricsTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMetricsTagT
metricsTag
    Ptr Int32
position <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr FontT -> CUInt -> Ptr Int32 -> IO ()
hb_ot_metrics_get_position_with_fallback Ptr FontT
font' CUInt
metricsTag' Ptr Int32
position
    Int32
position' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
position
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
position
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
position'


-- function ot_metrics_get_position
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_font_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "metrics_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_metrics_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tag of metrics value you like to fetch."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "position"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "result of metrics value from the font."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_metrics_get_position" hb_ot_metrics_get_position :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- metrics_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_metrics_tag_t"})
    Ptr Int32 ->                            -- position : TBasicType TInt32
    IO Int32

-- | Fetches metrics value corresponding to /@metricsTag@/ from /@font@/.
-- 
-- /Since: 2.6.0/
otMetricsGetPosition ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: an t'GI.HarfBuzz.Structs.FontT.FontT' object.
    -> HarfBuzz.Enums.OtMetricsTagT
    -- ^ /@metricsTag@/: tag of metrics value you like to fetch.
    -> m ((Int32, Int32))
    -- ^ __Returns:__ Whether found the requested metrics in the font.
otMetricsGetPosition :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> OtMetricsTagT -> m (Int32, Int32)
otMetricsGetPosition FontT
font OtMetricsTagT
metricsTag = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let metricsTag' :: CUInt
metricsTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetricsTagT -> Int) -> OtMetricsTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetricsTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMetricsTagT
metricsTag
    Ptr Int32
position <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Int32
result <- Ptr FontT -> CUInt -> Ptr Int32 -> IO Int32
hb_ot_metrics_get_position Ptr FontT
font' CUInt
metricsTag' Ptr Int32
position
    Int32
position' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
position
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
position
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Int32
position')


-- function ot_meta_reference_entry
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #hb_face_t object."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "meta_tag"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "ot_meta_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "tag of metadata you like to have."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_meta_reference_entry" hb_ot_meta_reference_entry :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    CUInt ->                                -- meta_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_meta_tag_t"})
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | It fetches metadata entry of a given tag from a font.
-- 
-- /Since: 2.6.0/
otMetaReferenceEntry ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: a t'GI.HarfBuzz.Structs.FaceT.FaceT' object.
    -> HarfBuzz.Enums.OtMetaTagT
    -- ^ /@metaTag@/: tag of metadata you like to have.
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ A blob containing the blob.
otMetaReferenceEntry :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> OtMetaTagT -> m BlobT
otMetaReferenceEntry FaceT
face OtMetaTagT
metaTag = 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
    let metaTag' :: CUInt
metaTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetaTagT -> Int) -> OtMetaTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetaTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMetaTagT
metaTag
    Ptr BlobT
result <- Ptr FaceT -> CUInt -> IO (Ptr BlobT)
hb_ot_meta_reference_entry Ptr FaceT
face' CUInt
metaTag'
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"otMetaReferenceEntry" 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'


-- function ot_meta_get_entry_tags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "iteration's start offset"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "entries_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "buffer size as input, filled size as output"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "entries"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_meta_tag_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "entries tags buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "entries_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "buffer size as input, filled size as output"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_meta_get_entry_tags" hb_ot_meta_get_entry_tags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- entries_count : TBasicType TUInt
    Ptr CUInt ->                            -- entries : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "ot_meta_tag_t"}))
    IO Word32

-- | Fetches all available feature types.
-- 
-- /Since: 2.6.0/
otMetaGetEntryTags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: a face object
    -> Word32
    -- ^ /@startOffset@/: iteration\'s start offset
    -> [HarfBuzz.Enums.OtMetaTagT]
    -- ^ /@entries@/: entries tags buffer
    -> m ((Word32, [HarfBuzz.Enums.OtMetaTagT]))
    -- ^ __Returns:__ Number of all available feature types.
otMetaGetEntryTags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> [OtMetaTagT] -> m (Word32, [OtMetaTagT])
otMetaGetEntryTags FaceT
face Word32
startOffset [OtMetaTagT]
entries = IO (Word32, [OtMetaTagT]) -> m (Word32, [OtMetaTagT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [OtMetaTagT]) -> m (Word32, [OtMetaTagT]))
-> IO (Word32, [OtMetaTagT]) -> m (Word32, [OtMetaTagT])
forall a b. (a -> b) -> a -> b
$ do
    let entriesCount :: Word32
entriesCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtMetaTagT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtMetaTagT]
entries
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    let entries' :: [CUInt]
entries' = (OtMetaTagT -> CUInt) -> [OtMetaTagT] -> [CUInt]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMetaTagT -> Int) -> OtMetaTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMetaTagT -> Int
forall a. Enum a => a -> Int
fromEnum) [OtMetaTagT]
entries
    Ptr CUInt
entries'' <- [CUInt] -> IO (Ptr CUInt)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [CUInt]
entries'
    Word32
result <- Ptr FaceT -> Word32 -> Word32 -> Ptr CUInt -> IO Word32
hb_ot_meta_get_entry_tags Ptr FaceT
face' Word32
startOffset Word32
entriesCount Ptr CUInt
entries''
    [CUInt]
entries''' <- (Word32 -> Ptr CUInt -> IO [CUInt]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
entriesCount) Ptr CUInt
entries''
    let entries'''' :: [OtMetaTagT]
entries'''' = (CUInt -> OtMetaTagT) -> [CUInt] -> [OtMetaTagT]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> OtMetaTagT
forall a. Enum a => Int -> a
toEnum (Int -> OtMetaTagT) -> (CUInt -> Int) -> CUInt -> OtMetaTagT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) [CUInt]
entries'''
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
entries''
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (Word32, [OtMetaTagT]) -> IO (Word32, [OtMetaTagT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [OtMetaTagT]
entries'''')


-- function ot_math_is_glyph_extended_shape
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , 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 index to test"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_is_glyph_extended_shape" hb_ot_math_is_glyph_extended_shape :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO Int32

-- | Tests whether the given glyph index is an extended shape in the face.
-- 
-- /Since: 1.3.3/
otMathIsGlyphExtendedShape ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph index to test
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the glyph is an extended shape, @/false/@ otherwise
otMathIsGlyphExtendedShape :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m Int32
otMathIsGlyphExtendedShape FaceT
face Word32
glyph = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> Word32 -> IO Int32
hb_ot_math_is_glyph_extended_shape Ptr FaceT
face' Word32
glyph
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_math_has_data
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to test" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_has_data" hb_ot_math_has_data :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face has a @MATH@ table.
-- 
-- /Since: 1.3.3/
otMathHasData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to test
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the table is found, @/false/@ otherwise
otMathHasData :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otMathHasData FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_math_has_data Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_math_get_min_connector_overlap
-- 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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "direction of the stretching (horizontal or vertical)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_min_connector_overlap" hb_ot_math_get_min_connector_overlap :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    IO Int32

-- | Fetches the MathVariants table for the specified font and returns the
-- minimum overlap of connecting glyphs that are required to draw a glyph
-- assembly in the specified direction.
-- 
-- \<note>The /@direction@/ parameter is only used to select between horizontal
-- or vertical directions for the construction. Even though all t'GI.HarfBuzz.Enums.DirectionT'
-- values are accepted, only the result of @/HB_DIRECTION_IS_HORIZONTAL/@ is
-- considered.\<\/note>
-- 
-- /Since: 1.3.3/
otMathGetMinConnectorOverlap ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: direction of the stretching (horizontal or vertical)
    -> m Int32
    -- ^ __Returns:__ requested minimum connector overlap or zero
otMathGetMinConnectorOverlap :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> DirectionT -> m Int32
otMathGetMinConnectorOverlap FontT
font DirectionT
direction = 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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Int32
result <- Ptr FontT -> CUInt -> IO Int32
hb_ot_math_get_min_connector_overlap Ptr FontT
font' CUInt
direction'
    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


-- function ot_math_get_glyph_variants
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the glyph to stretch"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The direction of the stretching (horizontal or vertical)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first variant to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variants_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of variants to return;\n                          Output = the actual number of variants returned"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "variants"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 4
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_math_glyph_variant_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "array of variants returned"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "variants_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of variants to return;\n                          Output = the actual number of variants returned"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_glyph_variants" hb_ot_math_get_glyph_variants :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- variants_count : TBasicType TUInt
    Ptr HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT -> -- variants : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "ot_math_glyph_variant_t"}))
    IO Word32

-- | Fetches the MathGlyphConstruction for the specified font, glyph index, and
-- direction. The corresponding list of size variants is returned as a list of
-- t'GI.HarfBuzz.Structs.OtMathGlyphVariantT.OtMathGlyphVariantT' structs.
-- 
-- \<note>The /@direction@/ parameter is only used to select between horizontal
-- or vertical directions for the construction. Even though all t'GI.HarfBuzz.Enums.DirectionT'
-- values are accepted, only the result of @/HB_DIRECTION_IS_HORIZONTAL/@ is
-- considered.\<\/note>
-- 
-- /Since: 1.3.3/
otMathGetGlyphVariants ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The index of the glyph to stretch
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the stretching (horizontal or vertical)
    -> Word32
    -- ^ /@startOffset@/: offset of the first variant to retrieve
    -> [HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT]
    -- ^ /@variants@/: array of variants returned
    -> m ((Word32, [HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT]))
    -- ^ __Returns:__ the total number of size variants available or zero
otMathGetGlyphVariants :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT
-> Word32
-> DirectionT
-> Word32
-> [OtMathGlyphVariantT]
-> m (Word32, [OtMathGlyphVariantT])
otMathGetGlyphVariants FontT
font Word32
glyph DirectionT
direction Word32
startOffset [OtMathGlyphVariantT]
variants = IO (Word32, [OtMathGlyphVariantT])
-> m (Word32, [OtMathGlyphVariantT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [OtMathGlyphVariantT])
 -> m (Word32, [OtMathGlyphVariantT]))
-> IO (Word32, [OtMathGlyphVariantT])
-> m (Word32, [OtMathGlyphVariantT])
forall a b. (a -> b) -> a -> b
$ do
    let variantsCount :: Word32
variantsCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtMathGlyphVariantT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtMathGlyphVariantT]
variants
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    [Ptr OtMathGlyphVariantT]
variants' <- (OtMathGlyphVariantT -> IO (Ptr OtMathGlyphVariantT))
-> [OtMathGlyphVariantT] -> IO [Ptr OtMathGlyphVariantT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OtMathGlyphVariantT -> IO (Ptr OtMathGlyphVariantT)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [OtMathGlyphVariantT]
variants
    Ptr OtMathGlyphVariantT
variants'' <- Int -> [Ptr OtMathGlyphVariantT] -> IO (Ptr OtMathGlyphVariantT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
8 [Ptr OtMathGlyphVariantT]
variants'
    Word32
result <- Ptr FontT
-> Word32
-> CUInt
-> Word32
-> Word32
-> Ptr OtMathGlyphVariantT
-> IO Word32
hb_ot_math_get_glyph_variants Ptr FontT
font' Word32
glyph CUInt
direction' Word32
startOffset Word32
variantsCount Ptr OtMathGlyphVariantT
variants''
    [Ptr OtMathGlyphVariantT]
variants''' <- (Int
-> Word32
-> Ptr OtMathGlyphVariantT
-> IO [Ptr OtMathGlyphVariantT]
forall a b.
(Integral a, GBoxed b) =>
Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength Int
8 Word32
variantsCount) Ptr OtMathGlyphVariantT
variants''
    [OtMathGlyphVariantT]
variants'''' <- (Ptr OtMathGlyphVariantT -> IO OtMathGlyphVariantT)
-> [Ptr OtMathGlyphVariantT] -> IO [OtMathGlyphVariantT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtMathGlyphVariantT -> OtMathGlyphVariantT)
-> Ptr OtMathGlyphVariantT -> IO OtMathGlyphVariantT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OtMathGlyphVariantT -> OtMathGlyphVariantT
HarfBuzz.OtMathGlyphVariantT.OtMathGlyphVariantT) [Ptr OtMathGlyphVariantT]
variants'''
    Ptr OtMathGlyphVariantT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr OtMathGlyphVariantT
variants''
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (OtMathGlyphVariantT -> IO ()) -> [OtMathGlyphVariantT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OtMathGlyphVariantT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [OtMathGlyphVariantT]
variants
    (Word32, [OtMathGlyphVariantT])
-> IO (Word32, [OtMathGlyphVariantT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [OtMathGlyphVariantT]
variants'''')


-- function ot_math_get_glyph_top_accent_attachment
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph index from which to retrieve the value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_glyph_top_accent_attachment" hb_ot_math_get_glyph_top_accent_attachment :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches a top-accent-attachment value (if one exists) for the specified
-- glyph index.
-- 
-- For any glyph that does not have a top-accent-attachment value - that is,
-- a glyph not covered by the @MathTopAccentAttachment@ table (or, when
-- /@font@/ has no @MathTopAccentAttachment@ table or no @MATH@ table, any
-- glyph) - the function synthesizes a value, returning the position at
-- one-half the glyph\'s advance width.
-- 
-- /Since: 1.3.3/
otMathGetGlyphTopAccentAttachment ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph index from which to retrieve the value
    -> m Int32
    -- ^ __Returns:__ the top accent attachment of the glyph or 0.5 * the advance
    --               width of /@glyph@/
otMathGetGlyphTopAccentAttachment :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m Int32
otMathGetGlyphTopAccentAttachment FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> IO Int32
hb_ot_math_get_glyph_top_accent_attachment Ptr FontT
font' Word32
glyph
    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


-- function ot_math_get_glyph_kernings
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph index from which to retrieve the kernings"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "kern"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_math_kern_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #hb_ot_math_kern_t from which to retrieve the kernings"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first kern entry to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "entries_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of kern entries to return;\n                                    Output = the actual number of kern entries returned"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "kern_entries"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 4
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_math_kern_entry_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "array of kern entries returned"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "entries_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of kern entries to return;\n                                    Output = the actual number of kern entries returned"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_glyph_kernings" hb_ot_math_get_glyph_kernings :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- kern : TInterface (Name {namespace = "HarfBuzz", name = "ot_math_kern_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- entries_count : TBasicType TUInt
    Ptr HarfBuzz.OtMathKernEntryT.OtMathKernEntryT -> -- kern_entries : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "ot_math_kern_entry_t"}))
    IO Word32

-- | Fetches the raw MathKern (cut-in) data for the specified font, glyph index,
-- and /@kern@/. The corresponding list of kern values and correction heights is
-- returned as a list of t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT' structs.
-- 
-- See also @/hb_ot_math_get_glyph_kerning/@, which handles selecting the
-- appropriate kern value for a given correction height.
-- 
-- \<note>For a glyph with /@n@/ defined kern values (where /@n@/ > 0), there are only
-- /@n@/−1 defined correction heights, as each correction height defines a boundary
-- past which the next kern value should be selected. Therefore, only the
-- t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT'.@/kern_value/@ of the uppermost t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT'
-- actually comes from the font; its corresponding
-- t'GI.HarfBuzz.Structs.OtMathKernEntryT.OtMathKernEntryT'.@/max_correction_height/@ is always set to
-- \<code>INT32_MAX\<\/code>.\<\/note>
-- 
-- /Since: 3.4.0/
otMathGetGlyphKernings ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph index from which to retrieve the kernings
    -> HarfBuzz.Enums.OtMathKernT
    -- ^ /@kern@/: The t'GI.HarfBuzz.Enums.OtMathKernT' from which to retrieve the kernings
    -> Word32
    -- ^ /@startOffset@/: offset of the first kern entry to retrieve
    -> [HarfBuzz.OtMathKernEntryT.OtMathKernEntryT]
    -- ^ /@kernEntries@/: array of kern entries returned
    -> m ((Word32, [HarfBuzz.OtMathKernEntryT.OtMathKernEntryT]))
    -- ^ __Returns:__ the total number of kern values available or zero
otMathGetGlyphKernings :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT
-> Word32
-> OtMathKernT
-> Word32
-> [OtMathKernEntryT]
-> m (Word32, [OtMathKernEntryT])
otMathGetGlyphKernings FontT
font Word32
glyph OtMathKernT
kern Word32
startOffset [OtMathKernEntryT]
kernEntries = IO (Word32, [OtMathKernEntryT]) -> m (Word32, [OtMathKernEntryT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [OtMathKernEntryT]) -> m (Word32, [OtMathKernEntryT]))
-> IO (Word32, [OtMathKernEntryT])
-> m (Word32, [OtMathKernEntryT])
forall a b. (a -> b) -> a -> b
$ do
    let entriesCount :: Word32
entriesCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtMathKernEntryT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtMathKernEntryT]
kernEntries
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    let kern' :: CUInt
kern' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMathKernT -> Int) -> OtMathKernT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMathKernT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMathKernT
kern
    [Ptr OtMathKernEntryT]
kernEntries' <- (OtMathKernEntryT -> IO (Ptr OtMathKernEntryT))
-> [OtMathKernEntryT] -> IO [Ptr OtMathKernEntryT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OtMathKernEntryT -> IO (Ptr OtMathKernEntryT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [OtMathKernEntryT]
kernEntries
    Ptr OtMathKernEntryT
kernEntries'' <- Int -> [Ptr OtMathKernEntryT] -> IO (Ptr OtMathKernEntryT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
8 [Ptr OtMathKernEntryT]
kernEntries'
    Word32
result <- Ptr FontT
-> Word32
-> CUInt
-> Word32
-> Word32
-> Ptr OtMathKernEntryT
-> IO Word32
hb_ot_math_get_glyph_kernings Ptr FontT
font' Word32
glyph CUInt
kern' Word32
startOffset Word32
entriesCount Ptr OtMathKernEntryT
kernEntries''
    [Ptr OtMathKernEntryT]
kernEntries''' <- (Int -> Word32 -> Ptr OtMathKernEntryT -> IO [Ptr OtMathKernEntryT]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
8 Word32
entriesCount) Ptr OtMathKernEntryT
kernEntries''
    [OtMathKernEntryT]
kernEntries'''' <- (Ptr OtMathKernEntryT -> IO OtMathKernEntryT)
-> [Ptr OtMathKernEntryT] -> IO [OtMathKernEntryT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtMathKernEntryT -> OtMathKernEntryT)
-> Ptr OtMathKernEntryT -> IO OtMathKernEntryT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OtMathKernEntryT -> OtMathKernEntryT
HarfBuzz.OtMathKernEntryT.OtMathKernEntryT) [Ptr OtMathKernEntryT]
kernEntries'''
    Ptr OtMathKernEntryT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr OtMathKernEntryT
kernEntries''
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (OtMathKernEntryT -> IO ()) -> [OtMathKernEntryT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OtMathKernEntryT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [OtMathKernEntryT]
kernEntries
    (Word32, [OtMathKernEntryT]) -> IO (Word32, [OtMathKernEntryT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [OtMathKernEntryT]
kernEntries'''')


-- function ot_math_get_glyph_kerning
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph index from which to retrieve the value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "kern"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_math_kern_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #hb_ot_math_kern_t from which to retrieve the value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "correction_height"
--           , argType = TBasicType TInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the correction height to use to determine the kerning."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_glyph_kerning" hb_ot_math_get_glyph_kerning :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- kern : TInterface (Name {namespace = "HarfBuzz", name = "ot_math_kern_t"})
    Int32 ->                                -- correction_height : TBasicType TInt32
    IO Int32

-- | Fetches the math kerning (cut-ins) value for the specified font, glyph index, and
-- /@kern@/.
-- 
-- If the MathKern table is found, the function examines it to find a height
-- value that is greater or equal to /@correctionHeight@/. If such a height
-- value is found, corresponding kerning value from the table is returned. If
-- no such height value is found, the last kerning value is returned.
-- 
-- /Since: 1.3.3/
otMathGetGlyphKerning ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph index from which to retrieve the value
    -> HarfBuzz.Enums.OtMathKernT
    -- ^ /@kern@/: The t'GI.HarfBuzz.Enums.OtMathKernT' from which to retrieve the value
    -> Int32
    -- ^ /@correctionHeight@/: the correction height to use to determine the kerning.
    -> m Int32
    -- ^ __Returns:__ requested kerning value or zero
otMathGetGlyphKerning :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> OtMathKernT -> Int32 -> m Int32
otMathGetGlyphKerning FontT
font Word32
glyph OtMathKernT
kern Int32
correctionHeight = 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
    let kern' :: CUInt
kern' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (OtMathKernT -> Int) -> OtMathKernT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMathKernT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMathKernT
kern
    Int32
result <- Ptr FontT -> Word32 -> CUInt -> Int32 -> IO Int32
hb_ot_math_get_glyph_kerning Ptr FontT
font' Word32
glyph CUInt
kern' Int32
correctionHeight
    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


-- function ot_math_get_glyph_italics_correction
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph index from which to retrieve the value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_glyph_italics_correction" hb_ot_math_get_glyph_italics_correction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches an italics-correction value (if one exists) for the specified
-- glyph index.
-- 
-- /Since: 1.3.3/
otMathGetGlyphItalicsCorrection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph index from which to retrieve the value
    -> m Int32
    -- ^ __Returns:__ the italics correction of the glyph or zero
otMathGetGlyphItalicsCorrection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m Int32
otMathGetGlyphItalicsCorrection FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> IO Int32
hb_ot_math_get_glyph_italics_correction Ptr FontT
font' Word32
glyph
    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


-- function ot_math_get_glyph_assembly
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the glyph to stretch"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "direction of the stretching (horizontal or vertical)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first glyph part to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "parts_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = maximum number of glyph parts to return;\n              Output = actual number of parts returned"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "parts"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 4
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_math_glyph_part_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the glyph parts returned"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "italics_correction"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "italics correction of the glyph assembly"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "parts_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = maximum number of glyph parts to return;\n              Output = actual number of parts returned"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_glyph_assembly" hb_ot_math_get_glyph_assembly :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- parts_count : TBasicType TUInt
    Ptr HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT -> -- parts : TCArray False (-1) 4 (TInterface (Name {namespace = "HarfBuzz", name = "ot_math_glyph_part_t"}))
    Ptr Int32 ->                            -- italics_correction : TBasicType TInt32
    IO Word32

-- | Fetches the GlyphAssembly for the specified font, glyph index, and direction.
-- Returned are a list of t'GI.HarfBuzz.Structs.OtMathGlyphPartT.OtMathGlyphPartT' glyph parts that can be
-- used to draw the glyph and an italics-correction value (if one is defined
-- in the font).
-- 
-- \<note>The /@direction@/ parameter is only used to select between horizontal
-- or vertical directions for the construction. Even though all t'GI.HarfBuzz.Enums.DirectionT'
-- values are accepted, only the result of @/HB_DIRECTION_IS_HORIZONTAL/@ is
-- considered.\<\/note>
-- 
-- /Since: 1.3.3/
otMathGetGlyphAssembly ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The index of the glyph to stretch
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: direction of the stretching (horizontal or vertical)
    -> Word32
    -- ^ /@startOffset@/: offset of the first glyph part to retrieve
    -> [HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT]
    -- ^ /@parts@/: the glyph parts returned
    -> m ((Word32, [HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT], Int32))
    -- ^ __Returns:__ the total number of parts in the glyph assembly
otMathGetGlyphAssembly :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT
-> Word32
-> DirectionT
-> Word32
-> [OtMathGlyphPartT]
-> m (Word32, [OtMathGlyphPartT], Int32)
otMathGetGlyphAssembly FontT
font Word32
glyph DirectionT
direction Word32
startOffset [OtMathGlyphPartT]
parts = IO (Word32, [OtMathGlyphPartT], Int32)
-> m (Word32, [OtMathGlyphPartT], Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [OtMathGlyphPartT], Int32)
 -> m (Word32, [OtMathGlyphPartT], Int32))
-> IO (Word32, [OtMathGlyphPartT], Int32)
-> m (Word32, [OtMathGlyphPartT], Int32)
forall a b. (a -> b) -> a -> b
$ do
    let partsCount :: Word32
partsCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtMathGlyphPartT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtMathGlyphPartT]
parts
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    [Ptr OtMathGlyphPartT]
parts' <- (OtMathGlyphPartT -> IO (Ptr OtMathGlyphPartT))
-> [OtMathGlyphPartT] -> IO [Ptr OtMathGlyphPartT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OtMathGlyphPartT -> IO (Ptr OtMathGlyphPartT)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed [OtMathGlyphPartT]
parts
    Ptr OtMathGlyphPartT
parts'' <- Int -> [Ptr OtMathGlyphPartT] -> IO (Ptr OtMathGlyphPartT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
20 [Ptr OtMathGlyphPartT]
parts'
    Ptr Int32
italicsCorrection <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Word32
result <- Ptr FontT
-> Word32
-> CUInt
-> Word32
-> Word32
-> Ptr OtMathGlyphPartT
-> Ptr Int32
-> IO Word32
hb_ot_math_get_glyph_assembly Ptr FontT
font' Word32
glyph CUInt
direction' Word32
startOffset Word32
partsCount Ptr OtMathGlyphPartT
parts'' Ptr Int32
italicsCorrection
    [Ptr OtMathGlyphPartT]
parts''' <- (Int -> Word32 -> Ptr OtMathGlyphPartT -> IO [Ptr OtMathGlyphPartT]
forall a b.
(Integral a, GBoxed b) =>
Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength Int
20 Word32
partsCount) Ptr OtMathGlyphPartT
parts''
    [OtMathGlyphPartT]
parts'''' <- (Ptr OtMathGlyphPartT -> IO OtMathGlyphPartT)
-> [Ptr OtMathGlyphPartT] -> IO [OtMathGlyphPartT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtMathGlyphPartT -> OtMathGlyphPartT)
-> Ptr OtMathGlyphPartT -> IO OtMathGlyphPartT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OtMathGlyphPartT -> OtMathGlyphPartT
HarfBuzz.OtMathGlyphPartT.OtMathGlyphPartT) [Ptr OtMathGlyphPartT]
parts'''
    Ptr OtMathGlyphPartT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr OtMathGlyphPartT
parts''
    Int32
italicsCorrection' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
italicsCorrection
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (OtMathGlyphPartT -> IO ()) -> [OtMathGlyphPartT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OtMathGlyphPartT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [OtMathGlyphPartT]
parts
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
italicsCorrection
    (Word32, [OtMathGlyphPartT], Int32)
-> IO (Word32, [OtMathGlyphPartT], Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [OtMathGlyphPartT]
parts'''', Int32
italicsCorrection')


-- function ot_math_get_constant
-- 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 = "constant"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_math_constant_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "#hb_ot_math_constant_t the constant to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_math_get_constant" hb_ot_math_get_constant :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- constant : TInterface (Name {namespace = "HarfBuzz", name = "ot_math_constant_t"})
    IO Int32

-- | Fetches the specified math constant. For most constants, the value returned
-- is an @/hb_position_t/@.
-- 
-- However, if the requested constant is @/HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN/@,
-- @/HB_OT_MATH_CONSTANT_SCRIPT_SCRIPT_PERCENT_SCALE_DOWN/@ or
-- @/HB_OT_MATH_CONSTANT_SCRIPT_PERCENT_SCALE_DOWN/@, then the return value is
-- an integer between 0 and 100 representing that percentage.
-- 
-- /Since: 1.3.3/
otMathGetConstant ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.Enums.OtMathConstantT
    -- ^ /@constant@/: t'GI.HarfBuzz.Enums.OtMathConstantT' the constant to retrieve
    -> m Int32
    -- ^ __Returns:__ the requested constant or zero
otMathGetConstant :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> OtMathConstantT -> m Int32
otMathGetConstant FontT
font OtMathConstantT
constant = 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
    let constant' :: CUInt
constant' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (OtMathConstantT -> Int) -> OtMathConstantT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtMathConstantT -> Int
forall a. Enum a => a -> Int
fromEnum) OtMathConstantT
constant
    Int32
result <- Ptr FontT -> CUInt -> IO Int32
hb_ot_math_get_constant Ptr FontT
font' CUInt
constant'
    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


-- function ot_layout_table_select_script
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of script tags in the array"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tags"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of #hb_tag_t script tags"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "chosen_script"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_tag_t of the requested script"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_select_script" hb_ot_layout_table_select_script :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_count : TBasicType TUInt
    Word32 ->                               -- script_tags : TBasicType TUInt32
    Ptr Word32 ->                           -- script_index : TBasicType TUInt
    Ptr Word32 ->                           -- chosen_script : TBasicType TUInt32
    IO Int32

-- | Selects an OpenType script for /@tableTag@/ from the /@scriptTags@/ array.
-- 
-- If the table does not have any of the requested scripts, then @DFLT@,
-- @dflt@, and @latn@ tags are tried in that order. If the table still does not
-- have any of these scripts, /@scriptIndex@/ and /@chosenScript@/ are set to
-- 'GI.HarfBuzz.Constants.OT_LAYOUT_NO_SCRIPT_INDEX'.
-- 
-- /Since: 2.0.0/
otLayoutTableSelectScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptCount@/: Number of script tags in the array
    -> Word32
    -- ^ /@scriptTags@/: Array of @/hb_tag_t/@ script tags
    -> m ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if one of the requested scripts is selected, @/false/@ if a fallback
    -- script is selected or if no scripts are selected.
otLayoutTableSelectScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32, Word32)
otLayoutTableSelectScript FaceT
face Word32
tableTag Word32
scriptCount Word32
scriptTags = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
scriptIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
chosenScript <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr Word32
-> IO Int32
hb_ot_layout_table_select_script Ptr FaceT
face' Word32
tableTag Word32
scriptCount Word32
scriptTags Ptr Word32
scriptIndex Ptr Word32
chosenScript
    Word32
scriptIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
scriptIndex
    Word32
chosenScript' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
chosenScript
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptIndex
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
chosenScript
    (Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
scriptIndex', Word32
chosenScript')


-- function ot_layout_table_get_script_tags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first script tag to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of script tags to return;\n               Output = the actual number of script tags returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "script_tags"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of #hb_tag_t script tags found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "script_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of script tags to return;\n               Output = the actual number of script tags returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_get_script_tags" hb_ot_layout_table_get_script_tags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- script_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- script_tags : TCArray False (-1) 3 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of all scripts enumerated in the specified face\'s GSUB table
-- or GPOS table. The list returned will begin at the offset provided.
otLayoutTableGetScriptTags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@startOffset@/: offset of the first script tag to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of script tags.
otLayoutTableGetScriptTags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutTableGetScriptTags FaceT
face Word32
tableTag Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
scriptCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
scriptTags <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Ptr Word32 -> Ptr (Ptr Word32) -> IO Word32
hb_ot_layout_table_get_script_tags Ptr FaceT
face' Word32
tableTag Word32
startOffset Ptr Word32
scriptCount Ptr (Ptr Word32)
scriptTags
    Word32
scriptCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
scriptCount
    Ptr Word32
scriptTags' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
scriptTags
    [Word32]
scriptTags'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
scriptCount') Ptr Word32
scriptTags'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptTags'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
scriptTags
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
scriptTags'')


-- function ot_layout_table_get_lookup_count
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_get_lookup_count" hb_ot_layout_table_get_lookup_count :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    IO Word32

-- | Fetches the total number of lookups enumerated in the specified
-- face\'s GSUB table or GPOS table.
-- 
-- /Since: 0.9.22/
otLayoutTableGetLookupCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> m Word32
    -- ^ __Returns:__ Total number of lookups.
otLayoutTableGetLookupCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m Word32
otLayoutTableGetLookupCount FaceT
face Word32
tableTag = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> Word32 -> IO Word32
hb_ot_layout_table_get_lookup_count Ptr FaceT
face' Word32
tableTag
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_layout_table_get_feature_tags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first feature tag to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of feature tags to return;\n                Output = the actual number of feature tags returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "feature_tags"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of feature tags found in the table"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "feature_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of feature tags to return;\n                Output = the actual number of feature tags returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_get_feature_tags" hb_ot_layout_table_get_feature_tags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- feature_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- feature_tags : TCArray False (-1) 3 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of all feature tags in the given face\'s GSUB or GPOS table.
otLayoutTableGetFeatureTags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@startOffset@/: offset of the first feature tag to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of feature tags.
otLayoutTableGetFeatureTags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutTableGetFeatureTags FaceT
face Word32
tableTag Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
featureCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
featureTags <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Ptr Word32 -> Ptr (Ptr Word32) -> IO Word32
hb_ot_layout_table_get_feature_tags Ptr FaceT
face' Word32
tableTag Word32
startOffset Ptr Word32
featureCount Ptr (Ptr Word32)
featureTags
    Word32
featureCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureCount
    Ptr Word32
featureTags' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
featureTags
    [Word32]
featureTags'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
featureCount') Ptr Word32
featureTags'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureTags'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
featureTags
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
featureTags'')


-- function ot_layout_table_find_script
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_tag_t of the script tag requested"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_find_script" hb_ot_layout_table_find_script :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_tag : TBasicType TUInt32
    Ptr Word32 ->                           -- script_index : TBasicType TUInt
    IO Int32

-- | Fetches the index if a given script tag in the specified face\'s GSUB table
-- or GPOS table.
otLayoutTableFindScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptTag@/: @/hb_tag_t/@ of the script tag requested
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if the script is found, @/false/@ otherwise
otLayoutTableFindScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Int32, Word32)
otLayoutTableFindScript FaceT
face Word32
tableTag Word32
scriptTag = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
scriptIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_ot_layout_table_find_script Ptr FaceT
face' Word32
tableTag Word32
scriptTag Ptr Word32
scriptIndex
    Word32
scriptIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
scriptIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptIndex
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
scriptIndex')


-- function ot_layout_table_find_feature_variations
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The variation coordinates to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "num_coords"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The number of variation coordinates"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variations_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of feature variations found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_find_feature_variations" hb_ot_layout_table_find_feature_variations :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Int32 ->                                -- coords : TBasicType TInt
    Word32 ->                               -- num_coords : TBasicType TUInt
    Ptr Word32 ->                           -- variations_index : TBasicType TUInt
    IO Int32

-- | Fetches a list of feature variations in the specified face\'s GSUB table
-- or GPOS table, at the specified variation coordinates.
otLayoutTableFindFeatureVariations ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Int32
    -- ^ /@coords@/: The variation coordinates to query
    -> Word32
    -- ^ /@numCoords@/: The number of variation coordinates
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if feature variations were found, @/false/@ otherwise.
otLayoutTableFindFeatureVariations :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Int32 -> Word32 -> m (Int32, Word32)
otLayoutTableFindFeatureVariations FaceT
face Word32
tableTag Int32
coords Word32
numCoords = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
variationsIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT -> Word32 -> Int32 -> Word32 -> Ptr Word32 -> IO Int32
hb_ot_layout_table_find_feature_variations Ptr FaceT
face' Word32
tableTag Int32
coords Word32
numCoords Ptr Word32
variationsIndex
    Word32
variationsIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
variationsIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
variationsIndex
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
variationsIndex')


-- function ot_layout_table_choose_script
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tags"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of #hb_tag_t script tags"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "chosen_script"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_tag_t of the script tag requested"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_table_choose_script" hb_ot_layout_table_choose_script :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_tags : TBasicType TUInt32
    Ptr Word32 ->                           -- script_index : TBasicType TUInt
    Ptr Word32 ->                           -- chosen_script : TBasicType TUInt32
    IO Int32

-- | Deprecated since 2.0.0
otLayoutTableChooseScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptTags@/: Array of @/hb_tag_t/@ script tags
    -> m ((Int32, Word32, Word32))
otLayoutTableChooseScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Int32, Word32, Word32)
otLayoutTableChooseScript FaceT
face Word32
tableTag Word32
scriptTags = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
scriptIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
chosenScript <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Word32 -> Word32 -> Ptr Word32 -> Ptr Word32 -> IO Int32
hb_ot_layout_table_choose_script Ptr FaceT
face' Word32
tableTag Word32
scriptTags Ptr Word32
scriptIndex Ptr Word32
chosenScript
    Word32
scriptIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
scriptIndex
    Word32
chosenScript' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
chosenScript
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
scriptIndex
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
chosenScript
    (Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
scriptIndex', Word32
chosenScript')


-- function ot_layout_script_select_language
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The number of languages in the specified script"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_tags"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of language tags"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_script_select_language" hb_ot_layout_script_select_language :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_count : TBasicType TUInt
    Word32 ->                               -- language_tags : TBasicType TUInt32
    Ptr Word32 ->                           -- language_index : TBasicType TUInt
    IO Int32

-- | Fetches the index of the first language tag fom /@languageTags@/ that is present
-- in the specified face\'s GSUB or GPOS table, underneath the specified script
-- index.
-- 
-- If none of the given language tags is found, @/false/@ is returned and
-- /@languageIndex@/ is set to the default language index.
-- 
-- /Since: 2.0.0/
otLayoutScriptSelectLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageCount@/: The number of languages in the specified script
    -> Word32
    -- ^ /@languageTags@/: The array of language tags
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if one of the given language tags is found, @/false/@ otherwise
otLayoutScriptSelectLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Word32)
otLayoutScriptSelectLanguage FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageCount Word32
languageTags = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
languageIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_ot_layout_script_select_language Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageCount Word32
languageTags Ptr Word32
languageIndex
    Word32
languageIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
languageIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
languageIndex
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
languageIndex')


-- function ot_layout_script_get_language_tags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first language tag to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of language tags to return;\n                 Output = the actual number of language tags returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "language_tags"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of language tags found in the table"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "language_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of language tags to return;\n                 Output = the actual number of language tags returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_script_get_language_tags" hb_ot_layout_script_get_language_tags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- language_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- language_tags : TCArray False (-1) 4 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of language tags in the given face\'s GSUB or GPOS table, underneath
-- the specified script index. The list returned will begin at the offset provided.
otLayoutScriptGetLanguageTags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@startOffset@/: offset of the first language tag to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of language tags.
otLayoutScriptGetLanguageTags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutScriptGetLanguageTags FaceT
face Word32
tableTag Word32
scriptIndex Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
languageCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
languageTags <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr (Ptr Word32)
-> IO Word32
hb_ot_layout_script_get_language_tags Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
startOffset Ptr Word32
languageCount Ptr (Ptr Word32)
languageTags
    Word32
languageCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
languageCount
    Ptr Word32
languageTags' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
languageTags
    [Word32]
languageTags'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
languageCount') Ptr Word32
languageTags'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
languageTags'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
languageCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
languageTags
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
languageTags'')


-- function ot_layout_script_find_language
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_tag_t of the requested language"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_script_find_language" hb_ot_layout_script_find_language :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_tag : TBasicType TUInt32
    Word32 ->                               -- language_index : TBasicType TUInt
    IO Int32

{-# DEPRECATED otLayoutScriptFindLanguage ["(Since version 2.0.0)"] #-}
-- | Fetches the index of a given language tag in the specified face\'s GSUB table
-- or GPOS table, underneath the specified script tag.
-- 
-- /Since: 0.6.0/
otLayoutScriptFindLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageTag@/: The @/hb_tag_t/@ of the requested language
    -> Word32
    -- ^ /@languageIndex@/: The index of the requested language
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the language tag is found, @/false/@ otherwise
otLayoutScriptFindLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m Int32
otLayoutScriptFindLanguage FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageTag Word32
languageIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> IO Int32
hb_ot_layout_script_find_language Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageTag Word32
languageIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_layout_lookups_substitute_closure
-- XXX Could not generate function ot_layout_lookups_substitute_closure

-- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_layout_lookup_would_substitute
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "lookup_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the lookup to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyphs"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The sequence of glyphs to query for substitution"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyphs_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The length of the glyph sequence"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "zero_context"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "#hb_bool_t indicating whether pre-/post-context are disallowed\nin substitutions"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_lookup_would_substitute" hb_ot_layout_lookup_would_substitute :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- lookup_index : TBasicType TUInt
    Word32 ->                               -- glyphs : TBasicType TUInt32
    Word32 ->                               -- glyphs_length : TBasicType TUInt
    Int32 ->                                -- zero_context : TBasicType TInt
    IO Int32

-- | Tests whether a specified lookup in the specified face would
-- trigger a substitution on the given glyph sequence.
-- 
-- /Since: 0.9.7/
otLayoutLookupWouldSubstitute ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@lookupIndex@/: The index of the lookup to query
    -> Word32
    -- ^ /@glyphs@/: The sequence of glyphs to query for substitution
    -> Word32
    -- ^ /@glyphsLength@/: The length of the glyph sequence
    -> Int32
    -- ^ /@zeroContext@/: @/hb_bool_t/@ indicating whether pre-\/post-context are disallowed
    -- in substitutions
    -> m Int32
    -- ^ __Returns:__ @/true/@ if a substitution would be triggered, @/false/@ otherwise
otLayoutLookupWouldSubstitute :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> Int32 -> m Int32
otLayoutLookupWouldSubstitute FaceT
face Word32
lookupIndex Word32
glyphs Word32
glyphsLength Int32
zeroContext = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> Word32 -> Word32 -> Word32 -> Int32 -> IO Int32
hb_ot_layout_lookup_would_substitute Ptr FaceT
face' Word32
lookupIndex Word32
glyphs Word32
glyphsLength Int32
zeroContext
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_layout_lookup_substitute_closure
-- XXX Could not generate function ot_layout_lookup_substitute_closure

-- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_layout_lookup_get_glyph_alternates
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a face." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "lookup_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of the feature lookup to query."
--                 , 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 "a glyph id." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "starting offset." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "alternate_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of alternate glyphs to return;\n                  Output = the actual number of alternate glyphs returned (may be zero)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "alternate_glyphs"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "A glyphs buffer.\n                   Alternate glyphs associated with the glyph id."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "alternate_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of alternate glyphs to return;\n                  Output = the actual number of alternate glyphs returned (may be zero)."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_lookup_get_glyph_alternates" hb_ot_layout_lookup_get_glyph_alternates :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- lookup_index : TBasicType TUInt
    Word32 ->                               -- glyph : TBasicType TUInt32
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- alternate_count : TBasicType TUInt
    Ptr Word32 ->                           -- alternate_glyphs : TCArray False (-1) 4 (TBasicType TUInt32)
    IO Word32

-- | Fetches alternates of a glyph from a given GSUB lookup index.
-- 
-- /Since: 2.6.8/
otLayoutLookupGetGlyphAlternates ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: a face.
    -> Word32
    -- ^ /@lookupIndex@/: index of the feature lookup to query.
    -> Word32
    -- ^ /@glyph@/: a glyph id.
    -> Word32
    -- ^ /@startOffset@/: starting offset.
    -> [Word32]
    -- ^ /@alternateGlyphs@/: A glyphs buffer.
    --                    Alternate glyphs associated with the glyph id.
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of alternates found in the specific lookup index for the given glyph id.
otLayoutLookupGetGlyphAlternates :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32 -> Word32 -> Word32 -> [Word32] -> m (Word32, [Word32])
otLayoutLookupGetGlyphAlternates FaceT
face Word32
lookupIndex Word32
glyph Word32
startOffset [Word32]
alternateGlyphs = 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
    let alternateCount :: Word32
alternateCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Word32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word32]
alternateGlyphs
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
alternateGlyphs' <- [Word32] -> IO (Ptr Word32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word32]
alternateGlyphs
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> Ptr Word32 -> IO Word32
hb_ot_layout_lookup_get_glyph_alternates Ptr FaceT
face' Word32
lookupIndex Word32
glyph Word32
startOffset Word32
alternateCount Ptr Word32
alternateGlyphs'
    [Word32]
alternateGlyphs'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
alternateCount) Ptr Word32
alternateGlyphs'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
alternateGlyphs'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
alternateGlyphs'')


-- function ot_layout_lookup_collect_glyphs
-- XXX Could not generate function ot_layout_lookup_collect_glyphs

-- Not implemented: Don't know how to allocate "glyphs_before" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_layout_language_get_required_feature_index
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested feature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_language_get_required_feature_index" hb_ot_layout_language_get_required_feature_index :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_index : TBasicType TUInt
    Ptr Word32 ->                           -- feature_index : TBasicType TUInt
    IO Int32

-- | Fetches the index of a requested feature in the given face\'s GSUB or GPOS table,
-- underneath the specified script and language.
otLayoutLanguageGetRequiredFeatureIndex ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageIndex@/: The index of the requested language tag
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if the feature is found, @/false/@ otherwise
otLayoutLanguageGetRequiredFeatureIndex :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32)
otLayoutLanguageGetRequiredFeatureIndex FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
featureIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT -> Word32 -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_ot_layout_language_get_required_feature_index Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageIndex Ptr Word32
featureIndex
    Word32
featureIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureIndex
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
featureIndex')


-- function ot_layout_language_get_required_feature
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested feature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "feature_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_tag_t of the requested feature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_language_get_required_feature" hb_ot_layout_language_get_required_feature :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_index : TBasicType TUInt
    Ptr Word32 ->                           -- feature_index : TBasicType TUInt
    Ptr Word32 ->                           -- feature_tag : TBasicType TUInt32
    IO Int32

-- | Fetches the tag of a requested feature index in the given face\'s GSUB or GPOS table,
-- underneath the specified script and language.
-- 
-- /Since: 0.9.30/
otLayoutLanguageGetRequiredFeature ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageIndex@/: The index of the requested language tag
    -> m ((Int32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if the feature is found, @/false/@ otherwise
otLayoutLanguageGetRequiredFeature :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32, Word32)
otLayoutLanguageGetRequiredFeature FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
featureIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
featureTag <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr Word32
-> IO Int32
hb_ot_layout_language_get_required_feature Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageIndex Ptr Word32
featureIndex Ptr Word32
featureTag
    Word32
featureIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureIndex
    Word32
featureTag' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureTag
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureIndex
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureTag
    (Int32, Word32, Word32) -> IO (Int32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
featureIndex', Word32
featureTag')


-- function ot_layout_language_get_feature_tags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first feature tag to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of feature tags to return;\n                Output = the actual number of feature tags returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "feature_tags"
--           , argType = TCArray False (-1) 5 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of #hb_tag_t feature tags found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "feature_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of feature tags to return;\n                Output = the actual number of feature tags returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_language_get_feature_tags" hb_ot_layout_language_get_feature_tags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- feature_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- feature_tags : TCArray False (-1) 5 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of all features in the specified face\'s GSUB table
-- or GPOS table, underneath the specified script and language. The list
-- returned will begin at the offset provided.
otLayoutLanguageGetFeatureTags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageIndex@/: The index of the requested language tag
    -> Word32
    -- ^ /@startOffset@/: offset of the first feature tag to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of feature tags.
otLayoutLanguageGetFeatureTags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutLanguageGetFeatureTags FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageIndex Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
featureCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
featureTags <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr (Ptr Word32)
-> IO Word32
hb_ot_layout_language_get_feature_tags Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageIndex Word32
startOffset Ptr Word32
featureCount Ptr (Ptr Word32)
featureTags
    Word32
featureCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureCount
    Ptr Word32
featureTags' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
featureTags
    [Word32]
featureTags'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
featureCount') Ptr Word32
featureTags'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureTags'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
featureTags
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
featureTags'')


-- function ot_layout_language_get_feature_indexes
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first feature tag to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of feature tags to return;\n                Output: the actual number of feature tags returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "feature_indexes"
--           , argType = TCArray False (-1) 5 (TBasicType TUInt)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of feature indexes found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "feature_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of feature tags to return;\n                Output: the actual number of feature tags returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_language_get_feature_indexes" hb_ot_layout_language_get_feature_indexes :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- feature_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- feature_indexes : TCArray False (-1) 5 (TBasicType TUInt)
    IO Word32

-- | Fetches a list of all features in the specified face\'s GSUB table
-- or GPOS table, underneath the specified script and language. The list
-- returned will begin at the offset provided.
otLayoutLanguageGetFeatureIndexes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageIndex@/: The index of the requested language tag
    -> Word32
    -- ^ /@startOffset@/: offset of the first feature tag to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of features.
otLayoutLanguageGetFeatureIndexes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutLanguageGetFeatureIndexes FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageIndex Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
featureCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
featureIndexes <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr (Ptr Word32)
-> IO Word32
hb_ot_layout_language_get_feature_indexes Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageIndex Word32
startOffset Ptr Word32
featureCount Ptr (Ptr Word32)
featureIndexes
    Word32
featureCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureCount
    Ptr Word32
featureIndexes' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
featureIndexes
    [Word32]
featureIndexes'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
featureCount') Ptr Word32
featureIndexes'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureIndexes'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
featureIndexes
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
featureIndexes'')


-- function ot_layout_language_find_feature
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested script tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested language tag"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_tag_t of the feature tag requested"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested feature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_language_find_feature" hb_ot_layout_language_find_feature :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- script_index : TBasicType TUInt
    Word32 ->                               -- language_index : TBasicType TUInt
    Word32 ->                               -- feature_tag : TBasicType TUInt32
    Ptr Word32 ->                           -- feature_index : TBasicType TUInt
    IO Int32

-- | Fetches the index of a given feature tag in the specified face\'s GSUB table
-- or GPOS table, underneath the specified script and language.
otLayoutLanguageFindFeature ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@scriptIndex@/: The index of the requested script tag
    -> Word32
    -- ^ /@languageIndex@/: The index of the requested language tag
    -> Word32
    -- ^ /@featureTag@/: @/hb_tag_t/@ of the feature tag requested
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if the feature is found, @/false/@ otherwise
otLayoutLanguageFindFeature :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Int32, Word32)
otLayoutLanguageFindFeature FaceT
face Word32
tableTag Word32
scriptIndex Word32
languageIndex Word32
featureTag = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
featureIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_ot_layout_language_find_feature Ptr FaceT
face' Word32
tableTag Word32
scriptIndex Word32
languageIndex Word32
featureTag Ptr Word32
featureIndex
    Word32
featureIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
featureIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
featureIndex
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
featureIndex')


-- function ot_layout_has_substitution
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_has_substitution" hb_ot_layout_has_substitution :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether the specified face includes any GSUB substitutions.
otLayoutHasSubstitution ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otLayoutHasSubstitution :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otLayoutHasSubstitution FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_layout_has_substitution Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_layout_has_positioning
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_has_positioning" hb_ot_layout_has_positioning :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether the specified face includes any GPOS positioning.
otLayoutHasPositioning ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the face has GPOS data, @/false/@ otherwise
otLayoutHasPositioning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otLayoutHasPositioning FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_layout_has_positioning Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_layout_has_glyph_classes
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_has_glyph_classes" hb_ot_layout_has_glyph_classes :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face has any glyph classes defined in its GDEF table.
otLayoutHasGlyphClasses ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otLayoutHasGlyphClasses :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otLayoutHasGlyphClasses FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_layout_has_glyph_classes Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_layout_get_size_params
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "design_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The design size of the face"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "subfamily_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The identifier of the face within the font subfamily"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "subfamily_name_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The \8216name\8217 table name ID of the face within the font subfamily"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "range_start"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The minimum size of the recommended size range for the face"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "range_end"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The maximum size of the recommended size range for the face"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_size_params" hb_ot_layout_get_size_params :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr Word32 ->                           -- design_size : TBasicType TUInt
    Ptr Word32 ->                           -- subfamily_id : TBasicType TUInt
    Ptr Word32 ->                           -- subfamily_name_id : TBasicType TUInt
    Ptr Word32 ->                           -- range_start : TBasicType TUInt
    Ptr Word32 ->                           -- range_end : TBasicType TUInt
    IO Int32

-- | Fetches optical-size feature data (i.e., the @size@ feature from GPOS). Note that
-- the subfamily_id and the subfamily name string (accessible via the subfamily_name_id)
-- as used here are defined as pertaining only to fonts within a font family that differ
-- specifically in their respective size ranges; other ways to differentiate fonts within
-- a subfamily are not covered by the @size@ feature.
-- 
-- For more information on this distinction, see the <http://developer.gnome.org/harfbuzz/stable/
-- https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-size `size` feature documentation>.
-- 
-- /Since: 0.9.10/
otLayoutGetSizeParams ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m ((Int32, Word32, Word32, Word32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otLayoutGetSizeParams :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m (Int32, Word32, Word32, Word32, Word32, Word32)
otLayoutGetSizeParams FaceT
face = IO (Int32, Word32, Word32, Word32, Word32, Word32)
-> m (Int32, Word32, Word32, Word32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32, Word32, Word32, Word32, Word32)
 -> m (Int32, Word32, Word32, Word32, Word32, Word32))
-> IO (Int32, Word32, Word32, Word32, Word32, Word32)
-> m (Int32, Word32, Word32, Word32, Word32, Word32)
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 Word32
designSize <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
subfamilyId <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
subfamilyNameId <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
rangeStart <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
rangeEnd <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> IO Int32
hb_ot_layout_get_size_params Ptr FaceT
face' Ptr Word32
designSize Ptr Word32
subfamilyId Ptr Word32
subfamilyNameId Ptr Word32
rangeStart Ptr Word32
rangeEnd
    Word32
designSize' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
designSize
    Word32
subfamilyId' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
subfamilyId
    Word32
subfamilyNameId' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
subfamilyNameId
    Word32
rangeStart' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
rangeStart
    Word32
rangeEnd' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
rangeEnd
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
designSize
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
subfamilyId
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
subfamilyNameId
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
rangeStart
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
rangeEnd
    (Int32, Word32, Word32, Word32, Word32, Word32)
-> IO (Int32, Word32, Word32, Word32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
designSize', Word32
subfamilyId', Word32
subfamilyNameId', Word32
rangeStart', Word32
rangeEnd')


-- function ot_layout_get_ligature_carets
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_font_t to work on"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_direction_t text direction to use"
--                 , 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 #hb_codepoint_t code point to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "offset of the first caret position to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "caret_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of caret positions to return;\n              Output = the actual number of caret positions returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "caret_array"
--           , argType = TCArray False (-1) 4 (TBasicType TInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of caret positions found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "caret_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of caret positions to return;\n              Output = the actual number of caret positions returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_ligature_carets" hb_ot_layout_get_ligature_carets :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- caret_count : TBasicType TUInt
    Ptr (Ptr Int32) ->                      -- caret_array : TCArray False (-1) 4 (TBasicType TInt32)
    IO Word32

-- | Fetches a list of the caret positions defined for a ligature glyph in the GDEF
-- table of the font. The list returned will begin at the offset provided.
-- 
-- Note that a ligature that is formed from n characters will have n-1
-- caret positions. The first character is not represented in the array,
-- since its caret position is the glyph position.
-- 
-- The positions returned by this function are \'unshaped\', and will have to
-- be fixed up for kerning that may be applied to the ligature glyph.
otLayoutGetLigatureCarets ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: The t'GI.HarfBuzz.Structs.FontT.FontT' to work on
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The t'GI.HarfBuzz.Enums.DirectionT' text direction to use
    -> Word32
    -- ^ /@glyph@/: The @/hb_codepoint_t/@ code point to query
    -> Word32
    -- ^ /@startOffset@/: offset of the first caret position to retrieve
    -> m ((Word32, [Int32]))
    -- ^ __Returns:__ Total number of ligature caret positions for /@glyph@/.
otLayoutGetLigatureCarets :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> DirectionT -> Word32 -> Word32 -> m (Word32, [Int32])
otLayoutGetLigatureCarets FontT
font DirectionT
direction Word32
glyph Word32
startOffset = IO (Word32, [Int32]) -> m (Word32, [Int32])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [Int32]) -> m (Word32, [Int32]))
-> IO (Word32, [Int32]) -> m (Word32, [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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr Word32
caretCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Int32)
caretArray <- IO (Ptr (Ptr Int32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Int32))
    Word32
result <- Ptr FontT
-> CUInt
-> Word32
-> Word32
-> Ptr Word32
-> Ptr (Ptr Int32)
-> IO Word32
hb_ot_layout_get_ligature_carets Ptr FontT
font' CUInt
direction' Word32
glyph Word32
startOffset Ptr Word32
caretCount Ptr (Ptr Int32)
caretArray
    Word32
caretCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
caretCount
    Ptr Int32
caretArray' <- Ptr (Ptr Int32) -> IO (Ptr Int32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Int32)
caretArray
    [Int32]
caretArray'' <- (Word32 -> Ptr Int32 -> IO [Int32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
caretCount') Ptr Int32
caretArray'
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
caretArray'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
caretCount
    Ptr (Ptr Int32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Int32)
caretArray
    (Word32, [Int32]) -> IO (Word32, [Int32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Int32]
caretArray'')


-- function ot_layout_get_horizontal_baseline_tag_for_script
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a script tag." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_horizontal_baseline_tag_for_script" hb_ot_layout_get_horizontal_baseline_tag_for_script :: 
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    IO CUInt

-- | Fetches the dominant horizontal baseline tag used by /@script@/.
-- 
-- /Since: 4.0.0/
otLayoutGetHorizontalBaselineTagForScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.ScriptT
    -- ^ /@script@/: a script tag.
    -> m HarfBuzz.Enums.OtLayoutBaselineTagT
    -- ^ __Returns:__ dominant baseline tag for the /@script@/.
otLayoutGetHorizontalBaselineTagForScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ScriptT -> m OtLayoutBaselineTagT
otLayoutGetHorizontalBaselineTagForScript ScriptT
script = IO OtLayoutBaselineTagT -> m OtLayoutBaselineTagT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OtLayoutBaselineTagT -> m OtLayoutBaselineTagT)
-> IO OtLayoutBaselineTagT -> m OtLayoutBaselineTagT
forall a b. (a -> b) -> a -> b
$ do
    let script' :: CUInt
script' = (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
script
    CUInt
result <- CUInt -> IO CUInt
hb_ot_layout_get_horizontal_baseline_tag_for_script CUInt
script'
    let result' :: OtLayoutBaselineTagT
result' = (Int -> OtLayoutBaselineTagT
forall a. Enum a => Int -> a
toEnum (Int -> OtLayoutBaselineTagT)
-> (CUInt -> Int) -> CUInt -> OtLayoutBaselineTagT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    OtLayoutBaselineTagT -> IO OtLayoutBaselineTagT
forall (m :: * -> *) a. Monad m => a -> m a
return OtLayoutBaselineTagT
result'


-- function ot_layout_get_glyphs_in_class
-- XXX Could not generate function ot_layout_get_glyphs_in_class

-- Not implemented: Don't know how to allocate "glyphs" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_layout_get_glyph_class
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , 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 #hb_codepoint_t code point to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "ot_layout_glyph_class_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_glyph_class" hb_ot_layout_get_glyph_class :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO CUInt

-- | Fetches the GDEF class of the requested glyph in the specified face.
-- 
-- /Since: 0.9.7/
otLayoutGetGlyphClass ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> Word32
    -- ^ /@glyph@/: The @/hb_codepoint_t/@ code point to query
    -> m HarfBuzz.Enums.OtLayoutGlyphClassT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.OtLayoutGlyphClassT' glyph class of the given code
    -- point in the GDEF table of the face.
otLayoutGetGlyphClass :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m OtLayoutGlyphClassT
otLayoutGetGlyphClass FaceT
face Word32
glyph = IO OtLayoutGlyphClassT -> m OtLayoutGlyphClassT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OtLayoutGlyphClassT -> m OtLayoutGlyphClassT)
-> IO OtLayoutGlyphClassT -> m OtLayoutGlyphClassT
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
    CUInt
result <- Ptr FaceT -> Word32 -> IO CUInt
hb_ot_layout_get_glyph_class Ptr FaceT
face' Word32
glyph
    let result' :: OtLayoutGlyphClassT
result' = (Int -> OtLayoutGlyphClassT
forall a. Enum a => Int -> a
toEnum (Int -> OtLayoutGlyphClassT)
-> (CUInt -> Int) -> CUInt -> OtLayoutGlyphClassT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    OtLayoutGlyphClassT -> IO OtLayoutGlyphClassT
forall (m :: * -> *) a. Monad m => a -> m a
return OtLayoutGlyphClassT
result'


-- function ot_layout_get_baseline_with_fallback
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a font" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "baseline_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a baseline tag" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "text direction." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "script tag." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "language tag, currently unused."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coord"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "baseline value if found."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_baseline_with_fallback" hb_ot_layout_get_baseline_with_fallback :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- baseline_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_layout_baseline_tag_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Word32 ->                               -- script_tag : TBasicType TUInt32
    Word32 ->                               -- language_tag : TBasicType TUInt32
    Ptr Int32 ->                            -- coord : TBasicType TInt32
    IO ()

-- | Fetches a baseline value from the face, and synthesizes
-- it if the font does not have it.
-- 
-- /Since: 4.0.0/
otLayoutGetBaselineWithFallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: a font
    -> HarfBuzz.Enums.OtLayoutBaselineTagT
    -- ^ /@baselineTag@/: a baseline tag
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: text direction.
    -> Word32
    -- ^ /@scriptTag@/: script tag.
    -> Word32
    -- ^ /@languageTag@/: language tag, currently unused.
    -> m (Int32)
otLayoutGetBaselineWithFallback :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT
-> OtLayoutBaselineTagT
-> DirectionT
-> Word32
-> Word32
-> m Int32
otLayoutGetBaselineWithFallback FontT
font OtLayoutBaselineTagT
baselineTag DirectionT
direction Word32
scriptTag Word32
languageTag = 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
    let baselineTag' :: CUInt
baselineTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (OtLayoutBaselineTagT -> Int) -> OtLayoutBaselineTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtLayoutBaselineTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtLayoutBaselineTagT
baselineTag
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr Int32
coord <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr FontT
-> CUInt -> CUInt -> Word32 -> Word32 -> Ptr Int32 -> IO ()
hb_ot_layout_get_baseline_with_fallback Ptr FontT
font' CUInt
baselineTag' CUInt
direction' Word32
scriptTag Word32
languageTag Ptr Int32
coord
    Int32
coord' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
coord
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
coord
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
coord'


-- function ot_layout_get_baseline
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a font" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "baseline_tag"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "ot_layout_baseline_tag_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a baseline tag" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "text direction." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "script tag." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "language tag, currently unused."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coord"
--           , argType = TBasicType TInt32
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "baseline value if found."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_baseline" hb_ot_layout_get_baseline :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- baseline_tag : TInterface (Name {namespace = "HarfBuzz", name = "ot_layout_baseline_tag_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Word32 ->                               -- script_tag : TBasicType TUInt32
    Word32 ->                               -- language_tag : TBasicType TUInt32
    Ptr Int32 ->                            -- coord : TBasicType TInt32
    IO Int32

-- | Fetches a baseline value from the face.
-- 
-- /Since: 2.6.0/
otLayoutGetBaseline ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: a font
    -> HarfBuzz.Enums.OtLayoutBaselineTagT
    -- ^ /@baselineTag@/: a baseline tag
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: text direction.
    -> Word32
    -- ^ /@scriptTag@/: script tag.
    -> Word32
    -- ^ /@languageTag@/: language tag, currently unused.
    -> m ((Int32, Int32))
    -- ^ __Returns:__ @/true/@ if found baseline value in the font.
otLayoutGetBaseline :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT
-> OtLayoutBaselineTagT
-> DirectionT
-> Word32
-> Word32
-> m (Int32, Int32)
otLayoutGetBaseline FontT
font OtLayoutBaselineTagT
baselineTag DirectionT
direction Word32
scriptTag Word32
languageTag = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let baselineTag' :: CUInt
baselineTag' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (OtLayoutBaselineTagT -> Int) -> OtLayoutBaselineTagT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtLayoutBaselineTagT -> Int
forall a. Enum a => a -> Int
fromEnum) OtLayoutBaselineTagT
baselineTag
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr Int32
coord <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Int32
result <- Ptr FontT
-> CUInt -> CUInt -> Word32 -> Word32 -> Ptr Int32 -> IO Int32
hb_ot_layout_get_baseline Ptr FontT
font' CUInt
baselineTag' CUInt
direction' Word32
scriptTag Word32
languageTag Ptr Int32
coord
    Int32
coord' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
coord
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
coord
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Int32
coord')


-- function ot_layout_get_attach_points
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to work on"
--                 , 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 #hb_codepoint_t code point to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "offset of the first attachment point to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "point_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of attachment points to return;\n              Output = the actual number of attachment points returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "point_array"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of attachment points found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "point_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of attachment points to return;\n              Output = the actual number of attachment points returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_get_attach_points" hb_ot_layout_get_attach_points :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- point_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- point_array : TCArray False (-1) 3 (TBasicType TUInt)
    IO Word32

-- | Fetches a list of all attachment points for the specified glyph in the GDEF
-- table of the face. The list returned will begin at the offset provided.
-- 
-- Useful if the client program wishes to cache the list.
otLayoutGetAttachPoints ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to work on
    -> Word32
    -- ^ /@glyph@/: The @/hb_codepoint_t/@ code point to query
    -> Word32
    -- ^ /@startOffset@/: offset of the first attachment point to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of attachment points for /@glyph@/.
otLayoutGetAttachPoints :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutGetAttachPoints FaceT
face Word32
glyph Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
pointCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
pointArray <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Ptr Word32 -> Ptr (Ptr Word32) -> IO Word32
hb_ot_layout_get_attach_points Ptr FaceT
face' Word32
glyph Word32
startOffset Ptr Word32
pointCount Ptr (Ptr Word32)
pointArray
    Word32
pointCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
pointCount
    Ptr Word32
pointArray' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
pointArray
    [Word32]
pointArray'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
pointCount') Ptr Word32
pointArray'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
pointArray'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
pointCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
pointArray
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
pointArray'')


-- function ot_layout_feature_with_variations_get_lookups
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the feature to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variations_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the feature variation to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first lookup to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "lookup_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of lookups to return;\n               Output = the actual number of lookups returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "lookup_indexes"
--           , argType = TCArray False (-1) 5 (TBasicType TUInt)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of lookups found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "lookup_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of lookups to return;\n               Output = the actual number of lookups returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_feature_with_variations_get_lookups" hb_ot_layout_feature_with_variations_get_lookups :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- feature_index : TBasicType TUInt
    Word32 ->                               -- variations_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- lookup_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- lookup_indexes : TCArray False (-1) 5 (TBasicType TUInt)
    IO Word32

-- | Fetches a list of all lookups enumerated for the specified feature, in
-- the specified face\'s GSUB table or GPOS table, enabled at the specified
-- variations index. The list returned will begin at the offset provided.
otLayoutFeatureWithVariationsGetLookups ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@featureIndex@/: The index of the feature to query
    -> Word32
    -- ^ /@variationsIndex@/: The index of the feature variation to query
    -> Word32
    -- ^ /@startOffset@/: offset of the first lookup to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of lookups.
otLayoutFeatureWithVariationsGetLookups :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutFeatureWithVariationsGetLookups FaceT
face Word32
tableTag Word32
featureIndex Word32
variationsIndex Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
lookupCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
lookupIndexes <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr (Ptr Word32)
-> IO Word32
hb_ot_layout_feature_with_variations_get_lookups Ptr FaceT
face' Word32
tableTag Word32
featureIndex Word32
variationsIndex Word32
startOffset Ptr Word32
lookupCount Ptr (Ptr Word32)
lookupIndexes
    Word32
lookupCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
lookupCount
    Ptr Word32
lookupIndexes' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
lookupIndexes
    [Word32]
lookupIndexes'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
lookupCount') Ptr Word32
lookupIndexes'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
lookupIndexes'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
lookupCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
lookupIndexes
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
lookupIndexes'')


-- function ot_layout_feature_get_name_ids
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "table tag to query, \"GSUB\" or \"GPOS\"."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of feature to query."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "label_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The \8216name\8217 table name ID that specifies a string\n           for a user-interface label for this feature. (May be NULL.)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "tooltip_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The \8216name\8217 table name ID that specifies a string\n             that an application can use for tooltip text for this\n             feature. (May be NULL.)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "sample_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The \8216name\8217 table name ID that specifies sample text\n            that illustrates the effect of this feature. (May be NULL.)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "num_named_parameters"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of named parameters. (May be zero.)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "first_param_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The first \8216name\8217 table name ID used to specify\n                 strings for user-interface labels for the feature\n                 parameters. (Must be zero if numParameters is zero.)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_feature_get_name_ids" hb_ot_layout_feature_get_name_ids :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- feature_index : TBasicType TUInt
    Ptr Word32 ->                           -- label_id : TBasicType TUInt
    Ptr Word32 ->                           -- tooltip_id : TBasicType TUInt
    Ptr Word32 ->                           -- sample_id : TBasicType TUInt
    Ptr Word32 ->                           -- num_named_parameters : TBasicType TUInt
    Ptr Word32 ->                           -- first_param_id : TBasicType TUInt
    IO Int32

-- | Fetches name indices from feature parameters for \"Stylistic Set\" (\'ssXX\') or
-- \"Character Variant\" (\'cvXX\') features.
-- 
-- /Since: 2.0.0/
otLayoutFeatureGetNameIds ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: table tag to query, \"GSUB\" or \"GPOS\".
    -> Word32
    -- ^ /@featureIndex@/: index of feature to query.
    -> m ((Int32, Word32, Word32, Word32, Word32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otLayoutFeatureGetNameIds :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32
-> Word32
-> m (Int32, Word32, Word32, Word32, Word32, Word32)
otLayoutFeatureGetNameIds FaceT
face Word32
tableTag Word32
featureIndex = IO (Int32, Word32, Word32, Word32, Word32, Word32)
-> m (Int32, Word32, Word32, Word32, Word32, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Word32, Word32, Word32, Word32, Word32)
 -> m (Int32, Word32, Word32, Word32, Word32, Word32))
-> IO (Int32, Word32, Word32, Word32, Word32, Word32)
-> m (Int32, Word32, Word32, Word32, Word32, Word32)
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 Word32
labelId <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
tooltipId <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
sampleId <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
numNamedParameters <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
firstParamId <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FaceT
-> Word32
-> Word32
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> Ptr Word32
-> IO Int32
hb_ot_layout_feature_get_name_ids Ptr FaceT
face' Word32
tableTag Word32
featureIndex Ptr Word32
labelId Ptr Word32
tooltipId Ptr Word32
sampleId Ptr Word32
numNamedParameters Ptr Word32
firstParamId
    Word32
labelId' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
labelId
    Word32
tooltipId' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
tooltipId
    Word32
sampleId' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
sampleId
    Word32
numNamedParameters' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
numNamedParameters
    Word32
firstParamId' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
firstParamId
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
labelId
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
tooltipId
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
sampleId
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
numNamedParameters
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
firstParamId
    (Int32, Word32, Word32, Word32, Word32, Word32)
-> IO (Int32, Word32, Word32, Word32, Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
labelId', Word32
tooltipId', Word32
sampleId', Word32
numNamedParameters', Word32
firstParamId')


-- function ot_layout_feature_get_lookups
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#HB_OT_TAG_GSUB or #HB_OT_TAG_GPOS"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the requested feature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first lookup to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "lookup_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of lookups to return;\n               Output = the actual number of lookups returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "lookup_indexes"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The array of lookup indexes found for the query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "lookup_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of lookups to return;\n               Output = the actual number of lookups returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_feature_get_lookups" hb_ot_layout_feature_get_lookups :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- feature_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- lookup_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- lookup_indexes : TCArray False (-1) 4 (TBasicType TUInt)
    IO Word32

-- | Fetches a list of all lookups enumerated for the specified feature, in
-- the specified face\'s GSUB table or GPOS table. The list returned will
-- begin at the offset provided.
-- 
-- /Since: 0.9.7/
otLayoutFeatureGetLookups ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: @/HB_OT_TAG_GSUB/@ or @/HB_OT_TAG_GPOS/@
    -> Word32
    -- ^ /@featureIndex@/: The index of the requested feature
    -> Word32
    -- ^ /@startOffset@/: offset of the first lookup to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of lookups.
otLayoutFeatureGetLookups :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> Word32 -> m (Word32, [Word32])
otLayoutFeatureGetLookups FaceT
face Word32
tableTag Word32
featureIndex Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
lookupCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
lookupIndexes <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32
-> Word32
-> Word32
-> Ptr Word32
-> Ptr (Ptr Word32)
-> IO Word32
hb_ot_layout_feature_get_lookups Ptr FaceT
face' Word32
tableTag Word32
featureIndex Word32
startOffset Ptr Word32
lookupCount Ptr (Ptr Word32)
lookupIndexes
    Word32
lookupCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
lookupCount
    Ptr Word32
lookupIndexes' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
lookupIndexes
    [Word32]
lookupIndexes'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
lookupCount') Ptr Word32
lookupIndexes'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
lookupIndexes'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
lookupCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
lookupIndexes
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
lookupIndexes'')


-- function ot_layout_feature_get_characters
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_tag"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "table tag to query, \"GSUB\" or \"GPOS\"."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "index of feature to query."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first character to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "char_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of characters to return;\n             Output = the actual number of characters returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "characters"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "A buffer pointer.\n             The Unicode codepoints of the characters for which this feature provides\n              glyph variants."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "char_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of characters to return;\n             Output = the actual number of characters returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_layout_feature_get_characters" hb_ot_layout_feature_get_characters :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- table_tag : TBasicType TUInt32
    Word32 ->                               -- feature_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- char_count : TBasicType TUInt
    Ptr Word32 ->                           -- characters : TCArray False (-1) 4 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of the characters defined as having a variant under the specified
-- \"Character Variant\" (\"cvXX\") feature tag.
-- 
-- /Since: 2.0.0/
otLayoutFeatureGetCharacters ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@tableTag@/: table tag to query, \"GSUB\" or \"GPOS\".
    -> Word32
    -- ^ /@featureIndex@/: index of feature to query.
    -> Word32
    -- ^ /@startOffset@/: offset of the first character to retrieve
    -> [Word32]
    -- ^ /@characters@/: A buffer pointer.
    --              The Unicode codepoints of the characters for which this feature provides
    --               glyph variants.
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Number of total sample characters in the cvXX feature.
otLayoutFeatureGetCharacters :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32 -> Word32 -> Word32 -> [Word32] -> m (Word32, [Word32])
otLayoutFeatureGetCharacters FaceT
face Word32
tableTag Word32
featureIndex Word32
startOffset [Word32]
characters = 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
    let charCount :: Word32
charCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Word32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word32]
characters
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
characters' <- [Word32] -> IO (Ptr Word32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word32]
characters
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Word32 -> Word32 -> Ptr Word32 -> IO Word32
hb_ot_layout_feature_get_characters Ptr FaceT
face' Word32
tableTag Word32
featureIndex Word32
startOffset Word32
charCount Ptr Word32
characters'
    [Word32]
characters'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
charCount) Ptr Word32
characters'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
characters'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
characters'')


-- function ot_layout_collect_lookups
-- XXX Could not generate function ot_layout_collect_lookups

-- Not implemented: Don't know how to allocate "lookup_indexes" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_layout_collect_features
-- XXX Could not generate function ot_layout_collect_features

-- Not implemented: Don't know how to allocate "feature_indexes" of type TInterface (Name {namespace = "HarfBuzz", name = "set_t"})

-- function ot_font_set_funcs
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_font_set_funcs" hb_ot_font_set_funcs :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO ()

-- | Sets the font functions to use when working with /@font@/.
-- 
-- /Since: 0.9.28/
otFontSetFuncs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ()
otFontSetFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m ()
otFontSetFuncs FontT
font = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> IO ()
hb_ot_font_set_funcs Ptr FontT
font'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function ot_color_palette_get_name_id
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "palette_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the color palette"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_palette_get_name_id" hb_ot_color_palette_get_name_id :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- palette_index : TBasicType TUInt
    IO Word32

-- | Fetches the @name@ table Name ID that provides display names for
-- a @CPAL@ color palette.
-- 
-- Palette display names can be generic (e.g., \"Default\") or provide
-- specific, themed names (e.g., \"Spring\", \"Summer\", \"Fall\", and \"Winter\").
-- 
-- /Since: 2.1.0/
otColorPaletteGetNameId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@paletteIndex@/: The index of the color palette
    -> m Word32
    -- ^ __Returns:__ the Named ID found for the palette.
    -- If the requested palette has no name the result is @/HB_OT_NAME_ID_INVALID/@.
otColorPaletteGetNameId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m Word32
otColorPaletteGetNameId FaceT
face Word32
paletteIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> Word32 -> IO Word32
hb_ot_color_palette_get_name_id Ptr FaceT
face' Word32
paletteIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_color_palette_get_flags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "palette_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the color palette"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "ot_color_palette_flags_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_palette_get_flags" hb_ot_color_palette_get_flags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- palette_index : TBasicType TUInt
    IO CUInt

-- | Fetches the flags defined for a color palette.
-- 
-- /Since: 2.1.0/
otColorPaletteGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@paletteIndex@/: The index of the color palette
    -> m [HarfBuzz.Flags.OtColorPaletteFlagsT]
    -- ^ __Returns:__ the t'GI.HarfBuzz.Flags.OtColorPaletteFlagsT' of the requested color palette
otColorPaletteGetFlags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m [OtColorPaletteFlagsT]
otColorPaletteGetFlags FaceT
face Word32
paletteIndex = IO [OtColorPaletteFlagsT] -> m [OtColorPaletteFlagsT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [OtColorPaletteFlagsT] -> m [OtColorPaletteFlagsT])
-> IO [OtColorPaletteFlagsT] -> m [OtColorPaletteFlagsT]
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
    CUInt
result <- Ptr FaceT -> Word32 -> IO CUInt
hb_ot_color_palette_get_flags Ptr FaceT
face' Word32
paletteIndex
    let result' :: [OtColorPaletteFlagsT]
result' = CUInt -> [OtColorPaletteFlagsT]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    [OtColorPaletteFlagsT] -> IO [OtColorPaletteFlagsT]
forall (m :: * -> *) a. Monad m => a -> m a
return [OtColorPaletteFlagsT]
result'


-- function ot_color_palette_get_count
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_palette_get_count" hb_ot_color_palette_get_count :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Word32

-- | Fetches the number of color palettes in a face.
-- 
-- /Since: 2.1.0/
otColorPaletteGetCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Word32
    -- ^ __Returns:__ the number of palettes found
otColorPaletteGetCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m Word32
otColorPaletteGetCount FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> IO Word32
hb_ot_color_palette_get_count Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_color_palette_get_colors
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "palette_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the index of the color palette to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first color to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "color_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of colors to return;\n              Output = the actual number of colors returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "colors"
--           , argType = TCArray False (-1) 3 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of #hb_color_t records found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "color_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of colors to return;\n              Output = the actual number of colors returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_palette_get_colors" hb_ot_color_palette_get_colors :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- palette_index : TBasicType TUInt
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- color_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- colors : TCArray False (-1) 3 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of the colors in a color palette.
-- 
-- After calling this function, /@colors@/ will be filled with the palette
-- colors. If /@colors@/ is NULL, the function will just return the number
-- of total colors without storing any actual colors; this can be used
-- for allocating a buffer of suitable size before calling
-- 'GI.HarfBuzz.Functions.otColorPaletteGetColors' a second time.
-- 
-- /Since: 2.1.0/
otColorPaletteGetColors ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@paletteIndex@/: the index of the color palette to query
    -> Word32
    -- ^ /@startOffset@/: offset of the first color to retrieve
    -> m ((Word32, Maybe [Word32]))
    -- ^ __Returns:__ the total number of colors in the palette
otColorPaletteGetColors :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> Word32 -> m (Word32, Maybe [Word32])
otColorPaletteGetColors FaceT
face Word32
paletteIndex Word32
startOffset = IO (Word32, Maybe [Word32]) -> m (Word32, Maybe [Word32])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, Maybe [Word32]) -> m (Word32, Maybe [Word32]))
-> IO (Word32, Maybe [Word32]) -> m (Word32, Maybe [Word32])
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 Word32
colorCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
colors <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Ptr Word32 -> Ptr (Ptr Word32) -> IO Word32
hb_ot_color_palette_get_colors Ptr FaceT
face' Word32
paletteIndex Word32
startOffset Ptr Word32
colorCount Ptr (Ptr Word32)
colors
    Word32
colorCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
colorCount
    Ptr Word32
colors' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
colors
    Maybe [Word32]
maybeColors' <- Ptr Word32 -> (Ptr Word32 -> IO [Word32]) -> IO (Maybe [Word32])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Word32
colors' ((Ptr Word32 -> IO [Word32]) -> IO (Maybe [Word32]))
-> (Ptr Word32 -> IO [Word32]) -> IO (Maybe [Word32])
forall a b. (a -> b) -> a -> b
$ \Ptr Word32
colors'' -> do
        [Word32]
colors''' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
colorCount') Ptr Word32
colors''
        Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
colors''
        [Word32] -> IO [Word32]
forall (m :: * -> *) a. Monad m => a -> m a
return [Word32]
colors'''
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
colorCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
colors
    (Word32, Maybe [Word32]) -> IO (Word32, Maybe [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, Maybe [Word32]
maybeColors')


-- function ot_color_palette_color_get_name_id
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "color_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the color"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_palette_color_get_name_id" hb_ot_color_palette_color_get_name_id :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- color_index : TBasicType TUInt
    IO Word32

-- | Fetches the @name@ table Name ID that provides display names for
-- the specified color in a face\'s @CPAL@ color palette.
-- 
-- Display names can be generic (e.g., \"Background\") or specific
-- (e.g., \"Eye color\").
-- 
-- /Since: 2.1.0/
otColorPaletteColorGetNameId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@colorIndex@/: The index of the color
    -> m Word32
    -- ^ __Returns:__ the Name ID found for the color.
otColorPaletteColorGetNameId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m Word32
otColorPaletteColorGetNameId FaceT
face Word32
colorIndex = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> Word32 -> IO Word32
hb_ot_color_palette_color_get_name_id Ptr FaceT
face' Word32
colorIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function ot_color_has_svg
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_has_svg" hb_ot_color_has_svg :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face includes any @SVG@ glyph images.
-- 
-- /Since: 2.1.0/
otColorHasSvg ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon.
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise.
otColorHasSvg :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otColorHasSvg FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_color_has_svg Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_color_has_png
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_has_png" hb_ot_color_has_png :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face has PNG glyph images (either in @CBDT@ or @sbix@ tables).
-- 
-- /Since: 2.1.0/
otColorHasPng ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otColorHasPng :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otColorHasPng FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_color_has_png Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_color_has_palettes
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_has_palettes" hb_ot_color_has_palettes :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face includes a @CPAL@ color-palette table.
-- 
-- /Since: 2.1.0/
otColorHasPalettes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otColorHasPalettes :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otColorHasPalettes FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_color_has_palettes Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_color_has_layers
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_has_layers" hb_ot_color_has_layers :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether a face includes any @COLR@ color layers.
-- 
-- /Since: 2.1.0/
otColorHasLayers ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
otColorHasLayers :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
otColorHasLayers FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_ot_color_has_layers Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function ot_color_glyph_reference_svg
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , 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 "a svg glyph index" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_glyph_reference_svg" hb_ot_color_glyph_reference_svg :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Fetches the SVG document for a glyph. The blob may be either plain text or gzip-encoded.
-- 
-- If the glyph has no SVG document, the singleton empty blob is returned.
-- 
-- /Since: 2.1.0/
otColorGlyphReferenceSvg ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@glyph@/: a svg glyph index
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' containing the SVG document of the glyph, if available
otColorGlyphReferenceSvg :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m BlobT
otColorGlyphReferenceSvg FaceT
face Word32
glyph = 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 <- Ptr FaceT -> Word32 -> IO (Ptr BlobT)
hb_ot_color_glyph_reference_svg Ptr FaceT
face' Word32
glyph
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"otColorGlyphReferenceSvg" 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'


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

foreign import ccall "hb_ot_color_glyph_reference_png" hb_ot_color_glyph_reference_png :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Fetches the PNG image for a glyph. This function takes a font object, not a face object,
-- as input. To get an optimally sized PNG blob, the UPEM value must be set on the /@font@/
-- object. If UPEM is unset, the blob returned will be the largest PNG available.
-- 
-- If the glyph has no PNG image, the singleton empty blob is returned.
-- 
-- /Since: 2.1.0/
otColorGlyphReferencePng ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: a glyph index
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' containing the PNG image for the glyph, if available
otColorGlyphReferencePng :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m BlobT
otColorGlyphReferencePng FontT
font Word32
glyph = 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 FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr BlobT
result <- Ptr FontT -> Word32 -> IO (Ptr BlobT)
hb_ot_color_glyph_reference_png Ptr FontT
font' Word32
glyph
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"otColorGlyphReferencePng" 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
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function ot_color_glyph_get_layers
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , 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 index to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first layer to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "layer_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of layers to return;\n        Output = the actual number of layers returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "layers"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface
--                    Name { namespace = "HarfBuzz" , name = "ot_color_layer_t" })
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of layers found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "layer_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of layers to return;\n        Output = the actual number of layers returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ot_color_glyph_get_layers" hb_ot_color_glyph_get_layers :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- layer_count : TBasicType TUInt
    Ptr HarfBuzz.OtColorLayerT.OtColorLayerT -> -- layers : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "ot_color_layer_t"}))
    IO Word32

-- | Fetches a list of all color layers for the specified glyph index in the specified
-- face. The list returned will begin at the offset provided.
-- 
-- /Since: 2.1.0/
otColorGlyphGetLayers ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph index to query
    -> Word32
    -- ^ /@startOffset@/: offset of the first layer to retrieve
    -> Maybe ([HarfBuzz.OtColorLayerT.OtColorLayerT])
    -- ^ /@layers@/: The array of layers found
    -> m ((Word32, Maybe [HarfBuzz.OtColorLayerT.OtColorLayerT]))
    -- ^ __Returns:__ Total number of layers available for the glyph index queried
otColorGlyphGetLayers :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32
-> Word32
-> Maybe [OtColorLayerT]
-> m (Word32, Maybe [OtColorLayerT])
otColorGlyphGetLayers FaceT
face Word32
glyph Word32
startOffset Maybe [OtColorLayerT]
layers = IO (Word32, Maybe [OtColorLayerT])
-> m (Word32, Maybe [OtColorLayerT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, Maybe [OtColorLayerT])
 -> m (Word32, Maybe [OtColorLayerT]))
-> IO (Word32, Maybe [OtColorLayerT])
-> m (Word32, Maybe [OtColorLayerT])
forall a b. (a -> b) -> a -> b
$ do
    let layerCount :: Word32
layerCount = case Maybe [OtColorLayerT]
layers of
            Maybe [OtColorLayerT]
Nothing -> Word32
0
            Just [OtColorLayerT]
jLayers -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [OtColorLayerT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [OtColorLayerT]
jLayers
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr OtColorLayerT
maybeLayers <- case Maybe [OtColorLayerT]
layers of
        Maybe [OtColorLayerT]
Nothing -> Ptr OtColorLayerT -> IO (Ptr OtColorLayerT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr OtColorLayerT
forall a. Ptr a
nullPtr
        Just [OtColorLayerT]
jLayers -> do
            [Ptr OtColorLayerT]
jLayers' <- (OtColorLayerT -> IO (Ptr OtColorLayerT))
-> [OtColorLayerT] -> IO [Ptr OtColorLayerT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OtColorLayerT -> IO (Ptr OtColorLayerT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [OtColorLayerT]
jLayers
            Ptr OtColorLayerT
jLayers'' <- Int -> [Ptr OtColorLayerT] -> IO (Ptr OtColorLayerT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
8 [Ptr OtColorLayerT]
jLayers'
            Ptr OtColorLayerT -> IO (Ptr OtColorLayerT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr OtColorLayerT
jLayers''
    Word32
result <- Ptr FaceT
-> Word32 -> Word32 -> Word32 -> Ptr OtColorLayerT -> IO Word32
hb_ot_color_glyph_get_layers Ptr FaceT
face' Word32
glyph Word32
startOffset Word32
layerCount Ptr OtColorLayerT
maybeLayers
    Maybe [OtColorLayerT]
maybeMaybeLayers <- Ptr OtColorLayerT
-> (Ptr OtColorLayerT -> IO [OtColorLayerT])
-> IO (Maybe [OtColorLayerT])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr OtColorLayerT
maybeLayers ((Ptr OtColorLayerT -> IO [OtColorLayerT])
 -> IO (Maybe [OtColorLayerT]))
-> (Ptr OtColorLayerT -> IO [OtColorLayerT])
-> IO (Maybe [OtColorLayerT])
forall a b. (a -> b) -> a -> b
$ \Ptr OtColorLayerT
maybeLayers' -> do
        [Ptr OtColorLayerT]
maybeLayers'' <- (Int -> Word32 -> Ptr OtColorLayerT -> IO [Ptr OtColorLayerT]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
8 Word32
layerCount) Ptr OtColorLayerT
maybeLayers'
        [OtColorLayerT]
maybeLayers''' <- (Ptr OtColorLayerT -> IO OtColorLayerT)
-> [Ptr OtColorLayerT] -> IO [OtColorLayerT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr OtColorLayerT -> OtColorLayerT)
-> Ptr OtColorLayerT -> IO OtColorLayerT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr OtColorLayerT -> OtColorLayerT
HarfBuzz.OtColorLayerT.OtColorLayerT) [Ptr OtColorLayerT]
maybeLayers''
        Ptr OtColorLayerT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr OtColorLayerT
maybeLayers'
        [OtColorLayerT] -> IO [OtColorLayerT]
forall (m :: * -> *) a. Monad m => a -> m a
return [OtColorLayerT]
maybeLayers'''
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Maybe [OtColorLayerT] -> ([OtColorLayerT] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [OtColorLayerT]
layers ((OtColorLayerT -> IO ()) -> [OtColorLayerT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OtColorLayerT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
    (Word32, Maybe [OtColorLayerT])
-> IO (Word32, Maybe [OtColorLayerT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, Maybe [OtColorLayerT]
maybeMaybeLayers)


-- function map_set
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The key to store in the map"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The value to store for @key"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_set" hb_map_set :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    Word32 ->                               -- key : TBasicType TUInt32
    Word32 ->                               -- value : TBasicType TUInt32
    IO ()

-- | Stores /@key@/:/@value@/ in the map.
-- 
-- /Since: 1.7.7/
mapSet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> Word32
    -- ^ /@key@/: The key to store in the map
    -> Word32
    -- ^ /@value@/: The value to store for /@key@/
    -> m ()
mapSet :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MapT -> Word32 -> Word32 -> m ()
mapSet MapT
map_ Word32
key Word32
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Ptr MapT -> Word32 -> Word32 -> IO ()
hb_map_set Ptr MapT
map_' Word32
key Word32
value
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function map_is_empty
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_is_empty" hb_map_is_empty :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    IO Int32

-- | Tests whether /@map@/ is empty (contains no elements).
-- 
-- /Since: 1.7.7/
mapIsEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@map@/ is empty
mapIsEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Int32
mapIsEmpty MapT
map_ = 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 MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Int32
result <- Ptr MapT -> IO Int32
hb_map_is_empty Ptr MapT
map_'
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function map_has
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The key to query" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_has" hb_map_has :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    Word32 ->                               -- key : TBasicType TUInt32
    IO Int32

-- | Tests whether /@key@/ is an element of /@map@/.
-- 
-- /Since: 1.7.7/
mapHas ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> Word32
    -- ^ /@key@/: The key to query
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@key@/ is found in /@map@/, @/false/@ otherwise
mapHas :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MapT -> Word32 -> m Int32
mapHas MapT
map_ Word32
key = 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 MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Int32
result <- Ptr MapT -> Word32 -> IO Int32
hb_map_has Ptr MapT
map_' Word32
key
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function map_get_population
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_get_population" hb_map_get_population :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    IO Word32

-- | Returns the number of key-value pairs in the map.
-- 
-- /Since: 1.7.7/
mapGetPopulation ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> m Word32
    -- ^ __Returns:__ The population of /@map@/
mapGetPopulation :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Word32
mapGetPopulation MapT
map_ = 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 MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Word32
result <- Ptr MapT -> IO Word32
hb_map_get_population Ptr MapT
map_'
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function map_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "map_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_get_empty" hb_map_get_empty :: 
    IO (Ptr HarfBuzz.MapT.MapT)

-- | Fetches the singleton empty t'GI.HarfBuzz.Structs.MapT.MapT'.
-- 
-- /Since: 1.7.7/
mapGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.MapT.MapT
    -- ^ __Returns:__ The empty t'GI.HarfBuzz.Structs.MapT.MapT'
mapGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m MapT
mapGetEmpty  = IO MapT -> m MapT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MapT -> m MapT) -> IO MapT -> m MapT
forall a b. (a -> b) -> a -> b
$ do
    Ptr MapT
result <- IO (Ptr MapT)
hb_map_get_empty
    Text -> Ptr MapT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mapGetEmpty" Ptr MapT
result
    MapT
result' <- ((ManagedPtr MapT -> MapT) -> Ptr MapT -> IO MapT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr MapT -> MapT
HarfBuzz.MapT.MapT) Ptr MapT
result
    MapT -> IO MapT
forall (m :: * -> *) a. Monad m => a -> m a
return MapT
result'


-- function map_get
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The key to query" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_get" hb_map_get :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    Word32 ->                               -- key : TBasicType TUInt32
    IO Word32

-- | Fetches the value stored for /@key@/ in /@map@/.
-- 
-- /Since: 1.7.7/
mapGet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> Word32
    -- ^ /@key@/: The key to query
    -> m Word32
mapGet :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MapT -> Word32 -> m Word32
mapGet MapT
map_ Word32
key = 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 MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Word32
result <- Ptr MapT -> Word32 -> IO Word32
hb_map_get Ptr MapT
map_' Word32
key
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function map_del
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The key to delete" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_del" hb_map_del :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    Word32 ->                               -- key : TBasicType TUInt32
    IO ()

-- | Removes /@key@/ and its stored value from /@map@/.
-- 
-- /Since: 1.7.7/
mapDel ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> Word32
    -- ^ /@key@/: The key to delete
    -> m ()
mapDel :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
MapT -> Word32 -> m ()
mapDel MapT
map_ Word32
key = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Ptr MapT -> Word32 -> IO ()
hb_map_del Ptr MapT
map_' Word32
key
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function map_create
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "map_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_create" hb_map_create :: 
    IO (Ptr HarfBuzz.MapT.MapT)

-- | Creates a new, initially empty map.
-- 
-- /Since: 1.7.7/
mapCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.MapT.MapT
    -- ^ __Returns:__ The new t'GI.HarfBuzz.Structs.MapT.MapT'
mapCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m MapT
mapCreate  = IO MapT -> m MapT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MapT -> m MapT) -> IO MapT -> m MapT
forall a b. (a -> b) -> a -> b
$ do
    Ptr MapT
result <- IO (Ptr MapT)
hb_map_create
    Text -> Ptr MapT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mapCreate" Ptr MapT
result
    MapT
result' <- ((ManagedPtr MapT -> MapT) -> Ptr MapT -> IO MapT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr MapT -> MapT
HarfBuzz.MapT.MapT) Ptr MapT
result
    MapT -> IO MapT
forall (m :: * -> *) a. Monad m => a -> m a
return MapT
result'


-- function map_clear
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_clear" hb_map_clear :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    IO ()

-- | Clears out the contents of /@map@/.
-- 
-- /Since: 1.7.7/
mapClear ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> m ()
mapClear :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m ()
mapClear MapT
map_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Ptr MapT -> IO ()
hb_map_clear Ptr MapT
map_'
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function map_allocation_successful
-- Args: [ Arg
--           { argCName = "map"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "map_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_map_allocation_successful" hb_map_allocation_successful :: 
    Ptr HarfBuzz.MapT.MapT ->               -- map : TInterface (Name {namespace = "HarfBuzz", name = "map_t"})
    IO Int32

-- | Tests whether memory allocation for a set was successful.
-- 
-- /Since: 1.7.7/
mapAllocationSuccessful ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.MapT.MapT
    -- ^ /@map@/: A map
    -> m Int32
    -- ^ __Returns:__ @/true/@ if allocation succeeded, @/false/@ otherwise
mapAllocationSuccessful :: forall (m :: * -> *). (HasCallStack, MonadIO m) => MapT -> m Int32
mapAllocationSuccessful MapT
map_ = 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 MapT
map_' <- MapT -> IO (Ptr MapT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapT
map_
    Int32
result <- Ptr MapT -> IO Int32
hb_map_allocation_successful Ptr MapT
map_'
    MapT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapT
map_
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function language_to_string
-- Args: [ Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_language_t to convert"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_language_to_string" hb_language_to_string :: 
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    IO CString

-- | Converts an t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to a string.
-- 
-- /Since: 0.9.2/
languageToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.LanguageT.LanguageT
    -- ^ /@language@/: The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' to convert
    -> m T.Text
    -- ^ __Returns:__ 
    -- A 'P.Nothing'-terminated string representing the /@language@/. Must not be freed by
    -- the caller.
languageToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
LanguageT -> m Text
languageToString LanguageT
language = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    CString
result <- Ptr LanguageT -> IO CString
hb_language_to_string Ptr LanguageT
language'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"languageToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function language_get_default
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "language_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_language_get_default" hb_language_get_default :: 
    IO (Ptr HarfBuzz.LanguageT.LanguageT)

-- | Fetch the default language from current locale.
-- 
-- \<note>Note that the first time this function is called, it calls
-- \"setlocale (LC_CTYPE, nullptr)\" to fetch current locale.  The underlying
-- setlocale function is, in many implementations, NOT threadsafe.  To avoid
-- problems, call this function once before multiple threads can call it.
-- This function is only used from 'GI.HarfBuzz.Functions.bufferGuessSegmentProperties' by
-- HarfBuzz itself.\<\/note>
-- 
-- /Since: 0.9.2/
languageGetDefault ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.LanguageT.LanguageT
    -- ^ __Returns:__ The default language of the locale as
    -- an t'GI.HarfBuzz.Structs.LanguageT.LanguageT'
languageGetDefault :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m LanguageT
languageGetDefault  = IO LanguageT -> m LanguageT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LanguageT -> m LanguageT) -> IO LanguageT -> m LanguageT
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageT
result <- IO (Ptr LanguageT)
hb_language_get_default
    Text -> Ptr LanguageT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"languageGetDefault" Ptr LanguageT
result
    LanguageT
result' <- ((ManagedPtr LanguageT -> LanguageT)
-> Ptr LanguageT -> IO LanguageT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr LanguageT -> LanguageT
HarfBuzz.LanguageT.LanguageT) Ptr LanguageT
result
    LanguageT -> IO LanguageT
forall (m :: * -> *) a. Monad m => a -> m a
return LanguageT
result'


-- function language_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a string representing\n      a BCP 47 language tag"
--                 , 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 "length of the @str, or -1 if it is %NULL-terminated."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "length of the @str, or -1 if it is %NULL-terminated."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "language_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_language_from_string" hb_language_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    IO (Ptr HarfBuzz.LanguageT.LanguageT)

-- | Converts /@str@/ representing a BCP 47 language tag to the corresponding
-- t'GI.HarfBuzz.Structs.LanguageT.LanguageT'.
-- 
-- /Since: 0.9.2/
languageFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: a string representing
    --       a BCP 47 language tag
    -> m HarfBuzz.LanguageT.LanguageT
    -- ^ __Returns:__ 
    -- The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' corresponding to the BCP 47 language tag.
languageFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m LanguageT
languageFromString ByteString
str = IO LanguageT -> m LanguageT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LanguageT -> m LanguageT) -> IO LanguageT -> m LanguageT
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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    Ptr LanguageT
result <- Ptr Word8 -> Int32 -> IO (Ptr LanguageT)
hb_language_from_string Ptr Word8
str' Int32
len
    Text -> Ptr LanguageT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"languageFromString" Ptr LanguageT
result
    LanguageT
result' <- ((ManagedPtr LanguageT -> LanguageT)
-> Ptr LanguageT -> IO LanguageT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr LanguageT -> LanguageT
HarfBuzz.LanguageT.LanguageT) Ptr LanguageT
result
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    LanguageT -> IO LanguageT
forall (m :: * -> *) a. Monad m => a -> m a
return LanguageT
result'


-- function glyph_info_get_glyph_flags
-- Args: [ Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "glyph_info_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #hb_glyph_info_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "glyph_flags_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_glyph_info_get_glyph_flags" hb_glyph_info_get_glyph_flags :: 
    Ptr HarfBuzz.GlyphInfoT.GlyphInfoT ->   -- info : TInterface (Name {namespace = "HarfBuzz", name = "glyph_info_t"})
    IO CUInt

-- | Returns glyph flags encoded within a t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.
-- 
-- /Since: 1.5.0/
glyphInfoGetGlyphFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.GlyphInfoT.GlyphInfoT
    -- ^ /@info@/: a t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'
    -> m [HarfBuzz.Flags.GlyphFlagsT]
    -- ^ __Returns:__ The t'GI.HarfBuzz.Flags.GlyphFlagsT' encoded within /@info@/
glyphInfoGetGlyphFlags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GlyphInfoT -> m [GlyphFlagsT]
glyphInfoGetGlyphFlags GlyphInfoT
info = IO [GlyphFlagsT] -> m [GlyphFlagsT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GlyphFlagsT] -> m [GlyphFlagsT])
-> IO [GlyphFlagsT] -> m [GlyphFlagsT]
forall a b. (a -> b) -> a -> b
$ do
    Ptr GlyphInfoT
info' <- GlyphInfoT -> IO (Ptr GlyphInfoT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GlyphInfoT
info
    CUInt
result <- Ptr GlyphInfoT -> IO CUInt
hb_glyph_info_get_glyph_flags Ptr GlyphInfoT
info'
    let result' :: [GlyphFlagsT]
result' = CUInt -> [GlyphFlagsT]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    GlyphInfoT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GlyphInfoT
info
    [GlyphFlagsT] -> IO [GlyphFlagsT]
forall (m :: * -> *) a. Monad m => a -> m a
return [GlyphFlagsT]
result'


-- function glib_script_to_script
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "UnicodeScript" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The GUnicodeScript identifier to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_glib_script_to_script" hb_glib_script_to_script :: 
    CInt ->                                 -- script : TInterface (Name {namespace = "GLib", name = "UnicodeScript"})
    IO CUInt

-- | Fetches the t'GI.HarfBuzz.Enums.ScriptT' script that corresponds to the
-- specified GUnicodeScript identifier.
-- 
-- /Since: 0.9.38/
glibScriptToScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Enums.UnicodeScript
    -- ^ /@script@/: The GUnicodeScript identifier to query
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ the t'GI.HarfBuzz.Enums.ScriptT' script found
glibScriptToScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
UnicodeScript -> m ScriptT
glibScriptToScript UnicodeScript
script = 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
    let script' :: CInt
script' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (UnicodeScript -> Int) -> UnicodeScript -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnicodeScript -> Int
forall a. Enum a => a -> Int
fromEnum) UnicodeScript
script
    CUInt
result <- CInt -> IO CUInt
hb_glib_script_to_script CInt
script'
    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
    ScriptT -> IO ScriptT
forall (m :: * -> *) a. Monad m => a -> m a
return ScriptT
result'


-- function glib_script_from_script
-- Args: [ Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_script_t to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "UnicodeScript" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_glib_script_from_script" hb_glib_script_from_script :: 
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    IO CInt

-- | Fetches the GUnicodeScript identifier that corresponds to the
-- specified t'GI.HarfBuzz.Enums.ScriptT' script.
-- 
-- /Since: 0.9.38/
glibScriptFromScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.ScriptT
    -- ^ /@script@/: The t'GI.HarfBuzz.Enums.ScriptT' to query
    -> m GLib.Enums.UnicodeScript
    -- ^ __Returns:__ the GUnicodeScript identifier found
glibScriptFromScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ScriptT -> m UnicodeScript
glibScriptFromScript ScriptT
script = IO UnicodeScript -> m UnicodeScript
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeScript -> m UnicodeScript)
-> IO UnicodeScript -> m UnicodeScript
forall a b. (a -> b) -> a -> b
$ do
    let script' :: CUInt
script' = (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
script
    CInt
result <- CUInt -> IO CInt
hb_glib_script_from_script CUInt
script'
    let result' :: UnicodeScript
result' = (Int -> UnicodeScript
forall a. Enum a => Int -> a
toEnum (Int -> UnicodeScript) -> (CInt -> Int) -> CInt -> UnicodeScript
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    UnicodeScript -> IO UnicodeScript
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeScript
result'


-- function glib_get_unicode_funcs
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_glib_get_unicode_funcs" hb_glib_get_unicode_funcs :: 
    IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)

-- | Fetches a Unicode-functions structure that is populated
-- with the appropriate GLib function for each method.
-- 
-- /Since: 0.9.38/
glibGetUnicodeFuncs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ __Returns:__ a pointer to the t'GI.HarfBuzz.Structs.UnicodeFuncsT.UnicodeFuncsT' Unicode-functions structure
glibGetUnicodeFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m UnicodeFuncsT
glibGetUnicodeFuncs  = IO UnicodeFuncsT -> m UnicodeFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT)
-> IO UnicodeFuncsT -> m UnicodeFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeFuncsT
result <- IO (Ptr UnicodeFuncsT)
hb_glib_get_unicode_funcs
    Text -> Ptr UnicodeFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"glibGetUnicodeFuncs" Ptr UnicodeFuncsT
result
    UnicodeFuncsT
result' <- ((ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> IO UnicodeFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) Ptr UnicodeFuncsT
result
    UnicodeFuncsT -> IO UnicodeFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeFuncsT
result'


-- function glib_blob_create
-- Args: [ Arg
--           { argCName = "gbytes"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the GBytes structure to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_glib_blob_create" hb_glib_blob_create :: 
    Ptr GLib.Bytes.Bytes ->                 -- gbytes : TInterface (Name {namespace = "GLib", name = "Bytes"})
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Creates an t'GI.HarfBuzz.Structs.BlobT.BlobT' blob from the specified
-- GBytes data structure.
-- 
-- /Since: 0.9.38/
glibBlobCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GLib.Bytes.Bytes
    -- ^ /@gbytes@/: the GBytes structure to work upon
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ the new t'GI.HarfBuzz.Structs.BlobT.BlobT' blob object
glibBlobCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Bytes -> m BlobT
glibBlobCreate Bytes
gbytes = 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 Bytes
gbytes' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
gbytes
    Ptr BlobT
result <- Ptr Bytes -> IO (Ptr BlobT)
hb_glib_blob_create Ptr Bytes
gbytes'
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"glibBlobCreate" 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
    Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
gbytes
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function ft_font_unlock_face
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ft_font_unlock_face" hb_ft_font_unlock_face :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO ()

-- | Releases an FT_Face previously obtained with @/hb_ft_font_lock_face()/@.
-- 
-- /Since: 2.6.5/
ftFontUnlockFace ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ()
ftFontUnlockFace :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m ()
ftFontUnlockFace FontT
font = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> IO ()
hb_ft_font_unlock_face Ptr FontT
font'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function ft_font_set_load_flags
-- 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 = "load_flags"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The FreeType load flags to set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ft_font_set_load_flags" hb_ft_font_set_load_flags :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Int32 ->                                -- load_flags : TBasicType TInt
    IO ()

-- | Sets the FT_Load_Glyph load flags for the specified t'GI.HarfBuzz.Structs.FontT.FontT'.
-- 
-- For more information, see
-- https:\/\/www.freetype.org\/freetype2\/docs\/reference\/ft2-base_interface.html@/ft_load_xxx/@
-- 
-- /Since: 1.0.5/
ftFontSetLoadFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Int32
    -- ^ /@loadFlags@/: The FreeType load flags to set
    -> m ()
ftFontSetLoadFlags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Int32 -> m ()
ftFontSetLoadFlags FontT
font Int32
loadFlags = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> Int32 -> IO ()
hb_ft_font_set_load_flags Ptr FontT
font' Int32
loadFlags
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function ft_font_set_funcs
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ft_font_set_funcs" hb_ft_font_set_funcs :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO ()

-- | Configures the font-functions structure of the specified
-- t'GI.HarfBuzz.Structs.FontT.FontT' font object to use FreeType font functions.
-- 
-- In particular, you can use this function to configure an
-- existing t'GI.HarfBuzz.Structs.FaceT.FaceT' face object for use with FreeType font
-- functions even if that t'GI.HarfBuzz.Structs.FaceT.FaceT' face object was initially
-- created with 'GI.HarfBuzz.Functions.faceCreate', and therefore was not
-- initially configured to use FreeType font functions.
-- 
-- An t'GI.HarfBuzz.Structs.FaceT.FaceT' face object created with @/hb_ft_face_create()/@
-- is preconfigured for FreeType font functions and does not
-- require this function to be used.
-- 
-- \<note>Note: Internally, this function creates an FT_Face.
-- \<\/note>
-- 
-- /Since: 1.0.5/
ftFontSetFuncs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ()
ftFontSetFuncs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m ()
ftFontSetFuncs FontT
font = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> IO ()
hb_ft_font_set_funcs Ptr FontT
font'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function ft_font_get_load_flags
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_ft_font_get_load_flags" hb_ft_font_get_load_flags :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO Int32

-- | Fetches the FT_Load_Glyph load flags of the specified t'GI.HarfBuzz.Structs.FontT.FontT'.
-- 
-- For more information, see
-- https:\/\/www.freetype.org\/freetype2\/docs\/reference\/ft2-base_interface.html@/ft_load_xxx/@
-- 
-- /Since: 1.0.5/
ftFontGetLoadFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m Int32
    -- ^ __Returns:__ FT_Load_Glyph flags found
ftFontGetLoadFlags :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Int32
ftFontGetLoadFlags FontT
font = 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 <- Ptr FontT -> IO Int32
hb_ft_font_get_load_flags Ptr FontT
font'
    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


-- function ft_font_changed
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_ft_font_changed" hb_ft_font_changed :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO ()

-- | Refreshes the state of /@font@/ when the underlying FT_Face has changed.
-- This function should be called after changing the size or
-- variation-axis settings on the FT_Face.
-- 
-- /Since: 1.0.5/
ftFontChanged ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ()
ftFontChanged :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m ()
ftFontChanged FontT
font = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> IO ()
hb_ft_font_changed Ptr FontT
font'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_subtract_glyph_origin_for_direction
-- 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 = "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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt32
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = The original X coordinate\n    Output = The X coordinate minus 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 = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = The original Y coordinate\n    Output = The Y coordinate minus the Y-coordinate of the origin"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_subtract_glyph_origin_for_direction" hb_font_subtract_glyph_origin_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO ()

-- | Subtracts the origin coordinates from an (X,Y) point coordinate,
-- in the specified glyph ID in the specified font.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontSubtractGlyphOriginForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> Int32
    -- ^ /@x@/: Input = The original X coordinate
    --     Output = The X coordinate minus the X-coordinate of the origin
    -> Int32
    -- ^ /@y@/: Input = The original Y coordinate
    --     Output = The Y coordinate minus the Y-coordinate of the origin
    -> m ((Int32, Int32))
fontSubtractGlyphOriginForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> DirectionT -> Int32 -> Int32 -> m (Int32, Int32)
fontSubtractGlyphOriginForDirection FontT
font Word32
glyph DirectionT
direction Int32
x Int32
y = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr Int32
x' <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
x' Int32
x
    Ptr Int32
y' <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
y' Int32
y
    Ptr FontT -> Word32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO ()
hb_font_subtract_glyph_origin_for_direction Ptr FontT
font' Word32
glyph CUInt
direction' Ptr Int32
x' Ptr Int32
y'
    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) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x'', Int32
y'')


-- function font_set_variations
-- 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 = "variations"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface Name { namespace = "HarfBuzz" , name = "variation_t" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of variation settings to apply"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "variations_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of variations to apply"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "variations_length"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Number of variations to apply"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_variations" hb_font_set_variations :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.VariationT.VariationT ->   -- variations : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "variation_t"}))
    Word32 ->                               -- variations_length : TBasicType TUInt
    IO ()

-- | Applies a list of font-variation settings to a font.
-- 
-- Note that this overrides all existing variations set on /@font@/.
-- Axes not included in /@variations@/ will be effectively set to their
-- default values.
-- 
-- /Since: 1.4.2/
fontSetVariations ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> [HarfBuzz.VariationT.VariationT]
    -- ^ /@variations@/: Array of variation settings to apply
    -> m ()
fontSetVariations :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> [VariationT] -> m ()
fontSetVariations FontT
font [VariationT]
variations = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let variationsLength :: Word32
variationsLength = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [VariationT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [VariationT]
variations
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    [Ptr VariationT]
variations' <- (VariationT -> IO (Ptr VariationT))
-> [VariationT] -> IO [Ptr VariationT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM VariationT -> IO (Ptr VariationT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [VariationT]
variations
    Ptr VariationT
variations'' <- Int -> [Ptr VariationT] -> IO (Ptr VariationT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
8 [Ptr VariationT]
variations'
    Ptr FontT -> Ptr VariationT -> Word32 -> IO ()
hb_font_set_variations Ptr FontT
font' Ptr VariationT
variations'' Word32
variationsLength
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (VariationT -> IO ()) -> [VariationT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ VariationT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [VariationT]
variations
    Ptr VariationT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr VariationT
variations''
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_var_named_instance
-- Args: [ Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a font." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "instance_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "named instance index."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_var_named_instance" hb_font_set_var_named_instance :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- instance_index : TBasicType TUInt
    IO ()

-- | Sets design coords of a font from a named instance index.
-- 
-- /Since: 2.6.0/
fontSetVarNamedInstance ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: a font.
    -> Word32
    -- ^ /@instanceIndex@/: named instance index.
    -> m ()
fontSetVarNamedInstance :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m ()
fontSetVarNamedInstance FontT
font Word32
instanceIndex = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> Word32 -> IO ()
hb_font_set_var_named_instance Ptr FontT
font' Word32
instanceIndex
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_var_coords_normalized
-- 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 = "coords"
--           , argType = TCArray False (-1) 2 (TBasicType TInt)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of variation coordinates to apply"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of coordinates to apply"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "coords_length"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Number of coordinates to apply"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_var_coords_normalized" hb_font_set_var_coords_normalized :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr Int32 ->                            -- coords : TCArray False (-1) 2 (TBasicType TInt)
    Word32 ->                               -- coords_length : TBasicType TUInt
    IO ()

-- | Applies a list of variation coordinates (in normalized units)
-- to a font.
-- 
-- Note that this overrides all existing variations set on /@font@/.
-- Axes not included in /@coords@/ will be effectively set to their
-- default values.
-- 
-- \<note>Note: Coordinates should be normalized to 2.14.\<\/note>
-- 
-- /Since: 1.4.2/
fontSetVarCoordsNormalized ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> [Int32]
    -- ^ /@coords@/: Array of variation coordinates to apply
    -> m ()
fontSetVarCoordsNormalized :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> [Int32] -> m ()
fontSetVarCoordsNormalized FontT
font [Int32]
coords = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let coordsLength :: Word32
coordsLength = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Int32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Int32]
coords
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr Int32
coords' <- [Int32] -> IO (Ptr Int32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Int32]
coords
    Ptr FontT -> Ptr Int32 -> Word32 -> IO ()
hb_font_set_var_coords_normalized Ptr FontT
font' Ptr Int32
coords' Word32
coordsLength
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
coords'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_var_coords_design
-- 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 = "coords"
--           , argType = TCArray False (-1) 2 (TBasicType TFloat)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of variation coordinates to apply"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "coords_length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of coordinates to apply"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "coords_length"
--              , argType = TBasicType TUInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Number of coordinates to apply"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_var_coords_design" hb_font_set_var_coords_design :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr CFloat ->                           -- coords : TCArray False (-1) 2 (TBasicType TFloat)
    Word32 ->                               -- coords_length : TBasicType TUInt
    IO ()

-- | Applies a list of variation coordinates (in design-space units)
-- to a font.
-- 
-- Note that this overrides all existing variations set on /@font@/.
-- Axes not included in /@coords@/ will be effectively set to their
-- default values.
-- 
-- /Since: 1.4.2/
fontSetVarCoordsDesign ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> [Float]
    -- ^ /@coords@/: Array of variation coordinates to apply
    -> m ()
fontSetVarCoordsDesign :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> [Float] -> m ()
fontSetVarCoordsDesign FontT
font [Float]
coords = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let coordsLength :: Word32
coordsLength = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Float] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Float]
coords
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr CFloat
coords' <- ((Float -> CFloat) -> [Float] -> IO (Ptr CFloat)
forall a b. Storable b => (a -> b) -> [a] -> IO (Ptr b)
packMapStorableArray Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac) [Float]
coords
    Ptr FontT -> Ptr CFloat -> Word32 -> IO ()
hb_font_set_var_coords_design Ptr FontT
font' Ptr CFloat
coords' Word32
coordsLength
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr CFloat -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CFloat
coords'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_synthetic_slant
-- 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 = "slant"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "synthetic slant value."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_synthetic_slant" hb_font_set_synthetic_slant :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CFloat ->                               -- slant : TBasicType TFloat
    IO ()

-- | Sets the \"synthetic slant\" of a font.  By default is zero.
-- Synthetic slant is the graphical skew applied to the font
-- at rendering time.
-- 
-- HarfBuzz needs to know this value to adjust shaping results,
-- metrics, and style values to match the slanted rendering.
-- 
-- \<note>Note: The glyph shape fetched via the
-- 'GI.HarfBuzz.Functions.fontGetGlyphShape' is slanted to reflect this value
-- as well.\<\/note>
-- 
-- \<note>Note: The slant value is a ratio.  For example, a
-- 20% slant would be represented as a 0.2 value.\<\/note>
-- 
-- /Since: 3.3.0/
fontSetSyntheticSlant ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Float
    -- ^ /@slant@/: synthetic slant value.
    -> m ()
fontSetSyntheticSlant :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Float -> m ()
fontSetSyntheticSlant FontT
font Float
slant = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    let slant' :: CFloat
slant' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
slant
    Ptr FontT -> CFloat -> IO ()
hb_font_set_synthetic_slant Ptr FontT
font' CFloat
slant'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_scale
-- 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 = "x_scale"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Horizontal scale value to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y_scale"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Vertical scale value to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_scale" hb_font_set_scale :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Int32 ->                                -- x_scale : TBasicType TInt
    Int32 ->                                -- y_scale : TBasicType TInt
    IO ()

-- | Sets the horizontal and vertical scale of a font.
-- 
-- /Since: 0.9.2/
fontSetScale ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Int32
    -- ^ /@xScale@/: Horizontal scale value to assign
    -> Int32
    -- ^ /@yScale@/: Vertical scale value to assign
    -> m ()
fontSetScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Int32 -> Int32 -> m ()
fontSetScale FontT
font Int32
xScale Int32
yScale = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> Int32 -> Int32 -> IO ()
hb_font_set_scale Ptr FontT
font' Int32
xScale Int32
yScale
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_ptem
-- 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 = "ptem"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "font size in points."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_ptem" hb_font_set_ptem :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CFloat ->                               -- ptem : TBasicType TFloat
    IO ()

-- | Sets the \"point size\" of a font. Set to zero to unset.
-- Used in CoreText to implement optical sizing.
-- 
-- \<note>Note: There are 72 points in an inch.\<\/note>
-- 
-- /Since: 1.6.0/
fontSetPtem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Float
    -- ^ /@ptem@/: font size in points.
    -> m ()
fontSetPtem :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Float -> m ()
fontSetPtem FontT
font Float
ptem = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    let ptem' :: CFloat
ptem' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
ptem
    Ptr FontT -> CFloat -> IO ()
hb_font_set_ptem Ptr FontT
font' CFloat
ptem'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_ppem
-- 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 = "x_ppem"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Horizontal ppem value to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "y_ppem"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Vertical ppem value to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_ppem" hb_font_set_ppem :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- x_ppem : TBasicType TUInt
    Word32 ->                               -- y_ppem : TBasicType TUInt
    IO ()

-- | Sets the horizontal and vertical pixels-per-em (ppem) of a font.
-- 
-- /Since: 0.9.2/
fontSetPpem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@xPpem@/: Horizontal ppem value to assign
    -> Word32
    -- ^ /@yPpem@/: Vertical ppem value to assign
    -> m ()
fontSetPpem :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> m ()
fontSetPpem FontT
font Word32
xPpem Word32
yPpem = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> Word32 -> Word32 -> IO ()
hb_font_set_ppem Ptr FontT
font' Word32
xPpem Word32
yPpem
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_parent
-- 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 = "parent"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The parent font object to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_parent" hb_font_set_parent :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.FontT.FontT ->             -- parent : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO ()

-- | Sets the parent font of /@font@/.
-- 
-- /Since: 1.0.5/
fontSetParent ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.FontT.FontT
    -- ^ /@parent@/: The parent font object to assign
    -> m ()
fontSetParent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> FontT -> m ()
fontSetParent FontT
font FontT
parent = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT
parent' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
parent
    Ptr FontT -> Ptr FontT -> IO ()
hb_font_set_parent Ptr FontT
font' Ptr FontT
parent'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
parent
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_funcs_data
-- 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 "Data to attach to @font"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destroy"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "destroy_func_t" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The function to call when @font_data is not needed anymore"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_funcs_data" hb_font_set_funcs_data :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr () ->                               -- font_data : TBasicType TPtr
    FunPtr HarfBuzz.Callbacks.C_DestroyFuncT -> -- destroy : TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})
    IO ()

-- | Replaces the user data attached to a font, updating the font\'s
-- /@destroy@/ callback.
-- 
-- /Since: 0.9.2/
fontSetFuncsData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Ptr ()
    -- ^ /@fontData@/: Data to attach to /@font@/
    -> Maybe (HarfBuzz.Callbacks.DestroyFuncT)
    -- ^ /@destroy@/: The function to call when /@fontData@/ is not needed anymore
    -> m ()
fontSetFuncsData :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Ptr () -> Maybe (IO ()) -> m ()
fontSetFuncsData FontT
font Ptr ()
fontData Maybe (IO ())
destroy = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    FunPtr C_DestroyFuncT
maybeDestroy <- case Maybe (IO ())
destroy of
        Maybe (IO ())
Nothing -> FunPtr C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_DestroyFuncT
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just IO ()
jDestroy -> do
            FunPtr C_DestroyFuncT
jDestroy' <- C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
HarfBuzz.Callbacks.mk_DestroyFuncT (Maybe (Ptr (FunPtr C_DestroyFuncT))
-> C_DestroyFuncT -> C_DestroyFuncT
HarfBuzz.Callbacks.wrap_DestroyFuncT Maybe (Ptr (FunPtr C_DestroyFuncT))
forall a. Maybe a
Nothing (IO () -> C_DestroyFuncT
HarfBuzz.Callbacks.drop_closures_DestroyFuncT IO ()
jDestroy))
            FunPtr C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DestroyFuncT
jDestroy'
    Ptr FontT -> Ptr () -> FunPtr C_DestroyFuncT -> IO ()
hb_font_set_funcs_data Ptr FontT
font' Ptr ()
fontData FunPtr C_DestroyFuncT
maybeDestroy
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_funcs
-- 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 = "klass"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The font-functions structure."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "font_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Data to attach to @font"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destroy"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "destroy_func_t" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The function to call when @font_data is not needed anymore"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_funcs" hb_font_set_funcs :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.FontFuncsT.FontFuncsT ->   -- klass : TInterface (Name {namespace = "HarfBuzz", name = "font_funcs_t"})
    Ptr () ->                               -- font_data : TBasicType TPtr
    FunPtr HarfBuzz.Callbacks.C_DestroyFuncT -> -- destroy : TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})
    IO ()

-- | Replaces the font-functions structure attached to a font, updating
-- the font\'s user-data with /@font@/-data and the /@destroy@/ callback.
-- 
-- /Since: 0.9.2/
fontSetFuncs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.FontFuncsT.FontFuncsT
    -- ^ /@klass@/: The font-functions structure.
    -> Ptr ()
    -- ^ /@fontData@/: Data to attach to /@font@/
    -> Maybe (HarfBuzz.Callbacks.DestroyFuncT)
    -- ^ /@destroy@/: The function to call when /@fontData@/ is not needed anymore
    -> m ()
fontSetFuncs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> FontFuncsT -> Ptr () -> Maybe (IO ()) -> m ()
fontSetFuncs FontT
font FontFuncsT
klass Ptr ()
fontData Maybe (IO ())
destroy = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontFuncsT
klass' <- FontFuncsT -> IO (Ptr FontFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontFuncsT
klass
    FunPtr C_DestroyFuncT
maybeDestroy <- case Maybe (IO ())
destroy of
        Maybe (IO ())
Nothing -> FunPtr C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_DestroyFuncT
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
        Just IO ()
jDestroy -> do
            FunPtr C_DestroyFuncT
jDestroy' <- C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
HarfBuzz.Callbacks.mk_DestroyFuncT (Maybe (Ptr (FunPtr C_DestroyFuncT))
-> C_DestroyFuncT -> C_DestroyFuncT
HarfBuzz.Callbacks.wrap_DestroyFuncT Maybe (Ptr (FunPtr C_DestroyFuncT))
forall a. Maybe a
Nothing (IO () -> C_DestroyFuncT
HarfBuzz.Callbacks.drop_closures_DestroyFuncT IO ()
jDestroy))
            FunPtr C_DestroyFuncT -> IO (FunPtr C_DestroyFuncT)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DestroyFuncT
jDestroy'
    Ptr FontT
-> Ptr FontFuncsT -> Ptr () -> FunPtr C_DestroyFuncT -> IO ()
hb_font_set_funcs Ptr FontT
font' Ptr FontFuncsT
klass' Ptr ()
fontData FunPtr C_DestroyFuncT
maybeDestroy
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FontFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontFuncsT
klass
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_set_face
-- 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 = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_face_t to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_set_face" hb_font_set_face :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO ()

-- | Sets /@face@/ as the font-face value of /@font@/.
-- 
-- /Since: 1.4.3/
fontSetFace ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: The t'GI.HarfBuzz.Structs.FaceT.FaceT' to assign
    -> m ()
fontSetFace :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> FaceT -> m ()
fontSetFace FontT
font FaceT
face = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr FontT -> Ptr FaceT -> IO ()
hb_font_set_face Ptr FontT
font' Ptr FaceT
face'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_make_immutable
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_make_immutable" hb_font_make_immutable :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO ()

-- | Makes /@font@/ immutable.
-- 
-- /Since: 0.9.2/
fontMakeImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ()
fontMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m ()
fontMakeImmutable FontT
font = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontT -> IO ()
hb_font_make_immutable Ptr FontT
font'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_is_immutable
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_is_immutable" hb_font_is_immutable :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO Int32

-- | Tests whether a font object is immutable.
-- 
-- /Since: 0.9.2/
fontIsImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@font@/ is immutable, @/false/@ otherwise
fontIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Int32
fontIsImmutable FontT
font = 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 <- Ptr FontT -> IO Int32
hb_font_is_immutable Ptr FontT
font'
    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


-- function font_glyph_to_string
-- 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 = "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 = "s"
--           , argType = TCArray False (-1) 3 (TBasicType TUTF8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The string containing the glyph name"
--                 , 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 string @s"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "Length of string @s"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_glyph_to_string" hb_font_glyph_to_string :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Ptr (Ptr CString) ->                    -- s : TCArray False (-1) 3 (TBasicType TUTF8)
    Ptr Word32 ->                           -- size : TBasicType TUInt
    IO ()

-- | Fetches the name of the specified glyph ID in /@font@/ and returns
-- it in string /@s@/.
-- 
-- If the glyph ID has no name in /@font@/, a string of the form @gidDDD@ is
-- generated, with @DDD@ being the glyph ID.
-- 
-- /Since: 0.9.2/
fontGlyphToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m ([T.Text])
fontGlyphToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m [Text]
fontGlyphToString FontT
font Word32
glyph = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [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)
s <- 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)
    Ptr FontT -> Word32 -> Ptr (Ptr CString) -> Ptr Word32 -> IO ()
hb_font_glyph_to_string Ptr FontT
font' Word32
glyph Ptr (Ptr CString)
s Ptr Word32
size
    Word32
size' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
size
    Ptr CString
s' <- Ptr (Ptr CString) -> IO (Ptr CString)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CString)
s
    [Text]
s'' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
size') Ptr CString
s'
    (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
s'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
s'
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
s
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
size
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
s''


-- function font_glyph_from_string
-- 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 = "s"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "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 string @s"
--                 , 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 corresponding to the string requested"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The length of the string @s"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_glyph_from_string" hb_font_glyph_from_string :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr Word8 ->                            -- s : TCArray False (-1) 2 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    Ptr Word32 ->                           -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the glyph ID from /@font@/ that matches the specified string.
-- Strings of the format @gidDDD@ or @uniUUUU@ are parsed automatically.
-- 
-- \<note>Note: /@len@/ == -1 means the string is null-terminated.\<\/note>
-- 
-- /Since: 0.9.2/
fontGlyphFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> ByteString
    -- ^ /@s@/: string to query
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGlyphFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> ByteString -> m (Int32, Word32)
fontGlyphFromString FontT
font ByteString
s = 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
$ ByteString -> Int
B.length ByteString
s
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr Word8
s' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
s
    Ptr Word32
glyph <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FontT -> Ptr Word8 -> Int32 -> Ptr Word32 -> IO Int32
hb_font_glyph_from_string Ptr FontT
font' Ptr Word8
s' Int32
len Ptr Word32
glyph
    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 Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
s'
    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')


-- function font_get_variation_glyph
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_variation_glyph" hb_font_get_variation_glyph :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    Word32 ->                               -- variation_selector : TBasicType TUInt32
    Ptr Word32 ->                           -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the glyph ID for a Unicode code point when followed by
-- by the specified variation-selector code point, in the specified
-- font.
-- 
-- /Since: 1.2.3/
fontGetVariationGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: The  variation-selector code point to query
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetVariationGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> m (Int32, Word32)
fontGetVariationGlyph FontT
font Word32
unicode Word32
variationSelector = 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 <- Ptr FontT -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_font_get_variation_glyph Ptr FontT
font' Word32
unicode Word32
variationSelector Ptr Word32
glyph
    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')


-- function font_get_var_coords_normalized
-- 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 = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of coordinates retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_var_coords_normalized" hb_font_get_var_coords_normalized :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr Word32 ->                           -- length : TBasicType TUInt
    IO Int32

-- | Fetches the list of normalized variation coordinates currently
-- set on a font.
-- 
-- Note that this returned array may only contain values for some
-- (or none) of the axes; omitted axes effectively have zero values.
-- 
-- Return value is valid as long as variation coordinates of the font
-- are not modified.
-- 
-- /Since: 1.4.2/
fontGetVarCoordsNormalized ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ((Int32, Word32))
    -- ^ __Returns:__ coordinates array
fontGetVarCoordsNormalized :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> m (Int32, Word32)
fontGetVarCoordsNormalized FontT
font = 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
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Int32
result <- Ptr FontT -> Ptr Word32 -> IO Int32
hb_font_get_var_coords_normalized Ptr FontT
font' Ptr Word32
length_
    Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Word32
length_')


-- function font_get_var_coords_design
-- 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 = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of coordinates retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_var_coords_design" hb_font_get_var_coords_design :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr Word32 ->                           -- length : TBasicType TUInt
    IO CFloat

-- | Fetches the list of variation coordinates (in design-space units) currently
-- set on a font.
-- 
-- Note that this returned array may only contain values for some
-- (or none) of the axes; omitted axes effectively have their default
-- values.
-- 
-- Return value is valid as long as variation coordinates of the font
-- are not modified.
-- 
-- /Since: 3.3.0/
fontGetVarCoordsDesign ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ((Float, Word32))
    -- ^ __Returns:__ coordinates array
fontGetVarCoordsDesign :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> m (Float, Word32)
fontGetVarCoordsDesign FontT
font = IO (Float, Word32) -> m (Float, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Float, Word32) -> m (Float, Word32))
-> IO (Float, Word32) -> m (Float, 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
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CFloat
result <- Ptr FontT -> Ptr Word32 -> IO CFloat
hb_font_get_var_coords_design Ptr FontT
font' Ptr Word32
length_
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
    (Float, Word32) -> IO (Float, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Float
result', Word32
length_')


-- function font_get_v_extents
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_v_extents" hb_font_get_v_extents :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"})
    IO Int32

-- | Fetches the extents for a specified font, for vertical
-- text segments.
-- 
-- /Since: 1.1.3/
fontGetVExtents ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ((Int32, HarfBuzz.FontExtentsT.FontExtentsT))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetVExtents :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> m (Int32, FontExtentsT)
fontGetVExtents FontT
font = IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT))
-> IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT)
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontExtentsT
extents <- Int -> IO (Ptr FontExtentsT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT)
    Int32
result <- Ptr FontT -> Ptr FontExtentsT -> IO Int32
hb_font_get_v_extents Ptr FontT
font' Ptr FontExtentsT
extents
    FontExtentsT
extents' <- ((ManagedPtr FontExtentsT -> FontExtentsT)
-> Ptr FontExtentsT -> IO FontExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr FontExtentsT -> FontExtentsT
HarfBuzz.FontExtentsT.FontExtentsT) Ptr FontExtentsT
extents
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (Int32, FontExtentsT) -> IO (Int32, FontExtentsT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, FontExtentsT
extents')


-- function font_get_synthetic_slant
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_synthetic_slant" hb_font_get_synthetic_slant :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO CFloat

-- | Fetches the \"synthetic slant\" of a font.
-- 
-- /Since: 3.3.0/
fontGetSyntheticSlant ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m Float
    -- ^ __Returns:__ Synthetic slant.  By default is zero.
fontGetSyntheticSlant :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Float
fontGetSyntheticSlant FontT
font = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
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
    CFloat
result <- Ptr FontT -> IO CFloat
hb_font_get_synthetic_slant Ptr FontT
font'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'


-- function font_get_scale
-- 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 = "x_scale"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Horizontal scale value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y_scale"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Vertical scale value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_scale" hb_font_get_scale :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr Int32 ->                            -- x_scale : TBasicType TInt
    Ptr Int32 ->                            -- y_scale : TBasicType TInt
    IO ()

-- | Fetches the horizontal and vertical scale of a font.
-- 
-- /Since: 0.9.2/
fontGetScale ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ((Int32, Int32))
fontGetScale :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> m (Int32, Int32)
fontGetScale FontT
font = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
xScale <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32
yScale <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr FontT -> Ptr Int32 -> Ptr Int32 -> IO ()
hb_font_get_scale Ptr FontT
font' Ptr Int32
xScale Ptr Int32
yScale
    Int32
xScale' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
xScale
    Int32
yScale' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
yScale
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
xScale
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
yScale
    (Int32, Int32) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
xScale', Int32
yScale')


-- function font_get_ptem
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TFloat)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_ptem" hb_font_get_ptem :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO CFloat

-- | Fetches the \"point size\" of a font. Used in CoreText to
-- implement optical sizing.
-- 
-- /Since: 1.6.0/
fontGetPtem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m Float
    -- ^ __Returns:__ Point size.  A value of zero means \"not set.\"
fontGetPtem :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m Float
fontGetPtem FontT
font = IO Float -> m Float
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Float -> m Float) -> IO Float -> m Float
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
    CFloat
result <- Ptr FontT -> IO CFloat
hb_font_get_ptem Ptr FontT
font'
    let result' :: Float
result' = CFloat -> Float
forall a b. (Real a, Fractional b) => a -> b
realToFrac CFloat
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Float -> IO Float
forall (m :: * -> *) a. Monad m => a -> m a
return Float
result'


-- function font_get_ppem
-- 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 = "x_ppem"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Horizontal ppem value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "y_ppem"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Vertical ppem value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_ppem" hb_font_get_ppem :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr Word32 ->                           -- x_ppem : TBasicType TUInt
    Ptr Word32 ->                           -- y_ppem : TBasicType TUInt
    IO ()

-- | Fetches the horizontal and vertical points-per-em (ppem) of a font.
-- 
-- /Since: 0.9.2/
fontGetPpem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ((Word32, Word32))
fontGetPpem :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> m (Word32, Word32)
fontGetPpem FontT
font = 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
xPpem <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
yPpem <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr FontT -> Ptr Word32 -> Ptr Word32 -> IO ()
hb_font_get_ppem Ptr FontT
font' Ptr Word32
xPpem Ptr Word32
yPpem
    Word32
xPpem' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
xPpem
    Word32
yPpem' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
yPpem
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
xPpem
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
yPpem
    (Word32, Word32) -> IO (Word32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
xPpem', Word32
yPpem')


-- function font_get_parent
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_parent" hb_font_get_parent :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO (Ptr HarfBuzz.FontT.FontT)

-- | Fetches the parent font of /@font@/.
-- 
-- /Since: 0.9.2/
fontGetParent ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m HarfBuzz.FontT.FontT
    -- ^ __Returns:__ The parent font object
fontGetParent :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m FontT
fontGetParent FontT
font = IO FontT -> m FontT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT
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 FontT
result <- Ptr FontT -> IO (Ptr FontT)
hb_font_get_parent Ptr FontT
font'
    Text -> Ptr FontT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontGetParent" Ptr FontT
result
    FontT
result' <- ((ManagedPtr FontT -> FontT) -> Ptr FontT -> IO FontT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT) Ptr FontT
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FontT -> IO FontT
forall (m :: * -> *) a. Monad m => a -> m a
return FontT
result'


-- function font_get_nominal_glyphs
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_nominal_glyphs" hb_font_get_nominal_glyphs :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- count : TBasicType TUInt
    Word32 ->                               -- first_unicode : TBasicType TUInt32
    Word32 ->                               -- unicode_stride : TBasicType TUInt
    Ptr Word32 ->                           -- first_glyph : TBasicType TUInt32
    Word32 ->                               -- glyph_stride : TBasicType TUInt
    IO Word32

-- | Fetches the nominal glyph IDs for a sequence of Unicode code points. Glyph
-- IDs must be returned in a @/hb_codepoint_t/@ output parameter.
-- 
-- /Since: 2.6.3/
fontGetNominalGlyphs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> 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
    -> m ((Word32, Word32))
    -- ^ __Returns:__ the number of code points processed
fontGetNominalGlyphs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> Word32 -> Word32 -> m (Word32, Word32)
fontGetNominalGlyphs FontT
font Word32
count Word32
firstUnicode Word32
unicodeStride Word32
glyphStride = 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 <- Ptr FontT
-> Word32 -> Word32 -> Word32 -> Ptr Word32 -> Word32 -> IO Word32
hb_font_get_nominal_glyphs Ptr FontT
font' Word32
count Word32
firstUnicode Word32
unicodeStride Ptr Word32
firstGlyph Word32
glyphStride
    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')


-- function font_get_nominal_glyph
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_nominal_glyph" hb_font_get_nominal_glyph :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    Ptr Word32 ->                           -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the nominal glyph ID for a Unicode code point in the
-- specified font.
-- 
-- This version of the function should not be used to fetch glyph IDs
-- for code points modified by variation selectors. For variation-selector
-- support, user 'GI.HarfBuzz.Functions.fontGetVariationGlyph' or use 'GI.HarfBuzz.Functions.fontGetGlyph'.
-- 
-- /Since: 1.2.3/
fontGetNominalGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetNominalGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m (Int32, Word32)
fontGetNominalGlyph FontT
font Word32
unicode = 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 <- Ptr FontT -> Word32 -> Ptr Word32 -> IO Int32
hb_font_get_nominal_glyph Ptr FontT
font' Word32
unicode Ptr Word32
glyph
    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')


-- function font_get_h_extents
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_h_extents" hb_font_get_h_extents :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"})
    IO Int32

-- | Fetches the extents for a specified font, for horizontal
-- text segments.
-- 
-- /Since: 1.1.3/
fontGetHExtents ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m ((Int32, HarfBuzz.FontExtentsT.FontExtentsT))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetHExtents :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> m (Int32, FontExtentsT)
fontGetHExtents FontT
font = IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT))
-> IO (Int32, FontExtentsT) -> m (Int32, FontExtentsT)
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr FontExtentsT
extents <- Int -> IO (Ptr FontExtentsT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT)
    Int32
result <- Ptr FontT -> Ptr FontExtentsT -> IO Int32
hb_font_get_h_extents Ptr FontT
font' Ptr FontExtentsT
extents
    FontExtentsT
extents' <- ((ManagedPtr FontExtentsT -> FontExtentsT)
-> Ptr FontExtentsT -> IO FontExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr FontExtentsT -> FontExtentsT
HarfBuzz.FontExtentsT.FontExtentsT) Ptr FontExtentsT
extents
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (Int32, FontExtentsT) -> IO (Int32, FontExtentsT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, FontExtentsT
extents')


-- function font_get_glyph_v_origin
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_v_origin" hb_font_get_glyph_v_origin :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO Int32

-- | Fetches the (X,Y) coordinates of the origin for a glyph ID
-- in the specified font, for vertical text segments.
-- 
-- /Since: 0.9.2/
fontGetGlyphVOrigin ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphVOrigin :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m (Int32, Int32, Int32)
fontGetGlyphVOrigin FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> Ptr Int32 -> Ptr Int32 -> IO Int32
hb_font_get_glyph_v_origin Ptr FontT
font' Word32
glyph Ptr Int32
x Ptr Int32
y
    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')


-- function font_get_glyph_v_kerning
-- 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 = "top_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph ID of the top glyph in the glyph pair"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "bottom_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph ID of the bottom glyph in the glyph pair"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_v_kerning" hb_font_get_glyph_v_kerning :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- top_glyph : TBasicType TUInt32
    Word32 ->                               -- bottom_glyph : TBasicType TUInt32
    IO Int32

{-# DEPRECATED fontGetGlyphVKerning ["(Since version 2.0.0)"] #-}
-- | Fetches the kerning-adjustment value for a glyph-pair in
-- the specified font, for vertical text segments.
-- 
-- \<note>It handles legacy kerning only (as returned by the corresponding
-- t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' function).\<\/note>
-- 
-- /Since: 0.9.2/
fontGetGlyphVKerning ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@topGlyph@/: The glyph ID of the top glyph in the glyph pair
    -> Word32
    -- ^ /@bottomGlyph@/: The glyph ID of the bottom glyph in the glyph pair
    -> m Int32
    -- ^ __Returns:__ The kerning adjustment value
fontGetGlyphVKerning :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> m Int32
fontGetGlyphVKerning FontT
font Word32
topGlyph Word32
bottomGlyph = 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 <- Ptr FontT -> Word32 -> Word32 -> IO Int32
hb_font_get_glyph_v_kerning Ptr FontT
font' Word32
topGlyph Word32
bottomGlyph
    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


-- function font_get_glyph_v_advances
-- 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 = "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 = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The stride between successive advances"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_v_advances" hb_font_get_glyph_v_advances :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- count : TBasicType TUInt
    Word32 ->                               -- first_glyph : TBasicType TUInt32
    Word32 ->                               -- glyph_stride : TBasicType TUInt
    Ptr Int32 ->                            -- first_advance : TBasicType TInt32
    Ptr Word32 ->                           -- advance_stride : TBasicType TUInt
    IO ()

-- | Fetches the advances for a sequence of glyph IDs in the specified
-- font, for vertical text segments.
-- 
-- /Since: 1.8.6/
fontGetGlyphVAdvances ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> 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
    -> m ((Int32, Word32))
fontGetGlyphVAdvances :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32)
fontGetGlyphVAdvances FontT
font Word32
count Word32
firstGlyph Word32
glyphStride = 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 Int32
firstAdvance <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Word32
advanceStride <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr FontT
-> Word32 -> Word32 -> Word32 -> Ptr Int32 -> Ptr Word32 -> IO ()
hb_font_get_glyph_v_advances Ptr FontT
font' Word32
count Word32
firstGlyph Word32
glyphStride Ptr Int32
firstAdvance Ptr Word32
advanceStride
    Int32
firstAdvance' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
firstAdvance
    Word32
advanceStride' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
advanceStride
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
firstAdvance
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
advanceStride
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
firstAdvance', Word32
advanceStride')


-- function font_get_glyph_v_advance
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_v_advance" hb_font_get_glyph_v_advance :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the advance for a glyph ID in the specified font,
-- for vertical text segments.
-- 
-- /Since: 0.9.2/
fontGetGlyphVAdvance ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m Int32
    -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/
fontGetGlyphVAdvance :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m Int32
fontGetGlyphVAdvance FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> IO Int32
hb_font_get_glyph_v_advance Ptr FontT
font' Word32
glyph
    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


-- function font_get_glyph_shape
-- 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 = "glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The glyph ID" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_draw_funcs_t to draw to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "User data to pass to draw callbacks"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_shape" hb_font_get_glyph_shape :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    Ptr () ->                               -- draw_data : TBasicType TPtr
    IO ()

-- | Fetches the glyph shape that corresponds to a glyph in the specified /@font@/.
-- The shape is returned by way of calls to the callsbacks of the /@dfuncs@/
-- objects, with /@drawData@/ passed to them.
-- 
-- /Since: 4.0.0/
fontGetGlyphShape ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID
    -> HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' to draw to
    -> Ptr ()
    -- ^ /@drawData@/: User data to pass to draw callbacks
    -> m ()
fontGetGlyphShape :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> DrawFuncsT -> Ptr () -> m ()
fontGetGlyphShape FontT
font Word32
glyph DrawFuncsT
dfuncs Ptr ()
drawData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr FontT -> Word32 -> Ptr DrawFuncsT -> C_DestroyFuncT
hb_font_get_glyph_shape Ptr FontT
font' Word32
glyph Ptr DrawFuncsT
dfuncs' Ptr ()
drawData
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_get_glyph_origin_for_direction
-- 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 = "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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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 retrieved for 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 retrieved for the origin"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_origin_for_direction" hb_font_get_glyph_origin_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO ()

-- | Fetches the (X,Y) coordinates of the origin for a glyph in
-- the specified font.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontGetGlyphOriginForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> m ((Int32, Int32))
fontGetGlyphOriginForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> DirectionT -> m (Int32, Int32)
fontGetGlyphOriginForDirection FontT
font Word32
glyph DirectionT
direction = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    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)
    Ptr FontT -> Word32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO ()
hb_font_get_glyph_origin_for_direction Ptr FontT
font' Word32
glyph CUInt
direction' Ptr Int32
x Ptr Int32
y
    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) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y')


-- function font_get_glyph_name
-- 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 = "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) 3 (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
--           }
--       ]
-- 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 "hb_font_get_glyph_name" hb_font_get_glyph_name :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Ptr (Ptr CString) ->                    -- name : TCArray False (-1) 3 (TBasicType TUTF8)
    Ptr Word32 ->                           -- size : TBasicType TUInt
    IO Int32

-- | Fetches the glyph-name string for a glyph ID in the specified /@font@/.
-- 
-- /Since: 0.9.2/
fontGetGlyphName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m ((Int32, [T.Text]))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m (Int32, [Text])
fontGetGlyphName FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> Ptr (Ptr CString) -> Ptr Word32 -> IO Int32
hb_font_get_glyph_name Ptr FontT
font' Word32
glyph Ptr (Ptr CString)
name Ptr Word32
size
    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'')


-- function font_get_glyph_kerning_for_direction
-- 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 = "first_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph ID of the first glyph in the glyph pair to query"
--                 , 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 to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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 horizontal kerning-adjustment value retrieved"
--                 , 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 vertical kerning-adjustment value retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_kerning_for_direction" hb_font_get_glyph_kerning_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- first_glyph : TBasicType TUInt32
    Word32 ->                               -- second_glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO ()

-- | Fetches the kerning-adjustment value for a glyph-pair in the specified font.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontGetGlyphKerningForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@firstGlyph@/: The glyph ID of the first glyph in the glyph pair to query
    -> Word32
    -- ^ /@secondGlyph@/: The glyph ID of the second glyph in the glyph pair to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> m ((Int32, Int32))
fontGetGlyphKerningForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> DirectionT -> m (Int32, Int32)
fontGetGlyphKerningForDirection FontT
font Word32
firstGlyph Word32
secondGlyph DirectionT
direction = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    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)
    Ptr FontT
-> Word32 -> Word32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO ()
hb_font_get_glyph_kerning_for_direction Ptr FontT
font' Word32
firstGlyph Word32
secondGlyph CUInt
direction' Ptr Int32
x Ptr Int32
y
    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) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y')


-- function font_get_glyph_h_origin
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_h_origin" hb_font_get_glyph_h_origin :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO Int32

-- | Fetches the (X,Y) coordinates of the origin for a glyph ID
-- in the specified font, for horizontal text segments.
-- 
-- /Since: 0.9.2/
fontGetGlyphHOrigin ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphHOrigin :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m (Int32, Int32, Int32)
fontGetGlyphHOrigin FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> Ptr Int32 -> Ptr Int32 -> IO Int32
hb_font_get_glyph_h_origin Ptr FontT
font' Word32
glyph Ptr Int32
x Ptr Int32
y
    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')


-- function font_get_glyph_h_kerning
-- 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 = "left_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph ID of the left glyph in the glyph pair"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "right_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The glyph ID of the right glyph in the glyph pair"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_h_kerning" hb_font_get_glyph_h_kerning :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- left_glyph : TBasicType TUInt32
    Word32 ->                               -- right_glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the kerning-adjustment value for a glyph-pair in
-- the specified font, for horizontal text segments.
-- 
-- \<note>It handles legacy kerning only (as returned by the corresponding
-- t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' function).\<\/note>
-- 
-- /Since: 0.9.2/
fontGetGlyphHKerning ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@leftGlyph@/: The glyph ID of the left glyph in the glyph pair
    -> Word32
    -- ^ /@rightGlyph@/: The glyph ID of the right glyph in the glyph pair
    -> m Int32
    -- ^ __Returns:__ The kerning adjustment value
fontGetGlyphHKerning :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> m Int32
fontGetGlyphHKerning FontT
font Word32
leftGlyph Word32
rightGlyph = 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 <- Ptr FontT -> Word32 -> Word32 -> IO Int32
hb_font_get_glyph_h_kerning Ptr FontT
font' Word32
leftGlyph Word32
rightGlyph
    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


-- function font_get_glyph_h_advances
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_h_advances" hb_font_get_glyph_h_advances :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- count : TBasicType TUInt
    Word32 ->                               -- first_glyph : TBasicType TUInt32
    Word32 ->                               -- glyph_stride : TBasicType TUInt
    Ptr Int32 ->                            -- first_advance : TBasicType TInt32
    Word32 ->                               -- advance_stride : TBasicType TUInt
    IO ()

-- | Fetches the advances for a sequence of glyph IDs in the specified
-- font, for horizontal text segments.
-- 
-- /Since: 1.8.6/
fontGetGlyphHAdvances ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> 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
    -> m (Int32)
fontGetGlyphHAdvances :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> Word32 -> Word32 -> m Int32
fontGetGlyphHAdvances FontT
font Word32
count Word32
firstGlyph Word32
glyphStride Word32
advanceStride = 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)
    Ptr FontT
-> Word32 -> Word32 -> Word32 -> Ptr Int32 -> Word32 -> IO ()
hb_font_get_glyph_h_advances Ptr FontT
font' Word32
count Word32
firstGlyph Word32
glyphStride Ptr Int32
firstAdvance Word32
advanceStride
    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'


-- function font_get_glyph_h_advance
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_h_advance" hb_font_get_glyph_h_advance :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the advance for a glyph ID in the specified font,
-- for horizontal text segments.
-- 
-- /Since: 0.9.2/
fontGetGlyphHAdvance ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m Int32
    -- ^ __Returns:__ The advance of /@glyph@/ within /@font@/
fontGetGlyphHAdvance :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m Int32
fontGetGlyphHAdvance FontT
font Word32
glyph = 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 <- Ptr FontT -> Word32 -> IO Int32
hb_font_get_glyph_h_advance Ptr FontT
font' Word32
glyph
    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


-- function font_get_glyph_from_name
-- 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 = "name"
--           , argType = TCArray False (-1) 2 (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
--           }
--       ]
-- 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 "hb_font_get_glyph_from_name" hb_font_get_glyph_from_name :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Ptr CString ->                          -- name : TCArray False (-1) 2 (TBasicType TUTF8)
    Int32 ->                                -- len : TBasicType TInt
    Ptr Word32 ->                           -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the glyph ID that corresponds to a name string in the specified /@font@/.
-- 
-- \<note>Note: /@len@/ == -1 means the name string is null-terminated.\<\/note>
-- 
-- /Since: 0.9.2/
fontGetGlyphFromName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> [T.Text]
    -- ^ /@name@/: The name string to query
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphFromName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> [Text] -> m (Int32, Word32)
fontGetGlyphFromName FontT
font [Text]
name = 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 <- Ptr FontT -> Ptr CString -> Int32 -> Ptr Word32 -> IO Int32
hb_font_get_glyph_from_name Ptr FontT
font' Ptr CString
name' Int32
len Ptr Word32
glyph
    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')


-- function font_get_glyph_extents_for_origin
-- 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 = "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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_extents_for_origin" hb_font_get_glyph_extents_for_origin :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "glyph_extents_t"})
    IO Int32

-- | Fetches the t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT' data for a glyph ID
-- in the specified font, with respect to the origin in
-- a text segment in the specified direction.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontGetGlyphExtentsForOrigin ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> m ((Int32, HarfBuzz.GlyphExtentsT.GlyphExtentsT))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphExtentsForOrigin :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> DirectionT -> m (Int32, GlyphExtentsT)
fontGetGlyphExtentsForOrigin FontT
font Word32
glyph DirectionT
direction = IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT))
-> IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT)
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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr GlyphExtentsT
extents <- Int -> IO (Ptr GlyphExtentsT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT)
    Int32
result <- Ptr FontT -> Word32 -> CUInt -> Ptr GlyphExtentsT -> IO Int32
hb_font_get_glyph_extents_for_origin Ptr FontT
font' Word32
glyph CUInt
direction' Ptr GlyphExtentsT
extents
    GlyphExtentsT
extents' <- ((ManagedPtr GlyphExtentsT -> GlyphExtentsT)
-> Ptr GlyphExtentsT -> IO GlyphExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr GlyphExtentsT -> GlyphExtentsT
HarfBuzz.GlyphExtentsT.GlyphExtentsT) Ptr GlyphExtentsT
extents
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (Int32, GlyphExtentsT) -> IO (Int32, GlyphExtentsT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, GlyphExtentsT
extents')


-- function font_get_glyph_extents
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_extents" hb_font_get_glyph_extents :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "glyph_extents_t"})
    IO Int32

-- | Fetches the t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT' data for a glyph ID
-- in the specified font.
-- 
-- /Since: 0.9.2/
fontGetGlyphExtents ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> m ((Int32, HarfBuzz.GlyphExtentsT.GlyphExtentsT))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphExtents :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> m (Int32, GlyphExtentsT)
fontGetGlyphExtents FontT
font Word32
glyph = IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT))
-> IO (Int32, GlyphExtentsT) -> m (Int32, GlyphExtentsT)
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
font' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
font
    Ptr GlyphExtentsT
extents <- Int -> IO (Ptr GlyphExtentsT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
16 :: IO (Ptr HarfBuzz.GlyphExtentsT.GlyphExtentsT)
    Int32
result <- Ptr FontT -> Word32 -> Ptr GlyphExtentsT -> IO Int32
hb_font_get_glyph_extents Ptr FontT
font' Word32
glyph Ptr GlyphExtentsT
extents
    GlyphExtentsT
extents' <- ((ManagedPtr GlyphExtentsT -> GlyphExtentsT)
-> Ptr GlyphExtentsT -> IO GlyphExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr GlyphExtentsT -> GlyphExtentsT
HarfBuzz.GlyphExtentsT.GlyphExtentsT) Ptr GlyphExtentsT
extents
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    (Int32, GlyphExtentsT) -> IO (Int32, GlyphExtentsT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, GlyphExtentsT
extents')


-- function font_get_glyph_contour_point_for_origin
-- 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 = "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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_contour_point_for_origin" hb_font_get_glyph_contour_point_for_origin :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Word32 ->                               -- point_index : TBasicType TUInt
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO Int32

-- | Fetches the (X,Y) coordinates of a specified contour-point index
-- in the specified glyph ID in the specified font, with respect
-- to the origin in a text segment in the specified direction.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontGetGlyphContourPointForOrigin ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Word32
    -- ^ /@pointIndex@/: The contour-point index to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphContourPointForOrigin :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> DirectionT -> m (Int32, Int32, Int32)
fontGetGlyphContourPointForOrigin FontT
font Word32
glyph Word32
pointIndex DirectionT
direction = 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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    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 <- Ptr FontT
-> Word32 -> Word32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO Int32
hb_font_get_glyph_contour_point_for_origin Ptr FontT
font' Word32
glyph Word32
pointIndex CUInt
direction' Ptr Int32
x Ptr Int32
y
    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')


-- function font_get_glyph_contour_point
-- 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 = "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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_contour_point" hb_font_get_glyph_contour_point :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    Word32 ->                               -- point_index : TBasicType TUInt
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO Int32

-- | Fetches the (x,y) coordinates of a specified contour-point index
-- in the specified glyph, within the specified font.
-- 
-- /Since: 0.9.2/
fontGetGlyphContourPoint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> Word32
    -- ^ /@pointIndex@/: The contour-point index to query
    -> m ((Int32, Int32, Int32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyphContourPoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> m (Int32, Int32, Int32)
fontGetGlyphContourPoint FontT
font Word32
glyph Word32
pointIndex = 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 <- Ptr FontT -> Word32 -> Word32 -> Ptr Int32 -> Ptr Int32 -> IO Int32
hb_font_get_glyph_contour_point Ptr FontT
font' Word32
glyph Word32
pointIndex Ptr Int32
x Ptr Int32
y
    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')


-- function font_get_glyph_advances_for_direction
-- 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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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 = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The stride between successive advances"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_advances_for_direction" hb_font_get_glyph_advances_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Word32 ->                               -- count : TBasicType TUInt
    Word32 ->                               -- first_glyph : TBasicType TUInt32
    Word32 ->                               -- glyph_stride : TBasicType TUInt
    Ptr Int32 ->                            -- first_advance : TBasicType TInt32
    Ptr Word32 ->                           -- advance_stride : TBasicType TUInt
    IO ()

-- | Fetches the advances for a sequence of glyph IDs in the specified
-- font, in a text segment of the specified direction.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 1.8.6/
fontGetGlyphAdvancesForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> 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
    -> m ((Int32, Word32))
fontGetGlyphAdvancesForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT
-> DirectionT -> Word32 -> Word32 -> Word32 -> m (Int32, Word32)
fontGetGlyphAdvancesForDirection FontT
font DirectionT
direction Word32
count Word32
firstGlyph Word32
glyphStride = 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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr Int32
firstAdvance <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Word32
advanceStride <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr FontT
-> CUInt
-> Word32
-> Word32
-> Word32
-> Ptr Int32
-> Ptr Word32
-> IO ()
hb_font_get_glyph_advances_for_direction Ptr FontT
font' CUInt
direction' Word32
count Word32
firstGlyph Word32
glyphStride Ptr Int32
firstAdvance Ptr Word32
advanceStride
    Int32
firstAdvance' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
firstAdvance
    Word32
advanceStride' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
advanceStride
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
firstAdvance
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
advanceStride
    (Int32, Word32) -> IO (Int32, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
firstAdvance', Word32
advanceStride')


-- function font_get_glyph_advance_for_direction
-- 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 = "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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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 horizontal advance retrieved"
--                 , 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 vertical advance retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph_advance_for_direction" hb_font_get_glyph_advance_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO ()

-- | Fetches the advance for a glyph ID from the specified font,
-- in a text segment of the specified direction.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontGetGlyphAdvanceForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> m ((Int32, Int32))
fontGetGlyphAdvanceForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> DirectionT -> m (Int32, Int32)
fontGetGlyphAdvanceForDirection FontT
font Word32
glyph DirectionT
direction = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    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)
    Ptr FontT -> Word32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO ()
hb_font_get_glyph_advance_for_direction Ptr FontT
font' Word32
glyph CUInt
direction' Ptr Int32
x Ptr Int32
y
    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) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x', Int32
y')


-- function font_get_glyph
-- 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 = "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 "A variation-selector code point"
--                 , 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_glyph" hb_font_get_glyph :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- unicode : TBasicType TUInt32
    Word32 ->                               -- variation_selector : TBasicType TUInt32
    Ptr Word32 ->                           -- glyph : TBasicType TUInt32
    IO Int32

-- | Fetches the glyph ID for a Unicode code point in the specified
-- font, with an optional variation selector.
-- 
-- If /@variationSelector@/ is 0, calls 'GI.HarfBuzz.Functions.fontGetNominalGlyph';
-- otherwise calls 'GI.HarfBuzz.Functions.fontGetVariationGlyph'.
-- 
-- /Since: 0.9.2/
fontGetGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@unicode@/: The Unicode code point to query
    -> Word32
    -- ^ /@variationSelector@/: A variation-selector code point
    -> m ((Int32, Word32))
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
fontGetGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> Word32 -> m (Int32, Word32)
fontGetGlyph FontT
font Word32
unicode Word32
variationSelector = 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 <- Ptr FontT -> Word32 -> Word32 -> Ptr Word32 -> IO Int32
hb_font_get_glyph Ptr FontT
font' Word32
unicode Word32
variationSelector Ptr Word32
glyph
    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')


-- function font_get_face
-- 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
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_face" hb_font_get_face :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO (Ptr HarfBuzz.FaceT.FaceT)

-- | Fetches the face associated with the specified font object.
-- 
-- /Since: 0.9.2/
fontGetFace ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> m HarfBuzz.FaceT.FaceT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Structs.FaceT.FaceT' value
fontGetFace :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m FaceT
fontGetFace FontT
font = IO FaceT -> m FaceT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT
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 FaceT
result <- Ptr FontT -> IO (Ptr FaceT)
hb_font_get_face Ptr FontT
font'
    Text -> Ptr FaceT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontGetFace" Ptr FaceT
result
    FaceT
result' <- ((ManagedPtr FaceT -> FaceT) -> Ptr FaceT -> IO FaceT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr FaceT -> FaceT
HarfBuzz.FaceT.FaceT) Ptr FaceT
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FaceT -> IO FaceT
forall (m :: * -> *) a. Monad m => a -> m a
return FaceT
result'


-- function font_get_extents_for_direction
-- 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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , 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 #hb_font_extents_t retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_extents_for_direction" hb_font_get_extents_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr HarfBuzz.FontExtentsT.FontExtentsT -> -- extents : TInterface (Name {namespace = "HarfBuzz", name = "font_extents_t"})
    IO ()

-- | Fetches the extents for a font in a text segment of the
-- specified direction.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 1.1.3/
fontGetExtentsForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> m (HarfBuzz.FontExtentsT.FontExtentsT)
fontGetExtentsForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> DirectionT -> m FontExtentsT
fontGetExtentsForDirection FontT
font DirectionT
direction = IO FontExtentsT -> m FontExtentsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontExtentsT -> m FontExtentsT)
-> IO FontExtentsT -> m FontExtentsT
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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr FontExtentsT
extents <- Int -> IO (Ptr FontExtentsT)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
48 :: IO (Ptr HarfBuzz.FontExtentsT.FontExtentsT)
    Ptr FontT -> CUInt -> Ptr FontExtentsT -> IO ()
hb_font_get_extents_for_direction Ptr FontT
font' CUInt
direction' Ptr FontExtentsT
extents
    FontExtentsT
extents' <- ((ManagedPtr FontExtentsT -> FontExtentsT)
-> Ptr FontExtentsT -> IO FontExtentsT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr FontExtentsT -> FontExtentsT
HarfBuzz.FontExtentsT.FontExtentsT) Ptr FontExtentsT
extents
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
font
    FontExtentsT -> IO FontExtentsT
forall (m :: * -> *) a. Monad m => a -> m a
return FontExtentsT
extents'


-- function font_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_get_empty" hb_font_get_empty :: 
    IO (Ptr HarfBuzz.FontT.FontT)

-- | Fetches the empty font object.
-- 
-- /Since: 0.9.2/
fontGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.FontT.FontT
    -- ^ __Returns:__ The empty font object
fontGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FontT
fontGetEmpty  = IO FontT -> m FontT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
result <- IO (Ptr FontT)
hb_font_get_empty
    Text -> Ptr FontT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontGetEmpty" Ptr FontT
result
    FontT
result' <- ((ManagedPtr FontT -> FontT) -> Ptr FontT -> IO FontT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT) Ptr FontT
result
    FontT -> IO FontT
forall (m :: * -> *) a. Monad m => a -> m a
return FontT
result'


-- function font_funcs_set_variation_glyph_func
-- XXX Could not generate function font_funcs_set_variation_glyph_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_nominal_glyphs_func
-- XXX Could not generate function font_funcs_set_nominal_glyphs_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_nominal_glyph_func
-- XXX Could not generate function font_funcs_set_nominal_glyph_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_v_origin_func
-- XXX Could not generate function font_funcs_set_glyph_v_origin_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_v_kerning_func
-- XXX Could not generate function font_funcs_set_glyph_v_kerning_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_v_advances_func
-- XXX Could not generate function font_funcs_set_glyph_v_advances_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_v_advance_func
-- XXX Could not generate function font_funcs_set_glyph_v_advance_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_shape_func
-- XXX Could not generate function font_funcs_set_glyph_shape_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_name_func
-- XXX Could not generate function font_funcs_set_glyph_name_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_h_origin_func
-- XXX Could not generate function font_funcs_set_glyph_h_origin_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_h_kerning_func
-- XXX Could not generate function font_funcs_set_glyph_h_kerning_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_h_advances_func
-- XXX Could not generate function font_funcs_set_glyph_h_advances_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_h_advance_func
-- XXX Could not generate function font_funcs_set_glyph_h_advance_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_func
-- XXX Could not generate function font_funcs_set_glyph_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_from_name_func
-- XXX Could not generate function font_funcs_set_glyph_from_name_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_extents_func
-- XXX Could not generate function font_funcs_set_glyph_extents_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_glyph_contour_point_func
-- XXX Could not generate function font_funcs_set_glyph_contour_point_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_font_v_extents_func
-- XXX Could not generate function font_funcs_set_font_v_extents_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_set_font_h_extents_func
-- XXX Could not generate function font_funcs_set_font_h_extents_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function font_funcs_make_immutable
-- Args: [ Arg
--           { argCName = "ffuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The font-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_funcs_make_immutable" hb_font_funcs_make_immutable :: 
    Ptr HarfBuzz.FontFuncsT.FontFuncsT ->   -- ffuncs : TInterface (Name {namespace = "HarfBuzz", name = "font_funcs_t"})
    IO ()

-- | Makes a font-functions structure immutable.
-- 
-- /Since: 0.9.2/
fontFuncsMakeImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontFuncsT.FontFuncsT
    -- ^ /@ffuncs@/: The font-functions structure
    -> m ()
fontFuncsMakeImmutable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontFuncsT -> m ()
fontFuncsMakeImmutable FontFuncsT
ffuncs = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontFuncsT
ffuncs' <- FontFuncsT -> IO (Ptr FontFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontFuncsT
ffuncs
    Ptr FontFuncsT -> IO ()
hb_font_funcs_make_immutable Ptr FontFuncsT
ffuncs'
    FontFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontFuncsT
ffuncs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function font_funcs_is_immutable
-- Args: [ Arg
--           { argCName = "ffuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The font-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_funcs_is_immutable" hb_font_funcs_is_immutable :: 
    Ptr HarfBuzz.FontFuncsT.FontFuncsT ->   -- ffuncs : TInterface (Name {namespace = "HarfBuzz", name = "font_funcs_t"})
    IO Int32

-- | Tests whether a font-functions structure is immutable.
-- 
-- /Since: 0.9.2/
fontFuncsIsImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontFuncsT.FontFuncsT
    -- ^ /@ffuncs@/: The font-functions structure
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@ffuncs@/ is immutable, @/false/@ otherwise
fontFuncsIsImmutable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontFuncsT -> m Int32
fontFuncsIsImmutable FontFuncsT
ffuncs = 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 FontFuncsT
ffuncs' <- FontFuncsT -> IO (Ptr FontFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontFuncsT
ffuncs
    Int32
result <- Ptr FontFuncsT -> IO Int32
hb_font_funcs_is_immutable Ptr FontFuncsT
ffuncs'
    FontFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontFuncsT
ffuncs
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function font_funcs_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "font_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_funcs_get_empty" hb_font_funcs_get_empty :: 
    IO (Ptr HarfBuzz.FontFuncsT.FontFuncsT)

-- | Fetches an empty font-functions structure.
-- 
-- /Since: 0.9.2/
fontFuncsGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.FontFuncsT.FontFuncsT
    -- ^ __Returns:__ The font-functions structure
fontFuncsGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FontFuncsT
fontFuncsGetEmpty  = IO FontFuncsT -> m FontFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontFuncsT -> m FontFuncsT) -> IO FontFuncsT -> m FontFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontFuncsT
result <- IO (Ptr FontFuncsT)
hb_font_funcs_get_empty
    Text -> Ptr FontFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontFuncsGetEmpty" Ptr FontFuncsT
result
    FontFuncsT
result' <- ((ManagedPtr FontFuncsT -> FontFuncsT)
-> Ptr FontFuncsT -> IO FontFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontFuncsT -> FontFuncsT
HarfBuzz.FontFuncsT.FontFuncsT) Ptr FontFuncsT
result
    FontFuncsT -> IO FontFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return FontFuncsT
result'


-- function font_funcs_create
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "font_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_funcs_create" hb_font_funcs_create :: 
    IO (Ptr HarfBuzz.FontFuncsT.FontFuncsT)

-- | Creates a new t'GI.HarfBuzz.Structs.FontFuncsT.FontFuncsT' structure of font functions.
-- 
-- /Since: 0.9.2/
fontFuncsCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.FontFuncsT.FontFuncsT
    -- ^ __Returns:__ The font-functions structure
fontFuncsCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FontFuncsT
fontFuncsCreate  = IO FontFuncsT -> m FontFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontFuncsT -> m FontFuncsT) -> IO FontFuncsT -> m FontFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontFuncsT
result <- IO (Ptr FontFuncsT)
hb_font_funcs_create
    Text -> Ptr FontFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontFuncsCreate" Ptr FontFuncsT
result
    FontFuncsT
result' <- ((ManagedPtr FontFuncsT -> FontFuncsT)
-> Ptr FontFuncsT -> IO FontFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontFuncsT -> FontFuncsT
HarfBuzz.FontFuncsT.FontFuncsT) Ptr FontFuncsT
result
    FontFuncsT -> IO FontFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return FontFuncsT
result'


-- function font_create_sub_font
-- Args: [ Arg
--           { argCName = "parent"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The parent font object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_create_sub_font" hb_font_create_sub_font :: 
    Ptr HarfBuzz.FontT.FontT ->             -- parent : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    IO (Ptr HarfBuzz.FontT.FontT)

-- | Constructs a sub-font font object from the specified /@parent@/ font,
-- replicating the parent\'s properties.
-- 
-- /Since: 0.9.2/
fontCreateSubFont ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@parent@/: The parent font object
    -> m HarfBuzz.FontT.FontT
    -- ^ __Returns:__ The new sub-font font object
fontCreateSubFont :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FontT -> m FontT
fontCreateSubFont FontT
parent = IO FontT -> m FontT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FontT
parent' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
parent
    Ptr FontT
result <- Ptr FontT -> IO (Ptr FontT)
hb_font_create_sub_font Ptr FontT
parent'
    Text -> Ptr FontT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontCreateSubFont" Ptr FontT
result
    FontT
result' <- ((ManagedPtr FontT -> FontT) -> Ptr FontT -> IO FontT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT) Ptr FontT
result
    FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FontT
parent
    FontT -> IO FontT
forall (m :: * -> *) a. Monad m => a -> m a
return FontT
result'


-- function font_create
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a face." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "font_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_create" hb_font_create :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO (Ptr HarfBuzz.FontT.FontT)

-- | Constructs a new font object from the specified face.
-- 
-- \<note>Note: If /@face@/\'s index value (as passed to 'GI.HarfBuzz.Functions.faceCreate'
-- has non-zero top 16-bits, those bits minus one are passed to
-- 'GI.HarfBuzz.Functions.fontSetVarNamedInstance', effectively loading a named-instance
-- of a variable font, instead of the default-instance.  This allows
-- specifying which named-instance to load by default when creating the
-- face.\<\/note>
-- 
-- /Since: 0.9.2/
fontCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: a face.
    -> m HarfBuzz.FontT.FontT
    -- ^ __Returns:__ The new font object
fontCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m FontT
fontCreate FaceT
face = IO FontT -> m FontT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FontT -> m FontT) -> IO FontT -> m FontT
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 FontT
result <- Ptr FaceT -> IO (Ptr FontT)
hb_font_create Ptr FaceT
face'
    Text -> Ptr FontT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fontCreate" Ptr FontT
result
    FontT
result' <- ((ManagedPtr FontT -> FontT) -> Ptr FontT -> IO FontT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FontT -> FontT
HarfBuzz.FontT.FontT) Ptr FontT
result
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    FontT -> IO FontT
forall (m :: * -> *) a. Monad m => a -> m a
return FontT
result'


-- function font_add_glyph_origin_for_direction
-- 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 = "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 = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The direction of the text segment"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "x"
--           , argType = TBasicType TInt32
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = The original X coordinate\n    Output = The X coordinate plus 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 = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = The original Y coordinate\n    Output = The Y coordinate plus the Y-coordinate of the origin"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_font_add_glyph_origin_for_direction" hb_font_add_glyph_origin_for_direction :: 
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    Word32 ->                               -- glyph : TBasicType TUInt32
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    Ptr Int32 ->                            -- x : TBasicType TInt32
    Ptr Int32 ->                            -- y : TBasicType TInt32
    IO ()

-- | Adds the origin coordinates to an (X,Y) point coordinate, in
-- the specified glyph ID in the specified font.
-- 
-- Calls the appropriate direction-specific variant (horizontal
-- or vertical) depending on the value of /@direction@/.
-- 
-- /Since: 0.9.2/
fontAddGlyphOriginForDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FontT.FontT
    -- ^ /@font@/: t'GI.HarfBuzz.Structs.FontT.FontT' to work upon
    -> Word32
    -- ^ /@glyph@/: The glyph ID to query
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The direction of the text segment
    -> Int32
    -- ^ /@x@/: Input = The original X coordinate
    --     Output = The X coordinate plus the X-coordinate of the origin
    -> Int32
    -- ^ /@y@/: Input = The original Y coordinate
    --     Output = The Y coordinate plus the Y-coordinate of the origin
    -> m ((Int32, Int32))
fontAddGlyphOriginForDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FontT -> Word32 -> DirectionT -> Int32 -> Int32 -> m (Int32, Int32)
fontAddGlyphOriginForDirection FontT
font Word32
glyph DirectionT
direction Int32
x Int32
y = IO (Int32, Int32) -> m (Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, Int32) -> m (Int32, Int32))
-> IO (Int32, Int32) -> m (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
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr Int32
x' <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
x' Int32
x
    Ptr Int32
y' <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr Int32
y' Int32
y
    Ptr FontT -> Word32 -> CUInt -> Ptr Int32 -> Ptr Int32 -> IO ()
hb_font_add_glyph_origin_for_direction Ptr FontT
font' Word32
glyph CUInt
direction' Ptr Int32
x' Ptr Int32
y'
    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) -> IO (Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
x'', Int32
y'')


-- function feature_to_string
-- Args: [ Arg
--           { argCName = "feature"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_feature_t to convert"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 2 (TBasicType TUTF8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "output string" , 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 "the allocated size of @buf"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the allocated size of @buf"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_feature_to_string" hb_feature_to_string :: 
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- feature : TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})
    Ptr (Ptr CString) ->                    -- buf : TCArray False (-1) 2 (TBasicType TUTF8)
    Ptr Word32 ->                           -- size : TBasicType TUInt
    IO ()

-- | Converts a t'GI.HarfBuzz.Structs.FeatureT.FeatureT' into a 'P.Nothing'-terminated string in the format
-- understood by 'GI.HarfBuzz.Functions.featureFromString'. The client in responsible for
-- allocating big enough size for /@buf@/, 128 bytes is more than enough.
-- 
-- /Since: 0.9.5/
featureToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FeatureT.FeatureT
    -- ^ /@feature@/: an t'GI.HarfBuzz.Structs.FeatureT.FeatureT' to convert
    -> m ([T.Text])
featureToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FeatureT -> m [Text]
featureToString FeatureT
feature = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr FeatureT
feature' <- FeatureT -> IO (Ptr FeatureT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FeatureT
feature
    Ptr (Ptr CString)
buf <- 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)
    Ptr FeatureT -> Ptr (Ptr CString) -> Ptr Word32 -> IO ()
hb_feature_to_string Ptr FeatureT
feature' Ptr (Ptr CString)
buf Ptr Word32
size
    Word32
size' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
size
    Ptr CString
buf' <- Ptr (Ptr CString) -> IO (Ptr CString)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr CString)
buf
    [Text]
buf'' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
size') Ptr CString
buf'
    (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
buf'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
buf'
    FeatureT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FeatureT
feature
    Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
buf
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
size
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
buf''


-- function feature_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a string to parse" , 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 "length of @str, or -1 if string is %NULL terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "feature_t" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #hb_feature_t to initialize with the parsed values"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "length of @str, or -1 if string is %NULL terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_feature_from_string" hb_feature_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    Ptr HarfBuzz.FeatureT.FeatureT ->       -- feature : TInterface (Name {namespace = "HarfBuzz", name = "feature_t"})
    IO Int32

-- | Parses a string into a t'GI.HarfBuzz.Structs.FeatureT.FeatureT'.
-- 
-- The format for specifying feature strings follows. All valid CSS
-- font-feature-settings values other than \'normal\' and the global values are
-- also accepted, though not documented below. CSS string escapes are not
-- supported.
-- 
-- The range indices refer to the positions between Unicode characters. The
-- position before the first character is always 0.
-- 
-- The format is Python-esque.  Here is how it all works:
-- 
-- \<informaltable pgwide=\'1\' align=\'left\' frame=\'none\'>
-- \<tgroup cols=\'5\'>
-- \<thead>
-- \<row>\<entry>Syntax\<\/entry>    \<entry>Value\<\/entry> \<entry>Start\<\/entry> \<entry>End\<\/entry>\<\/row>
-- \<\/thead>
-- \<tbody>
-- \<row>\<entry>Setting value:\<\/entry>\<\/row>
-- \<row>\<entry>kern\<\/entry>      \<entry>1\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature on\<\/entry>\<\/row>
-- \<row>\<entry>+kern\<\/entry>     \<entry>1\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature on\<\/entry>\<\/row>
-- \<row>\<entry>-kern\<\/entry>     \<entry>0\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature off\<\/entry>\<\/row>
-- \<row>\<entry>kern=0\<\/entry>    \<entry>0\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature off\<\/entry>\<\/row>
-- \<row>\<entry>kern=1\<\/entry>    \<entry>1\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature on\<\/entry>\<\/row>
-- \<row>\<entry>aalt=2\<\/entry>    \<entry>2\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Choose 2nd alternate\<\/entry>\<\/row>
-- \<row>\<entry>Setting index:\<\/entry>\<\/row>
-- \<row>\<entry>kern[]\<\/entry>    \<entry>1\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature on\<\/entry>\<\/row>
-- \<row>\<entry>kern[:]\<\/entry>   \<entry>1\<\/entry>     \<entry>0\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature on\<\/entry>\<\/row>
-- \<row>\<entry>kern[5:]\<\/entry>  \<entry>1\<\/entry>     \<entry>5\<\/entry>      \<entry>∞\<\/entry>   \<entry>Turn feature on, partial\<\/entry>\<\/row>
-- \<row>\<entry>kern[:5]\<\/entry>  \<entry>1\<\/entry>     \<entry>0\<\/entry>      \<entry>5\<\/entry>   \<entry>Turn feature on, partial\<\/entry>\<\/row>
-- \<row>\<entry>kern[3:5]\<\/entry> \<entry>1\<\/entry>     \<entry>3\<\/entry>      \<entry>5\<\/entry>   \<entry>Turn feature on, range\<\/entry>\<\/row>
-- \<row>\<entry>kern[3]\<\/entry>   \<entry>1\<\/entry>     \<entry>3\<\/entry>      \<entry>3+1\<\/entry> \<entry>Turn feature on, single char\<\/entry>\<\/row>
-- \<row>\<entry>Mixing it all:\<\/entry>\<\/row>
-- \<row>\<entry>aalt[3:5]=2\<\/entry> \<entry>2\<\/entry>   \<entry>3\<\/entry>      \<entry>5\<\/entry>   \<entry>Turn 2nd alternate on for range\<\/entry>\<\/row>
-- \<\/tbody>
-- \<\/tgroup>
-- \<\/informaltable>
-- 
-- /Since: 0.9.5/
featureFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: a string to parse
    -> m ((Int32, HarfBuzz.FeatureT.FeatureT))
    -- ^ __Returns:__ @/true/@ if /@str@/ is successfully parsed, @/false/@ otherwise
featureFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m (Int32, FeatureT)
featureFromString ByteString
str = IO (Int32, FeatureT) -> m (Int32, FeatureT)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Int32, FeatureT) -> m (Int32, FeatureT))
-> IO (Int32, FeatureT) -> m (Int32, FeatureT)
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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    Ptr FeatureT
feature <- Int -> IO (Ptr FeatureT)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
16 :: IO (Ptr HarfBuzz.FeatureT.FeatureT)
    Int32
result <- Ptr Word8 -> Int32 -> Ptr FeatureT -> IO Int32
hb_feature_from_string Ptr Word8
str' Int32
len Ptr FeatureT
feature
    FeatureT
feature' <- ((ManagedPtr FeatureT -> FeatureT) -> Ptr FeatureT -> IO FeatureT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FeatureT -> FeatureT
HarfBuzz.FeatureT.FeatureT) Ptr FeatureT
feature
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    (Int32, FeatureT) -> IO (Int32, FeatureT)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, FeatureT
feature')


-- function face_set_upem
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "upem"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The units-per-em value to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_set_upem" hb_face_set_upem :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- upem : TBasicType TUInt
    IO ()

-- | Sets the units-per-em (upem) for a face object to the specified value.
-- 
-- /Since: 0.9.2/
faceSetUpem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> Word32
    -- ^ /@upem@/: The units-per-em value to assign
    -> m ()
faceSetUpem :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m ()
faceSetUpem FaceT
face Word32
upem = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr FaceT -> Word32 -> IO ()
hb_face_set_upem Ptr FaceT
face' Word32
upem
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_set_index
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_set_index" hb_face_set_index :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- index : TBasicType TUInt
    IO ()

-- | Assigns the specified face-index to /@face@/. Fails if the
-- face is immutable.
-- 
-- \<note>Note: changing the index has no effect on the face itself
-- This only changes the value returned by 'GI.HarfBuzz.Functions.faceGetIndex'.\<\/note>
-- 
-- /Since: 0.9.2/
faceSetIndex ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> Word32
    -- ^ /@index@/: The index to assign
    -> m ()
faceSetIndex :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m ()
faceSetIndex FaceT
face Word32
index = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr FaceT -> Word32 -> IO ()
hb_face_set_index Ptr FaceT
face' Word32
index
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_set_glyph_count
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "glyph_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The glyph-count value to assign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_set_glyph_count" hb_face_set_glyph_count :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- glyph_count : TBasicType TUInt
    IO ()

-- | Sets the glyph count for a face object to the specified value.
-- 
-- /Since: 0.9.7/
faceSetGlyphCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> Word32
    -- ^ /@glyphCount@/: The glyph-count value to assign
    -> m ()
faceSetGlyphCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m ()
faceSetGlyphCount FaceT
face Word32
glyphCount = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr FaceT -> Word32 -> IO ()
hb_face_set_glyph_count Ptr FaceT
face' Word32
glyphCount
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_reference_table
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , 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 #hb_tag_t of the table to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_reference_table" hb_face_reference_table :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- tag : TBasicType TUInt32
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Fetches a reference to the specified table within
-- the specified face.
-- 
-- /Since: 0.9.2/
faceReferenceTable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> Word32
    -- ^ /@tag@/: The @/hb_tag_t/@ of the table to query
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ A pointer to the /@tag@/ table within /@face@/
faceReferenceTable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m BlobT
faceReferenceTable FaceT
face Word32
tag = 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 <- Ptr FaceT -> Word32 -> IO (Ptr BlobT)
hb_face_reference_table Ptr FaceT
face' Word32
tag
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"faceReferenceTable" 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'


-- function face_reference_blob
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_reference_blob" hb_face_reference_blob :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Fetches a pointer to the binary blob that contains the
-- specified face. Returns an empty blob if referencing face data is not
-- possible.
-- 
-- /Since: 0.9.2/
faceReferenceBlob ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ A pointer to the blob for /@face@/
faceReferenceBlob :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m BlobT
faceReferenceBlob FaceT
face = 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 <- Ptr FaceT -> IO (Ptr BlobT)
hb_face_reference_blob Ptr FaceT
face'
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"faceReferenceBlob" 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'


-- function face_make_immutable
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_make_immutable" hb_face_make_immutable :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO ()

-- | Makes the given face object immutable.
-- 
-- /Since: 0.9.2/
faceMakeImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> m ()
faceMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m ()
faceMakeImmutable FaceT
face = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr FaceT -> IO ()
hb_face_make_immutable Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_is_immutable
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_is_immutable" hb_face_is_immutable :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether the given face object is immutable.
-- 
-- /Since: 0.9.2/
faceIsImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> m Int32
    -- ^ __Returns:__ @/true/@ is /@face@/ is immutable, @/false/@ otherwise
faceIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
faceIsImmutable FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_face_is_immutable Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function face_get_upem
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_get_upem" hb_face_get_upem :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Word32

-- | Fetches the units-per-em (upem) value of the specified face object.
-- 
-- /Since: 0.9.2/
faceGetUpem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> m Word32
    -- ^ __Returns:__ The upem value of /@face@/
faceGetUpem :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m Word32
faceGetUpem FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> IO Word32
hb_face_get_upem Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function face_get_table_tags
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of first table tag to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "table_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of table tags to return;\n               Output = the actual number of table tags returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "table_tags"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt32)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The array of table tags found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "table_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of table tags to return;\n               Output = the actual number of table tags returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_get_table_tags" hb_face_get_table_tags :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Ptr Word32 ->                           -- table_count : TBasicType TUInt
    Ptr (Ptr Word32) ->                     -- table_tags : TCArray False (-1) 2 (TBasicType TUInt32)
    IO Word32

-- | Fetches a list of all table tags for a face, if possible. The list returned will
-- begin at the offset provided
-- 
-- /Since: 1.6.0/
faceGetTableTags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> Word32
    -- ^ /@startOffset@/: The index of first table tag to retrieve
    -> m ((Word32, [Word32]))
    -- ^ __Returns:__ Total number of tables, or zero if it is not possible to list
faceGetTableTags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> m (Word32, [Word32])
faceGetTableTags FaceT
face Word32
startOffset = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr Word32
tableCount <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr (Ptr Word32)
tableTags <- IO (Ptr (Ptr Word32))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word32))
    Word32
result <- Ptr FaceT -> Word32 -> Ptr Word32 -> Ptr (Ptr Word32) -> IO Word32
hb_face_get_table_tags Ptr FaceT
face' Word32
startOffset Ptr Word32
tableCount Ptr (Ptr Word32)
tableTags
    Word32
tableCount' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
tableCount
    Ptr Word32
tableTags' <- Ptr (Ptr Word32) -> IO (Ptr Word32)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word32)
tableTags
    [Word32]
tableTags'' <- (Word32 -> Ptr Word32 -> IO [Word32]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
tableCount') Ptr Word32
tableTags'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
tableTags'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
tableCount
    Ptr (Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word32)
tableTags
    (Word32, [Word32]) -> IO (Word32, [Word32])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [Word32]
tableTags'')


-- function face_get_index
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_get_index" hb_face_get_index :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Word32

-- | Fetches the face-index corresponding to the given face.
-- 
-- \<note>Note: face indices within a collection are zero-based.\<\/note>
-- 
-- /Since: 0.9.2/
faceGetIndex ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> m Word32
    -- ^ __Returns:__ The index of /@face@/.
faceGetIndex :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m Word32
faceGetIndex FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> IO Word32
hb_face_get_index Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function face_get_glyph_count
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_get_glyph_count" hb_face_get_glyph_count :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Word32

-- | Fetches the glyph-count value of the specified face object.
-- 
-- /Since: 0.9.7/
faceGetGlyphCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> m Word32
    -- ^ __Returns:__ The glyph-count value of /@face@/
faceGetGlyphCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> m Word32
faceGetGlyphCount FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Word32
result <- Ptr FaceT -> IO Word32
hb_face_get_glyph_count Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function face_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_get_empty" hb_face_get_empty :: 
    IO (Ptr HarfBuzz.FaceT.FaceT)

-- | Fetches the singleton empty face object.
-- 
-- /Since: 0.9.2/
faceGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.FaceT.FaceT
    -- ^ __Returns:__ The empty face object
faceGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FaceT
faceGetEmpty  = IO FaceT -> m FaceT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
result <- IO (Ptr FaceT)
hb_face_get_empty
    Text -> Ptr FaceT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"faceGetEmpty" Ptr FaceT
result
    FaceT
result' <- ((ManagedPtr FaceT -> FaceT) -> Ptr FaceT -> IO FaceT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FaceT -> FaceT
HarfBuzz.FaceT.FaceT) Ptr FaceT
result
    FaceT -> IO FaceT
forall (m :: * -> *) a. Monad m => a -> m a
return FaceT
result'


-- function face_create_for_tables
-- XXX Could not generate function face_create_for_tables

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function face_create
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_blob_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The index of the face within @blob"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_create" hb_face_create :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    Word32 ->                               -- index : TBasicType TUInt
    IO (Ptr HarfBuzz.FaceT.FaceT)

-- | Constructs a new face object from the specified blob and
-- a face index into that blob.
-- 
-- The face index is used for blobs of file formats such as TTC and
-- and DFont that can contain more than one face.  Face indices within
-- such collections are zero-based.
-- 
-- \<note>Note: If the blob font format is not a collection, /@index@/
-- is ignored.  Otherwise, only the lower 16-bits of /@index@/ are used.
-- The unmodified /@index@/ can be accessed via 'GI.HarfBuzz.Functions.faceGetIndex'.\<\/note>
-- 
-- \<note>Note: The high 16-bits of /@index@/, if non-zero, are used by
-- 'GI.HarfBuzz.Functions.fontCreate' to load named-instances in variable fonts.  See
-- 'GI.HarfBuzz.Functions.fontCreate' for details.\<\/note>
-- 
-- /Since: 0.9.2/
faceCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: t'GI.HarfBuzz.Structs.BlobT.BlobT' to work upon
    -> Word32
    -- ^ /@index@/: The index of the face within /@blob@/
    -> m HarfBuzz.FaceT.FaceT
    -- ^ __Returns:__ The new face object
faceCreate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BlobT -> Word32 -> m FaceT
faceCreate BlobT
blob Word32
index = IO FaceT -> m FaceT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT
forall a b. (a -> b) -> a -> b
$ do
    Ptr BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Ptr FaceT
result <- Ptr BlobT -> Word32 -> IO (Ptr FaceT)
hb_face_create Ptr BlobT
blob' Word32
index
    Text -> Ptr FaceT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"faceCreate" Ptr FaceT
result
    FaceT
result' <- ((ManagedPtr FaceT -> FaceT) -> Ptr FaceT -> IO FaceT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FaceT -> FaceT
HarfBuzz.FaceT.FaceT) Ptr FaceT
result
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    FaceT -> IO FaceT
forall (m :: * -> *) a. Monad m => a -> m a
return FaceT
result'


-- function face_count
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_count" hb_face_count :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    IO Word32

-- | Fetches the number of faces in a blob.
-- 
-- /Since: 1.7.7/
faceCount ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: a blob.
    -> m Word32
    -- ^ __Returns:__ Number of faces in /@blob@/
faceCount :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BlobT -> m Word32
faceCount BlobT
blob = 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 BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Word32
result <- Ptr BlobT -> IO Word32
hb_face_count Ptr BlobT
blob'
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function face_collect_variation_unicodes
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , 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 to query"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The set to add Unicode characters to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_collect_variation_unicodes" hb_face_collect_variation_unicodes :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- variation_selector : TBasicType TUInt32
    Ptr HarfBuzz.SetT.SetT ->               -- out : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Collects all Unicode characters for /@variationSelector@/ covered by /@face@/ and adds
-- them to the t'GI.HarfBuzz.Structs.SetT.SetT' set /@out@/.
-- 
-- /Since: 1.9.0/
faceCollectVariationUnicodes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> Word32
    -- ^ /@variationSelector@/: The Variation Selector to query
    -> HarfBuzz.SetT.SetT
    -- ^ /@out@/: The set to add Unicode characters to
    -> m ()
faceCollectVariationUnicodes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> SetT -> m ()
faceCollectVariationUnicodes FaceT
face Word32
variationSelector SetT
out = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SetT
out' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
out
    Ptr FaceT -> Word32 -> Ptr SetT -> IO ()
hb_face_collect_variation_unicodes Ptr FaceT
face' Word32
variationSelector Ptr SetT
out'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
out
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_collect_variation_selectors
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The set to add Variation Selector characters to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_collect_variation_selectors" hb_face_collect_variation_selectors :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- out : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Collects all Unicode \"Variation Selector\" characters covered by /@face@/ and adds
-- them to the t'GI.HarfBuzz.Structs.SetT.SetT' set /@out@/.
-- 
-- /Since: 1.9.0/
faceCollectVariationSelectors ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> HarfBuzz.SetT.SetT
    -- ^ /@out@/: The set to add Variation Selector characters to
    -> m ()
faceCollectVariationSelectors :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> SetT -> m ()
faceCollectVariationSelectors FaceT
face SetT
out = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SetT
out' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
out
    Ptr FaceT -> Ptr SetT -> IO ()
hb_face_collect_variation_selectors Ptr FaceT
face' Ptr SetT
out'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
out
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_collect_unicodes
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A face object" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "set_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The set to add Unicode characters to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_collect_unicodes" hb_face_collect_unicodes :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Ptr HarfBuzz.SetT.SetT ->               -- out : TInterface (Name {namespace = "HarfBuzz", name = "set_t"})
    IO ()

-- | Collects all of the Unicode characters covered by /@face@/ and adds
-- them to the t'GI.HarfBuzz.Structs.SetT.SetT' set /@out@/.
-- 
-- /Since: 1.9.0/
faceCollectUnicodes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object
    -> HarfBuzz.SetT.SetT
    -- ^ /@out@/: The set to add Unicode characters to
    -> m ()
faceCollectUnicodes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> SetT -> m ()
faceCollectUnicodes FaceT
face SetT
out = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr SetT
out' <- SetT -> IO (Ptr SetT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SetT
out
    Ptr FaceT -> Ptr SetT -> IO ()
hb_face_collect_unicodes Ptr FaceT
face' Ptr SetT
out'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    SetT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SetT
out
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function face_builder_create
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "face_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_builder_create" hb_face_builder_create :: 
    IO (Ptr HarfBuzz.FaceT.FaceT)

-- | Creates a t'GI.HarfBuzz.Structs.FaceT.FaceT' that can be used with 'GI.HarfBuzz.Functions.faceBuilderAddTable'.
-- After tables are added to the face, it can be compiled to a binary
-- font file by calling 'GI.HarfBuzz.Functions.faceReferenceBlob'.
-- 
-- /Since: 1.9.0/
faceBuilderCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.FaceT.FaceT
    -- ^ __Returns:__ New face.
faceBuilderCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FaceT
faceBuilderCreate  = IO FaceT -> m FaceT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FaceT -> m FaceT) -> IO FaceT -> m FaceT
forall a b. (a -> b) -> a -> b
$ do
    Ptr FaceT
result <- IO (Ptr FaceT)
hb_face_builder_create
    Text -> Ptr FaceT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"faceBuilderCreate" Ptr FaceT
result
    FaceT
result' <- ((ManagedPtr FaceT -> FaceT) -> Ptr FaceT -> IO FaceT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr FaceT -> FaceT
HarfBuzz.FaceT.FaceT) Ptr FaceT
result
    FaceT -> IO FaceT
forall (m :: * -> *) a. Monad m => a -> m a
return FaceT
result'


-- function face_builder_add_table
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A face object created with hb_face_builder_create()"
--                 , 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 #hb_tag_t of the table to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The blob containing the table data to add"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_face_builder_add_table" hb_face_builder_add_table :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- tag : TBasicType TUInt32
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    IO Int32

-- | Add table for /@tag@/ with data provided by /@blob@/ to the face.  /@face@/ must
-- be created using 'GI.HarfBuzz.Functions.faceBuilderCreate'.
-- 
-- /Since: 1.9.0/
faceBuilderAddTable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: A face object created with 'GI.HarfBuzz.Functions.faceBuilderCreate'
    -> Word32
    -- ^ /@tag@/: The @/hb_tag_t/@ of the table to add
    -> HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: The blob containing the table data to add
    -> m Int32
faceBuilderAddTable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> Word32 -> BlobT -> m Int32
faceBuilderAddTable FaceT
face Word32
tag BlobT
blob = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Ptr BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Int32
result <- Ptr FaceT -> Word32 -> Ptr BlobT -> IO Int32
hb_face_builder_add_table Ptr FaceT
face' Word32
tag Ptr BlobT
blob'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function draw_quadratic_to
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "associated draw data passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "st"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "current draw state" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "control_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of control point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "control_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of control point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_quadratic_to" hb_draw_quadratic_to :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    Ptr () ->                               -- draw_data : TBasicType TPtr
    Ptr HarfBuzz.DrawStateT.DrawStateT ->   -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"})
    CFloat ->                               -- control_x : TBasicType TFloat
    CFloat ->                               -- control_y : TBasicType TFloat
    CFloat ->                               -- to_x : TBasicType TFloat
    CFloat ->                               -- to_y : TBasicType TFloat
    IO ()

-- | Perform a \"quadratic-to\" draw operation.
-- 
-- /Since: 4.0.0/
drawQuadraticTo ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> Ptr ()
    -- ^ /@drawData@/: associated draw data passed by the caller
    -> HarfBuzz.DrawStateT.DrawStateT
    -- ^ /@st@/: current draw state
    -> Float
    -- ^ /@controlX@/: X component of control point
    -> Float
    -- ^ /@controlY@/: Y component of control point
    -> Float
    -- ^ /@toX@/: X component of target point
    -> Float
    -- ^ /@toY@/: Y component of target point
    -> m ()
drawQuadraticTo :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT
-> Ptr () -> DrawStateT -> Float -> Float -> Float -> Float -> m ()
drawQuadraticTo DrawFuncsT
dfuncs Ptr ()
drawData DrawStateT
st Float
controlX Float
controlY Float
toX Float
toY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr DrawStateT
st' <- DrawStateT -> IO (Ptr DrawStateT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawStateT
st
    let controlX' :: CFloat
controlX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
controlX
    let controlY' :: CFloat
controlY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
controlY
    let toX' :: CFloat
toX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toX
    let toY' :: CFloat
toY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toY
    Ptr DrawFuncsT
-> Ptr ()
-> Ptr DrawStateT
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> IO ()
hb_draw_quadratic_to Ptr DrawFuncsT
dfuncs' Ptr ()
drawData Ptr DrawStateT
st' CFloat
controlX' CFloat
controlY' CFloat
toX' CFloat
toY'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    DrawStateT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawStateT
st
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function draw_move_to
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "associated draw data passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "st"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "current draw state" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_move_to" hb_draw_move_to :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    Ptr () ->                               -- draw_data : TBasicType TPtr
    Ptr HarfBuzz.DrawStateT.DrawStateT ->   -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"})
    CFloat ->                               -- to_x : TBasicType TFloat
    CFloat ->                               -- to_y : TBasicType TFloat
    IO ()

-- | Perform a \"move-to\" draw operation.
-- 
-- /Since: 4.0.0/
drawMoveTo ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> Ptr ()
    -- ^ /@drawData@/: associated draw data passed by the caller
    -> HarfBuzz.DrawStateT.DrawStateT
    -- ^ /@st@/: current draw state
    -> Float
    -- ^ /@toX@/: X component of target point
    -> Float
    -- ^ /@toY@/: Y component of target point
    -> m ()
drawMoveTo :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT -> Ptr () -> DrawStateT -> Float -> Float -> m ()
drawMoveTo DrawFuncsT
dfuncs Ptr ()
drawData DrawStateT
st Float
toX Float
toY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr DrawStateT
st' <- DrawStateT -> IO (Ptr DrawStateT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawStateT
st
    let toX' :: CFloat
toX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toX
    let toY' :: CFloat
toY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toY
    Ptr DrawFuncsT
-> Ptr () -> Ptr DrawStateT -> CFloat -> CFloat -> IO ()
hb_draw_move_to Ptr DrawFuncsT
dfuncs' Ptr ()
drawData Ptr DrawStateT
st' CFloat
toX' CFloat
toY'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    DrawStateT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawStateT
st
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function draw_line_to
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "associated draw data passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "st"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "current draw state" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_line_to" hb_draw_line_to :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    Ptr () ->                               -- draw_data : TBasicType TPtr
    Ptr HarfBuzz.DrawStateT.DrawStateT ->   -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"})
    CFloat ->                               -- to_x : TBasicType TFloat
    CFloat ->                               -- to_y : TBasicType TFloat
    IO ()

-- | Perform a \"line-to\" draw operation.
-- 
-- /Since: 4.0.0/
drawLineTo ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> Ptr ()
    -- ^ /@drawData@/: associated draw data passed by the caller
    -> HarfBuzz.DrawStateT.DrawStateT
    -- ^ /@st@/: current draw state
    -> Float
    -- ^ /@toX@/: X component of target point
    -> Float
    -- ^ /@toY@/: Y component of target point
    -> m ()
drawLineTo :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT -> Ptr () -> DrawStateT -> Float -> Float -> m ()
drawLineTo DrawFuncsT
dfuncs Ptr ()
drawData DrawStateT
st Float
toX Float
toY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr DrawStateT
st' <- DrawStateT -> IO (Ptr DrawStateT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawStateT
st
    let toX' :: CFloat
toX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toX
    let toY' :: CFloat
toY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toY
    Ptr DrawFuncsT
-> Ptr () -> Ptr DrawStateT -> CFloat -> CFloat -> IO ()
hb_draw_line_to Ptr DrawFuncsT
dfuncs' Ptr ()
drawData Ptr DrawStateT
st' CFloat
toX' CFloat
toY'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    DrawStateT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawStateT
st
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function draw_funcs_set_quadratic_to_func
-- XXX Could not generate function draw_funcs_set_quadratic_to_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function draw_funcs_set_move_to_func
-- XXX Could not generate function draw_funcs_set_move_to_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function draw_funcs_set_line_to_func
-- XXX Could not generate function draw_funcs_set_line_to_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function draw_funcs_set_cubic_to_func
-- XXX Could not generate function draw_funcs_set_cubic_to_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function draw_funcs_set_close_path_func
-- XXX Could not generate function draw_funcs_set_close_path_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function draw_funcs_make_immutable
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_funcs_make_immutable" hb_draw_funcs_make_immutable :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    IO ()

-- | Makes /@dfuncs@/ object immutable.
-- 
-- /Since: 4.0.0/
drawFuncsMakeImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> m ()
drawFuncsMakeImmutable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT -> m ()
drawFuncsMakeImmutable DrawFuncsT
dfuncs = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr DrawFuncsT -> IO ()
hb_draw_funcs_make_immutable Ptr DrawFuncsT
dfuncs'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function draw_funcs_is_immutable
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_funcs_is_immutable" hb_draw_funcs_is_immutable :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    IO Int32

-- | Checks whether /@dfuncs@/ is immutable.
-- 
-- /Since: 4.0.0/
drawFuncsIsImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@dfuncs@/ is immutable, @/false/@ otherwise
drawFuncsIsImmutable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT -> m Int32
drawFuncsIsImmutable DrawFuncsT
dfuncs = 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 DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Int32
result <- Ptr DrawFuncsT -> IO Int32
hb_draw_funcs_is_immutable Ptr DrawFuncsT
dfuncs'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function draw_funcs_create
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "draw_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_funcs_create" hb_draw_funcs_create :: 
    IO (Ptr HarfBuzz.DrawFuncsT.DrawFuncsT)

-- | Creates a new draw callbacks object.
-- 
-- /Since: 4.0.0/
drawFuncsCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ __Returns:__ 
    -- A newly allocated t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' with a reference count of 1. The initial
    -- reference count should be released with hb_draw_funcs_destroy when you are
    -- done using the t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT'. This function never returns 'P.Nothing'. If
    -- memory cannot be allocated, a special singleton t'GI.HarfBuzz.Structs.DrawFuncsT.DrawFuncsT' object will
    -- be returned.
drawFuncsCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m DrawFuncsT
drawFuncsCreate  = IO DrawFuncsT -> m DrawFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DrawFuncsT -> m DrawFuncsT) -> IO DrawFuncsT -> m DrawFuncsT
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
result <- IO (Ptr DrawFuncsT)
hb_draw_funcs_create
    Text -> Ptr DrawFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"drawFuncsCreate" Ptr DrawFuncsT
result
    DrawFuncsT
result' <- ((ManagedPtr DrawFuncsT -> DrawFuncsT)
-> Ptr DrawFuncsT -> IO DrawFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DrawFuncsT -> DrawFuncsT
HarfBuzz.DrawFuncsT.DrawFuncsT) Ptr DrawFuncsT
result
    DrawFuncsT -> IO DrawFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return DrawFuncsT
result'


-- function draw_cubic_to
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "associated draw data passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "st"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "current draw state" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "control1_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of first control point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "control1_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of first control point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "control2_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of second control point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "control2_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of second control point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_x"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "X component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "to_y"
--           , argType = TBasicType TFloat
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Y component of target point"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_cubic_to" hb_draw_cubic_to :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    Ptr () ->                               -- draw_data : TBasicType TPtr
    Ptr HarfBuzz.DrawStateT.DrawStateT ->   -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"})
    CFloat ->                               -- control1_x : TBasicType TFloat
    CFloat ->                               -- control1_y : TBasicType TFloat
    CFloat ->                               -- control2_x : TBasicType TFloat
    CFloat ->                               -- control2_y : TBasicType TFloat
    CFloat ->                               -- to_x : TBasicType TFloat
    CFloat ->                               -- to_y : TBasicType TFloat
    IO ()

-- | Perform a \"cubic-to\" draw operation.
-- 
-- /Since: 4.0.0/
drawCubicTo ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> Ptr ()
    -- ^ /@drawData@/: associated draw data passed by the caller
    -> HarfBuzz.DrawStateT.DrawStateT
    -- ^ /@st@/: current draw state
    -> Float
    -- ^ /@control1X@/: X component of first control point
    -> Float
    -- ^ /@control1Y@/: Y component of first control point
    -> Float
    -- ^ /@control2X@/: X component of second control point
    -> Float
    -- ^ /@control2Y@/: Y component of second control point
    -> Float
    -- ^ /@toX@/: X component of target point
    -> Float
    -- ^ /@toY@/: Y component of target point
    -> m ()
drawCubicTo :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT
-> Ptr ()
-> DrawStateT
-> Float
-> Float
-> Float
-> Float
-> Float
-> Float
-> m ()
drawCubicTo DrawFuncsT
dfuncs Ptr ()
drawData DrawStateT
st Float
control1X Float
control1Y Float
control2X Float
control2Y Float
toX Float
toY = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr DrawStateT
st' <- DrawStateT -> IO (Ptr DrawStateT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawStateT
st
    let control1X' :: CFloat
control1X' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
control1X
    let control1Y' :: CFloat
control1Y' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
control1Y
    let control2X' :: CFloat
control2X' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
control2X
    let control2Y' :: CFloat
control2Y' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
control2Y
    let toX' :: CFloat
toX' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toX
    let toY' :: CFloat
toY' = Float -> CFloat
forall a b. (Real a, Fractional b) => a -> b
realToFrac Float
toY
    Ptr DrawFuncsT
-> Ptr ()
-> Ptr DrawStateT
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> CFloat
-> IO ()
hb_draw_cubic_to Ptr DrawFuncsT
dfuncs' Ptr ()
drawData Ptr DrawStateT
st' CFloat
control1X' CFloat
control1Y' CFloat
control2X' CFloat
control2Y' CFloat
toX' CFloat
toY'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    DrawStateT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawStateT
st
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function draw_close_path
-- Args: [ Arg
--           { argCName = "dfuncs"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "draw functions" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "draw_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "associated draw data passed by the caller"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "st"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "draw_state_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "current draw state" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_draw_close_path" hb_draw_close_path :: 
    Ptr HarfBuzz.DrawFuncsT.DrawFuncsT ->   -- dfuncs : TInterface (Name {namespace = "HarfBuzz", name = "draw_funcs_t"})
    Ptr () ->                               -- draw_data : TBasicType TPtr
    Ptr HarfBuzz.DrawStateT.DrawStateT ->   -- st : TInterface (Name {namespace = "HarfBuzz", name = "draw_state_t"})
    IO ()

-- | Perform a \"close-path\" draw operation.
-- 
-- /Since: 4.0.0/
drawClosePath ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.DrawFuncsT.DrawFuncsT
    -- ^ /@dfuncs@/: draw functions
    -> Ptr ()
    -- ^ /@drawData@/: associated draw data passed by the caller
    -> HarfBuzz.DrawStateT.DrawStateT
    -- ^ /@st@/: current draw state
    -> m ()
drawClosePath :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DrawFuncsT -> Ptr () -> DrawStateT -> m ()
drawClosePath DrawFuncsT
dfuncs Ptr ()
drawData DrawStateT
st = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DrawFuncsT
dfuncs' <- DrawFuncsT -> IO (Ptr DrawFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawFuncsT
dfuncs
    Ptr DrawStateT
st' <- DrawStateT -> IO (Ptr DrawStateT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DrawStateT
st
    Ptr DrawFuncsT -> Ptr () -> Ptr DrawStateT -> IO ()
hb_draw_close_path Ptr DrawFuncsT
dfuncs' Ptr ()
drawData Ptr DrawStateT
st'
    DrawFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawFuncsT
dfuncs
    DrawStateT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DrawStateT
st
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function direction_to_string
-- Args: [ Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #hb_direction_t to convert"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_direction_to_string" hb_direction_to_string :: 
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    IO CString

-- | Converts an t'GI.HarfBuzz.Enums.DirectionT' to a string.
-- 
-- /Since: 0.9.2/
directionToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: The t'GI.HarfBuzz.Enums.DirectionT' to convert
    -> m T.Text
    -- ^ __Returns:__ The string corresponding to /@direction@/
directionToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
DirectionT -> m Text
directionToString DirectionT
direction = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    CString
result <- CUInt -> IO CString
hb_direction_to_string CUInt
direction'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"directionToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function direction_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "String to convert" , 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 "Length of @str, or -1 if it is %NULL-terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "Length of @str, or -1 if it is %NULL-terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "direction_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_direction_from_string" hb_direction_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    IO CUInt

-- | Converts a string to an t'GI.HarfBuzz.Enums.DirectionT'.
-- 
-- Matching is loose and applies only to the first letter. For
-- examples, \"LTR\" and \"left-to-right\" will both return @/HB_DIRECTION_LTR/@.
-- 
-- Unmatched strings will return @/HB_DIRECTION_INVALID/@.
-- 
-- /Since: 0.9.2/
directionFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: String to convert
    -> m HarfBuzz.Enums.DirectionT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.DirectionT' matching /@str@/
directionFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m DirectionT
directionFromString ByteString
str = IO DirectionT -> m DirectionT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DirectionT -> m DirectionT) -> IO DirectionT -> m DirectionT
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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    CUInt
result <- Ptr Word8 -> Int32 -> IO CUInt
hb_direction_from_string Ptr Word8
str' Int32
len
    let result' :: DirectionT
result' = (Int -> DirectionT
forall a. Enum a => Int -> a
toEnum (Int -> DirectionT) -> (CUInt -> Int) -> CUInt -> DirectionT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    DirectionT -> IO DirectionT
forall (m :: * -> *) a. Monad m => a -> m a
return DirectionT
result'


-- function color_get_red
-- Args: [ Arg
--           { argCName = "color"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an #hb_color_t we are interested in its channels."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_color_get_red" hb_color_get_red :: 
    Word32 ->                               -- color : TBasicType TUInt32
    IO Word8

-- | Fetches the red channel of the given /@color@/.
-- 
-- /Since: 2.1.0/
colorGetRed ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels.
    -> m Word8
    -- ^ __Returns:__ Red channel value
colorGetRed :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m Word8
colorGetRed Word32
color = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
    Word8
result <- Word32 -> IO Word8
hb_color_get_red Word32
color
    Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
result


-- function color_get_green
-- Args: [ Arg
--           { argCName = "color"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an #hb_color_t we are interested in its channels."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_color_get_green" hb_color_get_green :: 
    Word32 ->                               -- color : TBasicType TUInt32
    IO Word8

-- | Fetches the green channel of the given /@color@/.
-- 
-- /Since: 2.1.0/
colorGetGreen ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels.
    -> m Word8
    -- ^ __Returns:__ Green channel value
colorGetGreen :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m Word8
colorGetGreen Word32
color = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
    Word8
result <- Word32 -> IO Word8
hb_color_get_green Word32
color
    Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
result


-- function color_get_blue
-- Args: [ Arg
--           { argCName = "color"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an #hb_color_t we are interested in its channels."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_color_get_blue" hb_color_get_blue :: 
    Word32 ->                               -- color : TBasicType TUInt32
    IO Word8

-- | Fetches the blue channel of the given /@color@/.
-- 
-- /Since: 2.1.0/
colorGetBlue ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels.
    -> m Word8
    -- ^ __Returns:__ Blue channel value
colorGetBlue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m Word8
colorGetBlue Word32
color = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
    Word8
result <- Word32 -> IO Word8
hb_color_get_blue Word32
color
    Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
result


-- function color_get_alpha
-- Args: [ Arg
--           { argCName = "color"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an #hb_color_t we are interested in its channels."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_color_get_alpha" hb_color_get_alpha :: 
    Word32 ->                               -- color : TBasicType TUInt32
    IO Word8

-- | Fetches the alpha channel of the given /@color@/.
-- 
-- /Since: 2.1.0/
colorGetAlpha ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@color@/: an @/hb_color_t/@ we are interested in its channels.
    -> m Word8
    -- ^ __Returns:__ Alpha channel value
colorGetAlpha :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> m Word8
colorGetAlpha Word32
color = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
    Word8
result <- Word32 -> IO Word8
hb_color_get_alpha Word32
color
    Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
result


-- function buffer_set_unicode_funcs
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "unicode_funcs"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The Unicode-functions structure"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_unicode_funcs" hb_buffer_set_unicode_funcs :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT -> -- unicode_funcs : TInterface (Name {namespace = "HarfBuzz", name = "unicode_funcs_t"})
    IO ()

-- | Sets the Unicode-functions structure of a buffer to
-- /@unicodeFuncs@/.
-- 
-- /Since: 0.9.2/
bufferSetUnicodeFuncs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ /@unicodeFuncs@/: The Unicode-functions structure
    -> m ()
bufferSetUnicodeFuncs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> UnicodeFuncsT -> m ()
bufferSetUnicodeFuncs BufferT
buffer UnicodeFuncsT
unicodeFuncs = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr UnicodeFuncsT
unicodeFuncs' <- UnicodeFuncsT -> IO (Ptr UnicodeFuncsT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr UnicodeFuncsT
unicodeFuncs
    Ptr BufferT -> Ptr UnicodeFuncsT -> IO ()
hb_buffer_set_unicode_funcs Ptr BufferT
buffer' Ptr UnicodeFuncsT
unicodeFuncs'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    UnicodeFuncsT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr UnicodeFuncsT
unicodeFuncs
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_segment_properties
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_segment_properties_t to use"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_segment_properties" hb_buffer_set_segment_properties :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    IO ()

-- | Sets the segment properties of the buffer, a shortcut for calling
-- 'GI.HarfBuzz.Functions.bufferSetDirection', 'GI.HarfBuzz.Functions.bufferSetScript' and
-- 'GI.HarfBuzz.Functions.bufferSetLanguage' individually.
-- 
-- /Since: 0.9.7/
bufferSetSegmentProperties ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.SegmentPropertiesT.SegmentPropertiesT
    -- ^ /@props@/: An t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' to use
    -> m ()
bufferSetSegmentProperties :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> SegmentPropertiesT -> m ()
bufferSetSegmentProperties BufferT
buffer SegmentPropertiesT
props = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr SegmentPropertiesT
props' <- SegmentPropertiesT -> IO (Ptr SegmentPropertiesT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr SegmentPropertiesT
props
    Ptr BufferT -> Ptr SegmentPropertiesT -> IO ()
hb_buffer_set_segment_properties Ptr BufferT
buffer' Ptr SegmentPropertiesT
props'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    SegmentPropertiesT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr SegmentPropertiesT
props
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_script
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "script"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "script_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_script_t to set."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_script" hb_buffer_set_script :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    CUInt ->                                -- script : TInterface (Name {namespace = "HarfBuzz", name = "script_t"})
    IO ()

-- | Sets the script of /@buffer@/ to /@script@/.
-- 
-- Script is crucial for choosing the proper shaping behaviour for scripts that
-- require it (e.g. Arabic) and the which OpenType features defined in the font
-- to be applied.
-- 
-- You can pass one of the predefined t'GI.HarfBuzz.Enums.ScriptT' values, or use
-- 'GI.HarfBuzz.Functions.scriptFromString' or 'GI.HarfBuzz.Functions.scriptFromIso15924Tag' to get the
-- corresponding script from an ISO 15924 script tag.
-- 
-- /Since: 0.9.2/
bufferSetScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.Enums.ScriptT
    -- ^ /@script@/: An t'GI.HarfBuzz.Enums.ScriptT' to set.
    -> m ()
bufferSetScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> ScriptT -> m ()
bufferSetScript BufferT
buffer ScriptT
script = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    let script' :: CUInt
script' = (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
script
    Ptr BufferT -> CUInt -> IO ()
hb_buffer_set_script Ptr BufferT
buffer' CUInt
script'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_replacement_codepoint
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "replacement"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the replacement #hb_codepoint_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_replacement_codepoint" hb_buffer_set_replacement_codepoint :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- replacement : TBasicType TUInt32
    IO ()

-- | Sets the @/hb_codepoint_t/@ that replaces invalid entries for a given encoding
-- when adding text to /@buffer@/.
-- 
-- Default is 'GI.HarfBuzz.Constants.BUFFER_REPLACEMENT_CODEPOINT_DEFAULT'.
-- 
-- /Since: 0.9.31/
bufferSetReplacementCodepoint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@replacement@/: the replacement @/hb_codepoint_t/@
    -> m ()
bufferSetReplacementCodepoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> m ()
bufferSetReplacementCodepoint BufferT
buffer Word32
replacement = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> Word32 -> IO ()
hb_buffer_set_replacement_codepoint Ptr BufferT
buffer' Word32
replacement
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_not_found_glyph
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "not_found"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the not-found #hb_codepoint_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_not_found_glyph" hb_buffer_set_not_found_glyph :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- not_found : TBasicType TUInt32
    IO ()

-- | Sets the @/hb_codepoint_t/@ that replaces characters not found in
-- the font during shaping.
-- 
-- The not-found glyph defaults to zero, sometimes knows as the
-- \".notdef\" glyph.  This API allows for differentiating the two.
-- 
-- /Since: 3.1.0/
bufferSetNotFoundGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@notFound@/: the not-found @/hb_codepoint_t/@
    -> m ()
bufferSetNotFoundGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> m ()
bufferSetNotFoundGlyph BufferT
buffer Word32
notFound = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> Word32 -> IO ()
hb_buffer_set_not_found_glyph Ptr BufferT
buffer' Word32
notFound
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_message_func
-- XXX Could not generate function buffer_set_message_func

-- Not implemented: Unknown destroy type: TInterface (Name {namespace = "HarfBuzz", name = "destroy_func_t"})

-- function buffer_set_length
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The new length of @buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_length" hb_buffer_set_length :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- length : TBasicType TUInt
    IO Int32

-- | Similar to 'GI.HarfBuzz.Functions.bufferPreAllocate', but clears any new items added at the
-- end.
-- 
-- /Since: 0.9.2/
bufferSetLength ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@length@/: The new length of /@buffer@/
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@buffer@/ memory allocation succeeded, @/false/@ otherwise.
bufferSetLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> m Int32
bufferSetLength BufferT
buffer Word32
length_ = 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
    Int32
result <- Ptr BufferT -> Word32 -> IO Int32
hb_buffer_set_length Ptr BufferT
buffer' Word32
length_
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function buffer_set_language
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "language_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An hb_language_t to set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_language" hb_buffer_set_language :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.LanguageT.LanguageT ->     -- language : TInterface (Name {namespace = "HarfBuzz", name = "language_t"})
    IO ()

-- | Sets the language of /@buffer@/ to /@language@/.
-- 
-- Languages are crucial for selecting which OpenType feature to apply to the
-- buffer which can result in applying language-specific behaviour. Languages
-- are orthogonal to the scripts, and though they are related, they are
-- different concepts and should not be confused with each other.
-- 
-- Use 'GI.HarfBuzz.Functions.languageFromString' to convert from BCP 47 language tags to
-- t'GI.HarfBuzz.Structs.LanguageT.LanguageT'.
-- 
-- /Since: 0.9.2/
bufferSetLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.LanguageT.LanguageT
    -- ^ /@language@/: An hb_language_t to set
    -> m ()
bufferSetLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> LanguageT -> m ()
bufferSetLanguage BufferT
buffer LanguageT
language = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr LanguageT
language' <- LanguageT -> IO (Ptr LanguageT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr LanguageT
language
    Ptr BufferT -> Ptr LanguageT -> IO ()
hb_buffer_set_language Ptr BufferT
buffer' Ptr LanguageT
language'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    LanguageT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr LanguageT
language
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_invisible_glyph
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "invisible"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the invisible #hb_codepoint_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_invisible_glyph" hb_buffer_set_invisible_glyph :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- invisible : TBasicType TUInt32
    IO ()

-- | Sets the @/hb_codepoint_t/@ that replaces invisible characters in
-- the shaping result.  If set to zero (default), the glyph for the
-- U+0020 SPACE character is used.  Otherwise, this value is used
-- verbatim.
-- 
-- /Since: 2.0.0/
bufferSetInvisibleGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@invisible@/: the invisible @/hb_codepoint_t/@
    -> m ()
bufferSetInvisibleGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> m ()
bufferSetInvisibleGlyph BufferT
buffer Word32
invisible = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> Word32 -> IO ()
hb_buffer_set_invisible_glyph Ptr BufferT
buffer' Word32
invisible
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_flags
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "buffer_flags_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The buffer flags to set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_flags" hb_buffer_set_flags :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_flags_t"})
    IO ()

-- | Sets /@buffer@/ flags to /@flags@/. See t'GI.HarfBuzz.Flags.BufferFlagsT'.
-- 
-- /Since: 0.9.7/
bufferSetFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> [HarfBuzz.Flags.BufferFlagsT]
    -- ^ /@flags@/: The buffer flags to set
    -> m ()
bufferSetFlags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> [BufferFlagsT] -> m ()
bufferSetFlags BufferT
buffer [BufferFlagsT]
flags = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    let flags' :: CUInt
flags' = [BufferFlagsT] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [BufferFlagsT]
flags
    Ptr BufferT -> CUInt -> IO ()
hb_buffer_set_flags Ptr BufferT
buffer' CUInt
flags'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_direction
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "direction"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "direction_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #hb_direction_t of the @buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_direction" hb_buffer_set_direction :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    CUInt ->                                -- direction : TInterface (Name {namespace = "HarfBuzz", name = "direction_t"})
    IO ()

-- | Set the text flow direction of the buffer. No shaping can happen without
-- setting /@buffer@/ direction, and it controls the visual direction for the
-- output glyphs; for RTL direction the glyphs will be reversed. Many layout
-- features depend on the proper setting of the direction, for example,
-- reversing RTL text before shaping, then shaping with LTR direction is not
-- the same as keeping the text in logical order and shaping with RTL
-- direction.
-- 
-- /Since: 0.9.2/
bufferSetDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.Enums.DirectionT
    -- ^ /@direction@/: the t'GI.HarfBuzz.Enums.DirectionT' of the /@buffer@/
    -> m ()
bufferSetDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> DirectionT -> m ()
bufferSetDirection BufferT
buffer DirectionT
direction = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    let direction' :: CUInt
direction' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DirectionT -> Int) -> DirectionT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DirectionT -> Int
forall a. Enum a => a -> Int
fromEnum) DirectionT
direction
    Ptr BufferT -> CUInt -> IO ()
hb_buffer_set_direction Ptr BufferT
buffer' CUInt
direction'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_content_type
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "content_type"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "buffer_content_type_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The type of buffer contents to set"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_content_type" hb_buffer_set_content_type :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    CUInt ->                                -- content_type : TInterface (Name {namespace = "HarfBuzz", name = "buffer_content_type_t"})
    IO ()

-- | Sets the type of /@buffer@/ contents. Buffers are either empty, contain
-- characters (before shaping), or contain glyphs (the result of shaping).
-- 
-- /Since: 0.9.5/
bufferSetContentType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.Enums.BufferContentTypeT
    -- ^ /@contentType@/: The type of buffer contents to set
    -> m ()
bufferSetContentType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> BufferContentTypeT -> m ()
bufferSetContentType BufferT
buffer BufferContentTypeT
contentType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    let contentType' :: CUInt
contentType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferContentTypeT -> Int) -> BufferContentTypeT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferContentTypeT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferContentTypeT
contentType
    Ptr BufferT -> CUInt -> IO ()
hb_buffer_set_content_type Ptr BufferT
buffer' CUInt
contentType'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_set_cluster_level
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cluster_level"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "buffer_cluster_level_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The cluster level to set on the buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_set_cluster_level" hb_buffer_set_cluster_level :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    CUInt ->                                -- cluster_level : TInterface (Name {namespace = "HarfBuzz", name = "buffer_cluster_level_t"})
    IO ()

-- | Sets the cluster level of a buffer. The t'GI.HarfBuzz.Enums.BufferClusterLevelT'
-- dictates one aspect of how HarfBuzz will treat non-base characters
-- during shaping.
-- 
-- /Since: 0.9.42/
bufferSetClusterLevel ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.Enums.BufferClusterLevelT
    -- ^ /@clusterLevel@/: The cluster level to set on the buffer
    -> m ()
bufferSetClusterLevel :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> BufferClusterLevelT -> m ()
bufferSetClusterLevel BufferT
buffer BufferClusterLevelT
clusterLevel = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    let clusterLevel' :: CUInt
clusterLevel' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferClusterLevelT -> Int) -> BufferClusterLevelT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferClusterLevelT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferClusterLevelT
clusterLevel
    Ptr BufferT -> CUInt -> IO ()
hb_buffer_set_cluster_level Ptr BufferT
buffer' CUInt
clusterLevel'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_serialize_unicode
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the first item in @buffer to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the last item in @buffer to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "output string to\n      write serialized buffer into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "buf_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the size of @buf." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "buf_consumed"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if not %NULL, will be set to the number of byes written into @buf."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "format"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_buffer_serialize_format_t to use for formatting the output."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "buffer_serialize_flags_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_buffer_serialize_flags_t that control what glyph properties\n        to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "buf_size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the size of @buf." , sinceVersion = Nothing }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_serialize_unicode" hb_buffer_serialize_unicode :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- start : TBasicType TUInt
    Word32 ->                               -- end : TBasicType TUInt
    Ptr (Ptr Word8) ->                      -- buf : TCArray False (-1) 4 (TBasicType TUInt8)
    Ptr Word32 ->                           -- buf_size : TBasicType TUInt
    Ptr Word32 ->                           -- buf_consumed : TBasicType TUInt
    CUInt ->                                -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_flags_t"})
    IO Word32

-- | Serializes /@buffer@/ into a textual representation of its content,
-- when the buffer contains Unicode codepoints (i.e., before shaping). This is
-- useful for showing the contents of the buffer, for example during debugging.
-- There are currently two supported serialization formats:
-- 
-- == text
-- A human-readable, plain text format.
-- The serialized codepoints will look something like:
-- 
-- > <U+0651=0|U+0628=1>
-- 
-- 
-- * Glyphs are separated with @|@
-- * Unicode codepoints are expressed as zero-padded four (or more)
-- digit hexadecimal numbers preceded by @U+@
-- * If @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set, the cluster
-- will be indicated with a @=@ then t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@.
-- 
-- 
-- == json
-- A machine-readable, structured format.
-- The serialized codepoints will be a list of objects with the following
-- properties:
-- 
-- * @u@: the Unicode codepoint as a decimal integer
-- * @cl@: t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@ if
-- @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set.
-- 
-- 
-- For example:
-- 
-- >[{u:1617,cl:0},{u:1576,cl:1}]
-- 
-- 
-- /Since: 2.7.3/
bufferSerializeUnicode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer.
    -> Word32
    -- ^ /@start@/: the first item in /@buffer@/ to serialize.
    -> Word32
    -- ^ /@end@/: the last item in /@buffer@/ to serialize.
    -> HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ /@format@/: the t'GI.HarfBuzz.Enums.BufferSerializeFormatT' to use for formatting the output.
    -> [HarfBuzz.Flags.BufferSerializeFlagsT]
    -- ^ /@flags@/: the t'GI.HarfBuzz.Flags.BufferSerializeFlagsT' that control what glyph properties
    --         to serialize.
    -> m ((Word32, ByteString, Word32))
    -- ^ __Returns:__ The number of serialized items.
bufferSerializeUnicode :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT
-> Word32
-> Word32
-> BufferSerializeFormatT
-> [BufferSerializeFlagsT]
-> m (Word32, ByteString, Word32)
bufferSerializeUnicode BufferT
buffer Word32
start Word32
end BufferSerializeFormatT
format [BufferSerializeFlagsT]
flags = IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32))
-> IO (Word32, ByteString, Word32)
-> m (Word32, ByteString, Word32)
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 (Ptr Word8)
buf <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word8))
    Ptr Word32
bufSize <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
bufConsumed <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferSerializeFormatT -> Int)
-> BufferSerializeFormatT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferSerializeFormatT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferSerializeFormatT
format
    let flags' :: CUInt
flags' = [BufferSerializeFlagsT] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [BufferSerializeFlagsT]
flags
    Word32
result <- Ptr BufferT
-> Word32
-> Word32
-> Ptr (Ptr Word8)
-> Ptr Word32
-> Ptr Word32
-> CUInt
-> CUInt
-> IO Word32
hb_buffer_serialize_unicode Ptr BufferT
buffer' Word32
start Word32
end Ptr (Ptr Word8)
buf Ptr Word32
bufSize Ptr Word32
bufConsumed CUInt
format' CUInt
flags'
    Word32
bufSize' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
bufSize
    Ptr Word8
buf' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
buf
    ByteString
buf'' <- (Word32 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word32
bufSize') Ptr Word8
buf'
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buf'
    Word32
bufConsumed' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
bufConsumed
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
buf
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
bufSize
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
bufConsumed
    (Word32, ByteString, Word32) -> IO (Word32, ByteString, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, ByteString
buf'', Word32
bufConsumed')


-- function buffer_serialize_list_formats
-- Args: []
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_serialize_list_formats" hb_buffer_serialize_list_formats :: 
    IO (Ptr CString)

-- | Returns a list of supported buffer serialization formats.
-- 
-- /Since: 0.9.7/
bufferSerializeListFormats ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [T.Text]
    -- ^ __Returns:__ 
    -- A string array of buffer serialization formats. Should not be freed.
bufferSerializeListFormats :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text]
bufferSerializeListFormats  = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr CString
result <- IO (Ptr CString)
hb_buffer_serialize_list_formats
    Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferSerializeListFormats" Ptr CString
result
    [Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'


-- function buffer_serialize_glyphs
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the first item in @buffer to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the last item in @buffer to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "output string to\n      write serialized buffer into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "buf_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the size of @buf." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "buf_consumed"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if not %NULL, will be set to the number of byes written into @buf."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_font_t used to shape this buffer, needed to\n       read glyph names and extents. If %NULL, and empty font will be used."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "format"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_buffer_serialize_format_t to use for formatting the output."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "buffer_serialize_flags_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_buffer_serialize_flags_t that control what glyph properties\n        to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "buf_size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the size of @buf." , sinceVersion = Nothing }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_serialize_glyphs" hb_buffer_serialize_glyphs :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- start : TBasicType TUInt
    Word32 ->                               -- end : TBasicType TUInt
    Ptr (Ptr Word8) ->                      -- buf : TCArray False (-1) 4 (TBasicType TUInt8)
    Ptr Word32 ->                           -- buf_size : TBasicType TUInt
    Ptr Word32 ->                           -- buf_consumed : TBasicType TUInt
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_flags_t"})
    IO Word32

-- | Serializes /@buffer@/ into a textual representation of its glyph content,
-- useful for showing the contents of the buffer, for example during debugging.
-- There are currently two supported serialization formats:
-- 
-- == text
-- A human-readable, plain text format.
-- The serialized glyphs will look something like:
-- 
-- >[uni0651=0@518,0+0|uni0628=0+1897]
-- 
-- 
-- * The serialized glyphs are delimited with @[@ and @]@.
-- * Glyphs are separated with @|@
-- * Each glyph starts with glyph name, or glyph index if
-- @/HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES/@ flag is set. Then,
-- - If @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set, @=@ then t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@.
-- - If @/HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS/@ is not set, the t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT' in the format:
--   - If both t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/x_offset/@ and t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_offset/@ are not 0, @\@x_offset,y_offset@. Then,
--   - @+x_advance@, then @,y_advance@ if t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_advance/@ is not 0. Then,
-- - If @/HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS/@ is set, the t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT' in the format @\<x_bearing,y_bearing,width,height>@
-- 
-- 
-- == json
-- A machine-readable, structured format.
-- The serialized glyphs will look something like:
-- 
-- >[{"g":"uni0651","cl":0,"dx":518,"dy":0,"ax":0,"ay":0},
-- >{"g":"uni0628","cl":0,"dx":0,"dy":0,"ax":1897,"ay":0}]
-- 
-- 
-- Each glyph is a JSON object, with the following properties:
-- 
-- * @g@: the glyph name or glyph index if
-- @/HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES/@ flag is set.
-- * @cl@: t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@ if
-- @/HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS/@ is not set.
-- * @dx@,@dy@,@ax@,@ay@: t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/x_offset/@, t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_offset/@,
--  t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/x_advance/@ and t'GI.HarfBuzz.Structs.GlyphPositionT.GlyphPositionT'.@/y_advance/@
--  respectively, if @/HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS/@ is not set.
-- * @xb@,@yb@,@w@,@h@: t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/x_bearing/@, t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/y_bearing/@,
--  t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/width/@ and t'GI.HarfBuzz.Structs.GlyphExtentsT.GlyphExtentsT'.@/height/@ respectively if
--  @/HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS/@ is set.
-- 
-- 
-- /Since: 0.9.7/
bufferSerializeGlyphs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer.
    -> Word32
    -- ^ /@start@/: the first item in /@buffer@/ to serialize.
    -> Word32
    -- ^ /@end@/: the last item in /@buffer@/ to serialize.
    -> Maybe (HarfBuzz.FontT.FontT)
    -- ^ /@font@/: the t'GI.HarfBuzz.Structs.FontT.FontT' used to shape this buffer, needed to
    --        read glyph names and extents. If 'P.Nothing', and empty font will be used.
    -> HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ /@format@/: the t'GI.HarfBuzz.Enums.BufferSerializeFormatT' to use for formatting the output.
    -> [HarfBuzz.Flags.BufferSerializeFlagsT]
    -- ^ /@flags@/: the t'GI.HarfBuzz.Flags.BufferSerializeFlagsT' that control what glyph properties
    --         to serialize.
    -> m ((Word32, ByteString, Word32))
    -- ^ __Returns:__ The number of serialized items.
bufferSerializeGlyphs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT
-> Word32
-> Word32
-> Maybe FontT
-> BufferSerializeFormatT
-> [BufferSerializeFlagsT]
-> m (Word32, ByteString, Word32)
bufferSerializeGlyphs BufferT
buffer Word32
start Word32
end Maybe FontT
font BufferSerializeFormatT
format [BufferSerializeFlagsT]
flags = IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32))
-> IO (Word32, ByteString, Word32)
-> m (Word32, ByteString, Word32)
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 (Ptr Word8)
buf <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word8))
    Ptr Word32
bufSize <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
bufConsumed <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr FontT
maybeFont <- case Maybe FontT
font of
        Maybe FontT
Nothing -> Ptr FontT -> IO (Ptr FontT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontT
forall a. Ptr a
nullPtr
        Just FontT
jFont -> do
            Ptr FontT
jFont' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
jFont
            Ptr FontT -> IO (Ptr FontT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontT
jFont'
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferSerializeFormatT -> Int)
-> BufferSerializeFormatT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferSerializeFormatT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferSerializeFormatT
format
    let flags' :: CUInt
flags' = [BufferSerializeFlagsT] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [BufferSerializeFlagsT]
flags
    Word32
result <- Ptr BufferT
-> Word32
-> Word32
-> Ptr (Ptr Word8)
-> Ptr Word32
-> Ptr Word32
-> Ptr FontT
-> CUInt
-> CUInt
-> IO Word32
hb_buffer_serialize_glyphs Ptr BufferT
buffer' Word32
start Word32
end Ptr (Ptr Word8)
buf Ptr Word32
bufSize Ptr Word32
bufConsumed Ptr FontT
maybeFont CUInt
format' CUInt
flags'
    Word32
bufSize' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
bufSize
    Ptr Word8
buf' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
buf
    ByteString
buf'' <- (Word32 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word32
bufSize') Ptr Word8
buf'
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buf'
    Word32
bufConsumed' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
bufConsumed
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Maybe FontT -> (FontT -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontT
font FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
buf
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
bufSize
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
bufConsumed
    (Word32, ByteString, Word32) -> IO (Word32, ByteString, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, ByteString
buf'', Word32
bufConsumed')


-- function buffer_serialize_format_to_string
-- Args: [ Arg
--           { argCName = "format"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_serialize_format_t to convert."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_serialize_format_to_string" hb_buffer_serialize_format_to_string :: 
    CUInt ->                                -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"})
    IO CString

-- | Converts /@format@/ to the string corresponding it, or 'P.Nothing' if it is not a valid
-- t'GI.HarfBuzz.Enums.BufferSerializeFormatT'.
-- 
-- /Since: 0.9.7/
bufferSerializeFormatToString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ /@format@/: an t'GI.HarfBuzz.Enums.BufferSerializeFormatT' to convert.
    -> m T.Text
    -- ^ __Returns:__ 
    -- A 'P.Nothing' terminated string corresponding to /@format@/. Should not be freed.
bufferSerializeFormatToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferSerializeFormatT -> m Text
bufferSerializeFormatToString BufferSerializeFormatT
format = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferSerializeFormatT -> Int)
-> BufferSerializeFormatT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferSerializeFormatT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferSerializeFormatT
format
    CString
result <- CUInt -> IO CString
hb_buffer_serialize_format_to_string CUInt
format'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferSerializeFormatToString" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'


-- function buffer_serialize_format_from_string
-- Args: [ Arg
--           { argCName = "str"
--           , argType = TCArray False (-1) 1 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a string to parse" , 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 "length of @str, or -1 if string is %NULL terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "length of @str, or -1 if string is %NULL terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just
--               (TInterface
--                  Name
--                    { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_serialize_format_from_string" hb_buffer_serialize_format_from_string :: 
    Ptr Word8 ->                            -- str : TCArray False (-1) 1 (TBasicType TUInt8)
    Int32 ->                                -- len : TBasicType TInt
    IO CUInt

-- | Parses a string into an t'GI.HarfBuzz.Enums.BufferSerializeFormatT'. Does not check if
-- /@str@/ is a valid buffer serialization format, use
-- 'GI.HarfBuzz.Functions.bufferSerializeListFormats' to get the list of supported formats.
-- 
-- /Since: 0.9.7/
bufferSerializeFormatFromString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    ByteString
    -- ^ /@str@/: a string to parse
    -> m HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ __Returns:__ The parsed t'GI.HarfBuzz.Enums.BufferSerializeFormatT'.
bufferSerializeFormatFromString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ByteString -> m BufferSerializeFormatT
bufferSerializeFormatFromString ByteString
str = IO BufferSerializeFormatT -> m BufferSerializeFormatT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferSerializeFormatT -> m BufferSerializeFormatT)
-> IO BufferSerializeFormatT -> m BufferSerializeFormatT
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
$ ByteString -> Int
B.length ByteString
str
    Ptr Word8
str' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
str
    CUInt
result <- Ptr Word8 -> Int32 -> IO CUInt
hb_buffer_serialize_format_from_string Ptr Word8
str' Int32
len
    let result' :: BufferSerializeFormatT
result' = (Int -> BufferSerializeFormatT
forall a. Enum a => Int -> a
toEnum (Int -> BufferSerializeFormatT)
-> (CUInt -> Int) -> CUInt -> BufferSerializeFormatT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
str'
    BufferSerializeFormatT -> IO BufferSerializeFormatT
forall (m :: * -> *) a. Monad m => a -> m a
return BufferSerializeFormatT
result'


-- function buffer_serialize
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the first item in @buffer to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the last item in @buffer to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 4 (TBasicType TUInt8)
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "output string to\n      write serialized buffer into."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "buf_size"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the size of @buf." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "buf_consumed"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if not %NULL, will be set to the number of byes written into @buf."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_font_t used to shape this buffer, needed to\n       read glyph names and extents. If %NULL, and empty font will be used."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "format"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_buffer_serialize_format_t to use for formatting the output."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "buffer_serialize_flags_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the #hb_buffer_serialize_flags_t that control what glyph properties\n        to serialize."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "buf_size"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "the size of @buf." , sinceVersion = Nothing }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_serialize" hb_buffer_serialize :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- start : TBasicType TUInt
    Word32 ->                               -- end : TBasicType TUInt
    Ptr (Ptr Word8) ->                      -- buf : TCArray False (-1) 4 (TBasicType TUInt8)
    Ptr Word32 ->                           -- buf_size : TBasicType TUInt
    Ptr Word32 ->                           -- buf_consumed : TBasicType TUInt
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_flags_t"})
    IO Word32

-- | Serializes /@buffer@/ into a textual representation of its content, whether
-- Unicode codepoints or glyph identifiers and positioning information. This is
-- useful for showing the contents of the buffer, for example during debugging.
-- See the documentation of 'GI.HarfBuzz.Functions.bufferSerializeUnicode' and
-- 'GI.HarfBuzz.Functions.bufferSerializeGlyphs' for a description of the output format.
-- 
-- /Since: 2.7.3/
bufferSerialize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer.
    -> Word32
    -- ^ /@start@/: the first item in /@buffer@/ to serialize.
    -> Word32
    -- ^ /@end@/: the last item in /@buffer@/ to serialize.
    -> Maybe (HarfBuzz.FontT.FontT)
    -- ^ /@font@/: the t'GI.HarfBuzz.Structs.FontT.FontT' used to shape this buffer, needed to
    --        read glyph names and extents. If 'P.Nothing', and empty font will be used.
    -> HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ /@format@/: the t'GI.HarfBuzz.Enums.BufferSerializeFormatT' to use for formatting the output.
    -> [HarfBuzz.Flags.BufferSerializeFlagsT]
    -- ^ /@flags@/: the t'GI.HarfBuzz.Flags.BufferSerializeFlagsT' that control what glyph properties
    --         to serialize.
    -> m ((Word32, ByteString, Word32))
    -- ^ __Returns:__ The number of serialized items.
bufferSerialize :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT
-> Word32
-> Word32
-> Maybe FontT
-> BufferSerializeFormatT
-> [BufferSerializeFlagsT]
-> m (Word32, ByteString, Word32)
bufferSerialize BufferT
buffer Word32
start Word32
end Maybe FontT
font BufferSerializeFormatT
format [BufferSerializeFlagsT]
flags = IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, ByteString, Word32) -> m (Word32, ByteString, Word32))
-> IO (Word32, ByteString, Word32)
-> m (Word32, ByteString, Word32)
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 (Ptr Word8)
buf <- IO (Ptr (Ptr Word8))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Word8))
    Ptr Word32
bufSize <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr Word32
bufConsumed <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr FontT
maybeFont <- case Maybe FontT
font of
        Maybe FontT
Nothing -> Ptr FontT -> IO (Ptr FontT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontT
forall a. Ptr a
nullPtr
        Just FontT
jFont -> do
            Ptr FontT
jFont' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
jFont
            Ptr FontT -> IO (Ptr FontT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontT
jFont'
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferSerializeFormatT -> Int)
-> BufferSerializeFormatT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferSerializeFormatT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferSerializeFormatT
format
    let flags' :: CUInt
flags' = [BufferSerializeFlagsT] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [BufferSerializeFlagsT]
flags
    Word32
result <- Ptr BufferT
-> Word32
-> Word32
-> Ptr (Ptr Word8)
-> Ptr Word32
-> Ptr Word32
-> Ptr FontT
-> CUInt
-> CUInt
-> IO Word32
hb_buffer_serialize Ptr BufferT
buffer' Word32
start Word32
end Ptr (Ptr Word8)
buf Ptr Word32
bufSize Ptr Word32
bufConsumed Ptr FontT
maybeFont CUInt
format' CUInt
flags'
    Word32
bufSize' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
bufSize
    Ptr Word8
buf' <- Ptr (Ptr Word8) -> IO (Ptr Word8)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Word8)
buf
    ByteString
buf'' <- (Word32 -> Ptr Word8 -> IO ByteString
forall a. Integral a => a -> Ptr Word8 -> IO ByteString
unpackByteStringWithLength Word32
bufSize') Ptr Word8
buf'
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
buf'
    Word32
bufConsumed' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
bufConsumed
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Maybe FontT -> (FontT -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontT
font FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Ptr (Ptr Word8) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Word8)
buf
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
bufSize
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
bufConsumed
    (Word32, ByteString, Word32) -> IO (Word32, ByteString, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, ByteString
buf'', Word32
bufConsumed')


-- function buffer_reverse_range
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "start index" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "end index" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_reverse_range" hb_buffer_reverse_range :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- start : TBasicType TUInt
    Word32 ->                               -- end : TBasicType TUInt
    IO ()

-- | Reverses buffer contents between /@start@/ and /@end@/.
-- 
-- /Since: 0.9.41/
bufferReverseRange ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@start@/: start index
    -> Word32
    -- ^ /@end@/: end index
    -> m ()
bufferReverseRange :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> Word32 -> m ()
bufferReverseRange BufferT
buffer Word32
start Word32
end = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> Word32 -> Word32 -> IO ()
hb_buffer_reverse_range Ptr BufferT
buffer' Word32
start Word32
end
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_reverse_clusters
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_reverse_clusters" hb_buffer_reverse_clusters :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO ()

-- | Reverses buffer clusters.  That is, the buffer contents are
-- reversed, then each cluster (consecutive items having the
-- same cluster number) are reversed again.
-- 
-- /Since: 0.9.2/
bufferReverseClusters ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m ()
bufferReverseClusters :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m ()
bufferReverseClusters BufferT
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> IO ()
hb_buffer_reverse_clusters Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_reverse
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_reverse" hb_buffer_reverse :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO ()

-- | Reverses buffer contents.
-- 
-- /Since: 0.9.2/
bufferReverse ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m ()
bufferReverse :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m ()
bufferReverse BufferT
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> IO ()
hb_buffer_reverse Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_reset
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_reset" hb_buffer_reset :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO ()

-- | Resets the buffer to its initial status, as if it was just newly created
-- with 'GI.HarfBuzz.Functions.bufferCreate'.
-- 
-- /Since: 0.9.2/
bufferReset ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m ()
bufferReset :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m ()
bufferReset BufferT
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> IO ()
hb_buffer_reset Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_pre_allocate
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Number of items to pre allocate."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_pre_allocate" hb_buffer_pre_allocate :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- size : TBasicType TUInt
    IO Int32

-- | Pre allocates memory for /@buffer@/ to fit at least /@size@/ number of items.
-- 
-- /Since: 0.9.2/
bufferPreAllocate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@size@/: Number of items to pre allocate.
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@buffer@/ memory allocation succeeded, @/false/@ otherwise
bufferPreAllocate :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> m Int32
bufferPreAllocate BufferT
buffer Word32
size = 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
    Int32
result <- Ptr BufferT -> Word32 -> IO Int32
hb_buffer_pre_allocate Ptr BufferT
buffer' Word32
size
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function buffer_normalize_glyphs
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_normalize_glyphs" hb_buffer_normalize_glyphs :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO ()

-- | Reorders a glyph buffer to have canonical in-cluster glyph order \/ position.
-- The resulting clusters should behave identical to pre-reordering clusters.
-- 
-- \<note>This has nothing to do with Unicode normalization.\<\/note>
-- 
-- /Since: 0.9.2/
bufferNormalizeGlyphs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m ()
bufferNormalizeGlyphs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m ()
bufferNormalizeGlyphs BufferT
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> IO ()
hb_buffer_normalize_glyphs Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_has_positions
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_has_positions" hb_buffer_has_positions :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO Int32

-- | Returns whether /@buffer@/ has glyph position data.
-- A buffer gains position data when 'GI.HarfBuzz.Functions.bufferGetGlyphPositions' is called on it,
-- and cleared of position data when 'GI.HarfBuzz.Functions.bufferClearContents' is called.
-- 
-- /Since: 2.7.3/
bufferHasPositions ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT'.
    -> m Int32
    -- ^ __Returns:__ @/true/@ if the /@buffer@/ has position array, @/false/@ otherwise.
bufferHasPositions :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m Int32
bufferHasPositions BufferT
buffer = 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
    Int32
result <- Ptr BufferT -> IO Int32
hb_buffer_has_positions Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function buffer_guess_segment_properties
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_guess_segment_properties" hb_buffer_guess_segment_properties :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO ()

-- | Sets unset buffer segment properties based on buffer Unicode
-- contents.  If buffer is not empty, it must have content type
-- @/HB_BUFFER_CONTENT_TYPE_UNICODE/@.
-- 
-- If buffer script is not set (ie. is @/HB_SCRIPT_INVALID/@), it
-- will be set to the Unicode script of the first character in
-- the buffer that has a script other than @/HB_SCRIPT_COMMON/@,
-- @/HB_SCRIPT_INHERITED/@, and @/HB_SCRIPT_UNKNOWN/@.
-- 
-- Next, if buffer direction is not set (ie. is @/HB_DIRECTION_INVALID/@),
-- it will be set to the natural horizontal direction of the
-- buffer script as returned by 'GI.HarfBuzz.Functions.scriptGetHorizontalDirection'.
-- If 'GI.HarfBuzz.Functions.scriptGetHorizontalDirection' returns @/HB_DIRECTION_INVALID/@,
-- then @/HB_DIRECTION_LTR/@ is used.
-- 
-- Finally, if buffer language is not set (ie. is 'GI.HarfBuzz.Constants.LANGUAGE_INVALID'),
-- it will be set to the process\'s default language as returned by
-- 'GI.HarfBuzz.Functions.languageGetDefault'.  This may change in the future by
-- taking buffer script into consideration when choosing a language.
-- Note that 'GI.HarfBuzz.Functions.languageGetDefault' is NOT threadsafe the first time
-- it is called.  See documentation for that function for details.
-- 
-- /Since: 0.9.7/
bufferGuessSegmentProperties ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m ()
bufferGuessSegmentProperties :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m ()
bufferGuessSegmentProperties BufferT
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> IO ()
hb_buffer_guess_segment_properties Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_get_unicode_funcs
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "unicode_funcs_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_unicode_funcs" hb_buffer_get_unicode_funcs :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO (Ptr HarfBuzz.UnicodeFuncsT.UnicodeFuncsT)

-- | Fetches the Unicode-functions structure of a buffer.
-- 
-- /Since: 0.9.2/
bufferGetUnicodeFuncs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.UnicodeFuncsT.UnicodeFuncsT
    -- ^ __Returns:__ The Unicode-functions structure
bufferGetUnicodeFuncs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m UnicodeFuncsT
bufferGetUnicodeFuncs BufferT
buffer = IO UnicodeFuncsT -> m UnicodeFuncsT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeFuncsT -> m UnicodeFuncsT)
-> IO UnicodeFuncsT -> m UnicodeFuncsT
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 UnicodeFuncsT
result <- Ptr BufferT -> IO (Ptr UnicodeFuncsT)
hb_buffer_get_unicode_funcs Ptr BufferT
buffer'
    Text -> Ptr UnicodeFuncsT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetUnicodeFuncs" Ptr UnicodeFuncsT
result
    UnicodeFuncsT
result' <- ((ManagedPtr UnicodeFuncsT -> UnicodeFuncsT)
-> Ptr UnicodeFuncsT -> IO UnicodeFuncsT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr UnicodeFuncsT -> UnicodeFuncsT
HarfBuzz.UnicodeFuncsT.UnicodeFuncsT) Ptr UnicodeFuncsT
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    UnicodeFuncsT -> IO UnicodeFuncsT
forall (m :: * -> *) a. Monad m => a -> m a
return UnicodeFuncsT
result'


-- function buffer_get_segment_properties
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "props"
--           , argType =
--               TInterface
--                 Name { namespace = "HarfBuzz" , name = "segment_properties_t" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The output #hb_segment_properties_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_segment_properties" hb_buffer_get_segment_properties :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT -> -- props : TInterface (Name {namespace = "HarfBuzz", name = "segment_properties_t"})
    IO ()

-- | Sets /@props@/ to the t'GI.HarfBuzz.Structs.SegmentPropertiesT.SegmentPropertiesT' of /@buffer@/.
-- 
-- /Since: 0.9.7/
bufferGetSegmentProperties ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m (HarfBuzz.SegmentPropertiesT.SegmentPropertiesT)
bufferGetSegmentProperties :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m SegmentPropertiesT
bufferGetSegmentProperties BufferT
buffer = IO SegmentPropertiesT -> m SegmentPropertiesT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SegmentPropertiesT -> m SegmentPropertiesT)
-> IO SegmentPropertiesT -> m SegmentPropertiesT
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 SegmentPropertiesT
props <- Int -> IO (Ptr SegmentPropertiesT)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
32 :: IO (Ptr HarfBuzz.SegmentPropertiesT.SegmentPropertiesT)
    Ptr BufferT -> Ptr SegmentPropertiesT -> IO ()
hb_buffer_get_segment_properties Ptr BufferT
buffer' Ptr SegmentPropertiesT
props
    SegmentPropertiesT
props' <- ((ManagedPtr SegmentPropertiesT -> SegmentPropertiesT)
-> Ptr SegmentPropertiesT -> IO SegmentPropertiesT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SegmentPropertiesT -> SegmentPropertiesT
HarfBuzz.SegmentPropertiesT.SegmentPropertiesT) Ptr SegmentPropertiesT
props
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    SegmentPropertiesT -> IO SegmentPropertiesT
forall (m :: * -> *) a. Monad m => a -> m a
return SegmentPropertiesT
props'


-- function buffer_get_script
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "script_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_script" hb_buffer_get_script :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO CUInt

-- | Fetches the script of /@buffer@/.
-- 
-- /Since: 0.9.2/
bufferGetScript ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.Enums.ScriptT
    -- ^ __Returns:__ The t'GI.HarfBuzz.Enums.ScriptT' of the /@buffer@/
bufferGetScript :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m ScriptT
bufferGetScript BufferT
buffer = 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 BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    CUInt
result <- Ptr BufferT -> IO CUInt
hb_buffer_get_script Ptr BufferT
buffer'
    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
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    ScriptT -> IO ScriptT
forall (m :: * -> *) a. Monad m => a -> m a
return ScriptT
result'


-- function buffer_get_replacement_codepoint
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_replacement_codepoint" hb_buffer_get_replacement_codepoint :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO Word32

-- | Fetches the @/hb_codepoint_t/@ that replaces invalid entries for a given encoding
-- when adding text to /@buffer@/.
-- 
-- /Since: 0.9.31/
bufferGetReplacementCodepoint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m Word32
    -- ^ __Returns:__ The /@buffer@/ replacement @/hb_codepoint_t/@
bufferGetReplacementCodepoint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m Word32
bufferGetReplacementCodepoint BufferT
buffer = 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 BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Word32
result <- Ptr BufferT -> IO Word32
hb_buffer_get_replacement_codepoint Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function buffer_get_not_found_glyph
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_not_found_glyph" hb_buffer_get_not_found_glyph :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO Word32

-- | See 'GI.HarfBuzz.Functions.bufferSetNotFoundGlyph'.
-- 
-- /Since: 3.1.0/
bufferGetNotFoundGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m Word32
    -- ^ __Returns:__ The /@buffer@/ not-found @/hb_codepoint_t/@
bufferGetNotFoundGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m Word32
bufferGetNotFoundGlyph BufferT
buffer = 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 BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Word32
result <- Ptr BufferT -> IO Word32
hb_buffer_get_not_found_glyph Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function buffer_get_length
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_length" hb_buffer_get_length :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO Word32

-- | Returns the number of items in the buffer.
-- 
-- /Since: 0.9.2/
bufferGetLength ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m Word32
    -- ^ __Returns:__ The /@buffer@/ length.
    -- The value valid as long as buffer has not been modified.
bufferGetLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m Word32
bufferGetLength BufferT
buffer = 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 BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Word32
result <- Ptr BufferT -> IO Word32
hb_buffer_get_length Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function buffer_get_language
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "language_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_language" hb_buffer_get_language :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO (Ptr HarfBuzz.LanguageT.LanguageT)

-- | See 'GI.HarfBuzz.Functions.bufferSetLanguage'.
-- 
-- /Since: 0.9.2/
bufferGetLanguage ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.LanguageT.LanguageT
    -- ^ __Returns:__ 
    -- The t'GI.HarfBuzz.Structs.LanguageT.LanguageT' of the buffer. Must not be freed by the caller.
bufferGetLanguage :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m LanguageT
bufferGetLanguage BufferT
buffer = IO LanguageT -> m LanguageT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LanguageT -> m LanguageT) -> IO LanguageT -> m LanguageT
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 LanguageT
result <- Ptr BufferT -> IO (Ptr LanguageT)
hb_buffer_get_language Ptr BufferT
buffer'
    Text -> Ptr LanguageT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetLanguage" Ptr LanguageT
result
    LanguageT
result' <- ((ManagedPtr LanguageT -> LanguageT)
-> Ptr LanguageT -> IO LanguageT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr LanguageT -> LanguageT
HarfBuzz.LanguageT.LanguageT) Ptr LanguageT
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    LanguageT -> IO LanguageT
forall (m :: * -> *) a. Monad m => a -> m a
return LanguageT
result'


-- function buffer_get_invisible_glyph
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_invisible_glyph" hb_buffer_get_invisible_glyph :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO Word32

-- | See 'GI.HarfBuzz.Functions.bufferSetInvisibleGlyph'.
-- 
-- /Since: 2.0.0/
bufferGetInvisibleGlyph ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m Word32
    -- ^ __Returns:__ The /@buffer@/ invisible @/hb_codepoint_t/@
bufferGetInvisibleGlyph :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m Word32
bufferGetInvisibleGlyph BufferT
buffer = 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 BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Word32
result <- Ptr BufferT -> IO Word32
hb_buffer_get_invisible_glyph Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function buffer_get_glyph_positions
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The output length" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "length"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The output length" , sinceVersion = Nothing }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just
--               (TCArray
--                  False
--                  (-1)
--                  1
--                  (TInterface
--                     Name { namespace = "HarfBuzz" , name = "glyph_position_t" }))
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_glyph_positions" hb_buffer_get_glyph_positions :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word32 ->                           -- length : TBasicType TUInt
    IO (Ptr HarfBuzz.GlyphPositionT.GlyphPositionT)

-- | Returns /@buffer@/ glyph position array.  Returned pointer
-- is valid as long as /@buffer@/ contents are not modified.
-- 
-- If buffer did not have positions before, the positions will be
-- initialized to zeros, unless this function is called from
-- within a buffer message callback (see 'GI.HarfBuzz.Functions.bufferSetMessageFunc'),
-- in which case 'P.Nothing' is returned.
-- 
-- /Since: 0.9.2/
bufferGetGlyphPositions ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m [HarfBuzz.GlyphPositionT.GlyphPositionT]
    -- ^ __Returns:__ 
    -- The /@buffer@/ glyph position array.
    -- The value valid as long as buffer has not been modified.
bufferGetGlyphPositions :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m [GlyphPositionT]
bufferGetGlyphPositions BufferT
buffer = IO [GlyphPositionT] -> m [GlyphPositionT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GlyphPositionT] -> m [GlyphPositionT])
-> IO [GlyphPositionT] -> m [GlyphPositionT]
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 Word32
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr GlyphPositionT
result <- Ptr BufferT -> Ptr Word32 -> IO (Ptr GlyphPositionT)
hb_buffer_get_glyph_positions Ptr BufferT
buffer' Ptr Word32
length_
    Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
    Text -> Ptr GlyphPositionT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetGlyphPositions" Ptr GlyphPositionT
result
    [Ptr GlyphPositionT]
result' <- (Int -> Word32 -> Ptr GlyphPositionT -> IO [Ptr GlyphPositionT]
forall a b.
(Integral a, GBoxed b) =>
Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength Int
20 Word32
length_') Ptr GlyphPositionT
result
    [GlyphPositionT]
result'' <- (Ptr GlyphPositionT -> IO GlyphPositionT)
-> [Ptr GlyphPositionT] -> IO [GlyphPositionT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr GlyphPositionT -> GlyphPositionT)
-> Ptr GlyphPositionT -> IO GlyphPositionT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GlyphPositionT -> GlyphPositionT
HarfBuzz.GlyphPositionT.GlyphPositionT) [Ptr GlyphPositionT]
result'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
    [GlyphPositionT] -> IO [GlyphPositionT]
forall (m :: * -> *) a. Monad m => a -> m a
return [GlyphPositionT]
result''


-- function buffer_get_glyph_infos
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The output-array length."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "length"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The output-array length."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just
--               (TCArray
--                  False
--                  (-1)
--                  1
--                  (TInterface
--                     Name { namespace = "HarfBuzz" , name = "glyph_info_t" }))
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_glyph_infos" hb_buffer_get_glyph_infos :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word32 ->                           -- length : TBasicType TUInt
    IO (Ptr HarfBuzz.GlyphInfoT.GlyphInfoT)

-- | Returns /@buffer@/ glyph information array.  Returned pointer
-- is valid as long as /@buffer@/ contents are not modified.
-- 
-- /Since: 0.9.2/
bufferGetGlyphInfos ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m [HarfBuzz.GlyphInfoT.GlyphInfoT]
    -- ^ __Returns:__ 
    -- The /@buffer@/ glyph information array.
    -- The value valid as long as buffer has not been modified.
bufferGetGlyphInfos :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m [GlyphInfoT]
bufferGetGlyphInfos BufferT
buffer = IO [GlyphInfoT] -> m [GlyphInfoT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [GlyphInfoT] -> m [GlyphInfoT])
-> IO [GlyphInfoT] -> m [GlyphInfoT]
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 Word32
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr GlyphInfoT
result <- Ptr BufferT -> Ptr Word32 -> IO (Ptr GlyphInfoT)
hb_buffer_get_glyph_infos Ptr BufferT
buffer' Ptr Word32
length_
    Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
    Text -> Ptr GlyphInfoT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetGlyphInfos" Ptr GlyphInfoT
result
    [Ptr GlyphInfoT]
result' <- (Int -> Word32 -> Ptr GlyphInfoT -> IO [Ptr GlyphInfoT]
forall a b.
(Integral a, GBoxed b) =>
Int -> a -> Ptr b -> IO [Ptr b]
unpackBoxedArrayWithLength Int
20 Word32
length_') Ptr GlyphInfoT
result
    [GlyphInfoT]
result'' <- (Ptr GlyphInfoT -> IO GlyphInfoT)
-> [Ptr GlyphInfoT] -> IO [GlyphInfoT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr GlyphInfoT -> GlyphInfoT)
-> Ptr GlyphInfoT -> IO GlyphInfoT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr GlyphInfoT -> GlyphInfoT
HarfBuzz.GlyphInfoT.GlyphInfoT) [Ptr GlyphInfoT]
result'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
    [GlyphInfoT] -> IO [GlyphInfoT]
forall (m :: * -> *) a. Monad m => a -> m a
return [GlyphInfoT]
result''


-- function buffer_get_flags
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "buffer_flags_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_flags" hb_buffer_get_flags :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO CUInt

-- | Fetches the t'GI.HarfBuzz.Flags.BufferFlagsT' of /@buffer@/.
-- 
-- /Since: 0.9.7/
bufferGetFlags ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m [HarfBuzz.Flags.BufferFlagsT]
    -- ^ __Returns:__ The /@buffer@/ flags
bufferGetFlags :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m [BufferFlagsT]
bufferGetFlags BufferT
buffer = IO [BufferFlagsT] -> m [BufferFlagsT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [BufferFlagsT] -> m [BufferFlagsT])
-> IO [BufferFlagsT] -> m [BufferFlagsT]
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
    CUInt
result <- Ptr BufferT -> IO CUInt
hb_buffer_get_flags Ptr BufferT
buffer'
    let result' :: [BufferFlagsT]
result' = CUInt -> [BufferFlagsT]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    [BufferFlagsT] -> IO [BufferFlagsT]
forall (m :: * -> *) a. Monad m => a -> m a
return [BufferFlagsT]
result'


-- function buffer_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_empty" hb_buffer_get_empty :: 
    IO (Ptr HarfBuzz.BufferT.BufferT)

-- | Fetches an empty t'GI.HarfBuzz.Structs.BufferT.BufferT'.
-- 
-- /Since: 0.9.2/
bufferGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.BufferT.BufferT
    -- ^ __Returns:__ The empty buffer
bufferGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m BufferT
bufferGetEmpty  = IO BufferT -> m BufferT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferT -> m BufferT) -> IO BufferT -> m BufferT
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
result <- IO (Ptr BufferT)
hb_buffer_get_empty
    Text -> Ptr BufferT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetEmpty" Ptr BufferT
result
    BufferT
result' <- ((ManagedPtr BufferT -> BufferT) -> Ptr BufferT -> IO BufferT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BufferT -> BufferT
HarfBuzz.BufferT.BufferT) Ptr BufferT
result
    BufferT -> IO BufferT
forall (m :: * -> *) a. Monad m => a -> m a
return BufferT
result'


-- function buffer_get_direction
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "direction_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_direction" hb_buffer_get_direction :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO CUInt

-- | See 'GI.HarfBuzz.Functions.bufferSetDirection'
-- 
-- /Since: 0.9.2/
bufferGetDirection ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.Enums.DirectionT
    -- ^ __Returns:__ The direction of the /@buffer@/.
bufferGetDirection :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m DirectionT
bufferGetDirection BufferT
buffer = IO DirectionT -> m DirectionT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DirectionT -> m DirectionT) -> IO DirectionT -> m DirectionT
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
    CUInt
result <- Ptr BufferT -> IO CUInt
hb_buffer_get_direction Ptr BufferT
buffer'
    let result' :: DirectionT
result' = (Int -> DirectionT
forall a. Enum a => Int -> a
toEnum (Int -> DirectionT) -> (CUInt -> Int) -> CUInt -> DirectionT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    DirectionT -> IO DirectionT
forall (m :: * -> *) a. Monad m => a -> m a
return DirectionT
result'


-- function buffer_get_content_type
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "buffer_content_type_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_content_type" hb_buffer_get_content_type :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO CUInt

-- | Fetches the type of /@buffer@/ contents. Buffers are either empty, contain
-- characters (before shaping), or contain glyphs (the result of shaping).
-- 
-- /Since: 0.9.5/
bufferGetContentType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.Enums.BufferContentTypeT
    -- ^ __Returns:__ The type of /@buffer@/ contents
bufferGetContentType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m BufferContentTypeT
bufferGetContentType BufferT
buffer = IO BufferContentTypeT -> m BufferContentTypeT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferContentTypeT -> m BufferContentTypeT)
-> IO BufferContentTypeT -> m BufferContentTypeT
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
    CUInt
result <- Ptr BufferT -> IO CUInt
hb_buffer_get_content_type Ptr BufferT
buffer'
    let result' :: BufferContentTypeT
result' = (Int -> BufferContentTypeT
forall a. Enum a => Int -> a
toEnum (Int -> BufferContentTypeT)
-> (CUInt -> Int) -> CUInt -> BufferContentTypeT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    BufferContentTypeT -> IO BufferContentTypeT
forall (m :: * -> *) a. Monad m => a -> m a
return BufferContentTypeT
result'


-- function buffer_get_cluster_level
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "buffer_cluster_level_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_get_cluster_level" hb_buffer_get_cluster_level :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO CUInt

-- | Fetches the cluster level of a buffer. The t'GI.HarfBuzz.Enums.BufferClusterLevelT'
-- dictates one aspect of how HarfBuzz will treat non-base characters
-- during shaping.
-- 
-- /Since: 0.9.42/
bufferGetClusterLevel ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.Enums.BufferClusterLevelT
    -- ^ __Returns:__ The cluster level of /@buffer@/
bufferGetClusterLevel :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m BufferClusterLevelT
bufferGetClusterLevel BufferT
buffer = IO BufferClusterLevelT -> m BufferClusterLevelT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferClusterLevelT -> m BufferClusterLevelT)
-> IO BufferClusterLevelT -> m BufferClusterLevelT
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
    CUInt
result <- Ptr BufferT -> IO CUInt
hb_buffer_get_cluster_level Ptr BufferT
buffer'
    let result' :: BufferClusterLevelT
result' = (Int -> BufferClusterLevelT
forall a. Enum a => Int -> a
toEnum (Int -> BufferClusterLevelT)
-> (CUInt -> Int) -> CUInt -> BufferClusterLevelT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    BufferClusterLevelT -> IO BufferClusterLevelT
forall (m :: * -> *) a. Monad m => a -> m a
return BufferClusterLevelT
result'


-- function buffer_diff
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a buffer." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "reference"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "other buffer to compare to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dottedcircle_glyph"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "glyph id of U+25CC DOTTED CIRCLE, or (hb_codepont_t) -1."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "position_fuzz"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "allowed absolute difference in position values."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "HarfBuzz" , name = "buffer_diff_flags_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_diff" hb_buffer_diff :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.BufferT.BufferT ->         -- reference : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- dottedcircle_glyph : TBasicType TUInt32
    Word32 ->                               -- position_fuzz : TBasicType TUInt
    IO CUInt

-- | If dottedcircle_glyph is (hb_codepoint_t) -1 then @/HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT/@
-- and @/HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT/@ are never returned.  This should be used by most
-- callers if just comparing two buffers is needed.
-- 
-- /Since: 1.5.0/
bufferDiff ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: a buffer.
    -> HarfBuzz.BufferT.BufferT
    -- ^ /@reference@/: other buffer to compare to.
    -> Word32
    -- ^ /@dottedcircleGlyph@/: glyph id of U+25CC DOTTED CIRCLE, or (hb_codepont_t) -1.
    -> Word32
    -- ^ /@positionFuzz@/: allowed absolute difference in position values.
    -> m [HarfBuzz.Flags.BufferDiffFlagsT]
bufferDiff :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> BufferT -> Word32 -> Word32 -> m [BufferDiffFlagsT]
bufferDiff BufferT
buffer BufferT
reference Word32
dottedcircleGlyph Word32
positionFuzz = IO [BufferDiffFlagsT] -> m [BufferDiffFlagsT]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [BufferDiffFlagsT] -> m [BufferDiffFlagsT])
-> IO [BufferDiffFlagsT] -> m [BufferDiffFlagsT]
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 BufferT
reference' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
reference
    CUInt
result <- Ptr BufferT -> Ptr BufferT -> Word32 -> Word32 -> IO CUInt
hb_buffer_diff Ptr BufferT
buffer' Ptr BufferT
reference' Word32
dottedcircleGlyph Word32
positionFuzz
    let result' :: [BufferDiffFlagsT]
result' = CUInt -> [BufferDiffFlagsT]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
reference
    [BufferDiffFlagsT] -> IO [BufferDiffFlagsT]
forall (m :: * -> *) a. Monad m => a -> m a
return [BufferDiffFlagsT]
result'


-- function buffer_deserialize_unicode
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 2 (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "string to deserialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf_len"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the size of @buf, or -1 if it is %NULL-terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end_ptr"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "output pointer to the character after last\n                              consumed one."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "format"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #hb_buffer_serialize_format_t of the input @buf"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "buf_len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "the size of @buf, or -1 if it is %NULL-terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_deserialize_unicode" hb_buffer_deserialize_unicode :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr CString ->                          -- buf : TCArray False (-1) 2 (TBasicType TUTF8)
    Int32 ->                                -- buf_len : TBasicType TInt
    Ptr CString ->                          -- end_ptr : TBasicType TUTF8
    CUInt ->                                -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"})
    IO Int32

-- | Deserializes Unicode /@buffer@/ from textual representation in the format
-- produced by 'GI.HarfBuzz.Functions.bufferSerializeUnicode'.
-- 
-- /Since: 2.7.3/
bufferDeserializeUnicode ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer.
    -> [T.Text]
    -- ^ /@buf@/: string to deserialize
    -> HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ /@format@/: the t'GI.HarfBuzz.Enums.BufferSerializeFormatT' of the input /@buf@/
    -> m ((Int32, T.Text))
    -- ^ __Returns:__ @/true/@ if /@buf@/ is not fully consumed, @/false/@ otherwise.
bufferDeserializeUnicode :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> [Text] -> BufferSerializeFormatT -> m (Int32, Text)
bufferDeserializeUnicode BufferT
buffer [Text]
buf BufferSerializeFormatT
format = 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
    let bufLen :: Int32
bufLen = 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]
buf
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr CString
buf' <- [Text] -> IO (Ptr CString)
packUTF8CArray [Text]
buf
    Ptr CString
endPtr <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferSerializeFormatT -> Int)
-> BufferSerializeFormatT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferSerializeFormatT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferSerializeFormatT
format
    Int32
result <- Ptr BufferT
-> Ptr CString -> Int32 -> Ptr CString -> CUInt -> IO Int32
hb_buffer_deserialize_unicode Ptr BufferT
buffer' Ptr CString
buf' Int32
bufLen Ptr CString
endPtr CUInt
format'
    CString
endPtr' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
endPtr
    Text
endPtr'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
endPtr'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
endPtr'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    (Int32 -> (CString -> IO ()) -> Ptr CString -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Int32
bufLen) CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
buf'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
buf'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
endPtr
    (Int32, Text) -> IO (Int32, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Text
endPtr'')


-- function buffer_deserialize_glyphs
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #hb_buffer_t buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf"
--           , argType = TCArray False (-1) 2 (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "string to deserialize"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "buf_len"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the size of @buf, or -1 if it is %NULL-terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end_ptr"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "output pointer to the character after last\n                              consumed one."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "font"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "font_t" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "font for getting glyph IDs"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "format"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "buffer_serialize_format_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the #hb_buffer_serialize_format_t of the input @buf"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "buf_len"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "the size of @buf, or -1 if it is %NULL-terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_deserialize_glyphs" hb_buffer_deserialize_glyphs :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr CString ->                          -- buf : TCArray False (-1) 2 (TBasicType TUTF8)
    Int32 ->                                -- buf_len : TBasicType TInt
    Ptr CString ->                          -- end_ptr : TBasicType TUTF8
    Ptr HarfBuzz.FontT.FontT ->             -- font : TInterface (Name {namespace = "HarfBuzz", name = "font_t"})
    CUInt ->                                -- format : TInterface (Name {namespace = "HarfBuzz", name = "buffer_serialize_format_t"})
    IO Int32

-- | Deserializes glyphs /@buffer@/ from textual representation in the format
-- produced by 'GI.HarfBuzz.Functions.bufferSerializeGlyphs'.
-- 
-- /Since: 0.9.7/
bufferDeserializeGlyphs ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: an t'GI.HarfBuzz.Structs.BufferT.BufferT' buffer.
    -> [T.Text]
    -- ^ /@buf@/: string to deserialize
    -> Maybe (HarfBuzz.FontT.FontT)
    -- ^ /@font@/: font for getting glyph IDs
    -> HarfBuzz.Enums.BufferSerializeFormatT
    -- ^ /@format@/: the t'GI.HarfBuzz.Enums.BufferSerializeFormatT' of the input /@buf@/
    -> m ((Int32, T.Text))
    -- ^ __Returns:__ @/true/@ if /@buf@/ is not fully consumed, @/false/@ otherwise.
bufferDeserializeGlyphs :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT
-> [Text]
-> Maybe FontT
-> BufferSerializeFormatT
-> m (Int32, Text)
bufferDeserializeGlyphs BufferT
buffer [Text]
buf Maybe FontT
font BufferSerializeFormatT
format = 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
    let bufLen :: Int32
bufLen = 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]
buf
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr CString
buf' <- [Text] -> IO (Ptr CString)
packUTF8CArray [Text]
buf
    Ptr CString
endPtr <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
    Ptr FontT
maybeFont <- case Maybe FontT
font of
        Maybe FontT
Nothing -> Ptr FontT -> IO (Ptr FontT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontT
forall a. Ptr a
nullPtr
        Just FontT
jFont -> do
            Ptr FontT
jFont' <- FontT -> IO (Ptr FontT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FontT
jFont
            Ptr FontT -> IO (Ptr FontT)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FontT
jFont'
    let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (BufferSerializeFormatT -> Int)
-> BufferSerializeFormatT
-> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BufferSerializeFormatT -> Int
forall a. Enum a => a -> Int
fromEnum) BufferSerializeFormatT
format
    Int32
result <- Ptr BufferT
-> Ptr CString
-> Int32
-> Ptr CString
-> Ptr FontT
-> CUInt
-> IO Int32
hb_buffer_deserialize_glyphs Ptr BufferT
buffer' Ptr CString
buf' Int32
bufLen Ptr CString
endPtr Ptr FontT
maybeFont CUInt
format'
    CString
endPtr' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
endPtr
    Text
endPtr'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
endPtr'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
endPtr'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Maybe FontT -> (FontT -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FontT
font FontT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    (Int32 -> (CString -> IO ()) -> Ptr CString -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Int32
bufLen) CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
buf'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
buf'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
endPtr
    (Int32, Text) -> IO (Int32, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Int32
result, Text
endPtr'')


-- function buffer_create_similar
-- Args: [ Arg
--           { argCName = "src"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_create_similar" hb_buffer_create_similar :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- src : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO (Ptr HarfBuzz.BufferT.BufferT)

-- | Creates a new t'GI.HarfBuzz.Structs.BufferT.BufferT', similar to 'GI.HarfBuzz.Functions.bufferCreate'. The only
-- difference is that the buffer is configured similarly to /@src@/.
-- 
-- /Since: 3.3.0/
bufferCreateSimilar ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@src@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m HarfBuzz.BufferT.BufferT
    -- ^ __Returns:__ 
    -- A newly allocated t'GI.HarfBuzz.Structs.BufferT.BufferT', similar to 'GI.HarfBuzz.Functions.bufferCreate'.
bufferCreateSimilar :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m BufferT
bufferCreateSimilar BufferT
src = IO BufferT -> m BufferT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferT -> m BufferT) -> IO BufferT -> m BufferT
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
src' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
src
    Ptr BufferT
result <- Ptr BufferT -> IO (Ptr BufferT)
hb_buffer_create_similar Ptr BufferT
src'
    Text -> Ptr BufferT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferCreateSimilar" Ptr BufferT
result
    BufferT
result' <- ((ManagedPtr BufferT -> BufferT) -> Ptr BufferT -> IO BufferT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BufferT -> BufferT
HarfBuzz.BufferT.BufferT) Ptr BufferT
result
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
src
    BufferT -> IO BufferT
forall (m :: * -> *) a. Monad m => a -> m a
return BufferT
result'


-- function buffer_create
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_create" hb_buffer_create :: 
    IO (Ptr HarfBuzz.BufferT.BufferT)

-- | Creates a new t'GI.HarfBuzz.Structs.BufferT.BufferT' with all properties to defaults.
-- 
-- /Since: 0.9.2/
bufferCreate ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.BufferT.BufferT
    -- ^ __Returns:__ 
    -- A newly allocated t'GI.HarfBuzz.Structs.BufferT.BufferT' with a reference count of 1. The initial
    -- reference count should be released with @/hb_buffer_destroy()/@ when you are done
    -- using the t'GI.HarfBuzz.Structs.BufferT.BufferT'. This function never returns 'P.Nothing'. If memory cannot
    -- be allocated, a special t'GI.HarfBuzz.Structs.BufferT.BufferT' object will be returned on which
    -- 'GI.HarfBuzz.Functions.bufferAllocationSuccessful' returns @/false/@.
bufferCreate :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m BufferT
bufferCreate  = IO BufferT -> m BufferT
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BufferT -> m BufferT) -> IO BufferT -> m BufferT
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
result <- IO (Ptr BufferT)
hb_buffer_create
    Text -> Ptr BufferT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferCreate" Ptr BufferT
result
    BufferT
result' <- ((ManagedPtr BufferT -> BufferT) -> Ptr BufferT -> IO BufferT
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BufferT -> BufferT
HarfBuzz.BufferT.BufferT) Ptr BufferT
result
    BufferT -> IO BufferT
forall (m :: * -> *) a. Monad m => a -> m a
return BufferT
result'


-- function buffer_clear_contents
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_clear_contents" hb_buffer_clear_contents :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO ()

-- | Similar to 'GI.HarfBuzz.Functions.bufferReset', but does not clear the Unicode functions and
-- the replacement code point.
-- 
-- /Since: 0.9.11/
bufferClearContents ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m ()
bufferClearContents :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BufferT -> m ()
bufferClearContents BufferT
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> IO ()
hb_buffer_clear_contents Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_append
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "source #hb_buffer_t"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "start index into source buffer to copy.  Use 0 to copy from start of buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "end index into source buffer to copy.  Use @HB_FEATURE_GLOBAL_END to copy to end of buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_append" hb_buffer_append :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr HarfBuzz.BufferT.BufferT ->         -- source : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- start : TBasicType TUInt
    Word32 ->                               -- end : TBasicType TUInt
    IO ()

-- | Append (part of) contents of another buffer to this buffer.
-- 
-- /Since: 1.5.0/
bufferAppend ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> HarfBuzz.BufferT.BufferT
    -- ^ /@source@/: source t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@start@/: start index into source buffer to copy.  Use 0 to copy from start of buffer.
    -> Word32
    -- ^ /@end@/: end index into source buffer to copy.  Use /@hBFEATUREGLOBALEND@/ to copy to end of buffer.
    -> m ()
bufferAppend :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> BufferT -> Word32 -> Word32 -> m ()
bufferAppend BufferT
buffer BufferT
source Word32
start Word32
end = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT
source' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
source
    Ptr BufferT -> Ptr BufferT -> Word32 -> Word32 -> IO ()
hb_buffer_append Ptr BufferT
buffer' Ptr BufferT
source' Word32
start Word32
end
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
source
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_allocation_successful
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_allocation_successful" hb_buffer_allocation_successful :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    IO Int32

-- | Check if allocating memory for the buffer succeeded.
-- 
-- /Since: 0.9.2/
bufferAllocationSuccessful ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@buffer@/ memory allocation succeeded, @/false/@ otherwise.
bufferAllocationSuccessful :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> m Int32
bufferAllocationSuccessful BufferT
buffer = 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
    Int32
result <- Ptr BufferT -> IO Int32
hb_buffer_allocation_successful Ptr BufferT
buffer'
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function buffer_add_utf8
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "An array of UTF-8\n              characters to append."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The length of the @text, or -1 if it is %NULL terminated."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The offset of the first character to add to the @buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The number of characters to add to the @buffer, or -1 for the\n              end of @text (assuming it is %NULL terminated)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_length"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "The length of the @text, or -1 if it is %NULL terminated."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_add_utf8" hb_buffer_add_utf8 :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word8 ->                            -- text : TCArray False (-1) 2 (TBasicType TUInt8)
    Int32 ->                                -- text_length : TBasicType TInt
    Word32 ->                               -- item_offset : TBasicType TUInt
    Int32 ->                                -- item_length : TBasicType TInt
    IO ()

-- | See 'GI.HarfBuzz.Functions.bufferAddCodepoints'.
-- 
-- Replaces invalid UTF-8 characters with the /@buffer@/ replacement code point,
-- see 'GI.HarfBuzz.Functions.bufferSetReplacementCodepoint'.
-- 
-- /Since: 0.9.2/
bufferAddUtf8 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> ByteString
    -- ^ /@text@/: An array of UTF-8
    --               characters to append.
    -> Word32
    -- ^ /@itemOffset@/: The offset of the first character to add to the /@buffer@/.
    -> Int32
    -- ^ /@itemLength@/: The number of characters to add to the /@buffer@/, or -1 for the
    --               end of /@text@/ (assuming it is 'P.Nothing' terminated).
    -> m ()
bufferAddUtf8 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> ByteString -> Word32 -> Int32 -> m ()
bufferAddUtf8 BufferT
buffer ByteString
text Word32
itemOffset Int32
itemLength = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let textLength :: Int32
textLength = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
text
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr Word8
text' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
text
    Ptr BufferT -> Ptr Word8 -> Int32 -> Word32 -> Int32 -> IO ()
hb_buffer_add_utf8 Ptr BufferT
buffer' Ptr Word8
text' Int32
textLength Word32
itemOffset Int32
itemLength
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_add_utf32
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt32)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An array of UTF-32 characters to append"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The length of the @text, or -1 if it is %NULL terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The offset of the first character to add to the @buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The number of characters to add to the @buffer, or -1 for the\n              end of @text (assuming it is %NULL terminated)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_length"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "The length of the @text, or -1 if it is %NULL terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_add_utf32" hb_buffer_add_utf32 :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word32 ->                           -- text : TCArray False (-1) 2 (TBasicType TUInt32)
    Int32 ->                                -- text_length : TBasicType TInt
    Word32 ->                               -- item_offset : TBasicType TUInt
    Int32 ->                                -- item_length : TBasicType TInt
    IO ()

-- | See 'GI.HarfBuzz.Functions.bufferAddCodepoints'.
-- 
-- Replaces invalid UTF-32 characters with the /@buffer@/ replacement code point,
-- see 'GI.HarfBuzz.Functions.bufferSetReplacementCodepoint'.
-- 
-- /Since: 0.9.2/
bufferAddUtf32 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> [Word32]
    -- ^ /@text@/: An array of UTF-32 characters to append
    -> Word32
    -- ^ /@itemOffset@/: The offset of the first character to add to the /@buffer@/
    -> Int32
    -- ^ /@itemLength@/: The number of characters to add to the /@buffer@/, or -1 for the
    --               end of /@text@/ (assuming it is 'P.Nothing' terminated)
    -> m ()
bufferAddUtf32 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> [Word32] -> Word32 -> Int32 -> m ()
bufferAddUtf32 BufferT
buffer [Word32]
text Word32
itemOffset Int32
itemLength = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let textLength :: Int32
textLength = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Word32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word32]
text
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr Word32
text' <- [Word32] -> IO (Ptr Word32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word32]
text
    Ptr BufferT -> Ptr Word32 -> Int32 -> Word32 -> Int32 -> IO ()
hb_buffer_add_utf32 Ptr BufferT
buffer' Ptr Word32
text' Int32
textLength Word32
itemOffset Int32
itemLength
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_add_utf16
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt16)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An array of UTF-16 characters to append"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The length of the @text, or -1 if it is %NULL terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The offset of the first character to add to the @buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The number of characters to add to the @buffer, or -1 for the\n              end of @text (assuming it is %NULL terminated)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_length"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "The length of the @text, or -1 if it is %NULL terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_add_utf16" hb_buffer_add_utf16 :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word16 ->                           -- text : TCArray False (-1) 2 (TBasicType TUInt16)
    Int32 ->                                -- text_length : TBasicType TInt
    Word32 ->                               -- item_offset : TBasicType TUInt
    Int32 ->                                -- item_length : TBasicType TInt
    IO ()

-- | See 'GI.HarfBuzz.Functions.bufferAddCodepoints'.
-- 
-- Replaces invalid UTF-16 characters with the /@buffer@/ replacement code point,
-- see 'GI.HarfBuzz.Functions.bufferSetReplacementCodepoint'.
-- 
-- /Since: 0.9.2/
bufferAddUtf16 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> [Word16]
    -- ^ /@text@/: An array of UTF-16 characters to append
    -> Word32
    -- ^ /@itemOffset@/: The offset of the first character to add to the /@buffer@/
    -> Int32
    -- ^ /@itemLength@/: The number of characters to add to the /@buffer@/, or -1 for the
    --               end of /@text@/ (assuming it is 'P.Nothing' terminated)
    -> m ()
bufferAddUtf16 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> [Word16] -> Word32 -> Int32 -> m ()
bufferAddUtf16 BufferT
buffer [Word16]
text Word32
itemOffset Int32
itemLength = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let textLength :: Int32
textLength = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Word16] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word16]
text
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr Word16
text' <- [Word16] -> IO (Ptr Word16)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word16]
text
    Ptr BufferT -> Ptr Word16 -> Int32 -> Word32 -> Int32 -> IO ()
hb_buffer_add_utf16 Ptr BufferT
buffer' Ptr Word16
text' Int32
textLength Word32
itemOffset Int32
itemLength
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word16 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word16
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_add_latin1
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt8)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "an array of UTF-8\n              characters to append"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the length of the @text, or -1 if it is %NULL terminated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the offset of the first character to add to the @buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the number of characters to add to the @buffer, or -1 for the\n              end of @text (assuming it is %NULL terminated)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_length"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "the length of the @text, or -1 if it is %NULL terminated"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_add_latin1" hb_buffer_add_latin1 :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word8 ->                            -- text : TCArray False (-1) 2 (TBasicType TUInt8)
    Int32 ->                                -- text_length : TBasicType TInt
    Word32 ->                               -- item_offset : TBasicType TUInt
    Int32 ->                                -- item_length : TBasicType TInt
    IO ()

-- | Similar to 'GI.HarfBuzz.Functions.bufferAddCodepoints', but allows only access to first 256
-- Unicode code points that can fit in 8-bit strings.
-- 
-- \<note>Has nothing to do with non-Unicode Latin-1 encoding.\<\/note>
-- 
-- /Since: 0.9.39/
bufferAddLatin1 ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> ByteString
    -- ^ /@text@/: an array of UTF-8
    --               characters to append
    -> Word32
    -- ^ /@itemOffset@/: the offset of the first character to add to the /@buffer@/
    -> Int32
    -- ^ /@itemLength@/: the number of characters to add to the /@buffer@/, or -1 for the
    --               end of /@text@/ (assuming it is 'P.Nothing' terminated)
    -> m ()
bufferAddLatin1 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> ByteString -> Word32 -> Int32 -> m ()
bufferAddLatin1 BufferT
buffer ByteString
text Word32
itemOffset Int32
itemLength = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let textLength :: Int32
textLength = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ ByteString -> Int
B.length ByteString
text
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr Word8
text' <- ByteString -> IO (Ptr Word8)
packByteString ByteString
text
    Ptr BufferT -> Ptr Word8 -> Int32 -> Word32 -> Int32 -> IO ()
hb_buffer_add_latin1 Ptr BufferT
buffer' Ptr Word8
text' Int32
textLength Word32
itemOffset Int32
itemLength
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word8 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word8
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_add_codepoints
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #hb_buffer_t to append characters to."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TCArray False (-1) 2 (TBasicType TUInt32)
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an array of Unicode code points to append."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the length of the @text, or -1 if it is %NULL terminated."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the offset of the first code point to add to the @buffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item_length"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the number of code points to add to the @buffer, or -1 for the\n              end of @text (assuming it is %NULL terminated)."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "text_length"
--              , argType = TBasicType TInt
--              , direction = DirectionIn
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just "the length of the @text, or -1 if it is %NULL terminated."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferNothing
--              }
--          ]
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_add_codepoints" hb_buffer_add_codepoints :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Ptr Word32 ->                           -- text : TCArray False (-1) 2 (TBasicType TUInt32)
    Int32 ->                                -- text_length : TBasicType TInt
    Word32 ->                               -- item_offset : TBasicType TUInt
    Int32 ->                                -- item_length : TBasicType TInt
    IO ()

-- | Appends characters from /@text@/ array to /@buffer@/. The /@itemOffset@/ is the
-- position of the first character from /@text@/ that will be appended, and
-- /@itemLength@/ is the number of character. When shaping part of a larger text
-- (e.g. a run of text from a paragraph), instead of passing just the substring
-- corresponding to the run, it is preferable to pass the whole
-- paragraph and specify the run start and length as /@itemOffset@/ and
-- /@itemLength@/, respectively, to give HarfBuzz the full context to be able,
-- for example, to do cross-run Arabic shaping or properly handle combining
-- marks at stat of run.
-- 
-- This function does not check the validity of /@text@/, it is up to the caller
-- to ensure it contains a valid Unicode code points.
-- 
-- /Since: 0.9.31/
bufferAddCodepoints ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: a t'GI.HarfBuzz.Structs.BufferT.BufferT' to append characters to.
    -> [Word32]
    -- ^ /@text@/: an array of Unicode code points to append.
    -> Word32
    -- ^ /@itemOffset@/: the offset of the first code point to add to the /@buffer@/.
    -> Int32
    -- ^ /@itemLength@/: the number of code points to add to the /@buffer@/, or -1 for the
    --               end of /@text@/ (assuming it is 'P.Nothing' terminated).
    -> m ()
bufferAddCodepoints :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> [Word32] -> Word32 -> Int32 -> m ()
bufferAddCodepoints BufferT
buffer [Word32]
text Word32
itemOffset Int32
itemLength = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let textLength :: Int32
textLength = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [Word32] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Word32]
text
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr Word32
text' <- [Word32] -> IO (Ptr Word32)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [Word32]
text
    Ptr BufferT -> Ptr Word32 -> Int32 -> Word32 -> Int32 -> IO ()
hb_buffer_add_codepoints Ptr BufferT
buffer' Ptr Word32
text' Int32
textLength Word32
itemOffset Int32
itemLength
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
text'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function buffer_add
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "buffer_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #hb_buffer_t" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "codepoint"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A Unicode code point."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cluster"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The cluster value of @codepoint."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_buffer_add" hb_buffer_add :: 
    Ptr HarfBuzz.BufferT.BufferT ->         -- buffer : TInterface (Name {namespace = "HarfBuzz", name = "buffer_t"})
    Word32 ->                               -- codepoint : TBasicType TUInt32
    Word32 ->                               -- cluster : TBasicType TUInt
    IO ()

-- | Appends a character with the Unicode value of /@codepoint@/ to /@buffer@/, and
-- gives it the initial cluster value of /@cluster@/. Clusters can be any thing
-- the client wants, they are usually used to refer to the index of the
-- character in the input text stream and are output in
-- t'GI.HarfBuzz.Structs.GlyphInfoT.GlyphInfoT'.@/cluster/@ field.
-- 
-- This function does not check the validity of /@codepoint@/, it is up to the
-- caller to ensure it is a valid Unicode code point.
-- 
-- /Since: 0.9.7/
bufferAdd ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BufferT.BufferT
    -- ^ /@buffer@/: An t'GI.HarfBuzz.Structs.BufferT.BufferT'
    -> Word32
    -- ^ /@codepoint@/: A Unicode code point.
    -> Word32
    -- ^ /@cluster@/: The cluster value of /@codepoint@/.
    -> m ()
bufferAdd :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BufferT -> Word32 -> Word32 -> m ()
bufferAdd BufferT
buffer Word32
codepoint Word32
cluster = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BufferT
buffer' <- BufferT -> IO (Ptr BufferT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BufferT
buffer
    Ptr BufferT -> Word32 -> Word32 -> IO ()
hb_buffer_add Ptr BufferT
buffer' Word32
codepoint Word32
cluster
    BufferT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferT
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function blob_make_immutable
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a blob" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_make_immutable" hb_blob_make_immutable :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    IO ()

-- | Makes a blob immutable.
-- 
-- /Since: 0.9.2/
blobMakeImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: a blob
    -> m ()
blobMakeImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m ()
blobMakeImmutable BlobT
blob = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Ptr BlobT -> IO ()
hb_blob_make_immutable Ptr BlobT
blob'
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function blob_is_immutable
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_is_immutable" hb_blob_is_immutable :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    IO Int32

-- | Tests whether a blob is immutable.
-- 
-- /Since: 0.9.2/
blobIsImmutable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: a blob.
    -> m Int32
    -- ^ __Returns:__ @/true/@ if /@blob@/ is immutable, @/false/@ otherwise
blobIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m Int32
blobIsImmutable BlobT
blob = 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 BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Int32
result <- Ptr BlobT -> IO Int32
hb_blob_is_immutable Ptr BlobT
blob'
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function blob_get_length
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_get_length" hb_blob_get_length :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    IO Word32

-- | Fetches the length of a blob\'s data.
-- 
-- /Since: 0.9.2/
blobGetLength ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: a blob.
    -> m Word32
    -- ^ __Returns:__ the length of /@blob@/ data in bytes.
blobGetLength :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BlobT -> m Word32
blobGetLength BlobT
blob = 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 BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Word32
result <- Ptr BlobT -> IO Word32
hb_blob_get_length Ptr BlobT
blob'
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function blob_get_empty
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_get_empty" hb_blob_get_empty :: 
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Returns the singleton empty blob.
-- 
-- See TODO:link object types for more information.
-- 
-- /Since: 0.9.2/
blobGetEmpty ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ The empty blob.
blobGetEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m BlobT
blobGetEmpty  = 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 BlobT
result <- IO (Ptr BlobT)
hb_blob_get_empty
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobGetEmpty" 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
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function blob_get_data_writable
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "output length of the writable data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "length"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "output length of the writable data."
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TCArray False (-1) 1 (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_get_data_writable" hb_blob_get_data_writable :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    Ptr Word32 ->                           -- length : TBasicType TUInt
    IO (Ptr CString)

-- | Tries to make blob data writable (possibly copying it) and
-- return pointer to data.
-- 
-- Fails if blob has been made immutable, or if memory allocation
-- fails.
-- 
-- /Since: 0.9.2/
blobGetDataWritable ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: a blob.
    -> m [T.Text]
    -- ^ __Returns:__ Writable blob data,
    -- or 'P.Nothing' if failed.
blobGetDataWritable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BlobT -> m [Text]
blobGetDataWritable BlobT
blob = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Ptr Word32
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr CString
result <- Ptr BlobT -> Ptr Word32 -> IO (Ptr CString)
hb_blob_get_data_writable Ptr BlobT
blob' Ptr Word32
length_
    Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
    Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobGetDataWritable" Ptr CString
result
    [Text]
result' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
length_') Ptr CString
result
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'


-- function blob_get_data
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The length in bytes of the data retrieved"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "length"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText = Just "The length in bytes of the data retrieved"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TCArray False (-1) 1 (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_get_data" hb_blob_get_data :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    Ptr Word32 ->                           -- length : TBasicType TUInt
    IO (Ptr CString)

-- | Fetches the data from a blob.
-- 
-- /Since: 0.9.2/
blobGetData ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: a blob.
    -> m [T.Text]
    -- ^ __Returns:__ the byte data of /@blob@/.
blobGetData :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BlobT -> m [Text]
blobGetData BlobT
blob = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Ptr Word32
length_ <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Ptr CString
result <- Ptr BlobT -> Ptr Word32 -> IO (Ptr CString)
hb_blob_get_data Ptr BlobT
blob' Ptr Word32
length_
    Word32
length_' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
length_
    Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobGetData" Ptr CString
result
    [Text]
result' <- (Word32 -> Ptr CString -> IO [Text]
forall a.
(HasCallStack, Integral a) =>
a -> Ptr CString -> IO [Text]
unpackUTF8CArrayWithLength Word32
length_') Ptr CString
result
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
length_
    [Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'


-- function blob_create_sub_blob
-- Args: [ Arg
--           { argCName = "parent"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Parent blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "Start offset of sub-blob within @parent, in bytes."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "length"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Length of sub-blob."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_create_sub_blob" hb_blob_create_sub_blob :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- parent : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    Word32 ->                               -- offset : TBasicType TUInt
    Word32 ->                               -- length : TBasicType TUInt
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Returns a blob that represents a range of bytes in /@parent@/.  The new
-- blob is always created with @/HB_MEMORY_MODE_READONLY/@, meaning that it
-- will never modify data in the parent blob.  The parent data is not
-- expected to be modified, and will result in undefined behavior if it
-- is.
-- 
-- Makes /@parent@/ immutable.
-- 
-- /Since: 0.9.2/
blobCreateSubBlob ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@parent@/: Parent blob.
    -> Word32
    -- ^ /@offset@/: Start offset of sub-blob within /@parent@/, in bytes.
    -> Word32
    -- ^ /@length@/: Length of sub-blob.
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ New blob, or the empty blob if something failed or if
    -- /@length@/ is zero or /@offset@/ is beyond the end of /@parent@/\'s data.  Destroy
    -- with @/hb_blob_destroy()/@.
blobCreateSubBlob :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
BlobT -> Word32 -> Word32 -> m BlobT
blobCreateSubBlob BlobT
parent Word32
offset Word32
length_ = 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 BlobT
parent' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
parent
    Ptr BlobT
result <- Ptr BlobT -> Word32 -> Word32 -> IO (Ptr BlobT)
hb_blob_create_sub_blob Ptr BlobT
parent' Word32
offset Word32
length_
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobCreateSubBlob" 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
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
parent
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function blob_create_from_file_or_fail
-- Args: [ Arg
--           { argCName = "file_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A font filename" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_create_from_file_or_fail" hb_blob_create_from_file_or_fail :: 
    CString ->                              -- file_name : TBasicType TUTF8
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Creates a new blob containing the data from the
-- specified binary font file.
-- 
-- /Since: 2.8.2/
blobCreateFromFileOrFail ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@fileName@/: A font filename
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' pointer with the content of the file,
    -- or 'P.Nothing' if failed.
blobCreateFromFileOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m BlobT
blobCreateFromFileOrFail Text
fileName = 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
    CString
fileName' <- Text -> IO CString
textToCString Text
fileName
    Ptr BlobT
result <- CString -> IO (Ptr BlobT)
hb_blob_create_from_file_or_fail CString
fileName'
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobCreateFromFileOrFail" 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
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
fileName'
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function blob_create_from_file
-- Args: [ Arg
--           { argCName = "file_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A font filename" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_create_from_file" hb_blob_create_from_file :: 
    CString ->                              -- file_name : TBasicType TUTF8
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Creates a new blob containing the data from the
-- specified binary font file.
-- 
-- /Since: 1.7.7/
blobCreateFromFile ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@fileName@/: A font filename
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ An t'GI.HarfBuzz.Structs.BlobT.BlobT' pointer with the content of the file,
    -- or 'GI.HarfBuzz.Functions.blobGetEmpty' if failed.
blobCreateFromFile :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m BlobT
blobCreateFromFile Text
fileName = 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
    CString
fileName' <- Text -> IO CString
textToCString Text
fileName
    Ptr BlobT
result <- CString -> IO (Ptr BlobT)
hb_blob_create_from_file CString
fileName'
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobCreateFromFile" 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
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
fileName'
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function blob_copy_writable_or_fail
-- Args: [ Arg
--           { argCName = "blob"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "blob_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A blob." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "HarfBuzz" , name = "blob_t" })
-- throws : False
-- Skip return : False

foreign import ccall "hb_blob_copy_writable_or_fail" hb_blob_copy_writable_or_fail :: 
    Ptr HarfBuzz.BlobT.BlobT ->             -- blob : TInterface (Name {namespace = "HarfBuzz", name = "blob_t"})
    IO (Ptr HarfBuzz.BlobT.BlobT)

-- | Makes a writable copy of /@blob@/.
-- 
-- /Since: 1.8.0/
blobCopyWritableOrFail ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.BlobT.BlobT
    -- ^ /@blob@/: A blob.
    -> m HarfBuzz.BlobT.BlobT
    -- ^ __Returns:__ The new blob, or nullptr if allocation failed
blobCopyWritableOrFail :: forall (m :: * -> *). (HasCallStack, MonadIO m) => BlobT -> m BlobT
blobCopyWritableOrFail BlobT
blob = 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 BlobT
blob' <- BlobT -> IO (Ptr BlobT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr BlobT
blob
    Ptr BlobT
result <- Ptr BlobT -> IO (Ptr BlobT)
hb_blob_copy_writable_or_fail Ptr BlobT
blob'
    Text -> Ptr BlobT -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"blobCopyWritableOrFail" 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
    BlobT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BlobT
blob
    BlobT -> IO BlobT
forall (m :: * -> *) a. Monad m => a -> m a
return BlobT
result'


-- function aat_layout_has_tracking
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_aat_layout_has_tracking" hb_aat_layout_has_tracking :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether the specified face includes any tracking information
-- in the @trak@ table.
-- 
-- /Since: 2.3.0/
aatLayoutHasTracking ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
aatLayoutHasTracking :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
aatLayoutHasTracking FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_aat_layout_has_tracking Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function aat_layout_has_substitution
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_aat_layout_has_substitution" hb_aat_layout_has_substitution :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether the specified face includes any substitutions in the
-- @morx@ or @mort@ tables.
-- 
-- \<note>Note: does not examine the @GSUB@ table.\<\/note>
-- 
-- /Since: 2.3.0/
aatLayoutHasSubstitution ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
aatLayoutHasSubstitution :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
aatLayoutHasSubstitution FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_aat_layout_has_substitution Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function aat_layout_has_positioning
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_aat_layout_has_positioning" hb_aat_layout_has_positioning :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    IO Int32

-- | Tests whether the specified face includes any positioning information
-- in the @kerx@ table.
-- 
-- \<note>Note: does not examine the @GPOS@ table.\<\/note>
-- 
-- /Since: 2.3.0/
aatLayoutHasPositioning ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> m Int32
    -- ^ __Returns:__ @/true/@ if data found, @/false/@ otherwise
aatLayoutHasPositioning :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FaceT -> m Int32
aatLayoutHasPositioning FaceT
face = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    Int32
result <- Ptr FaceT -> IO Int32
hb_aat_layout_has_positioning Ptr FaceT
face'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result


-- function aat_layout_get_feature_types
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first feature type to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of feature types to return;\n                Output = the actual number of feature types returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "features"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 2
--                 (TInterface
--                    Name
--                      { namespace = "HarfBuzz" , name = "aat_layout_feature_type_t" })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Array of feature types found"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "feature_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of feature types to return;\n                Output = the actual number of feature types returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_aat_layout_get_feature_types" hb_aat_layout_get_feature_types :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- feature_count : TBasicType TUInt
    Ptr CUInt ->                            -- features : TCArray False (-1) 2 (TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_type_t"}))
    IO Word32

-- | Fetches a list of the AAT feature types included in the specified face.
-- 
-- /Since: 2.2.0/
aatLayoutGetFeatureTypes ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> Word32
    -- ^ /@startOffset@/: offset of the first feature type to retrieve
    -> [HarfBuzz.Enums.AatLayoutFeatureTypeT]
    -- ^ /@features@/: Array of feature types found
    -> m ((Word32, [HarfBuzz.Enums.AatLayoutFeatureTypeT]))
    -- ^ __Returns:__ Number of all available feature types.
aatLayoutGetFeatureTypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> Word32
-> [AatLayoutFeatureTypeT]
-> m (Word32, [AatLayoutFeatureTypeT])
aatLayoutGetFeatureTypes FaceT
face Word32
startOffset [AatLayoutFeatureTypeT]
features = IO (Word32, [AatLayoutFeatureTypeT])
-> m (Word32, [AatLayoutFeatureTypeT])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [AatLayoutFeatureTypeT])
 -> m (Word32, [AatLayoutFeatureTypeT]))
-> IO (Word32, [AatLayoutFeatureTypeT])
-> m (Word32, [AatLayoutFeatureTypeT])
forall a b. (a -> b) -> a -> b
$ do
    let featureCount :: Word32
featureCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [AatLayoutFeatureTypeT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [AatLayoutFeatureTypeT]
features
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    let features' :: [CUInt]
features' = (AatLayoutFeatureTypeT -> CUInt)
-> [AatLayoutFeatureTypeT] -> [CUInt]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (AatLayoutFeatureTypeT -> Int) -> AatLayoutFeatureTypeT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AatLayoutFeatureTypeT -> Int
forall a. Enum a => a -> Int
fromEnum) [AatLayoutFeatureTypeT]
features
    Ptr CUInt
features'' <- [CUInt] -> IO (Ptr CUInt)
forall a. Storable a => [a] -> IO (Ptr a)
packStorableArray [CUInt]
features'
    Word32
result <- Ptr FaceT -> Word32 -> Word32 -> Ptr CUInt -> IO Word32
hb_aat_layout_get_feature_types Ptr FaceT
face' Word32
startOffset Word32
featureCount Ptr CUInt
features''
    [CUInt]
features''' <- (Word32 -> Ptr CUInt -> IO [CUInt]
forall a b. (Integral a, Storable b) => a -> Ptr b -> IO [b]
unpackStorableArrayWithLength Word32
featureCount) Ptr CUInt
features''
    let features'''' :: [AatLayoutFeatureTypeT]
features'''' = (CUInt -> AatLayoutFeatureTypeT)
-> [CUInt] -> [AatLayoutFeatureTypeT]
forall a b. (a -> b) -> [a] -> [b]
map (Int -> AatLayoutFeatureTypeT
forall a. Enum a => Int -> a
toEnum (Int -> AatLayoutFeatureTypeT)
-> (CUInt -> Int) -> CUInt -> AatLayoutFeatureTypeT
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) [CUInt]
features'''
    Ptr CUInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CUInt
features''
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (Word32, [AatLayoutFeatureTypeT])
-> IO (Word32, [AatLayoutFeatureTypeT])
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [AatLayoutFeatureTypeT]
features'''')


-- function aat_layout_feature_type_get_selector_infos
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "aat_layout_feature_type_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The #hb_aat_layout_feature_type_t of the requested feature type"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_offset"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "offset of the first feature type to retrieve"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "selector_count"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "Input = the maximum number of selectors to return;\n                 Output = the actual number of selectors returned (may be zero)"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "selectors"
--           , argType =
--               TCArray
--                 False
--                 (-1)
--                 3
--                 (TInterface
--                    Name
--                      { namespace = "HarfBuzz"
--                      , name = "aat_layout_feature_selector_info_t"
--                      })
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "\n            A buffer pointer. The selectors available for the feature type queries."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "default_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The index of the feature's default selector, if any"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: [ Arg
--              { argCName = "selector_count"
--              , argType = TBasicType TUInt
--              , direction = DirectionOut
--              , mayBeNull = False
--              , argDoc =
--                  Documentation
--                    { rawDocText =
--                        Just
--                          "Input = the maximum number of selectors to return;\n                 Output = the actual number of selectors returned (may be zero)"
--                    , sinceVersion = Nothing
--                    }
--              , argScope = ScopeTypeInvalid
--              , argClosure = -1
--              , argDestroy = -1
--              , argCallerAllocates = False
--              , transfer = TransferEverything
--              }
--          ]
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_aat_layout_feature_type_get_selector_infos" hb_aat_layout_feature_type_get_selector_infos :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    CUInt ->                                -- feature_type : TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_type_t"})
    Word32 ->                               -- start_offset : TBasicType TUInt
    Word32 ->                               -- selector_count : TBasicType TUInt
    Ptr HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT -> -- selectors : TCArray False (-1) 3 (TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_selector_info_t"}))
    Ptr Word32 ->                           -- default_index : TBasicType TUInt
    IO Word32

-- | Fetches a list of the selectors available for the specified feature in the given face.
-- 
-- If upon return, /@defaultIndex@/ is set to 'GI.HarfBuzz.Constants.AAT_LAYOUT_NO_SELECTOR_INDEX', then
-- the feature type is non-exclusive.  Otherwise, /@defaultIndex@/ is the index of
-- the selector that is selected by default.
-- 
-- /Since: 2.2.0/
aatLayoutFeatureTypeGetSelectorInfos ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> HarfBuzz.Enums.AatLayoutFeatureTypeT
    -- ^ /@featureType@/: The t'GI.HarfBuzz.Enums.AatLayoutFeatureTypeT' of the requested feature type
    -> Word32
    -- ^ /@startOffset@/: offset of the first feature type to retrieve
    -> [HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT]
    -- ^ /@selectors@/: 
    --             A buffer pointer. The selectors available for the feature type queries.
    -> m ((Word32, [HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT], Word32))
    -- ^ __Returns:__ Number of all available feature selectors
aatLayoutFeatureTypeGetSelectorInfos :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT
-> AatLayoutFeatureTypeT
-> Word32
-> [AatLayoutFeatureSelectorInfoT]
-> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
aatLayoutFeatureTypeGetSelectorInfos FaceT
face AatLayoutFeatureTypeT
featureType Word32
startOffset [AatLayoutFeatureSelectorInfoT]
selectors = IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
-> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
 -> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32))
-> IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
-> m (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
forall a b. (a -> b) -> a -> b
$ do
    let selectorCount :: Word32
selectorCount = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [AatLayoutFeatureSelectorInfoT] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [AatLayoutFeatureSelectorInfoT]
selectors
    Ptr FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    let featureType' :: CUInt
featureType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (AatLayoutFeatureTypeT -> Int) -> AatLayoutFeatureTypeT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AatLayoutFeatureTypeT -> Int
forall a. Enum a => a -> Int
fromEnum) AatLayoutFeatureTypeT
featureType
    [Ptr AatLayoutFeatureSelectorInfoT]
selectors' <- (AatLayoutFeatureSelectorInfoT
 -> IO (Ptr AatLayoutFeatureSelectorInfoT))
-> [AatLayoutFeatureSelectorInfoT]
-> IO [Ptr AatLayoutFeatureSelectorInfoT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM AatLayoutFeatureSelectorInfoT
-> IO (Ptr AatLayoutFeatureSelectorInfoT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [AatLayoutFeatureSelectorInfoT]
selectors
    Ptr AatLayoutFeatureSelectorInfoT
selectors'' <- Int
-> [Ptr AatLayoutFeatureSelectorInfoT]
-> IO (Ptr AatLayoutFeatureSelectorInfoT)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr AatLayoutFeatureSelectorInfoT]
selectors'
    Ptr Word32
defaultIndex <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    Word32
result <- Ptr FaceT
-> CUInt
-> Word32
-> Word32
-> Ptr AatLayoutFeatureSelectorInfoT
-> Ptr Word32
-> IO Word32
hb_aat_layout_feature_type_get_selector_infos Ptr FaceT
face' CUInt
featureType' Word32
startOffset Word32
selectorCount Ptr AatLayoutFeatureSelectorInfoT
selectors'' Ptr Word32
defaultIndex
    [Ptr AatLayoutFeatureSelectorInfoT]
selectors''' <- (Int
-> Word32
-> Ptr AatLayoutFeatureSelectorInfoT
-> IO [Ptr AatLayoutFeatureSelectorInfoT]
forall a b. Integral a => Int -> a -> Ptr b -> IO [Ptr b]
unpackBlockArrayWithLength Int
16 Word32
selectorCount) Ptr AatLayoutFeatureSelectorInfoT
selectors''
    [AatLayoutFeatureSelectorInfoT]
selectors'''' <- (Ptr AatLayoutFeatureSelectorInfoT
 -> IO AatLayoutFeatureSelectorInfoT)
-> [Ptr AatLayoutFeatureSelectorInfoT]
-> IO [AatLayoutFeatureSelectorInfoT]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr AatLayoutFeatureSelectorInfoT
 -> AatLayoutFeatureSelectorInfoT)
-> Ptr AatLayoutFeatureSelectorInfoT
-> IO AatLayoutFeatureSelectorInfoT
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr AatLayoutFeatureSelectorInfoT
-> AatLayoutFeatureSelectorInfoT
HarfBuzz.AatLayoutFeatureSelectorInfoT.AatLayoutFeatureSelectorInfoT) [Ptr AatLayoutFeatureSelectorInfoT]
selectors'''
    Ptr AatLayoutFeatureSelectorInfoT -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr AatLayoutFeatureSelectorInfoT
selectors''
    Word32
defaultIndex' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
defaultIndex
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    (AatLayoutFeatureSelectorInfoT -> IO ())
-> [AatLayoutFeatureSelectorInfoT] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ AatLayoutFeatureSelectorInfoT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [AatLayoutFeatureSelectorInfoT]
selectors
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
defaultIndex
    (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
-> IO (Word32, [AatLayoutFeatureSelectorInfoT], Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Word32
result, [AatLayoutFeatureSelectorInfoT]
selectors'''', Word32
defaultIndex')


-- function aat_layout_feature_type_get_name_id
-- Args: [ Arg
--           { argCName = "face"
--           , argType =
--               TInterface Name { namespace = "HarfBuzz" , name = "face_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "#hb_face_t to work upon"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_type"
--           , argType =
--               TInterface
--                 Name
--                   { namespace = "HarfBuzz" , name = "aat_layout_feature_type_t" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "The #hb_aat_layout_feature_type_t of the requested feature type"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "hb_aat_layout_feature_type_get_name_id" hb_aat_layout_feature_type_get_name_id :: 
    Ptr HarfBuzz.FaceT.FaceT ->             -- face : TInterface (Name {namespace = "HarfBuzz", name = "face_t"})
    CUInt ->                                -- feature_type : TInterface (Name {namespace = "HarfBuzz", name = "aat_layout_feature_type_t"})
    IO Word32

-- | Fetches the name identifier of the specified feature type in the face\'s @name@ table.
-- 
-- /Since: 2.2.0/
aatLayoutFeatureTypeGetNameId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    HarfBuzz.FaceT.FaceT
    -- ^ /@face@/: t'GI.HarfBuzz.Structs.FaceT.FaceT' to work upon
    -> HarfBuzz.Enums.AatLayoutFeatureTypeT
    -- ^ /@featureType@/: The t'GI.HarfBuzz.Enums.AatLayoutFeatureTypeT' of the requested feature type
    -> m Word32
    -- ^ __Returns:__ Name identifier of the requested feature type
aatLayoutFeatureTypeGetNameId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FaceT -> AatLayoutFeatureTypeT -> m Word32
aatLayoutFeatureTypeGetNameId FaceT
face AatLayoutFeatureTypeT
featureType = 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 FaceT
face' <- FaceT -> IO (Ptr FaceT)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FaceT
face
    let featureType' :: CUInt
featureType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (AatLayoutFeatureTypeT -> Int) -> AatLayoutFeatureTypeT -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AatLayoutFeatureTypeT -> Int
forall a. Enum a => a -> Int
fromEnum) AatLayoutFeatureTypeT
featureType
    Word32
result <- Ptr FaceT -> CUInt -> IO Word32
hb_aat_layout_feature_type_get_name_id Ptr FaceT
face' CUInt
featureType'
    FaceT -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FaceT
face
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result