1 /* gjackclock - .rc interface
2 * Copyright (C) 2010 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 #include "gjackclock.h"
29 extern GtkWidget
*window1
;
30 extern int want_quiet
;
31 extern gint my_root_x
, my_root_y
, my_width
, my_height
;
32 extern gint key_cfg
[MAX_KEYBINDING
];
33 extern char *font_family
;
35 extern int want_ontop
;
36 extern int want_ignore_timemaster
;
38 extern int want_scaling
;
40 extern double user_fps
;
41 extern char *color_bg
;
42 extern char *color_fg
;
43 extern int use_table_layout
;
45 int parse_rc(const char*key
, const char *value
) {
46 my_width
=-1; my_height
=-1;
47 if (!strncmp(key
,"keybinding_",11)) {
48 int mykey
= atoi(key
+11);
49 if (mykey
< 1 || mykey
> MAX_KEYBINDING
) return -1;
51 key_cfg
[mykey
]=atoi(value
);
52 } else if (!strcmp(key
,"color_bg")) {
53 if (color_bg
) free(color_bg
);
54 color_bg
= strdup(value
);
55 } else if (!strcmp(key
,"color_fg")) {
56 if (color_bg
) free(color_fg
);
57 color_fg
= strdup(value
);
58 } else if (!strcmp(key
,"font_family")) {
59 if (font_family
) free(font_family
);
60 font_family
= strdup (value
);
61 } else if (!strcmp(key
,"font_size")) {
62 font_size
= atoi (value
);
63 } else if (!strcmp(key
,"ignore_timebase_master")) {
64 want_ignore_timemaster
= atoi(value
)?1:0;
65 } else if (!strcmp(key
,"show_fps")) {
66 show_fps
= atoi(value
)?1:0;
67 } else if (!strcmp(key
,"font_scaling")) {
68 want_scaling
= atoi(value
)?1:0;
69 } else if (!strcmp(key
,"ontop")) {
70 want_ontop
= atoi(value
)?1:0;
71 } else if (!strcmp(key
,"table_layout")) {
72 use_table_layout
= atoi(value
)?1:0;
73 } else if (!strcmp(key
,"fps")) {
74 user_fps
= atof (value
);
75 } else if (!strcmp(key
,"seek_stride")) {
76 stride
= atof (value
);
77 if (stride
<=0) stride
= 10.0;
78 } else if (!strcmp(key
,"win_x")) {
79 my_root_x
=atoi(value
);
80 } else if (!strcmp(key
,"win_y")) {
81 my_root_y
=atoi(value
);
84 fprintf (stderr
, "WARNING: unhandled Config parameter Key = '%s' \n", key
);
90 /* vi:set ts=8 sts=2 sw=2: */