From f4268d8d18e57952b046c1bb6ab2aeeac145c310 Mon Sep 17 00:00:00 2001 From: Araki Ken Date: Tue, 29 Jan 2013 00:27:27 +0900 Subject: Support remote image by OSC 5379 show_picture sequence. --- display.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'display.c') diff --git a/display.c b/display.c index 2fe1183..471c8af 100644 --- a/display.c +++ b/display.c @@ -487,7 +487,7 @@ displayBuffer(Buffer *buf, int mode) term_title(conv_to_system(buf->buffername)); refresh(); #ifdef USE_IMAGE - if (activeImage && displayImage && buf->img) { + if (activeImage && displayImage && buf->img && buf->image_loaded) { drawImage(); } #endif @@ -521,7 +521,10 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, break; } if (hseq >= 0 && an->hseq == hseq) { + int hasImage = 0; for (i = an->start.pos; i < an->end.pos; i++) { + if (l->propBuf[i] & PE_IMAGE) + hasImage = 1 ; if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { if (active) l->propBuf[i] |= PE_ACTIVE; @@ -529,7 +532,8 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, l->propBuf[i] &= ~PE_ACTIVE; } } - if (active) + if (active && + (! support_remote_image || ! hasImage)) redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY, an->start.pos, an->end.pos); } @@ -855,14 +859,16 @@ redrawLineImage(Buffer *buf, Line *l, int i) y = (int)(i * pixel_per_line); sx = (int)((rcol - COLPOS(l, a->start.pos)) * pixel_per_char); sy = (int)((l->linenumber - image->y) * pixel_per_line); - if (sx == 0 && x + image->xoffset >= 0) - x += image->xoffset; - else - sx -= image->xoffset; - if (sy == 0 && y + image->yoffset >= 0) - y += image->yoffset; - else - sy -= image->yoffset; + if (! support_remote_image) { + if (sx == 0 && x + image->xoffset >= 0) + x += image->xoffset; + else + sx -= image->xoffset; + if (sy == 0 && y + image->yoffset >= 0) + y += image->yoffset; + else + sy -= image->yoffset; + } if (image->width > 0) w = image->width - sx; else -- cgit v1.2.3 From 0d99209d9f499ff3d7edf2b34f8343ba23a39aef Mon Sep 17 00:00:00 2001 From: Araki Ken Date: Thu, 14 Mar 2013 06:24:43 +0900 Subject: * display.c: Draw underline on anchor text which is not overlapped with any image. --- display.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'display.c') diff --git a/display.c b/display.c index 471c8af..691437b 100644 --- a/display.c +++ b/display.c @@ -521,10 +521,10 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, break; } if (hseq >= 0 && an->hseq == hseq) { - int hasImage = 0; + int start_pos = an->start.pos; for (i = an->start.pos; i < an->end.pos; i++) { - if (l->propBuf[i] & PE_IMAGE) - hasImage = 1 ; + if (support_remote_image && (l->propBuf[i] & PE_IMAGE)) + start_pos = i + 1; /* Lazy check */ if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { if (active) l->propBuf[i] |= PE_ACTIVE; @@ -532,10 +532,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, l->propBuf[i] &= ~PE_ACTIVE; } } - if (active && - (! support_remote_image || ! hasImage)) + if (active && start_pos < an->end.pos) redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY, - an->start.pos, an->end.pos); + start_pos, an->end.pos); } else if (prevhseq >= 0 && an->hseq == prevhseq) { if (active) -- cgit v1.2.3 From 2fe66f3a6f1b1fd28424a2f14beebdd535e9d17b Mon Sep 17 00:00:00 2001 From: Araki Ken Date: Mon, 22 Sep 2014 20:16:39 +0900 Subject: Add -sixel option which supports image processing by img2sixel. --- display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'display.c') diff --git a/display.c b/display.c index 691437b..6dd0976 100644 --- a/display.c +++ b/display.c @@ -523,7 +523,7 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, if (hseq >= 0 && an->hseq == hseq) { int start_pos = an->start.pos; for (i = an->start.pos; i < an->end.pos; i++) { - if (support_remote_image && (l->propBuf[i] & PE_IMAGE)) + if (enable_inline_image && (l->propBuf[i] & PE_IMAGE)) start_pos = i + 1; /* Lazy check */ if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { if (active) @@ -858,7 +858,7 @@ redrawLineImage(Buffer *buf, Line *l, int i) y = (int)(i * pixel_per_line); sx = (int)((rcol - COLPOS(l, a->start.pos)) * pixel_per_char); sy = (int)((l->linenumber - image->y) * pixel_per_line); - if (! support_remote_image) { + if (! enable_inline_image) { if (sx == 0 && x + image->xoffset >= 0) x += image->xoffset; else -- cgit v1.2.3 From 1eabd79f5bb07addda737183d6681cadae4ebf38 Mon Sep 17 00:00:00 2001 From: Araki Ken Date: Wed, 24 Sep 2014 20:08:54 +0900 Subject: Draw underline on anchor which contains cboth text and images. --- display.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'display.c') diff --git a/display.c b/display.c index 6dd0976..d4f336a 100644 --- a/display.c +++ b/display.c @@ -522,9 +522,14 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, } if (hseq >= 0 && an->hseq == hseq) { int start_pos = an->start.pos; + int end_pos = an->end.pos; for (i = an->start.pos; i < an->end.pos; i++) { - if (enable_inline_image && (l->propBuf[i] & PE_IMAGE)) - start_pos = i + 1; /* Lazy check */ + if (enable_inline_image && (l->propBuf[i] & PE_IMAGE)) { + if (start_pos == i) + start_pos = i + 1; + else if (end_pos == an->end.pos) + end_pos = i - 1; + } if (l->propBuf[i] & (PE_IMAGE | PE_ANCHOR | PE_FORM)) { if (active) l->propBuf[i] |= PE_ACTIVE; @@ -532,9 +537,9 @@ drawAnchorCursor0(Buffer *buf, AnchorList *al, int hseq, int prevhseq, l->propBuf[i] &= ~PE_ACTIVE; } } - if (active && start_pos < an->end.pos) + if (active && start_pos < end_pos) redrawLineRegion(buf, l, l->linenumber - tline + buf->rootY, - start_pos, an->end.pos); + start_pos, end_pos); } else if (prevhseq >= 0 && an->hseq == prevhseq) { if (active) -- cgit v1.2.3