Imported Upstream version 0.6.2.17
[psensor-pkg-debian.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 "color.h"
23
24 enum sensorlist_position {
25         SENSORLIST_POSITION_RIGHT,
26         SENSORLIST_POSITION_LEFT,
27         SENSORLIST_POSITION_TOP,
28         SENSORLIST_POSITION_BOTTOM
29 };
30
31 struct config {
32         struct color *graph_bgcolor;
33         struct color *graph_fgcolor;
34
35         double graph_bg_alpha;
36
37         int alpha_channel_enabled;
38
39         /*
40            Position of the sensors list table
41          */
42         enum sensorlist_position sensorlist_position;
43
44         int window_decoration_enabled;
45         int window_keep_below_enabled;
46         int window_restore_enabled;
47         /* Last saved position of the window. */
48         int window_x;
49         int window_y;
50         /* Last saved size of the window. */
51         int window_w;
52         int window_h;
53         /* Last saved position of the window divider. */
54         int window_divider_pos;
55
56         int graph_update_interval;
57         int graph_monitoring_duration;
58
59         int sensor_values_max_length;
60         int sensor_update_interval;
61
62         int menu_bar_disabled;
63
64         int unity_launcher_count_disabled;
65
66         int hide_on_startup;
67 };
68
69 /*
70   Loads config from GConf
71 */
72 struct config *config_load();
73
74 void config_save(struct config *);
75
76 void config_init();
77
78 void config_cleanup();
79
80 struct color *config_get_sensor_color(char *, struct color *);
81 void config_set_sensor_color(char *, struct color *);
82
83 int config_get_sensor_alarm_limit(char *, int);
84 void config_set_sensor_alarm_limit(char *, int);
85
86 int config_get_sensor_alarm_enabled(char *);
87 void config_set_sensor_alarm_enabled(char *, int);
88
89 int config_is_sensor_enabled(char *);
90 void config_set_sensor_enabled(char *, int);
91
92 char *config_get_sensor_name(char *);
93 void config_set_sensor_name(char *, const char *);
94
95 #endif