X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fui.h;h=048d23cda85d61cbb411e22a9e74a74823051692;hb=883e54bb39729aaa9221bbebe9c9054ba99a3f5e;hp=5de84485decab6d3f971ee58dce48450c3526c11;hpb=005636d758ea3b7c6d71f02bc93a673977801c8a;p=psensor.git diff --git a/src/ui.h b/src/ui.h index 5de8448..048d23c 100644 --- a/src/ui.h +++ b/src/ui.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2011 jeanfi@gmail.com + * Copyright (C) 2010-2013 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,6 +21,8 @@ #include "config.h" +#include + #include #include @@ -30,19 +32,23 @@ #include "psensor.h" +#define PSENSOR_ICON "psensor" + struct ui_psensor { struct psensor **sensors; + /* mutex which MUST be used for accessing sensors.*/ + pthread_mutex_t sensors_mutex; GtkWidget *w_graph; - struct ui_sensorlist *ui_sensorlist; - struct config *config; GtkWidget *main_window; GtkWidget *menu_bar; + GtkWidget *popup_menu; + /* * The main vertical box, top contains the menubar, bottom * contains the sensor_box. @@ -53,20 +59,13 @@ struct ui_psensor { * The box which contains the sensors graph and the sensors * information list. */ - GtkWidget *sensor_box; - - int graph_update_interval; - - GMutex *sensors_mutex; + GtkPaned *sensor_box; -#ifdef HAVE_LIBNOTIFY - /* Time of the last notification */ - struct timeval *notification_last_time; -#endif + GtkListStore *sensors_store; + GtkTreeView *sensors_tree; + GtkScrolledWindow *sensors_scrolled_tree; -#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029) - AppIndicator *indicator; -#endif + int graph_update_interval; }; /* @@ -79,6 +78,9 @@ struct ui_psensor { */ void ui_window_update(struct ui_psensor *); +/* Show the main psensor window. */ +void ui_window_show(struct ui_psensor *); + /* Must be called to terminate Psensor UI. */ void ui_psensor_quit(struct ui_psensor *ui); @@ -89,4 +91,12 @@ 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_about(GtkMenuItem *mi, gpointer data); +void ui_cb_menu_quit(GtkMenuItem *mi, gpointer data); +void ui_cb_sensor_preferences(GtkMenuItem *mi, gpointer data); + +struct psensor **ui_get_sensors_ordered_by_position(struct ui_psensor *); #endif