* <listitem><para>hyperlink</para></listitem>
* <listitem><para>pager</para></listitem>
* </itemizedlist>
+ *
+ * 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)
/**
* 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();
}
/**
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);
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<num_tags; i++) {
gtk_tree_store_append(style_list, &buffer_child, &buffer);
gtk_tree_store_append(style_list, &grid_child, &grid);
}
g_settings_set(prefs_settings, "preferred-interpreters", "a{ss}", builder);
g_variant_builder_unref(builder);
-}
\ No newline at end of file
+}