]> Dogcows Code - chaz/tint2/blob - src/tint2conf/properties_rw.c
start tint2conf work
[chaz/tint2] / src / tint2conf / properties_rw.c
1
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 #include <gtk/gtk.h>
6
7 #include "common.h"
8 #include "properties.h"
9 #include "properties_rw.h"
10
11
12 void add_entry (char *key, char *value);
13 void hex2gdk(char *hex, GdkColor *color);
14
15
16
17 void config_read_file (const char *path)
18 {
19 FILE *fp;
20 char line[512];
21 char *key, *value;
22
23 if ((fp = fopen(path, "r")) == NULL) return;
24
25 while (fgets(line, sizeof(line), fp) != NULL) {
26 if (parse_line(line, &key, &value)) {
27 add_entry (key, value);
28 free (key);
29 free (value);
30 }
31 }
32 fclose (fp);
33 }
34
35
36 void config_save_file(const char *path) {
37 //printf("config_save_file : %s\n", path);
38 }
39
40
41 void add_entry (char *key, char *value)
42 {
43 char *value1=0, *value2=0, *value3=0;
44
45 /* Background and border */
46 if (strcmp (key, "rounded") == 0) {
47 // 'rounded' is the first parameter => alloc a new background
48 //Background bg;
49 //bg.border.rounded = atoi(value);
50 //g_array_append_val(backgrounds, bg);
51 }
52 else if (strcmp (key, "border_width") == 0) {
53 //g_array_index(backgrounds, Background, backgrounds->len-1).border.width = atoi(value);
54 }
55 else if (strcmp (key, "background_color") == 0) {
56 extract_values(value, &value1, &value2, &value3);
57 //Background* bg = &g_array_index(backgrounds, Background, backgrounds->len-1);
58 //get_color (value1, bg->back.color);
59 //if (value2) bg->back.alpha = (atoi (value2) / 100.0);
60 //else bg->back.alpha = 0.5;
61 }
62 else if (strcmp (key, "border_color") == 0) {
63 extract_values(value, &value1, &value2, &value3);
64 //Background* bg = &g_array_index(backgrounds, Background, backgrounds->len-1);
65 //get_color (value1, bg->border.color);
66 //if (value2) bg->border.alpha = (atoi (value2) / 100.0);
67 //else bg->border.alpha = 0.5;
68 }
69
70 /* Panel */
71 else if (strcmp (key, "panel_size") == 0) {
72 extract_values(value, &value1, &value2, &value3);
73 char *b;
74 if ((b = strchr (value1, '%'))) {
75 b[0] = '\0';
76 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 0);
77 }
78 else
79 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 1);
80 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_width), atof(value1));
81 if (atoi(value1) == 0) {
82 // full width mode
83 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_width), 100);
84 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_width_type), 0);
85 }
86 if ((b = strchr (value2, '%'))) {
87 b[0] = '\0';
88 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_height_type), 0);
89 }
90 else
91 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_height_type), 1);
92 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_height), atof(value2));
93 }
94 else if (strcmp (key, "panel_items") == 0) {
95 gtk_entry_set_text(GTK_ENTRY(items_order), value);
96 }
97 else if (strcmp (key, "panel_margin") == 0) {
98 extract_values(value, &value1, &value2, &value3);
99 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_margin_x), atof(value1));
100 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_margin_y), atof(value1));
101 }
102 else if (strcmp (key, "panel_padding") == 0) {
103 extract_values(value, &value1, &value2, &value3);
104 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_padding_x), atof(value1));
105 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_spacing), atof(value1));
106 if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_padding_y), atof(value2));
107 if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_spacing), atof(value3));
108 }
109 else if (strcmp (key, "panel_position") == 0) {
110 extract_values(value, &value1, &value2, &value3);
111 /*
112 if (strcmp (value1, "top") == 0) panel_position = TOP;
113 else {
114 if (strcmp (value1, "bottom") == 0) panel_position = BOTTOM;
115 else panel_position = CENTER;
116 }
117
118 if (!value2) panel_position |= CENTER;
119 else {
120 if (strcmp (value2, "left") == 0) panel_position |= LEFT;
121 else {
122 if (strcmp (value2, "right") == 0) panel_position |= RIGHT;
123 else panel_position |= CENTER;
124 }
125 }
126 if (!value3) panel_horizontal = 1;
127 else {
128 if (strcmp (value3, "vertical") == 0) panel_horizontal = 0;
129 else panel_horizontal = 1;
130 }
131 */
132 }
133 else if (strcmp (key, "panel_background_id") == 0) {
134 //int id = atoi (value);
135 //id = (id < backgrounds->len && id >= 0) ? id : 0;
136 //panel_config.area.bg = &g_array_index(backgrounds, Background, id);
137 }
138 else if (strcmp (key, "wm_menu") == 0) {
139 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_wm_menu), atoi(value));
140 }
141 else if (strcmp (key, "panel_dock") == 0) {
142 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_dock), atoi(value));
143 }
144 else if (strcmp (key, "panel_layer") == 0) {
145 if (strcmp(value, "bottom") == 0)
146 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 2);
147 else if (strcmp(value, "top") == 0)
148 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 0);
149 else
150 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_layer), 1);
151 }
152 else if (strcmp (key, "panel_monitor") == 0) {
153 //panel_config.monitor = config_get_monitor(value);
154 }
155 else if (strcmp (key, "font_shadow") == 0) {
156 //panel_config.g_task.font_shadow = atoi (value);
157 }
158 else if (strcmp (key, "urgent_nb_of_blink") == 0) {
159 //max_tick_urgent = atoi (value);
160 }
161
162 /* autohide options */
163 else if (strcmp(key, "autohide") == 0) {
164 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel_autohide), atoi(value));
165 }
166 else if (strcmp(key, "autohide_show_timeout") == 0) {
167 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_show_time), atof(value));
168 }
169 else if (strcmp(key, "autohide_hide_timeout") == 0) {
170 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_hide_time), atof(value));
171 }
172 else if (strcmp(key, "strut_policy") == 0) {
173 if (strcmp(value, "follow_size") == 0)
174 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 0);
175 else if (strcmp(value, "none") == 0)
176 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 2);
177 else
178 gtk_combo_box_set_active(GTK_COMBO_BOX(panel_combo_strut_policy), 1);
179 }
180 else if (strcmp(key, "autohide_height") == 0) {
181 if (atoi(value) == 0) {
182 // autohide need height > 0
183 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_size), 1);
184 }
185 else
186 gtk_spin_button_set_value(GTK_SPIN_BUTTON(panel_autohide_size), atof(value));
187 }
188
189 /* Battery */
190 else if (strcmp (key, "battery_low_status") == 0) {
191 #ifdef ENABLE_BATTERY
192 //battery_low_status = atoi(value);
193 //if(battery_low_status < 0 || battery_low_status > 100)
194 //battery_low_status = 0;
195 #endif
196 }
197 else if (strcmp (key, "battery_low_cmd") == 0) {
198 #ifdef ENABLE_BATTERY
199 //if (strlen(value) > 0)
200 //battery_low_cmd = strdup (value);
201 #endif
202 }
203 else if (strcmp (key, "bat1_font") == 0) {
204 #ifdef ENABLE_BATTERY
205 //bat1_font_desc = pango_font_description_from_string (value);
206 #endif
207 }
208 else if (strcmp (key, "bat2_font") == 0) {
209 #ifdef ENABLE_BATTERY
210 //bat2_font_desc = pango_font_description_from_string (value);
211 #endif
212 }
213 else if (strcmp (key, "battery_font_color") == 0) {
214 #ifdef ENABLE_BATTERY
215 extract_values(value, &value1, &value2, &value3);
216 //get_color (value1, panel_config.battery.font.color);
217 //if (value2) panel_config.battery.font.alpha = (atoi (value2) / 100.0);
218 //else panel_config.battery.font.alpha = 0.5;
219 #endif
220 }
221 else if (strcmp (key, "battery_padding") == 0) {
222 #ifdef ENABLE_BATTERY
223 extract_values(value, &value1, &value2, &value3);
224 //panel_config.battery.area.paddingxlr = panel_config.battery.area.paddingx = atoi (value1);
225 //if (value2) panel_config.battery.area.paddingy = atoi (value2);
226 //if (value3) panel_config.battery.area.paddingx = atoi (value3);
227 #endif
228 }
229 else if (strcmp (key, "battery_background_id") == 0) {
230 #ifdef ENABLE_BATTERY
231 //int id = atoi (value);
232 //id = (id < backgrounds->len && id >= 0) ? id : 0;
233 //panel_config.battery.area.bg = &g_array_index(backgrounds, Background, id);
234 #endif
235 }
236 else if (strcmp (key, "battery_hide") == 0) {
237 #ifdef ENABLE_BATTERY
238 //percentage_hide = atoi (value);
239 //if (percentage_hide == 0)
240 // percentage_hide = 101;
241 #endif
242 }
243
244 /* Clock */
245 else if (strcmp (key, "time1_format") == 0) {
246 //if (strlen(value) > 0) {
247 //time1_format = strdup (value);
248 //clock_enabled = 1;
249 //}
250 }
251 else if (strcmp (key, "time2_format") == 0) {
252 //if (strlen(value) > 0)
253 //time2_format = strdup (value);
254 }
255 else if (strcmp (key, "time1_font") == 0) {
256 //time1_font_desc = pango_font_description_from_string (value);
257 }
258 else if (strcmp(key, "time1_timezone") == 0) {
259 //if (strlen(value) > 0)
260 //time1_timezone = strdup(value);
261 }
262 else if (strcmp(key, "time2_timezone") == 0) {
263 //if (strlen(value) > 0)
264 //time2_timezone = strdup(value);
265 }
266 else if (strcmp (key, "time2_font") == 0) {
267 //time2_font_desc = pango_font_description_from_string (value);
268 }
269 else if (strcmp (key, "clock_font_color") == 0) {
270 extract_values(value, &value1, &value2, &value3);
271 //get_color (value1, panel_config.clock.font.color);
272 //if (value2) panel_config.clock.font.alpha = (atoi (value2) / 100.0);
273 //else panel_config.clock.font.alpha = 0.5;
274 }
275 else if (strcmp (key, "clock_padding") == 0) {
276 extract_values(value, &value1, &value2, &value3);
277 //panel_config.clock.area.paddingxlr = panel_config.clock.area.paddingx = atoi (value1);
278 //if (value2) panel_config.clock.area.paddingy = atoi (value2);
279 //if (value3) panel_config.clock.area.paddingx = atoi (value3);
280 }
281 else if (strcmp (key, "clock_background_id") == 0) {
282 //int id = atoi (value);
283 //id = (id < backgrounds->len && id >= 0) ? id : 0;
284 //panel_config.clock.area.bg = &g_array_index(backgrounds, Background, id);
285 }
286 else if (strcmp(key, "clock_tooltip") == 0) {
287 //if (strlen(value) > 0)
288 //time_tooltip_format = strdup (value);
289 }
290 else if (strcmp(key, "clock_tooltip_timezone") == 0) {
291 //if (strlen(value) > 0)
292 //time_tooltip_timezone = strdup(value);
293 }
294 else if (strcmp(key, "clock_lclick_command") == 0) {
295 //if (strlen(value) > 0)
296 //clock_lclick_command = strdup(value);
297 }
298 else if (strcmp(key, "clock_rclick_command") == 0) {
299 //if (strlen(value) > 0)
300 //clock_rclick_command = strdup(value);
301 }
302
303 /* Taskbar */
304 else if (strcmp (key, "taskbar_mode") == 0) {
305 if (strcmp (value, "multi_desktop") == 0)
306 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 1);
307 else
308 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_desktop), 0);
309 }
310 else if (strcmp (key, "taskbar_padding") == 0) {
311 extract_values(value, &value1, &value2, &value3);
312 gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_padding_x), atof(value1));
313 gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_spacing), atof(value1));
314 if (value2) gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_padding_y), atof(value2));
315 if (value3) gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_spacing), atof(value3));
316 }
317 else if (strcmp (key, "taskbar_background_id") == 0) {
318 //int id = atoi (value);
319 //id = (id < backgrounds->len && id >= 0) ? id : 0;
320 //panel_config.g_taskbar.background[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id);
321 //if (panel_config.g_taskbar.background[TASKBAR_ACTIVE] == 0)
322 //panel_config.g_taskbar.background[TASKBAR_ACTIVE] = panel_config.g_taskbar.background[TASKBAR_NORMAL];
323 }
324 else if (strcmp (key, "taskbar_active_background_id") == 0) {
325 //int id = atoi (value);
326 //id = (id < backgrounds->len && id >= 0) ? id : 0;
327 //panel_config.g_taskbar.background[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, id);
328 }
329 else if (strcmp (key, "taskbar_name") == 0) {
330 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(taskbar_show_name), atoi(value));
331 }
332 else if (strcmp (key, "taskbar_name_padding") == 0) {
333 extract_values(value, &value1, &value2, &value3);
334 gtk_spin_button_set_value(GTK_SPIN_BUTTON(taskbar_name_padding_x), atof(value1));
335 }
336 else if (strcmp (key, "taskbar_name_background_id") == 0) {
337 //int id = atoi (value);
338 //id = (id < backgrounds->len && id >= 0) ? id : 0;
339 //panel_config.g_taskbar.background_name[TASKBAR_NORMAL] = &g_array_index(backgrounds, Background, id);
340 //if (panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] == 0)
341 //panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] = panel_config.g_taskbar.background_name[TASKBAR_NORMAL];
342 }
343 else if (strcmp (key, "taskbar_name_active_background_id") == 0) {
344 //int id = atoi (value);
345 //id = (id < backgrounds->len && id >= 0) ? id : 0;
346 //panel_config.g_taskbar.background_name[TASKBAR_ACTIVE] = &g_array_index(backgrounds, Background, id);
347 }
348 else if (strcmp (key, "taskbar_name_font") == 0) {
349 gtk_font_button_set_font_name(GTK_FONT_BUTTON(taskbar_name_font), value);
350 }
351 else if (strcmp (key, "taskbar_name_font_color") == 0) {
352 extract_values(value, &value1, &value2, &value3);
353 GdkColor col;
354 hex2gdk(value1, &col);
355 gtk_color_button_set_color(GTK_COLOR_BUTTON(taskbar_name_inactive_color), &col);
356 if (value2) {
357 int alpha = atoi(value2);
358 gtk_color_button_set_alpha(GTK_COLOR_BUTTON(taskbar_name_inactive_color), (alpha*65535)/100);
359 }
360 }
361 else if (strcmp (key, "taskbar_name_active_font_color") == 0) {
362 extract_values(value, &value1, &value2, &value3);
363 GdkColor col;
364 hex2gdk(value1, &col);
365 gtk_color_button_set_color(GTK_COLOR_BUTTON(taskbar_name_active_color), &col);
366 if (value2) {
367 int alpha = atoi(value2);
368 gtk_color_button_set_alpha(GTK_COLOR_BUTTON(taskbar_name_active_color), (alpha*65535)/100);
369 }
370 }
371
372 /* Task */
373 else if (strcmp (key, "task_text") == 0) {
374 //panel_config.g_task.text = atoi (value);
375 }
376 else if (strcmp (key, "task_icon") == 0) {
377 //panel_config.g_task.icon = atoi (value);
378 }
379 else if (strcmp (key, "task_centered") == 0) {
380 //panel_config.g_task.centered = atoi (value);
381 }
382 else if (strcmp (key, "task_width") == 0) {
383 // old parameter : just for backward compatibility
384 //panel_config.g_task.maximum_width = atoi (value);
385 //panel_config.g_task.maximum_height = 30;
386 }
387 else if (strcmp (key, "task_maximum_size") == 0) {
388 extract_values(value, &value1, &value2, &value3);
389 //panel_config.g_task.maximum_width = atoi (value1);
390 //panel_config.g_task.maximum_height = 30;
391 //if (value2)
392 //panel_config.g_task.maximum_height = atoi (value2);
393 }
394 else if (strcmp (key, "task_padding") == 0) {
395 extract_values(value, &value1, &value2, &value3);
396 //panel_config.g_task.area.paddingxlr = panel_config.g_task.area.paddingx = atoi (value1);
397 //if (value2) panel_config.g_task.area.paddingy = atoi (value2);
398 //if (value3) panel_config.g_task.area.paddingx = atoi (value3);
399 }
400 else if (strcmp (key, "task_font") == 0) {
401 //panel_config.g_task.font_desc = pango_font_description_from_string (value);
402 }
403 else if (g_regex_match_simple("task.*_font_color", key, 0, 0)) {
404 /*gchar** split = g_regex_split_simple("_", key, 0, 0);
405 int status = get_task_status(split[1]);
406 g_strfreev(split);
407 extract_values(value, &value1, &value2, &value3);
408 float alpha = 1;
409 if (value2) alpha = (atoi (value2) / 100.0);
410 get_color (value1, panel_config.g_task.font[status].color);
411 panel_config.g_task.font[status].alpha = alpha;
412 panel_config.g_task.config_font_mask |= (1<<status);
413 */
414 }
415 else if (g_regex_match_simple("task.*_icon_asb", key, 0, 0)) {
416 /*gchar** split = g_regex_split_simple("_", key, 0, 0);
417 int status = get_task_status(split[1]);
418 g_strfreev(split);
419 extract_values(value, &value1, &value2, &value3);
420 panel_config.g_task.alpha[status] = atoi(value1);
421 panel_config.g_task.saturation[status] = atoi(value2);
422 panel_config.g_task.brightness[status] = atoi(value3);
423 panel_config.g_task.config_asb_mask |= (1<<status);
424 */
425 }
426 else if (g_regex_match_simple("task.*_background_id", key, 0, 0)) {
427 /*gchar** split = g_regex_split_simple("_", key, 0, 0);
428 int status = get_task_status(split[1]);
429 g_strfreev(split);
430 int id = atoi (value);
431 id = (id < backgrounds->len && id >= 0) ? id : 0;
432 panel_config.g_task.background[status] = &g_array_index(backgrounds, Background, id);
433 panel_config.g_task.config_background_mask |= (1<<status);
434 if (status == TASK_NORMAL) panel_config.g_task.area.bg = panel_config.g_task.background[TASK_NORMAL];
435 */
436 }
437 // "tooltip" is deprecated but here for backwards compatibility
438 else if (strcmp (key, "task_tooltip") == 0 || strcmp(key, "tooltip") == 0) {
439 //panel_config.g_task.tooltip_enabled = atoi(value);
440 }
441
442 /* Systray */
443 else if (strcmp (key, "systray_padding") == 0) {
444 extract_values(value, &value1, &value2, &value3);
445 //systray.area.paddingxlr = systray.area.paddingx = atoi (value1);
446 //if (value2) systray.area.paddingy = atoi (value2);
447 //if (value3) systray.area.paddingx = atoi (value3);
448 }
449 else if (strcmp (key, "systray_background_id") == 0) {
450 //int id = atoi (value);
451 //id = (id < backgrounds->len && id >= 0) ? id : 0;
452 //systray.area.bg = &g_array_index(backgrounds, Background, id);
453 }
454 else if (strcmp(key, "systray_sort") == 0) {
455 if (strcmp(value, "descending") == 0)
456 gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 1);
457 else if (strcmp(value, "ascending") == 0)
458 gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 0);
459 else if (strcmp(value, "right2left") == 0)
460 gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 3);
461 else // default to left2right
462 gtk_combo_box_set_active(GTK_COMBO_BOX(systray_icon_order), 2);
463 }
464 else if (strcmp(key, "systray_icon_size") == 0) {
465 //systray_max_icon_size = atoi(value);
466 }
467 else if (strcmp(key, "systray_icon_asb") == 0) {
468 extract_values(value, &value1, &value2, &value3);
469 //systray.alpha = atoi(value1);
470 //systray.saturation = atoi(value2);
471 //systray.brightness = atoi(value3);
472 }
473
474 /* Launcher */
475 else if (strcmp (key, "launcher_padding") == 0) {
476 extract_values(value, &value1, &value2, &value3);
477 //panel_config.launcher.area.paddingxlr = panel_config.launcher.area.paddingx = atoi (value1);
478 //if (value2) panel_config.launcher.area.paddingy = atoi (value2);
479 //if (value3) panel_config.launcher.area.paddingx = atoi (value3);
480 }
481 else if (strcmp (key, "launcher_background_id") == 0) {
482 //int id = atoi (value);
483 //id = (id < backgrounds->len && id >= 0) ? id : 0;
484 //panel_config.launcher.area.bg = &g_array_index(backgrounds, Background, id);
485 }
486 else if (strcmp(key, "launcher_icon_size") == 0) {
487 //launcher_max_icon_size = atoi(value);
488 }
489 else if (strcmp(key, "launcher_item_app") == 0) {
490 //char *app = strdup(value);
491 //panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, app);
492 }
493 else if (strcmp(key, "launcher_icon_theme") == 0) {
494 // if XSETTINGS manager running, tint2 use it.
495 //icon_theme_name = strdup(value);
496 }
497
498 /* Tooltip */
499 else if (strcmp (key, "tooltip_show_timeout") == 0) {
500 //int timeout_msec = 1000*atof(value);
501 }
502 else if (strcmp (key, "tooltip_hide_timeout") == 0) {
503 //int timeout_msec = 1000*atof(value);
504 }
505 else if (strcmp (key, "tooltip_padding") == 0) {
506 extract_values(value, &value1, &value2, &value3);
507 //if (value1) g_tooltip.paddingx = atoi(value1);
508 //if (value2) g_tooltip.paddingy = atoi(value2);
509 }
510 else if (strcmp (key, "tooltip_background_id") == 0) {
511 //int id = atoi (value);
512 //id = (id < backgrounds->len && id >= 0) ? id : 0;
513 //g_tooltip.bg = &g_array_index(backgrounds, Background, id);
514 }
515 else if (strcmp (key, "tooltip_font_color") == 0) {
516 extract_values(value, &value1, &value2, &value3);
517 //get_color(value1, g_tooltip.font_color.color);
518 //if (value2) g_tooltip.font_color.alpha = (atoi (value2) / 100.0);
519 //else g_tooltip.font_color.alpha = 0.1;
520 }
521 else if (strcmp (key, "tooltip_font") == 0) {
522 //g_tooltip.font_desc = pango_font_description_from_string(value);
523 }
524
525 /* Mouse actions */
526 else if (strcmp (key, "mouse_middle") == 0) {
527 //get_action (value, &mouse_middle);
528 }
529 else if (strcmp (key, "mouse_right") == 0) {
530 }
531 else if (strcmp (key, "mouse_scroll_up") == 0) {
532 }
533 else if (strcmp (key, "mouse_scroll_down") == 0) {
534 }
535
536 if (value1) free (value1);
537 if (value2) free (value2);
538 if (value3) free (value3);
539 }
540
541
542 void hex2gdk(char *hex, GdkColor *color)
543 {
544 if (hex == NULL || hex[0] != '#') return;
545
546 color->red = 257 * (hex_char_to_int (hex[1]) * 16 + hex_char_to_int (hex[2]));
547 color->green = 257 * (hex_char_to_int (hex[3]) * 16 + hex_char_to_int (hex[4]));
548 color->blue = 257 * (hex_char_to_int (hex[5]) * 16 + hex_char_to_int (hex[6]));
549 }
550
551
This page took 0.066049 seconds and 4 git commands to generate.