| 1 |
#include <gtk/gtk.h> |
| 2 |
|
| 3 |
static char *cursor_names[] = { |
| 4 |
/*** resize cursors that we're using for csd, from gtkwindow.c ***/ |
| 5 |
"nw-resize", |
| 6 |
"n-resize", |
| 7 |
"ne-resize", |
| 8 |
"w-resize", |
| 9 |
"e-resize", |
| 10 |
"sw-resize", |
| 11 |
"s-resize", |
| 12 |
"se-resize", |
| 13 |
|
| 14 |
/*** resize cursors, from gtkpaned.c ***/ |
| 15 |
"col-resize", |
| 16 |
"row-resize", |
| 17 |
|
| 18 |
/*** dnd cursors, from gtkdnd.c ***/ |
| 19 |
"dnd-ask", |
| 20 |
"copy", |
| 21 |
"move", |
| 22 |
"alias", |
| 23 |
"no-drop", |
| 24 |
|
| 25 |
"none", /* used e.g. in gtkentry.c */ |
| 26 |
"pointer", /* used e.g. in gtklinkbutton.c */ |
| 27 |
"text", /* used e.g. in gtkentry.c */ |
| 28 |
"crosshair", /* used e.g. in gtkcolorplane.c */ |
| 29 |
"progress", /* used e.g. in gtkfilechooserwidget.c */ |
| 30 |
}; |
| 31 |
|
| 32 |
static void |
| 33 |
test_cursor_existence (gconstpointer name) |
| 34 |
{ |
| 35 |
GdkDisplay *display; |
| 36 |
GdkCursor *cursor; |
| 37 |
|
| 38 |
display = gdk_display_get_default (); |
| 39 |
cursor = gdk_cursor_new_from_name (display, name); |
| 40 |
g_assert (cursor != NULL); |
| 41 |
g_object_unref (cursor); |
| 42 |
} |
| 43 |
|
| 44 |
int |
| 45 |
main (int argc, char *argv[]) |
| 46 |
{ |
| 47 |
guint i; |
| 48 |
char *test_name; |
| 49 |
char *theme; |
| 50 |
|
| 51 |
gtk_test_init (&argc, &argv); |
| 52 |
|
| 53 |
g_object_get (gtk_settings_get_default (), "gtk-cursor-theme-name", &theme, NULL); |
| 54 |
g_test_message ("Testing cursor theme: %s", theme); |
| 55 |
g_free (theme); |
| 56 |
|
| 57 |
for (i = 0; i < G_N_ELEMENTS (cursor_names); i++) |
| 58 |
{ |
| 59 |
test_name = g_strdup_printf ("/check-cursor-names/%s", cursor_names[i]); |
| 60 |
g_test_add_data_func (test_name, cursor_names[i], test_cursor_existence); |
| 61 |
g_free (test_name); |
| 62 |
} |
| 63 |
|
| 64 |
return g_test_run(); |
| 65 |
} |