aboutsummaryrefslogtreecommitdiffstats
path: root/w3mimgdisplay.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-07-13 16:19:09 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-07-13 16:19:09 +0000
commitc5b12782d9cc7af07f9571be9a7f13d1014b5912 (patch)
tree603b38e5bfa2c636e66337380049a402eb912648 /w3mimgdisplay.c
parent[w3m-dev 03937] <center> in <table> (diff)
downloadw3m-c5b12782d9cc7af07f9571be9a7f13d1014b5912.tar.gz
w3m-c5b12782d9cc7af07f9571be9a7f13d1014b5912.zip
[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 <hito@crl.go.jp>
Diffstat (limited to '')
-rw-r--r--w3mimgdisplay.c19
1 files changed, 16 insertions, 3 deletions
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 <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -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);
}