cleanup notification support
[psensor.git] / src / cfg.h
1 /*
2     Copyright (C) 2010-2011 jeanfi@gmail.com
3
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 of the License, or
7     (at your option) any later version.
8
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.
13
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
16     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17     02110-1301 USA
18 */
19
20 #ifndef _PSENSOR_CONFIG_H_
21 #define _PSENSOR_CONFIG_H_
22
23 #include "color.h"
24
25 enum sensorlist_position {
26         SENSORLIST_POSITION_RIGHT,
27         SENSORLIST_POSITION_LEFT,
28         SENSORLIST_POSITION_TOP,
29         SENSORLIST_POSITION_BOTTOM
30 };
31
32 struct config {
33         struct color *graph_bgcolor;
34         struct color *graph_fgcolor;
35
36         double graph_bg_alpha;
37
38         int alpha_channel_enabled;
39
40         /*
41            Position of the sensors list table
42          */
43         enum sensorlist_position sensorlist_position;
44
45         int window_decoration_enabled;
46         int window_keep_below_enabled;
47         int window_restore_enabled;
48         /* Last saved position of the window. */
49         int window_x;
50         int window_y;
51         /* Last saved size of the window. */
52         int window_w;
53         int window_h;
54         /* Last saved position of the window divider. */
55         int window_divider_pos;
56
57         int graph_update_interval;
58         int graph_monitoring_duration;
59
60         int sensor_values_max_length;
61         int sensor_update_interval;
62
63         int menu_bar_disabled;
64
65         int unity_launcher_count_disabled;
66
67         int hide_on_startup;
68 };
69
70 /*
71   Loads config from GConf
72 */
73 struct config *config_load();
74
75 void config_save(struct config *);
76
77 void config_init();
78
79 void config_cleanup();
80
81 struct color *config_get_sensor_color(char *, struct color *);
82 void config_set_sensor_color(char *, struct color *);
83
84 int config_get_sensor_alarm_limit(char *, int);
85 void config_set_sensor_alarm_limit(char *, int);
86
87 int config_get_sensor_alarm_enabled(char *);
88 void config_set_sensor_alarm_enabled(char *, int);
89
90 int config_is_sensor_enabled(char *);
91 void config_set_sensor_enabled(char *, int);
92
93 char *config_get_sensor_name(char *);
94 void config_set_sensor_name(char *, const char *);
95
96 #endif