Make chimara_glk_get_tag_names() a class method
authorP. F. Chimento <philip.chimento@gmail.com>
Wed, 22 Jun 2011 18:19:53 +0000 (20:19 +0200)
committerP. F. Chimento <philip.chimento@gmail.com>
Wed, 22 Jun 2011 18:19:53 +0000 (20:19 +0200)
libchimara/chimara-glk.c
libchimara/chimara-glk.h
player/preferences.c

index 19925569823b16569e2246a0f457a74f974348cb..49ef33fbbe1ff2106bb4eae09c8e4c6b94c523fc 100644 (file)
@@ -1477,17 +1477,17 @@ 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().
+ * Class method. 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, unsigned int *num_tags)
+chimara_glk_get_tag_names(unsigned int *num_tags)
 {
        g_return_val_if_fail(num_tags != NULL, NULL);
 
index 37d2220fb8776665cf07e947257dc01601db4fe6..743fa84bbcdaf8812bc380a182984c209d6488ec 100644 (file)
@@ -130,7 +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, unsigned int *num_tags);
+const gchar **chimara_glk_get_tag_names(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, GDestroyNotify destroy_user_data);
 
index cf485f7c3ca0115a36d57851dbd244ad846fde89..03e171e2cdd22e408d637e526b134281f32aeb41 100644 (file)
@@ -202,15 +202,15 @@ chimara_prefs_init(ChimaraPrefs *self)
        gtk_tree_store_set(style_list, &buffer, 0, "Text buffer", -1);
        gtk_tree_store_set(style_list, &grid, 0, "Text grid", -1);
 
-       //int i;
-       //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);
-       //      gtk_tree_store_set(style_list, &buffer_child, 0, tag_names[i], -1);
-       //      gtk_tree_store_set(style_list, &grid_child, 0, tag_names[i], -1);
-       //}
+       int i;
+       unsigned int num_tags;
+       const gchar **tag_names = chimara_glk_get_tag_names(&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);
+               gtk_tree_store_set(style_list, &buffer_child, 0, tag_names[i], -1);
+               gtk_tree_store_set(style_list, &grid_child, 0, tag_names[i], -1);
+       }
 
        /* Set selection mode to single select */
        GtkTreeView *view = GTK_TREE_VIEW( load_object(builder, "style-treeview") );