wok-next view libgtkimageview/stuff/patches/resource.patch @ rev 20333

Up bmpanel2, urxvt, usbip
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Nov 15 16:27:09 2017 +0200 (2017-11-15)
parents
children
line source
1 Origin: Jeffrey Ratcliffe <jjr@debian.org>
2 Bug-Debian: https://bugs.debian.org/789101
3 Last-Update: 2016-02-24
4 --- a/src/Makefile.am
5 +++ b/src/Makefile.am
6 @@ -87,6 +87,12 @@
7 --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \
8 gtk*.h gdk*.h > $@
10 -EXTRA_DIST = gtkimageview-marshal.list wscript_build
11 +# Generate the GResource source file for icon files:
12 +resource_file = gtkimageview.gresource.xml
13 +BUILT_SOURCES += gtkimageview-resources.c
14 +gtkimageview-resources.c: $(resource_file) $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(resource_file))
15 + $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(resource_file)
16 +
17 +EXTRA_DIST = gtkimageview-marshal.list wscript_build $(resource_file)
19 CLEANFILES = $(BUILT_SOURCES)
20 --- a/src/gtkimageview.gresource.xml
21 +++ b/src/gtkimageview.gresource.xml
22 @@ -0,0 +1,7 @@
23 +<?xml version="1.0" encoding="UTF-8"?>
24 +<gresources>
25 + <gresource prefix="/org/gnome/gtkimageview">
26 + <file>gtkimageview-nav_button.png</file>
27 + <file>gtkimageview-nav_button_hc.png</file>
28 + </gresource>
29 +</gresources>
30 --- a/configure.in
31 +++ b/configure.in
32 @@ -29,6 +29,14 @@
33 # Check for glib utils
34 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
35 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
36 +AC_PATH_PROG(GLIB_COMPILE_RESOURCES,[glib-compile-resources],no)
37 +AC_MSG_CHECKING([glib-compile-resources])
38 +if test "x$GLIB_COMPILE_RESOURCES" = xno ; then
39 + GLIB_COMPILE_RESOURCES=""
40 + AC_MSG_RESULT([cannot be found in PATH.])
41 +else
42 + AC_MSG_RESULT([usable.])
43 +fi
45 # 1.8 introduced the --rebuild-sections and --rebuild-types options to
46 # 1.gtkdoc-scan that we need.
47 --- a/src/gtkimagescrollwin.c
48 +++ b/src/gtkimagescrollwin.c
49 @@ -44,97 +44,6 @@
50 /*************************************************************/
51 /***** PRIVATE DATA ******************************************/
52 /*************************************************************/
53 -#ifdef __GNUC__
54 -static const guint8 nav_button[] __attribute__ ((__aligned__ (4))) =
55 -#else
56 -static const guint8 nav_button[] =
57 -#endif
58 -{
59 - ""
60 - /* Pixbuf magic (0x47646b50) */
61 - "GdkP"
62 - /* length: header (24) + pixel_data (784) */
63 - "\0\0\3("
64 - /* pixdata_type (0x1010002) */
65 - "\1\1\0\2"
66 - /* rowstride (56) */
67 - "\0\0\0""8"
68 - /* width (14) */
69 - "\0\0\0\16"
70 - /* height (14) */
71 - "\0\0\0\16"
72 - /* pixel_data: */
73 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377"
74 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
75 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0"
76 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
77 - "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0"
78 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
79 - "\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
80 - "\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377"
81 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
82 - "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0"
83 - "\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377"
84 - "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
85 - "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
86 - "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377"
87 - "\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\377"
88 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0"
89 - "\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0"
90 - "\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0"
91 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377"
92 - "\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
93 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0"
94 - "\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
95 - "\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\0\0"
96 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
97 - "\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
98 - "\0\0\0\0\0"
99 -};
100 -
101 -#ifdef __GNUC__
102 -static const guint8 nav_button_hc[] __attribute__ ((__aligned__ (4))) =
103 -#else
104 -static const guint8 nav_button_hc[] =
105 -#endif
106 -{
107 - ""
108 - /* Pixbuf magic (0x47646b50) */
109 - "GdkP"
110 - /* length: header (24) + pixel_data (784) */
111 - "\0\0\3("
112 - /* pixdata_type (0x1010002) */
113 - "\1\1\0\2"
114 - /* rowstride (56) */
115 - "\0\0\0""8"
116 - /* width (14) */
117 - "\0\0\0\16"
118 - /* height (14) */
119 - "\0\0\0\16"
120 - /* pixel_data: */
121 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377\0\0\0"
122 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
123 - "\0\0\0\0\0\0\0>>>\377>>>\377>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0\0"
124 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377>>>\377>"
125 - ">>\377>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
126 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0"
127 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>>>\377\0\0\0\0\0\0\0\0\0\0"
128 - "\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0>>>\377\0\0\0\0\0\0\0\0\0\0"
129 - "\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377\0\0\0\0\0\0"
130 - "\0\0\0\0\0\0>>>\377>>>\377\0\0\0\0>>>\377>>>\377>>>\377>>>\377>>>\377"
131 - ">>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377"
132 - ">>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377"
133 - ">>>\377>>>\377>>>\377\0\0\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0>"
134 - ">>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0"
135 - "\0\0\0>>>\377\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0"
136 - "\0\0\0>>>\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
137 - "\0\0\0\0>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
138 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377>>>\377>>>\377>>>\377"
139 - ">>>\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
140 - "\0\0\0\0\0>>>\377>>>\377>>>\377>>>\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
141 - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>"
142 - "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
143 -};
145 G_DEFINE_TYPE(GtkImageScrollWin, gtk_image_scroll_win, GTK_TYPE_TABLE);
147 @@ -294,9 +203,9 @@
149 // Setup the navigator button.
150 window->nav_button =
151 - gdk_pixbuf_new_from_inline (-1, nav_button, FALSE, NULL);
152 + gdk_pixbuf_new_from_resource ("gtkimageview-nav_button.png", NULL);
153 window->nav_button_hc =
154 - gdk_pixbuf_new_from_inline (-1, nav_button_hc, FALSE, NULL);
155 + gdk_pixbuf_new_from_resource ("gtkimageview-nav_button_hc.png", NULL);
156 window->nav_image = gtk_image_new_from_pixbuf (window->nav_button);
158 window->nav_box = gtk_event_box_new ();