X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fcfg.h;h=f7d4df179a67fbd421b82a4f5ece70846130a770;hb=af47d522aa7957879bd87a44a416bb25544ed9f5;hp=2ba847524184b43c91887810e5d03e89443e68e2;hpb=276294af0c56ea5cd7d7b11349a893852245f348;p=psensor.git diff --git a/src/cfg.h b/src/cfg.h index 2ba8475..f7d4df1 100644 --- a/src/cfg.h +++ b/src/cfg.h @@ -1,31 +1,32 @@ /* - Copyright (C) 2010-2011 jeanfi@gmail.com - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA -*/ - + * Copyright (C) 2010-2012 jeanfi@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #ifndef _PSENSOR_CONFIG_H_ #define _PSENSOR_CONFIG_H_ #include "color.h" -#define SENSORLIST_POSITION_RIGHT 0 -#define SENSORLIST_POSITION_LEFT 1 -#define SENSORLIST_POSITION_TOP 2 -#define SENSORLIST_POSITION_BOTTOM 3 +enum sensorlist_position { + SENSORLIST_POSITION_RIGHT, + SENSORLIST_POSITION_LEFT, + SENSORLIST_POSITION_TOP, + SENSORLIST_POSITION_BOTTOM +}; struct config { struct color *graph_bgcolor; @@ -38,11 +39,19 @@ struct config { /* Position of the sensors list table */ - int sensorlist_position; + enum sensorlist_position sensorlist_position; int window_decoration_enabled; - int window_keep_below_enabled; + int window_restore_enabled; + /* Last saved position of the window. */ + int window_x; + int window_y; + /* Last saved size of the window. */ + int window_w; + int window_h; + /* Last saved position of the window divider. */ + int window_divider_pos; int graph_update_interval; int graph_monitoring_duration; @@ -66,13 +75,13 @@ void config_save(struct config *); void config_init(); -struct color *config_get_sensor_color(char *sensor_name, - struct color *default_color); +void config_cleanup(); -void config_set_sensor_color(char *sensor_name, struct color *color); +struct color *config_get_sensor_color(char *, struct color *); +void config_set_sensor_color(char *, struct color *); int config_get_sensor_alarm_limit(char *, int); -void config_set_sensor_alarm_limit(char *sensor_name, int alarm_limit); +void config_set_sensor_alarm_limit(char *, int); int config_get_sensor_alarm_enabled(char *); void config_set_sensor_alarm_enabled(char *, int);