2 * Copyright (C) 2010-2016 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_UI_H_
20 #define _PSENSOR_UI_H_
26 #include <glib/gi18n.h>
29 #if defined(HAVE_APPINDICATOR)
30 #include <libappindicator/app-indicator.h>
35 #define PSENSOR_ICON "psensor"
38 struct psensor **sensors;
39 /* mutex which MUST be used for accessing sensors.*/
40 pthread_mutex_t sensors_mutex;
42 struct config *config;
44 GtkWidget *main_window;
46 GtkWidget *popup_menu;
48 GtkListStore *sensors_store;
49 GtkTreeView *sensors_tree;
51 int graph_update_interval;
54 /* Show the main psensor window. */
55 void ui_window_show(struct ui_psensor *);
57 /* Must be called to terminate Psensor UI. */
58 void ui_psensor_quit(struct ui_psensor *ui);
60 /* Creates the main GTK window */
61 void ui_window_create(struct ui_psensor *ui);
63 void ui_menu_bar_show(unsigned int show, struct ui_psensor *ui);
65 void ui_enable_alpha_channel(struct ui_psensor *ui);
67 void ui_cb_preferences(GtkMenuItem *mi, gpointer data);
68 void ui_cb_menu_quit(GtkMenuItem *mi, gpointer data);
69 void ui_cb_sensor_preferences(GtkMenuItem *mi, gpointer data);
71 GtkWidget *ui_get_graph(void);
73 struct psensor **ui_get_sensors_ordered_by_position(struct psensor **);