summaryrefslogtreecommitdiff
path: root/gtk/resources.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-06-21 23:24:31 +0100
committerVincent Sanders <vince@kyllikki.org>2015-06-21 23:27:22 +0100
commita94ae7a80a9d96c4aa88995412ea26feafa69f3b (patch)
tree58e908a4642a4a710827d107f6d43c2c97b929b6 /gtk/resources.c
parent67ded2a02a4f3f4d2a0ab156f3343dc93f4ba04c (diff)
downloadnetsurf-a94ae7a80a9d96c4aa88995412ea26feafa69f3b.tar.gz
netsurf-a94ae7a80a9d96c4aa88995412ea26feafa69f3b.tar.bz2
Allow translation messages to be compiled in as GTK resources
Diffstat (limited to 'gtk/resources.c')
-rw-r--r--gtk/resources.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gtk/resources.c b/gtk/resources.c
index 1998034ff..c9f08f4b7 100644
--- a/gtk/resources.c
+++ b/gtk/resources.c
@@ -45,8 +45,12 @@
#ifdef WITH_BUILTIN_PIXBUF
#ifdef __GNUC__
extern const guint8 menu_cursor_pixdata[] __attribute__ ((__aligned__ (4)));
+const guint8 favicon_pixdata[] __attribute__ ((__aligned__ (4)));
+const guint8 netsurf_pixdata[] __attribute__ ((__aligned__ (4)));
#else
extern const guint8 menu_cursor_pixdata[];
+const guint8 favicon_pixdata[];
+const guint8 netsurf_pixdata[];
#endif
#endif
@@ -119,6 +123,7 @@ static struct nsgtk_resource_s direct_resource[] = {
RES_ENTRY("icons/hotlist-add.png"),
RES_ENTRY("icons/hotlist-rmv.png"),
RES_ENTRY("icons/search.png"),
+ RES_ENTRY("Messages"),
{ NULL, 0, NSGTK_RESOURCE_FILE, NULL },
};
@@ -129,9 +134,8 @@ GdkCursor *nsgtk_create_menu_cursor(void)
GdkCursor *cursor = NULL;
GdkPixbuf *pixbuf;
nserror res;
- const char *resname = "menu_cursor.png";
- res = nsgdk_pixbuf_new_from_resname(resname, &pixbuf);
+ res = nsgdk_pixbuf_new_from_resname("menu_cursor.png", &pixbuf);
if (res == NSERROR_OK) {
cursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(),
pixbuf, 0, 3);
@@ -284,6 +288,20 @@ init_pixbuf_resource(char **respath, struct nsgtk_resource_s *resource)
LOG("Found builtin for %s", resource->name);
return NSERROR_OK;
}
+
+ if (strncmp(resource->name, "netsurf.xpm", resource->len) == 0) {
+ resource->path = (char *)&netsurf_pixdata[0];
+ resource->type = NSGTK_RESOURCE_INLINE;
+ LOG("Found builtin for %s", resource->name);
+ return NSERROR_OK;
+ }
+
+ if (strncmp(resource->name, "favicon.png", resource->len) == 0) {
+ resource->path = (char *)&favicon_pixdata[0];
+ resource->type = NSGTK_RESOURCE_INLINE;
+ LOG("Found builtin for %s", resource->name);
+ return NSERROR_OK;
+ }
#endif
return init_resource(respath, resource);
}