6 static void decor_print(gpointer data, gpointer user_data)
8 struct decor *decor = data;
9 printf(" decor id %s\n", decor->name);
10 printf(" anchor (%d %d %d)\n", decor->space.anchor.x, decor->space.anchor.y, decor->space.anchor.z);
11 printf(" up (%d %d %d)\n", decor->space.up.x, decor->space.up.y, decor->space.up.z);
13 g_slist_foreach(decor->children, decor_print, NULL);
16 static void style_print(gpointer key, gpointer value, gpointer user_data)
18 char *stylename = key;
19 struct style *style = value;
21 printf(" style %s\n", stylename);
22 g_slist_foreach(style->tree, decor_print, NULL);
25 static void theme_print(gpointer key, gpointer value, gpointer user_data)
28 struct theme *thm = value;
29 printf("name = %s\n", name);
30 g_hash_table_foreach(thm->styles, style_print, NULL);
33 static void material_print(gpointer key, gpointer value, gpointer user_data)
36 struct material *mat = value;
37 printf("name = %s\n", name);
38 printf(" opacity = %f\n", mat->opacity);
41 int main(int argc, char **argv)
44 struct obthemedata themedata;
46 themedata.themes = g_hash_table_new(g_str_hash, g_str_equal);
47 themedata.materials = g_hash_table_new(g_str_hash, g_str_equal);
48 err = obtheme_parse(&themedata, argv[1]);
49 printf("err = %d\n", err);
51 g_hash_table_foreach(themedata.materials, material_print, NULL);
53 g_hash_table_foreach(themedata.themes, theme_print, NULL);