From: P. F. Chimento Date: Mon, 13 Jun 2011 12:18:17 +0000 (+0200) Subject: Add introspection annotations X-Git-Tag: v0.9~78 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=3ce5b9f501ea360ab84ee35f4ef0b1f1066dee9d;hp=7242acd9825d3395634ab17a8bbfde55694c64bd;p=projects%2Fchimara%2Fchimara.git Add introspection annotations --- diff --git a/libchimara/chimara-glk.c b/libchimara/chimara-glk.c index 86522e5..a200b6b 100644 --- a/libchimara/chimara-glk.c +++ b/libchimara/chimara-glk.c @@ -1450,6 +1450,9 @@ chimara_glk_is_line_input_pending(ChimaraGlk *glk) * hyperlink * pager * + * + * Returns: (transfer none): The #GtkTextTag corresponding to @name in the + * styles of @window. */ GtkTextTag * chimara_glk_get_tag(ChimaraGlk *glk, ChimaraGlkWindowType window, const gchar *name) @@ -1472,25 +1475,21 @@ chimara_glk_get_tag(ChimaraGlk *glk, ChimaraGlkWindowType window, const gchar *n /** * chimara_glk_get_tag_names: * @glk: a #ChimaraGlk widget + * @num_tags: Return location for the number of tag names retrieved. * * Retrieves the possible tag names to use in chimara_glk_get_tag(). + * + * Returns: (transfer none) (array length=num_tags) (element-type utf8): + * Array of strings containing the tag names. This array is owned by Chimara, + * do not free it. */ const gchar ** -chimara_glk_get_tag_names(ChimaraGlk *glk) +chimara_glk_get_tag_names(ChimaraGlk *glk, unsigned int *num_tags) { - return style_get_tag_names(); -} + g_return_val_if_fail(num_tags != NULL, NULL); -/** - * chimara_glk_get_num_tag_names: - * @glk: a #ChimaraGlk widget - * - * Retrieves the number of style tags returned by chimara_glk_get_tag_names(). - */ -gint -chimara_glk_get_num_tag_names(ChimaraGlk *glk) -{ - return CHIMARA_NUM_STYLES; + *num_tags = CHIMARA_NUM_STYLES; + return style_get_tag_names(); } /** diff --git a/libchimara/chimara-glk.h b/libchimara/chimara-glk.h index df522da..593fa86 100644 --- a/libchimara/chimara-glk.h +++ b/libchimara/chimara-glk.h @@ -130,8 +130,7 @@ void chimara_glk_feed_line_input(ChimaraGlk *glk, const gchar *text); gboolean chimara_glk_is_char_input_pending(ChimaraGlk *glk); gboolean chimara_glk_is_line_input_pending(ChimaraGlk *glk); GtkTextTag *chimara_glk_get_tag(ChimaraGlk *glk, ChimaraGlkWindowType window, const gchar *name); -const gchar **chimara_glk_get_tag_names(ChimaraGlk *glk); -gint chimara_glk_get_num_tag_names(ChimaraGlk *glk); +const gchar **chimara_glk_get_tag_names(ChimaraGlk *glk, unsigned int *num_tags); void chimara_glk_update_style(ChimaraGlk *glk); void chimara_glk_set_resource_load_callback(ChimaraGlk *glk, ChimaraResourceLoadFunc func, gpointer user_data); diff --git a/player/preferences.c b/player/preferences.c index 88e88ff..9154f4e 100644 --- a/player/preferences.c +++ b/player/preferences.c @@ -148,8 +148,8 @@ preferences_create(ChimaraGlk *glk) gtk_tree_store_set(style_list, &grid, 0, "Text grid", -1); int i; - gint num_tags = chimara_glk_get_num_tag_names(glk); - const gchar **tag_names = chimara_glk_get_tag_names(glk); + unsigned int num_tags; + const gchar **tag_names = chimara_glk_get_tag_names(glk, &num_tags); for(i=0; i