+static GtkStyleContext *style;
+/* Foreground color of the current desktop theme */
+static GdkRGBA theme_fg_color;
+/* Background color of the current desktop theme */
+static GdkRGBA theme_bg_color;
+
+static void update_theme(GtkWidget *w)
+{
+ style = gtk_widget_get_style_context(w);
+
+ gtk_style_context_get_background_color(style,
+ GTK_STATE_FLAG_NORMAL,
+ &theme_bg_color);
+ gtk_style_context_get_color(style,
+ GTK_STATE_FLAG_NORMAL,
+ &theme_fg_color);
+}
+
+static struct psensor **list_filter_graph_enabled(struct psensor **sensors)
+{
+ int n, i;
+ struct psensor **result, **cur, *s;
+
+ if (!sensors)
+ return NULL;
+
+ n = psensor_list_size(sensors);
+ result = malloc((n+1) * sizeof(struct psensor *));
+
+ for (cur = sensors, i = 0; *cur; cur++) {
+ s = *cur;
+
+ if (config_is_sensor_graph_enabled(s->id))
+ result[i++] = s;
+ }
+
+ result[i] = NULL;
+
+ return result;
+}
+