package provide Freetype::ftincrem 0.1

if {![info exists _source([file tail [info script]])]} {
package require Freetype::ft2build
package require $FT_FREETYPE

ffidl::typedef FT_Incremental pointer

ft::struct define FT_Incremental_Metrics {
    {bearing_x int - FT_Long 1 FT_Long}
    {bearing_y int - FT_Long 1 FT_Long}
    {advance   int - FT_Long 1 FT_Long}
    {advance_v int - FT_Long 1 FT_Long}
}

# How to treat function pointer in ffidl???
#
#TODO: FT_Error (*FT_Incremental_GetGlyphDataFunc)
#TODO: void     (*FT_Incremental_FreeGlyphDataFunc)
#TODO: FT_Error (*FT_Incremental_GetGlyphMetricsFunc)

ft::struct define FT_Incremental_Funcs {
    {get_glyph_data    int - pointer 1 pointer}
    {free_glyph_data   int - pointer 1 pointer}
    {get_glyph_metrics int - pointer 1 pointer}
}

ft::struct define FT_Incremental_Interface {
    {funcs  object * FT_Incremental_Funcs 1 pointer}
    {object object * FT_Incremental       1 pointer}
}

set FT_PARAM_TAG_INCREMENTAL [FT_MAKE_TAG "i" "n" "c" "r"]


set _source([file tail [info script]]) 1
}
