From c5b12782d9cc7af07f9571be9a7f13d1014b5912 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Sun, 13 Jul 2003 16:19:09 +0000 Subject: [w3m-dev 03938] clear region margin * w3mimgdisplay.c (clearMargin): added (GetOption): add -margin (ClearImage): clear margin * w3mi,g/w3mimg.h (w3mimg_op): clear_margin * w3mimg/fb/fb.c (fb_clear): x,y must be >= 0 * w3mimg/x11/x11_w3mimg.c (x11_clear): x,y must be >= 0 From: Hiroyuki Ito --- w3mimgdisplay.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'w3mimgdisplay.c') diff --git a/w3mimgdisplay.c b/w3mimgdisplay.c index 8fb733d..6652337 100644 --- a/w3mimgdisplay.c +++ b/w3mimgdisplay.c @@ -1,4 +1,4 @@ -/* $Id: w3mimgdisplay.c,v 1.16 2003/07/08 17:29:56 ukai Exp $ */ +/* $Id: w3mimgdisplay.c,v 1.17 2003/07/13 16:19:10 ukai Exp $ */ #include #include #include @@ -17,7 +17,7 @@ static char *defined_size = NULL; #define MAX_IMAGE 1000 static W3MImage *imageBuf = NULL; -static int maxImage = 0, maxAnim = 100; +static int maxImage = 0, maxAnim = 100, clearMargin = 0; static void GetOption(int argc, char **argv); static void DrawImage(char *buf, int redraw); @@ -58,7 +58,9 @@ main(int argc, char **argv) w_op->offset_x = offset_x; if (defined_y) w_op->offset_y = offset_y; + w_op->max_anim = maxAnim; + w_op->clear_margin = clearMargin; if (defined_test) { printf("%d %d\n", w_op->width - w_op->offset_x, @@ -192,6 +194,13 @@ GetOption(int argc, char **argv) exit(1); maxAnim = atoi(argv[i]); } + else if (!strcmp("-margin", argv[i])) { + if (++i >= argc) + exit(1); + clearMargin = atoi(argv[i]); + if (clearMargin < 0) + clearMargin = 0; + } else if (!strcmp("-size", argv[i])) { if (++i >= argc) exit(1); @@ -324,5 +333,9 @@ ClearImage(char *buf) for (; isdigit(*p); p++) h = 10 * h + (*p - '0'); - w_op->clear(w_op, x + offset_x, y + offset_y, w, h); + w_op->clear(w_op, + x + offset_x - w_op->clear_margin, + y + offset_y - w_op->clear_margin, + w + w_op->clear_margin * 2, + h + w_op->clear_margin * 2); } -- cgit v1.2.3