2 * Copyright (C) 2010-2013 jeanfi@gmail.com
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.
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.
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
19 #ifndef _PSENSOR_CONFIG_H_
20 #define _PSENSOR_CONFIG_H_
22 #include <gconf/gconf-client.h>
27 enum temperature_unit {
32 enum sensorlist_position {
33 SENSORLIST_POSITION_RIGHT,
34 SENSORLIST_POSITION_LEFT,
35 SENSORLIST_POSITION_TOP,
36 SENSORLIST_POSITION_BOTTOM
40 struct color *graph_bgcolor;
41 struct color *graph_fgcolor;
43 double graph_bg_alpha;
45 bool alpha_channel_enabled;
48 * Position of the sensors list table
50 enum sensorlist_position sensorlist_position;
52 bool window_decoration_enabled;
53 bool window_keep_below_enabled;
54 bool window_restore_enabled;
55 /* Last saved position of the window. */
58 /* Last saved size of the window. */
61 /* Last saved position of the window divider. */
62 int window_divider_pos;
64 int graph_update_interval;
65 int graph_monitoring_duration;
67 int sensor_values_max_length;
68 int sensor_update_interval;
70 bool menu_bar_disabled;
72 bool unity_launcher_count_disabled;
76 enum temperature_unit temperature_unit;
83 Loads config from GConf
85 struct config *config_load();
87 void config_save(const struct config *);
89 void config_cleanup();
91 struct color *config_get_sensor_color(const char *sid, const struct color *);
92 void config_set_sensor_color(const char *sid, const struct color *);
94 int config_get_sensor_alarm_high_threshold(const char *);
95 void config_set_sensor_alarm_high_threshold(const char *, int);
97 int config_get_sensor_alarm_low_threshold(const char *);
98 void config_set_sensor_alarm_low_threshold(const char *, int);
100 bool config_get_sensor_alarm_enabled(const char *);
101 void config_set_sensor_alarm_enabled(const char *, bool);
103 bool config_is_sensor_enabled(const char *);
104 void config_set_sensor_enabled(const char *, bool);
106 char *config_get_sensor_name(const char *);
107 void config_set_sensor_name(const char *, const char *);
109 bool config_is_appindicator_enabled(const char *);
110 void config_set_appindicator_enabled(const char *, bool);
112 void config_slog_enabled_notify_add(GConfClientNotifyFunc cbk, void *data);
113 bool is_slog_enabled();
115 int config_get_slog_interval();
117 int config_get_sensor_position(const char *);
118 void config_set_sensor_position(const char *, int);