--- a/.hgignore Wed Jun 14 23:13:00 2017 -0500
+++ b/.hgignore Thu Jun 15 23:13:33 2017 -0400
@@ -108,7 +108,7 @@
+pidgin/.*\.gresource\.[ch]$ pidgin/data/pidgin.appdata.xml$
pidgin/data/pidgin.desktop$
--- a/configure.ac Wed Jun 14 23:13:00 2017 -0500
+++ b/configure.ac Thu Jun 15 23:13:33 2017 -0400
@@ -109,7 +109,6 @@
AC_SUBST(GNT_LT_VERSION_INFO)
AC_PATH_PROG(sedpath, sed)
-AC_PATH_PROG(xxdpath, xxd)
dnl Storing configure arguments
AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments])
@@ -488,6 +487,8 @@
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+AC_PATH_PROG(GLIB_COMPILE_RESOURCES, [glib-compile-resources]) AC_PATH_PROG(GTESTER, gtester)
--- a/pidgin/Makefile.am Wed Jun 14 23:13:00 2017 -0500
+++ b/pidgin/Makefile.am Thu Jun 15 23:13:33 2017 -0400
@@ -52,6 +52,7 @@
@@ -172,18 +173,22 @@
libpidgininclude_HEADERS = \
-libpidgin_la_builtheaders = gtkdebug.html.h
+libpidgin_la_builtheaders = gtkdebug.gresource.h +libpidgin_la_builtsources = gtkdebug.gresource.c -BUILT_SOURCES = $(libpidgin_la_builtheaders)
+BUILT_SOURCES = $(libpidgin_la_builtheaders) $(libpidgin_la_builtsources) -CLEANFILES = gtkdebug.html.h
+CLEANFILES = gtkdebug.gresource.h gtkdebug.gresource.c
- $(AM_V_GEN)echo "static const char $*_html[] = {" > $@
- $(AM_V_at)$(sedpath) -e 's/^[ ]\+//g' -e 's/[ ]\+/ /g' $< | $(xxdpath) -i | sed -e 's/\(0x[0-9a-f][0-9a-f]\)$$/\1, 0x00/' >> $@
- $(AM_V_at)echo "};" >> $@
+%.gresource.h: %.gresource.xml + $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --generate-header --target $@ --c-name gtkdebug $< -gtkdebug.c: gtkdebug.html.h
+%.gresource.c: %.gresource.xml + $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --generate-source --target $@ --c-name gtkdebug $< +gtkdebug.gresource.c: gtkdebug.html +gtkdebug.gresource.h: gtkdebug.html +gtkdebug.c: gtkdebug.gresource.h libpidgin_la_DEPENDENCIES = @LIBOBJS@ $(LIBPIDGIN_WIN32RES)
libpidgin_la_LDFLAGS = -export-dynamic -no-undefined \
--- a/pidgin/gtkdebug.c Wed Jun 14 23:13:00 2017 -0500
+++ b/pidgin/gtkdebug.c Thu Jun 15 23:13:33 2017 -0400
@@ -40,7 +40,7 @@
-#include "gtkdebug.html.h"
+#include "gtkdebug.gresource.h" @@ -409,7 +409,10 @@
+ GBytes *resource_bytes; @@ -586,7 +589,25 @@
frame = pidgin_create_webview(FALSE, &win->text, NULL);
pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(win->text),
PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY ^ PIDGIN_WEBVIEW_IMAGE);
- pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), gtkdebug_html);
+ resource = gtkdebug_get_resource(); + resource_bytes = g_resource_lookup_data(resource, + "/im/pidgin/Pidgin/gtkdebug.html", + G_RESOURCE_LOOKUP_FLAGS_NONE, + if (G_UNLIKELY(resource_bytes == NULL || error != NULL)) { + gchar *msg = g_strdup_printf("Unable to load debug window HTML: %s\n", + error ? error->message : "Unknown error"); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), msg); + gconstpointer gtkdebug_html; + gtkdebug_html = g_bytes_get_data(resource_bytes, NULL); + pidgin_webview_load_html_string(PIDGIN_WEBVIEW(win->text), + g_bytes_unref(resource_bytes); gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/gtkdebug.gresource.xml Thu Jun 15 23:13:33 2017 -0400
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?> + <gresource prefix="/im/pidgin/Pidgin"> + <file compressed="true">gtkdebug.html</file>