gtk-demo: Don't rely on gdk_cursor_get_image

This function is only implemented on X11. Instead,
just use a fixed set of cursor images from resources.
This commit is contained in:
Matthias Clasen 2015-05-11 23:06:50 -04:00
parent be9915b16a
commit cfc07fdfcf
38 changed files with 83 additions and 3 deletions

View File

@ -155,7 +155,43 @@ RESOURCES = \
css_pixbufs.css \
css_shadows.css \
cssview.css \
reset.css
reset.css \
alias_cursor.png \
all_scroll_cursor.png \
cell_cursor.png \
col_resize_cursor.png \
copy_cursor.png \
crosshair_cursor.png \
default_cursor.png \
e_resize_cursor.png \
ew_resize_cursor.png \
grabbing_cursor.png \
grab_cursor.png \
hand_cursor.png \
help_cursor.png \
move_cursor.png \
ne_resize_cursor.png \
nesw_resize_cursor.png \
none_cursor.png \
no_drop_cursor.png \
not_allowed_cursor.png \
n_resize_cursor.png \
ns_resize_cursor.png \
nw_resize_cursor.png \
nwse_resize_cursor.png \
pointer_cursor.png \
progress_cursor.png \
row_resize_cursor.png \
se_resize_cursor.png \
s_resize_cursor.png \
sw_resize_cursor.png \
text_cursor.png \
vertical_text_cursor.png \
wait_cursor.png \
w_resize_cursor.png \
zoom_in_cursor.png \
zoom_out_cursor.png
iconthemedir = $(datadir)/icons/hicolor

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

View File

@ -51,8 +51,15 @@ add_button (GtkWidget *section,
if (cursor == NULL)
image = gtk_image_new_from_icon_name ("image-missing", GTK_ICON_SIZE_MENU);
else
image = gtk_image_new_from_pixbuf (gdk_cursor_get_image (cursor));
gtk_widget_set_size_request (image, 24, 24);
{
gchar *path;
path = g_strdup_printf ("/cursors/%s_cursor.png", css_name);
g_strdelimit (path, "-", '_');
image = gtk_image_new_from_resource (path);
g_free (path);
}
gtk_widget_set_size_request (image, 32, 32);
button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), image);
gtk_style_context_add_class (gtk_widget_get_style_context (button), "image-button");

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -47,6 +47,43 @@
<file>cssview.css</file>
<file>reset.css</file>
</gresource>
<gresource prefix="/cursors">
<file>alias_cursor.png</file>
<file>all_scroll_cursor.png</file>
<file>cell_cursor.png</file>
<file>col_resize_cursor.png</file>
<file>copy_cursor.png</file>
<file>crosshair_cursor.png</file>
<file>default_cursor.png</file>
<file>e_resize_cursor.png</file>
<file>ew_resize_cursor.png</file>
<file>grabbing_cursor.png</file>
<file>grab_cursor.png</file>
<file>hand_cursor.png</file>
<file>help_cursor.png</file>
<file>move_cursor.png</file>
<file>ne_resize_cursor.png</file>
<file>nesw_resize_cursor.png</file>
<file>no_drop_cursor.png</file>
<file>none_cursor.png</file>
<file>not_allowed_cursor.png</file>
<file>n_resize_cursor.png</file>
<file>ns_resize_cursor.png</file>
<file>nw_resize_cursor.png</file>
<file>nwse_resize_cursor.png</file>
<file>pointer_cursor.png</file>
<file>progress_cursor.png</file>
<file>row_resize_cursor.png</file>
<file>se_resize_cursor.png</file>
<file>s_resize_cursor.png</file>
<file>sw_resize_cursor.png</file>
<file>text_cursor.png</file>
<file>vertical_text_cursor.png</file>
<file>wait_cursor.png</file>
<file>w_resize_cursor.png</file>
<file>zoom_in_cursor.png</file>
<file>zoom_out_cursor.png</file>
</gresource>
<gresource prefix="/iconview">
<file preprocess="to-pixdata">gnome-fs-directory.png</file>
<file preprocess="to-pixdata">gnome-fs-regular.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB