improved notification (added psensor icon).
[psensor.git] / src / ui.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_UI_H_
20 #define _PSENSOR_UI_H_
21
22 #include "config.h"
23
24 #include <glib/gi18n.h>
25 #include <gtk/gtk.h>
26
27 #if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
28 #include <libappindicator/app-indicator.h>
29 #endif
30
31 #include "psensor.h"
32
33 #define PSENSOR_ICON "psensor"
34
35 struct ui_psensor {
36         struct psensor **sensors;
37
38         GtkWidget *w_graph;
39
40         struct ui_sensorlist *ui_sensorlist;
41
42         struct config *config;
43
44         GtkWidget *main_window;
45
46         GtkWidget *menu_bar;
47
48         /*
49          * The main vertical box, top contains the menubar, bottom
50          * contains the sensor_box.
51          */
52         GtkWidget *main_box;
53
54         /*
55          * The box which contains the sensors graph and the sensors
56          * information list.
57          */
58         GtkWidget *sensor_box;
59
60         int graph_update_interval;
61
62         GMutex *sensors_mutex;
63 };
64
65 /*
66  * Update the window according to the configuration.
67  *
68  * Creates or re-creates the sensor_box according to the position of
69  * the list of sensors in the configuration.
70  *
71  * Show or hide the menu bar.
72  */
73 void ui_window_update(struct ui_psensor *);
74
75 /* Show the main psensor window. */
76 void ui_window_show(struct ui_psensor *);
77
78 /* Must be called to terminate Psensor UI. */
79 void ui_psensor_quit(struct ui_psensor *ui);
80
81 /* Creates the main GTK window */
82 void ui_window_create(struct ui_psensor *ui);
83
84 void ui_menu_bar_show(unsigned int show, struct ui_psensor *ui);
85
86 void ui_show_about_dialog();
87
88 void ui_enable_alpha_channel(struct ui_psensor *ui);
89
90 #endif