438166c76f1ff3b01feec557be41e6ad9e7322b9
[manmower/obtheme.git] / main.c
1 #include <assert.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <glib.h>
5 #include "obtheme.h"
6
7 struct obthemedata themedata;
8 struct boundrect {
9         double x1, y1;
10         double x2, y2;
11 };
12
13 int main(int argc, char **argv)
14 {
15         int err;
16         struct theme *thm;
17         struct boundrect br;
18         themedata.themes = g_hash_table_new(g_str_hash, g_str_equal);
19         themedata.materials = g_hash_table_new(g_str_hash, g_str_equal);
20         err = obtheme_parse(&themedata, argv[1]);
21         if (err) {
22                 printf("Fix the script\n");
23                 exit(1);
24         }
25         printf("err = %d\n", err);
26
27 //      g_hash_table_foreach(themedata.materials, material_print, NULL);
28
29 //      g_hash_table_foreach(themedata.themes, theme_print, NULL);
30
31         thm = g_hash_table_lookup(themedata.themes, "awesome");
32         obtheme_decorate_window(thm, "regular_window");
33         obtheme_calc_bound(thm, "regular_window", &br);
34         printf("bounding rectangle: (%f %f) - (%f %f)\n", br.x1, br.y1, br.x2, br.y2);
35
36         return 0;
37 }