#define _GNU_SOURCE #include #include #include /* * Short hack to dump the widget path as styles are applied against it. * Made to help find the Right Thing to match against in gtkrcs * Works with gtk 1.2 and 2.2 * * Ben Winslow - Jul 2003 * * gcc -shared -o /tmp/sd.so styledebug.c -Wall `pkg-config --cflags gtk+-2.0` */ GtkStyle *gtk_rc_get_style(GtkWidget *widget) { gchar *path, *path_rev; guint len; static GtkStyle *(*real_get_style)(GtkWidget *) = NULL; static void (*gtk_widget_path)(GtkWidget *, guint *, gchar **, gchar **) = NULL; if (!real_get_style) real_get_style = dlsym(RTLD_NEXT, "gtk_rc_get_style"); if (!real_get_style) return NULL; if (!gtk_widget_path) gtk_widget_path = dlsym(RTLD_NEXT, "gtk_widget_path"); if (!gtk_widget_path) return NULL; gtk_widget_path(widget, &len, &path, &path_rev); printf("STYLE> %s\n", path); fflush(stdout); return real_get_style(widget); }