From f942874facdfe31322b4cbe5cc7bb0dc0db48e5d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sat, 12 Feb 2022 01:43:11 +0200 Subject: [PATCH] [draw] Fix some introspection warnings --- src/hb-draw.cc | 32 ++++++++++++++++++++++---------- src/hb-draw.h | 10 +++++----- src/hb-font.h | 3 --- src/hb-gobject-structs.cc | 1 + src/hb-gobject-structs.h | 4 ++++ 5 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/hb-draw.cc b/src/hb-draw.cc index e83c2678a..023cb815f 100644 --- a/src/hb-draw.cc +++ b/src/hb-draw.cc @@ -107,10 +107,17 @@ HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS #undef HB_DRAW_FUNC_IMPLEMENT /** - * hb_draw_funcs_create: + * hb_draw_funcs_create: (Xconstructor) * * Creates a new draw callbacks object. * + * Return value: (transfer full): + * A newly allocated #hb_draw_funcs_t with a reference count of 1. The initial + * reference count should be released with hb_draw_funcs_destroy when you are + * done using the #hb_draw_funcs_t. This function never returns %NULL. If + * memory cannot be allocated, a special singleton #hb_draw_funcs_t object will + * be returned. + * * Since: REPLACEME **/ hb_draw_funcs_t * @@ -138,12 +145,15 @@ DEFINE_NULL_INSTANCE (hb_draw_funcs_t) = /** - * hb_draw_funcs_reference: + * hb_draw_funcs_reference: (skip) * @dfuncs: draw functions * - * Add to callbacks object refcount. + * Increases the reference count on @dfuncs by one. This prevents @buffer from + * being destroyed until a matching call to hb_draw_funcs_destroy() is made. + * + * Return value: (transfer full): + * The referenced #hb_draw_funcs_t. * - * Returns: The same object. * Since: REPLACEME **/ hb_draw_funcs_t * @@ -153,11 +163,12 @@ hb_draw_funcs_reference (hb_draw_funcs_t *dfuncs) } /** - * hb_draw_funcs_destroy: + * hb_draw_funcs_destroy: (skip) * @dfuncs: draw functions * - * Decreases refcount of callbacks object and deletes the object if it reaches - * to zero. + * Deallocate the @dfuncs. + * Decreases the reference count on @dfuncs by one. If the result is zero, then + * @dfuncs and all associated resources are freed. See hb_draw_funcs_reference(). * * Since: REPLACEME **/ @@ -179,7 +190,7 @@ hb_draw_funcs_destroy (hb_draw_funcs_t *dfuncs) * hb_draw_funcs_make_immutable: * @dfuncs: draw functions * - * Makes dfuncs object immutable. + * Makes @dfuncs object immutable. * * Since: REPLACEME **/ @@ -196,9 +207,10 @@ hb_draw_funcs_make_immutable (hb_draw_funcs_t *dfuncs) * hb_draw_funcs_is_immutable: * @dfuncs: draw functions * - * Checks whether dfuncs is immutable. + * Checks whether @dfuncs is immutable. + * + * Return value: %true if @dfuncs is immutable, %false otherwise * - * Returns: If is immutable. * Since: REPLACEME **/ hb_bool_t diff --git a/src/hb-draw.h b/src/hb-draw.h index 61eadb20e..8627e6e9e 100644 --- a/src/hb-draw.h +++ b/src/hb-draw.h @@ -198,7 +198,7 @@ typedef void (*hb_draw_close_path_func_t) (hb_draw_funcs_t *dfuncs, void *draw_d /** * hb_draw_funcs_set_move_to_func: * @dfuncs: draw functions object - * @func: move-to callback + * @func: (closure user_data) (destroy destroy) (scope notified): move-to callback * @user_data: Data to pass to @func * @destroy: (nullable): The function to call when @user_data is not needed anymore * @@ -214,7 +214,7 @@ hb_draw_funcs_set_move_to_func (hb_draw_funcs_t *dfuncs, /** * hb_draw_funcs_set_line_to_func: * @dfuncs: draw functions object - * @func: line-to callback + * @func: (closure user_data) (destroy destroy) (scope notified): line-to callback * @user_data: Data to pass to @func * @destroy: (nullable): The function to call when @user_data is not needed anymore * @@ -230,7 +230,7 @@ hb_draw_funcs_set_line_to_func (hb_draw_funcs_t *dfuncs, /** * hb_draw_funcs_set_quadratic_to_func: * @dfuncs: draw functions object - * @func: quadratic-to callback + * @func: (closure user_data) (destroy destroy) (scope notified): quadratic-to callback * @user_data: Data to pass to @func * @destroy: (nullable): The function to call when @user_data is not needed anymore * @@ -246,7 +246,7 @@ hb_draw_funcs_set_quadratic_to_func (hb_draw_funcs_t *dfuncs, /** * hb_draw_funcs_set_cubic_to_func: * @dfuncs: draw functions - * @func: cubic-to callback + * @func: (closure user_data) (destroy destroy) (scope notified): cubic-to callback * @user_data: Data to pass to @func * @destroy: (nullable): The function to call when @user_data is not needed anymore * @@ -262,7 +262,7 @@ hb_draw_funcs_set_cubic_to_func (hb_draw_funcs_t *dfuncs, /** * hb_draw_funcs_set_close_path_func: * @dfuncs: draw functions object - * @func: close-path callback + * @func: (closure user_data) (destroy destroy) (scope notified): close-path callback * @user_data: Data to pass to @func * @destroy: (nullable): The function to call when @user_data is not needed anymore * diff --git a/src/hb-font.h b/src/hb-font.h index 1126cebfe..2179f1838 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -522,9 +522,6 @@ typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void * * * A virtual method for the #hb_font_funcs_t of an #hb_font_t object. * - * - * - * Return value: %true if data found, %false otherwise * Since: REPLACEME * **/ diff --git a/src/hb-gobject-structs.cc b/src/hb-gobject-structs.cc index 540b11f91..ef13f1e96 100644 --- a/src/hb-gobject-structs.cc +++ b/src/hb-gobject-structs.cc @@ -90,6 +90,7 @@ hb_gobject_##name##_get_type () \ HB_DEFINE_OBJECT_TYPE (buffer) HB_DEFINE_OBJECT_TYPE (blob) +HB_DEFINE_OBJECT_TYPE (draw_funcs) HB_DEFINE_OBJECT_TYPE (face) HB_DEFINE_OBJECT_TYPE (font) HB_DEFINE_OBJECT_TYPE (font_funcs) diff --git a/src/hb-gobject-structs.h b/src/hb-gobject-structs.h index 63467f80d..3914a2431 100644 --- a/src/hb-gobject-structs.h +++ b/src/hb-gobject-structs.h @@ -48,6 +48,10 @@ HB_EXTERN GType hb_gobject_buffer_get_type (void); #define HB_GOBJECT_TYPE_BUFFER (hb_gobject_buffer_get_type ()) +HB_EXTERN GType +hb_gobject_draw_funcs_get_type (void); +#define HB_GOBJECT_TYPE_DRAW_FUNCS (hb_gobject_draw_funcs_get_type ()) + HB_EXTERN GType hb_gobject_face_get_type (void); #define HB_GOBJECT_TYPE_FACE (hb_gobject_face_get_type ())