aboutsummaryrefslogtreecommitdiffstats
path: root/w3mimg
diff options
context:
space:
mode:
authorAraki Ken <arakiken@users.sf.net>2013-01-28 15:27:27 +0000
committerTatsuya Kinoshita <tats@debian.org>2014-12-06 11:47:04 +0000
commitf4268d8d18e57952b046c1bb6ab2aeeac145c310 (patch)
tree32445358c7c1ebac283d6e364ca3b18b12748a42 /w3mimg
parentMerge branch 'bug/parsetagx-crash' (diff)
downloadw3m-f4268d8d18e57952b046c1bb6ab2aeeac145c310.tar.gz
w3m-f4268d8d18e57952b046c1bb6ab2aeeac145c310.zip
Support remote image by OSC 5379 show_picture sequence.
Diffstat (limited to '')
-rw-r--r--w3mimg/x11/x11_w3mimg.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/w3mimg/x11/x11_w3mimg.c b/w3mimg/x11/x11_w3mimg.c
index cef72e2..bc8d0aa 100644
--- a/w3mimg/x11/x11_w3mimg.c
+++ b/w3mimg/x11/x11_w3mimg.c
@@ -121,16 +121,21 @@ x11_init(w3mimg_op * self)
if (self == NULL)
return 0;
xi = (struct x11_info *)self->priv;
+#if defined(USE_IMLIB)
if (xi == NULL)
return 0;
-#if defined(USE_IMLIB)
if (!xi->id) {
xi->id = Imlib_init(xi->display);
if (!xi->id)
return 0;
}
#elif defined(USE_GDKPIXBUF)
- if (!xi->init_flag) {
+ if (!xi) {
+#if defined(USE_GTK2)
+ g_type_init();
+#endif
+ }
+ else if (!xi->init_flag) {
#if defined(USE_GTK2)
g_type_init();
#endif
@@ -138,7 +143,7 @@ x11_init(w3mimg_op * self)
xi->init_flag = TRUE;
}
#endif
- if (!xi->imageGC) {
+ if (xi && !xi->imageGC) {
xi->imageGC = XCreateGC(xi->display, xi->parent, 0, NULL);
if (!xi->imageGC)
return 0;
@@ -653,9 +658,11 @@ x11_get_image_size(w3mimg_op * self, W3MImage * img, char *fname, int *w,
if (self == NULL)
return 0;
+#if defined(USE_IMLIB) && defined(USE_IMLIB2)
xi = (struct x11_info *)self->priv;
if (xi == NULL)
return 0;
+#endif
#if defined(USE_IMLIB)
im = Imlib_load_image(xi->id, fname);
@@ -755,6 +762,9 @@ w3mimg_x11open()
return NULL;
memset(wop, 0, sizeof(w3mimg_op));
+ if (getenv("W3M_USE_REMOTE_IMAGE"))
+ goto end;
+
xi = (struct x11_info *)malloc(sizeof(struct x11_info));
if (xi == NULL)
goto error;
@@ -807,6 +817,7 @@ w3mimg_x11open()
wop->priv = xi;
+ end:
wop->init = x11_init;
wop->finish = x11_finish;
wop->active = x11_active;