use bool def from stdbool.h or define it if it does not exist
[psensor.git] / src / cfg.h
1 /*
2  * Copyright (C) 2010-2012 jeanfi@gmail.com
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of the
7  * License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * 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 #ifndef _PSENSOR_CONFIG_H_
20 #define _PSENSOR_CONFIG_H_
21
22 #include "bool.h"
23 #include "color.h"
24
25 enum temperature_unit {
26         CELCIUS,
27         FAHRENHEIT
28 };
29
30 enum sensorlist_position {
31         SENSORLIST_POSITION_RIGHT,
32         SENSORLIST_POSITION_LEFT,
33         SENSORLIST_POSITION_TOP,
34         SENSORLIST_POSITION_BOTTOM
35 };
36
37 struct config {
38         struct color *graph_bgcolor;
39         struct color *graph_fgcolor;
40
41         double graph_bg_alpha;
42
43         bool alpha_channel_enabled;
44
45         /*
46          * Position of the sensors list table
47          */
48         enum sensorlist_position sensorlist_position;
49
50         bool window_decoration_enabled;
51         bool window_keep_below_enabled;
52         bool window_restore_enabled;
53         /* Last saved position of the window. */
54         int window_x;
55         int window_y;
56         /* Last saved size of the window. */
57         int window_w;
58         int window_h;
59         /* Last saved position of the window divider. */
60         int window_divider_pos;
61
62         int graph_update_interval;
63         int graph_monitoring_duration;
64
65         int sensor_values_max_length;
66         int sensor_update_interval;
67
68         bool menu_bar_disabled;
69
70         bool unity_launcher_count_disabled;
71
72         int hide_on_startup;
73
74         enum temperature_unit temperature_unit;
75 };
76
77 /*
78   Loads config from GConf
79 */
80 struct config *config_load();
81
82 void config_save(const struct config *);
83
84 void config_cleanup();
85
86 struct color *config_get_sensor_color(const char *sid, const struct color *);
87 void config_set_sensor_color(const char *sid, const struct color *);
88
89 int config_get_sensor_alarm_high_threshold(const char *);
90 void config_set_sensor_alarm_high_threshold(const char *, int);
91
92 int config_get_sensor_alarm_low_threshold(const char *);
93 void config_set_sensor_alarm_low_threshold(const char *, int);
94
95 bool config_get_sensor_alarm_enabled(const char *);
96 void config_set_sensor_alarm_enabled(const char *, bool);
97
98 bool config_is_sensor_enabled(const char *);
99 void config_set_sensor_enabled(const char *, bool);
100
101 char *config_get_sensor_name(const char *);
102 void config_set_sensor_name(const char *, const char *);
103
104 bool config_is_appindicator_enabled(const char *);
105 void config_set_appindicator_enabled(const char *, bool);
106
107 #endif