aboutsummaryrefslogtreecommitdiffstats
path: root/w3mimg
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 /w3mimg
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 'w3mimg')
-rw-r--r--w3mimg/fb/fb.c8
-rw-r--r--w3mimg/w3mimg.h3
-rw-r--r--w3mimg/x11/x11_w3mimg.c8
3 files changed, 16 insertions, 3 deletions
diff --git a/w3mimg/fb/fb.c b/w3mimg/fb/fb.c
index 77c2fba..cd11128 100644
--- a/w3mimg/fb/fb.c
+++ b/w3mimg/fb/fb.c
@@ -1,4 +1,4 @@
-/* $Id: fb.c,v 1.15 2003/07/09 15:07:11 ukai Exp $ */
+/* $Id: fb.c,v 1.16 2003/07/13 16:19:10 ukai Exp $ */
/**************************************************************************
fb.c 0.3 Copyright (C) 2002, hito
**************************************************************************/
@@ -357,6 +357,12 @@ fb_clear(int x, int y, int w, int h, int r, int g, int b)
if (is_open != TRUE || x > fb_width() || y > fb_height())
return 1;
+
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+
if (x + w > fb_width())
w = fb_width() - x;
if (y + h > fb_height())
diff --git a/w3mimg/w3mimg.h b/w3mimg/w3mimg.h
index 03158db..3807ca5 100644
--- a/w3mimg/w3mimg.h
+++ b/w3mimg/w3mimg.h
@@ -1,4 +1,4 @@
-/* $Id: w3mimg.h,v 1.7 2003/07/07 15:48:17 ukai Exp $ */
+/* $Id: w3mimg.h,v 1.8 2003/07/13 16:19:10 ukai Exp $ */
#include "config.h"
#ifdef USE_W3MIMG_FB
@@ -16,6 +16,7 @@ typedef struct _w3mimg_op {
void *priv; /* driver specific data */
int width, height; /* window width, height */
int offset_x, offset_y; /* offset */
+ int clear_margin;
int max_anim;
int (*init) (struct _w3mimg_op * self);
diff --git a/w3mimg/x11/x11_w3mimg.c b/w3mimg/x11/x11_w3mimg.c
index ba88852..8c9cef2 100644
--- a/w3mimg/x11/x11_w3mimg.c
+++ b/w3mimg/x11/x11_w3mimg.c
@@ -1,4 +1,4 @@
-/* $Id: x11_w3mimg.c,v 1.24 2003/07/08 17:32:13 ukai Exp $ */
+/* $Id: x11_w3mimg.c,v 1.25 2003/07/13 16:19:10 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -131,6 +131,12 @@ x11_clear(w3mimg_op * self, int x, int y, int w, int h)
xi = (struct x11_info *)self->priv;
if (xi == NULL)
return 0;
+
+ if (x < 0)
+ x = 0;
+ if (y < 0)
+ y = 0;
+
XClearArea(xi->display, xi->window, x, y, w, h, False);
return 1;
}