summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-06-29 14:48:08 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2015-06-29 14:48:08 (GMT)
commit1c5a5207fb2056b58be7a27a5135f39228702260 (patch)
treef475f8dc534c2b13601557e4a211a20579622cef /gtk
parent796ac470b5e86e185ebfcd9b5d3f1a8686b7662f (diff)
downloadnetsurf-1c5a5207fb2056b58be7a27a5135f39228702260.tar.gz
netsurf-1c5a5207fb2056b58be7a27a5135f39228702260.tar.bz2
fix glib resource API usage even when gresource was disabled
Diffstat (limited to 'gtk')
-rw-r--r--gtk/resources.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/resources.c b/gtk/resources.c
index b90fdd4..e2ca72e 100644
--- a/gtk/resources.c
+++ b/gtk/resources.c
@@ -468,7 +468,9 @@ nsgdk_pixbuf_new_from_resname(const char *resname, GdkPixbuf **pixbuf_out)
break;
case NSGTK_RESOURCE_GLIB:
+#ifdef WITH_GRESOURCE
new_pixbuf = gdk_pixbuf_new_from_resource(resource->path, &error);
+#endif
break;
case NSGTK_RESOURCE_INLINE:
@@ -540,6 +542,7 @@ nsgtk_data_from_resname(const char *resname,
const uint8_t ** data_out,
size_t *data_size_out)
{
+#ifdef WITH_GRESOURCE
struct nsgtk_resource_s *resource;
GBytes *data;
const gchar *buffer;
@@ -564,6 +567,12 @@ nsgtk_data_from_resname(const char *resname,
*data_size_out = (size_t)buffer_length;
return NSERROR_OK;
+#else
+ /** \todo consider adding compiled inline resources for things
+ * other than pixbufs.
+ */
+ return NSERROR_NOT_FOUND;
+#endif
}
/* exported interface documented in gtk/resources.h */