(no commit message)
[psensor.git] / src / ui.h
1 /*
2     Copyright (C) 2010-2011 wpitchoune@gmail.com
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU 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
20 #ifndef _PSENSOR_UI_H_
21 #define _PSENSOR_UI_H_
22
23 #include "config.h"
24
25 #include <locale.h>
26 #include <libintl.h>
27 #define _(str) gettext(str)
28
29 #include <gtk/gtk.h>
30
31 #ifdef HAVE_APPINDICATOR
32 #include <libappindicator/app-indicator.h>
33 #endif
34
35 #include "psensor.h"
36
37 struct ui_psensor {
38         struct psensor **sensors;
39
40         GtkWidget *w_graph;
41
42         struct ui_sensorlist *ui_sensorlist;
43
44         struct config *config;
45
46         GtkWidget *main_window;
47         GtkWidget *main_box;
48         GtkWidget *w_sensorlist;
49
50         int graph_update_interval;
51
52 #ifdef HAVE_LIBNOTIFY
53         /*
54          * Time of the last notification
55          */
56         struct timeval *notification_last_time;
57 #endif
58
59 #ifdef HAVE_APPINDICATOR
60         AppIndicator *indicator;
61 #endif
62 };
63
64 void ui_main_box_create(struct ui_psensor *);
65
66 /*
67   Must be called to terminate Psensor UI.
68 */
69 void ui_psensor_exit();
70
71 /*
72   Creates the main GTK window
73 */
74 GtkWidget *ui_window_create(struct ui_psensor * ui);
75
76 #endif