import psensor trunk from private svn
[psensor.git] / src / cfg.h
1 /*
2     Copyright (C) 2010-2011 wpitchoune@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 #define SENSORLIST_POSITION_RIGHT 0
26 #define SENSORLIST_POSITION_LEFT 1
27 #define SENSORLIST_POSITION_TOP 2
28 #define SENSORLIST_POSITION_BOTTOM 3
29
30 struct config {
31         struct color *graph_bgcolor;
32         struct color *graph_fgcolor;
33
34         double graph_bg_alpha;
35
36         int alpha_channel_enabled;
37
38         /*
39            Position of the sensors list table
40          */
41         int sensorlist_position;
42
43         int window_decoration_enabled;
44
45         int window_keep_below_enabled;
46
47         int graph_update_interval;
48         int graph_monitoring_duration;
49
50         int sensor_values_max_length;
51         int sensor_update_interval;
52 };
53
54 /*
55   Loads config from GConf
56 */
57 struct config *config_load();
58
59 void config_save(struct config *);
60
61 void config_init();
62
63 struct color *config_get_sensor_color(char *sensor_name,
64                                       struct color *default_color);
65
66 void config_set_sensor_color(char *sensor_name, struct color *color);
67
68 int config_get_sensor_alarm_limit(char *, int);
69 void config_set_sensor_alarm_limit(char *sensor_name, int alarm_limit);
70
71 int config_get_sensor_alarm_enabled(char *);
72 void config_set_sensor_alarm_enabled(char *, int);
73
74 int config_is_sensor_enabled(char *);
75 void config_set_sensor_enabled(char *, int);
76
77 char *config_get_sensor_name(char *);
78 void config_set_sensor_name(char *, const char *);
79
80 #endif