Compare commits

...

3 Commits

Author SHA1 Message Date
Behdad Esfahbod cc5ed45fb8 [cairo] Add some GI annotations 2023-03-17 13:42:46 +02:00
Khaled Hosny 5595a7c82f [introspection] Enable hb-cairo 2023-03-17 13:42:46 +02:00
Khaled Hosny d444025870 [hb-cairo] Fix annotation of callback function 2023-03-17 13:42:46 +02:00
4 changed files with 29 additions and 11 deletions

View File

@ -628,6 +628,8 @@ if (HB_HAVE_INTROSPECTION)
--symbol-prefix=hb_gobject
--identifier-prefix=hb_
--include GObject-2.0
--include freetype2-2.0
--include cairo-1.0
--pkg-export=harfbuzz-gobject
--c-include=hb-gobject.h
--cflags-begin
@ -646,6 +648,7 @@ if (HB_HAVE_INTROSPECTION)
-DHB_EXTERN=
--cflags-end
--library=harfbuzz-gobject
--library=harfbuzz-cairo
--library=harfbuzz
-L${hb_libpath}
${extra_libs}

View File

@ -561,8 +561,8 @@ INTROSPECTION_SCANNER_ARGS = \
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
INTROSPECTION_SCANNER_ENV = CC="$(CC)"
HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la
HarfBuzz_0_0_gir_INCLUDES = GObject-2.0 freetype2-2.0
HarfBuzz-0.0.gir: libharfbuzz.la libharfbuzz-gobject.la libharfbuzz-cairo.la
HarfBuzz_0_0_gir_INCLUDES = GObject-2.0 freetype2-2.0 cairo-1.0
HarfBuzz_0_0_gir_CFLAGS = \
$(INCLUDES) \
$(HBCFLAGS) \
@ -579,6 +579,8 @@ HarfBuzz_0_0_gir_FILES = \
$(HBSOURCES) \
$(HB_GOBJECT_sources) \
$(HB_GOBJECT_headers) \
$(HB_CAIRO_sources) \
$(HB_CAIRO_headers) \
$(NULL)
girdir = $(datadir)/gir-1.0

View File

@ -725,7 +725,7 @@ hb_cairo_font_face_get_face (cairo_font_face_t *font_face)
/**
* hb_cairo_font_face_set_font_init_func:
* @font_face: a #cairo_font_face_t
* @func: The virtual method to use
* @func: (closure user_data) (destroy destroy) (scope notified): The virtual method to use
* @user_data: user data accompanying the method
* @destroy: function to call when @user_data is not needed anymore
*
@ -854,11 +854,12 @@ hb_cairo_font_face_get_scale_factor (cairo_font_face_t *font_face)
* @y_scale_factor: scale factor to divide #hb_position_t X values by
* @x: X position to place first glyph
* @y: Y position to place first glyph
* @utf8: (nullable): the text that was shaped in @buffer
* @utf8: (array length=utf8_len) (element-type uint8_t) (nullable):
* the text that was shaped in @buffer
* @utf8_len: the length of @utf8 in bytes
* @glyphs: (out): return location for an array of #cairo_glyph_t
* @glyphs: (inout) (array length=num_glyphs): return location for an array of #cairo_glyph_t
* @num_glyphs: (inout): return location for the length of @glyphs
* @clusters: (out) (nullable): return location for an array of cluster positions
* @clusters: (inout) (array length=num_clusters) (nullable): return location for an array of cluster positions
* @num_clusters: (inout) (nullable): return location for the length of @clusters
* @cluster_flags: (out) (nullable): return location for cluster flags
*

View File

@ -444,8 +444,10 @@ endif
# We set those here to not include the sources below that are of no use to
# GObject Introspection
gir_sources = hb_sources + hb_gobject_sources
gir_headers = hb_headers + hb_gobject_headers
gir_sources = hb_sources
gir_headers = hb_headers
gir_deps = []
gir_libs = []
if conf.get('HAVE_GDI', 0) == 1
hb_sources += hb_gdi_sources
@ -654,6 +656,11 @@ if conf.get('HAVE_CAIRO', 0) == 1
subdirs: [meson.project_name()],
version: meson.project_version(),
)
gir_sources += hb_cairo_sources
gir_headers += hb_cairo_headers
gir_deps += libharfbuzz_cairo_dep
gir_libs += libharfbuzz_cairo
endif
if get_option('tests').enabled()
@ -835,6 +842,11 @@ if have_gobject
link_language: 'c',
)
gir_sources += hb_gobject_sources
gir_headers += hb_gobject_headers
gir_deps += libharfbuzz_gobject_dep
gir_libs += libharfbuzz_gobject
gir = find_program('g-ir-scanner', required: get_option('introspection'))
build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
@ -845,14 +857,14 @@ if have_gobject
if build_gir
conf.set('HAVE_INTROSPECTION', 1)
hb_gen_files_gir = gnome.generate_gir(libharfbuzz_gobject,
hb_gen_files_gir = gnome.generate_gir(gir_libs,
sources: [gir_headers, gir_sources, gobject_enums_h],
dependencies: libharfbuzz_dep,
dependencies: gir_deps,
namespace: 'HarfBuzz',
nsversion: '0.0',
identifier_prefix: 'hb_',
symbol_prefix: ['hb', 'hb_gobject'],
includes: ['GObject-2.0', 'freetype2-2.0'],
includes: ['GObject-2.0', 'freetype2-2.0', 'cairo-1.0'],
export_packages: ['harfbuzz-gobject'],
header: 'hb-gobject.h',
install: true,