#ifndef _PSENSOR_NVIDIA_H_
#define _PSENSOR_NVIDIA_H_
+#include <bool.h>
#include <psensor.h>
-void nvidia_psensor_list_update(struct psensor **sensors);
-void nvidia_psensor_list_append(struct psensor ***sensors, int values_length);
+#if defined(HAVE_NVIDIA) && HAVE_NVIDIA
+static inline bool nvidia_is_supported(void) { return true; }
+
+void nvidia_psensor_list_update(struct psensor **);
+void nvidia_psensor_list_append(struct psensor ***, int);
void nvidia_cleanup(void);
+#else
+
+static inline bool nvidia_is_supported(void) { return false; }
+
+static inline void nvidia_psensor_list_update(struct psensor **s) {}
+static inline void nvidia_psensor_list_append(struct psensor ***, int) {}
+static inline void nvidia_cleanup(void) {}
+
+#endif
+
#endif
#include <ui.h>
#include <cfg.h>
#include <graph.h>
+#include <nvidia.h>
+#include <pxdg.h>
#include <ui_pref.h>
#include <ui_color.h>
-#include <pxdg.h>
GdkRGBA color_to_GdkRGBA(struct color *color)
{
w_nvctrl
= GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder,
"nvctrl"));
-#if !HAVE_NVIDIA
- gtk_widget_set_sensitive(GTK_WIDGET(w_nvctrl), 0);
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_nvctrl), TRUE);
-#else
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_nvctrl), FALSE);
-#endif
+
+ if (nvidia_is_supported()) {
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_nvctrl), FALSE);
+ } else {
+ gtk_widget_set_sensitive(GTK_WIDGET(w_nvctrl), 0);
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_nvctrl), TRUE);
+ }
+
gtk_toggle_button_set_active(w_nvctrl, config_is_nvctrl_enabled());
w_atiadlsdk