Origin: Jeffrey Ratcliffe Bug-Debian: https://bugs.debian.org/789101 Last-Update: 2016-02-24 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -87,6 +87,12 @@ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n }\n return etype;\n}\n" \ gtk*.h gdk*.h > $@ -EXTRA_DIST = gtkimageview-marshal.list wscript_build +# Generate the GResource source file for icon files: +resource_file = gtkimageview.gresource.xml +BUILT_SOURCES += gtkimageview-resources.c +gtkimageview-resources.c: $(resource_file) $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(resource_file)) + $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $(resource_file) + +EXTRA_DIST = gtkimageview-marshal.list wscript_build $(resource_file) CLEANFILES = $(BUILT_SOURCES) --- a/src/gtkimageview.gresource.xml +++ b/src/gtkimageview.gresource.xml @@ -0,0 +1,7 @@ + + + + gtkimageview-nav_button.png + gtkimageview-nav_button_hc.png + + --- a/configure.in +++ b/configure.in @@ -29,6 +29,14 @@ # Check for glib utils AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums) +AC_PATH_PROG(GLIB_COMPILE_RESOURCES,[glib-compile-resources],no) +AC_MSG_CHECKING([glib-compile-resources]) +if test "x$GLIB_COMPILE_RESOURCES" = xno ; then + GLIB_COMPILE_RESOURCES="" + AC_MSG_RESULT([cannot be found in PATH.]) +else + AC_MSG_RESULT([usable.]) +fi # 1.8 introduced the --rebuild-sections and --rebuild-types options to # 1.gtkdoc-scan that we need. --- a/src/gtkimagescrollwin.c +++ b/src/gtkimagescrollwin.c @@ -44,97 +44,6 @@ /*************************************************************/ /***** PRIVATE DATA ******************************************/ /*************************************************************/ -#ifdef __GNUC__ -static const guint8 nav_button[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 nav_button[] = -#endif -{ - "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (784) */ - "\0\0\3(" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (56) */ - "\0\0\0""8" - /* width (14) */ - "\0\0\0\16" - /* height (14) */ - "\0\0\0\16" - /* pixel_data: */ - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\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" - "\0\0\0\0\0" -}; - -#ifdef __GNUC__ -static const guint8 nav_button_hc[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 nav_button_hc[] = -#endif -{ - "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (784) */ - "\0\0\3(" - /* pixdata_type (0x1010002) */ - "\1\1\0\2" - /* rowstride (56) */ - "\0\0\0""8" - /* width (14) */ - "\0\0\0\16" - /* height (14) */ - "\0\0\0\16" - /* pixel_data: */ - "\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" - "\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" - "\0\0\0\0\0\0\0>>>\377>>>\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\0\0\0\0\0\0\0\0\0\0\0\0>>>\377>>>\377>>>\377>" - ">>\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" - "\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" - "\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" - "\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" - "\0\0>>>\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\0\0\0>>>\377>>>\377\0\0\0\0>>>\377>>>\377>>>\377>>>\377>>>\377" - ">>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377" - ">>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377>>>\377" - ">>>\377>>>\377>>>\377\0\0\0\0>>>\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\0\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\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\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\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\0\0\0>>>\377>>>\377>>>\377>>>\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\0\0\0\0\0\0\0" - "\0\0\0\0\0>>>\377>>>\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\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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" -}; G_DEFINE_TYPE(GtkImageScrollWin, gtk_image_scroll_win, GTK_TYPE_TABLE); @@ -294,9 +203,9 @@ // Setup the navigator button. window->nav_button = - gdk_pixbuf_new_from_inline (-1, nav_button, FALSE, NULL); + gdk_pixbuf_new_from_resource ("gtkimageview-nav_button.png", NULL); window->nav_button_hc = - gdk_pixbuf_new_from_inline (-1, nav_button_hc, FALSE, NULL); + gdk_pixbuf_new_from_resource ("gtkimageview-nav_button_hc.png", NULL); window->nav_image = gtk_image_new_from_pixbuf (window->nav_button); window->nav_box = gtk_event_box_new ();