#ifndef _PSENSOR_PGTOP2_H_
#define _PSENSOR_PGTOP2_H_
+#include <bool.h>
#include <psensor.h>
-struct psensor *create_cpu_usage_sensor(int measures_len);
+#if defined(HAVE_GTOP) && HAVE_GTOP
+
+static inline bool gtop2_is_supported(void) { return true; }
+
+struct psensor *create_cpu_usage_sensor(int);
void cpu_usage_sensor_update(struct psensor *);
void gtop2_psensor_list_update(struct psensor **);
+void gtop2_psensor_list_append(struct psensor ***, int);
+
+#else
+
+static inline bool gtop2_is_supported(void) { return false; }
-void gtop2_psensor_list_append(struct psensor ***sensors, int values_max_len);
+static inline struct psensor *create_cpu_usage_sensor(int n) { return NULL; }
+static inline void cpu_usage_sensor_update(struct psensor *s) {}
+
+static inline void gtop2_psensor_list_update(struct psensor **s) {}
+static inline void gtop2_psensor_list_append(struct psensor ***s, int n) {}
+
+#endif
#endif
#include <cfg.h>
#include <graph.h>
#include <nvidia.h>
+#include <pgtop2.h>
#include <pxdg.h>
#include <ui_pref.h>
#include <ui_color.h>
w_gtop2
= GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder,
"gtop2"));
-#if !HAVE_GTOP
- gtk_widget_set_sensitive(GTK_WIDGET(w_gtop2), 0);
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_gtop2), TRUE);
-#else
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_gtop2), FALSE);
-#endif
+
+ if (gtop2_is_supported()) {
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_gtop2), FALSE);
+ } else {
+ gtk_widget_set_sensitive(GTK_WIDGET(w_gtop2), 0);
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_gtop2), TRUE);
+ }
+
gtk_toggle_button_set_active(w_gtop2, config_is_gtop2_enabled());
w_hddtemp