X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=blobdiff_plain;f=src%2Fui.h;h=426f29cd9fefc36d589b2c6762792636a8eae30e;hp=f6559cd869c6d1a509f6e7468cfd037a2e07a339;hb=c1e20f2631a1249720e9c75d753eacfcb0f6c7b9;hpb=dbd93b22ec707f1d749e06b40947be77142ed85f diff --git a/src/ui.h b/src/ui.h index f6559cd..426f29c 100644 --- a/src/ui.h +++ b/src/ui.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 jeanfi@gmail.com + * Copyright (C) 2010-2016 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 @@ -21,64 +21,36 @@ #include "config.h" +#include + #include #include -#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029) +#if defined(HAVE_APPINDICATOR) #include #endif #include "psensor.h" +#define PSENSOR_ICON "psensor" + struct ui_psensor { struct psensor **sensors; - - GtkWidget *w_graph; - - struct ui_sensorlist *ui_sensorlist; + /* mutex which MUST be used for accessing sensors.*/ + pthread_mutex_t sensors_mutex; struct config *config; GtkWidget *main_window; - GtkWidget *menu_bar; - - /* - * The main vertical box, top contains the menubar, bottom - * contains the sensor_box. - */ - GtkWidget *main_box; + GtkWidget *popup_menu; - /* - * The box which contains the sensors graph and the sensors - * information list. - */ - GtkWidget *sensor_box; + GtkListStore *sensors_store; + GtkTreeView *sensors_tree; int graph_update_interval; - - GMutex *sensors_mutex; - -#ifdef HAVE_LIBNOTIFY - /* Time of the last notification */ - struct timeval *notification_last_time; -#endif - -#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029) - AppIndicator *indicator; -#endif }; -/* - * Update the window according to the configuration. - * - * Creates or re-creates the sensor_box according to the position of - * the list of sensors in the configuration. - * - * Show or hide the menu bar. - */ -void ui_window_update(struct ui_psensor *); - /* Show the main psensor window. */ void ui_window_show(struct ui_psensor *); @@ -90,6 +62,13 @@ void ui_window_create(struct ui_psensor *ui); void ui_menu_bar_show(unsigned int show, struct ui_psensor *ui); -void ui_show_about_dialog(); +void ui_enable_alpha_channel(struct ui_psensor *ui); + +void ui_cb_preferences(GtkMenuItem *mi, gpointer data); +void ui_cb_menu_quit(GtkMenuItem *mi, gpointer data); +void ui_cb_sensor_preferences(GtkMenuItem *mi, gpointer data); + +GtkWidget *ui_get_graph(void); +struct psensor **ui_get_sensors_ordered_by_position(struct psensor **); #endif