Index: kit/CHANGELOG
diff -u kit/CHANGELOG:1.9 kit/CHANGELOG:removed
--- kit/CHANGELOG:1.9	Sat Sep  5 00:11:21 1998
+++ kit/CHANGELOG	Mon Aug 13 05:10:01 2001
@@ -1,51 +0,0 @@
-CHANGELOG for magicpoint
-$Id: CHANGELOG,v 1.9 1998/09/04 15:11:21 onoe Exp $
-
-Fri Sep  5 1998  onoe@sm.sony.co.jp
-	* handle key inputs from invoked terminal as pressed on Xserver,
-	  even if the Xserver is running on a remote host.
-
-Mon Aug 26 1998  itojun@iijlab.net
-	* new copyright. (BSDish copyright without clause 3)
-
-Mon Aug 25 1998  itojun@iijlab.net
-	* print.c: better x11/freetype/vflib -> postscript font mapping.
-
-Mon Aug 23 1998  kato@wide.ad.jp
-	* embedded image support (added mgpembed.pl and embed.c)
-
-Mon Aug 22 1998  itojun@iijlab.net
-	* added contrib/xmindpath, MindPath PocketPoint user-level driver.
-
-Fri Jul 10 11:57:59 JST 1998  itojun@iijlab.net
-	* cache gs-generated image file.
-	  Suggested by: luigi@FreeBSD.org
-
-Mon Jul  6 11:38:32 JST 1998  itojun@iijlab.net
-	* capable of handling GB2312 and KSC5601 encoding.
-	  they must be encoded by using iso-2022 like escape sequences.
-	  EUC-cn or EUC-kr does not work.
-	* -x option is added.
-
-Thu Jul  2 18:04:16 JST 1998  itojun@iijlab.net
-	* eliminate gsview.
-	* revamp "xfont" directive. (see SYNTAX for detail)
-
-Thu Jun 25 13:10:28 JST 1998  itojun@iijlab.net
-	* print.c: color postscript support by "mgp2ps -c".
-
-changes between 1.02a and 1.03a:
-	* To allow color name that has space inbetween ("dark blue"), 
-	  color name after directives SHOULD come with doublequote.
-	  Therefore,
-		%fore blue
-	  should be
-		%fore "blue"
-	  At this moment, doublequote can be ommitted for backward
-	  compatibility.  We may require to have doublequote in the future.
-	  Font names and other string parameter obeys the same rule.
-	* %image is now capable of rendering encapsulated postscript files
-	  (*.eps).
-		%image foo.eps
-	  should work fine.
-	  By using -X option, you can specify device name for ghostscript.
Index: kit/SYNTAX
diff -u kit/SYNTAX:1.31 kit/SYNTAX:1.32
--- kit/SYNTAX:1.31	Thu Mar 15 18:24:30 2001
+++ kit/SYNTAX	Sat Aug 11 17:44:39 2001
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.31 2001/03/15 09:24:30 nishida Exp $
+$Id: SYNTAX,v 1.32 2001/08/11 08:44:39 onoe Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -341,3 +341,11 @@
 		iso8859-2
 		iso8859-3
 		iso8859-4
+
+%area <width> <height> [<xoffset> <yoffset>]
+	Specify the drawing area within the window.  All parameters are
+	translated as relative value of the window.  If offset is not
+	specified, the drawing area will be put center.
+	Note that all relative size specified in other directive after
+	"%area" will be affected, i.e. it will be relative to the
+	width/height of the drawing area instead of the window.
Index: kit/ctlwords.pl
diff -u kit/ctlwords.pl:1.2 kit/ctlwords.pl:removed
--- kit/ctlwords.pl:1.2	Sat Sep  5 06:05:08 1998
+++ kit/ctlwords.pl	Mon Aug 13 05:10:02 2001
@@ -1,12 +0,0 @@
-#! /usr/bin/perl
-$counter = 0;	# 0 origin
-print "/* generated by ctlwords.awk. do not edit by hand. */\n";
-
-while (<>) {
-	next if (!/^\/\*CTL\*\//);
-	next if ($_ !~ /(CTL_[A-Z0-9]+)/);
-
-	$word = $1;
-	print "#define $word\t$counter\n";
-	$counter++;
-}
Index: kit/draw.c
diff -u kit/draw.c:1.186 kit/draw.c:1.189
--- kit/draw.c:1.186	Fri Jun 29 22:43:28 2001
+++ kit/draw.c	Sat Aug 11 18:31:45 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.186 2001/06/29 13:43:28 nishida Exp $
+ * $Id: draw.c,v 1.189 2001/08/11 09:31:45 onoe Exp $
  */
 
 #include "mgp.h"
@@ -426,6 +426,10 @@
 		remapchild();
 		/* always cache next page */
 		if ((mgp_flag & FL_FRDCACHE) && cache_mode){
+#if 1/*ONOE*/
+			if (XCheckMaskEvent(display, emask, e) == True) 
+  				goto got_event;
+#endif
 			cache_page(&cache_state, state->page +1);
 			/* check if we got some events during caching */
 			if (XCheckMaskEvent(display, emask, e) == True) 
@@ -793,6 +797,14 @@
 		valign = cp->cti_value;
 		break;
 
+	case CTL_AREA:
+		state->width = window_width * cp->ctar_width / 100;
+		state->height = window_height * cp->ctar_height / 100;
+		state->xoff = window_width * cp->ctar_xoff / 100;
+		state->yoff = window_height * cp->ctar_yoff / 100;
+		state->ypos = 0;
+		break;
+
 	default:
 		fprintf(stderr,
 			"undefined directive %d at page %d line %d:\n\t",
@@ -1843,6 +1855,8 @@
 			? state->linewidth
 			: state->width - xpos;
 	height = state->maxascent + state->maxdescent + 1;
+	xpos += state->xoff;
+	ypos += state->yoff;
 	fore = fore_color[caching];
 
 #ifdef RASTERLIB
@@ -1880,7 +1894,7 @@
 			bw = bim->width;
 			bh = bim->height;
 			ox = xpos;
-			oy = state->ypos;
+			oy = state->ypos + state->yoff;
 			bcolor = (u_long)-1; /* tell vfc_image() to calculate */
 			by = oy % bh;
 			if (bw == 1) {
@@ -1983,18 +1997,20 @@
 #endif
 		XDestroyImage(xim);
 		if (mgp_flag & FL_GLYPHEDGE) {
-			XDrawLine(display, target, gcfore, 0, ypos,
-				state->width - 1, ypos);
+			XDrawLine(display, target, gcfore, state->xoff, ypos,
+				state->xoff + state->width - 1, ypos);
 			XDrawLine(display, target, gcfore,
-				0, ypos + state->maxascent,
-				state->width - 1, ypos + state->maxascent);
+				state->xoff, ypos + state->maxascent,
+				state->xoff + state->width - 1,
+				ypos + state->maxascent);
 			XDrawLine(display, target, gcgreen,
-				0, ypos + state->maxascent + state->maxdescent,
-				state->width - 1,
+				state->xoff,
+				ypos + state->maxascent + state->maxdescent,
+				state->xoff + state->width - 1,
 				ypos + state->maxascent + state->maxdescent);
 			XDrawLine(display, target, gcred,
-				0, ypos + height,
-				state->width - 1, ypos + height);
+				state->xoff, ypos + height,
+				state->xoff + state->width - 1, ypos + height);
 		}
 
 	}
@@ -2580,8 +2596,8 @@
 		int t;
 		int i;
 
-		dstwidth = state->width * cg->ct_width / 100;
-		dstheight = state->height * cg->ct_height / 100;
+		dstwidth = window_width * cg->ct_width / 100;
+		dstheight = window_height * cg->ct_height / 100;
 		srcwidth = dstwidth;
 		srcheight = dstheight;
 
@@ -2606,8 +2622,8 @@
 		srcheight = t;
 #undef TOOSMALLFACTOR
 	} else {
-		dstwidth = state->width;
-		dstheight = state->height;
+		dstwidth = window_width;
+		dstheight = window_height;
 		srcwidth = state->width * cg->ct_width / 100;
 		srcheight = state->height * cg->ct_height / 100;
 
@@ -3133,10 +3149,10 @@
 	width = cp->ctb_width * state->height / 1000;
 	swidth = width / 2;
 	width -= swidth;
-	st = cp->ctb_start * state->width / 100;
+	st = cp->ctb_start * state->width / 100 + state->xoff;
 	len = cp->ctb_length * state->width / 100;
-	XFillRectangle(display, state->target, gcbar, st, state->ypos, len, width);
-	XFillRectangle(display, state->target, gcsbar, st, state->ypos + width, len, swidth);
+	XFillRectangle(display, state->target, gcbar, st, state->ypos + state->yoff, len, width);
+	XFillRectangle(display, state->target, gcsbar, st, state->ypos + state->yoff + width, len, swidth);
 
 	state->ypos += width + swidth + VERT_GAP(char_size[caching]) / 2;
 	if (state->maxascent < width + swidth)
@@ -3226,7 +3242,7 @@
 				yloc = rootysiz - myypos + state->height - yloc;
 			else
 				yloc += myypos;
-			sprintf(q, "+%d+%d", xloc, yloc);
+			sprintf(q, "+%d+%d", xloc + state->xoff, yloc + state->yoff);
 		}
 
 		if (mgp_flag & FL_VERBOSE) {
@@ -3395,8 +3411,8 @@
 	XGetGeometry(display, window_id, &dumwin, 
 		&xloc, &yloc, &xsiz, &ysiz, &dumint, &dumint);
 	state->linewidth = xsiz;
-	xloc = set_position(state);
-	yloc = state->ypos;
+	xloc = set_position(state) + state->xoff;
+	yloc = state->ypos + state->yoff;
 	XMoveWindow(display, window_id, xloc, yloc);
 	state->ypos += ysiz;
 
@@ -3496,6 +3512,7 @@
 	char *cp;
 	int scale = 1;
 	struct stat stbuf;
+	XColor back;
 	char geom[32], device[64], scalebuf[32];
 	static char imagefile[MAXPATHLEN];
 	void (*sigpipe_handler)();
@@ -3777,12 +3794,8 @@
 		break;
 
 	case ITRUE:
-#ifdef notdef
-		/* How to inverse black & white? */
-		image->trans =
-		    RGB_TO_TRUE((Intensity)-1, (Intensity)-1, (Intensity)-1);
-#endif
-		break;
+		/* XXX: assume background color is on the left right corner */
+		image->trans = memToVal(image->data, image->pixlen);
 	}
 }
 
@@ -4050,8 +4063,20 @@
 		XCopyArea(display, cachewin, window, gc_cache,
 			window_width - x, 0, step, window_height, 
 			window_width - step, 0);
-
+#if 1
+		XSync(display, False);
+#else
 		XFlush(display);
+#endif
+#if 1/*ONOE*/
+	    { XEvent e;
+		if (XCheckMaskEvent(display, ~NoEventMask, &e) == True) {
+			printf("event type=%d\n", e.type);
+			XPutBackEvent(display, &e);
+			break;
+		}
+	    }
+#endif
 	}
 }
 
Index: kit/globals.c
diff -u kit/globals.c:1.44 kit/globals.c:1.45
--- kit/globals.c:1.44	Thu Feb  8 17:54:13 2001
+++ kit/globals.c	Sat Aug 11 17:50:00 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.44 2001/02/08 08:54:13 nishida Exp $
+ * $Id: globals.c,v 1.45 2001/08/11 08:50:00 onoe Exp $
  */
 
 #include "mgp.h"
@@ -147,5 +147,6 @@
 /*CTL*/	{ CTL_PCACHE,		T_SP,	"pcache", 6 },
 /*CTL*/	{ CTL_ANIM,		T_STR,	"anim", 4 },
 /*CTL*/	{ CTL_VALIGN,		T_STR,	"valign", 6 },
+/*CTL*/	{ CTL_AREA,		T_STR,	"area", 4 },
 	{ 0, 0, NULL, 0 },
 };
Index: kit/grammar.y
diff -u kit/grammar.y:1.37 kit/grammar.y:1.40
--- kit/grammar.y:1.37	Thu Feb  8 17:54:13 2001
+++ kit/grammar.y	Sat Aug 11 19:23:12 2001
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.37 2001/02/08 08:54:13 nishida Exp $
+ * $Id: grammar.y,v 1.40 2001/08/11 10:23:12 onoe Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -546,6 +546,40 @@
 	return ct;
 }
 
+static struct ctrl *
+gen_area(width, height, xoff, yoff)
+	int width;
+	int height;
+	int xoff;
+	int yoff;
+{
+	struct ctrl *ct;
+
+	if (!(ct = ctlalloc1(CTL_AREA))) {
+		yyerror("cannot allocate node (op=AREA)");
+		return ct;
+	}
+	if (width < 0 || width > 100)
+		width = 100;
+	if (height < 0 || height > 100)
+		height = 100;
+	if (xoff < 0)
+		xoff = (100 - width) / 2;
+	else if (width + xoff > 100)
+		xoff = 100 - width;
+	if (yoff < 0)
+		yoff = (100 - height) / 2;
+#ifdef notdef	/* mgp doesn't check overflow in y axis, anyway. */
+	else if (height + yoff > 100)
+		yoff = 100 - height;
+#endif
+	ct->ctar_width = width;
+	ct->ctar_height = height;
+	ct->ctar_xoff = xoff;
+	ct->ctar_yoff = yoff;
+	return ct;
+}
+
 #if 0
 
 static struct ctrl *
@@ -697,7 +731,7 @@
 %token KW_LINESTART KW_LINEEND KW_MARK KW_SYSTEM KW_FILTER KW_ENDFILTER
 %token KW_QUALITY KW_ICON KW_LEFTFILL KW_XSYSTEM KW_VFCAP KW_TFONT KW_TFDIR
 %token KW_DEFFONT KW_FONT KW_TFONT0 KW_EMBED KW_ENDEMBED KW_NEWIMAGE
-%token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN
+%token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN KW_AREA
 
 %type <ct> toplevel
 %type <ct> line defaultline tabline shellline deffontline
@@ -939,6 +973,8 @@
 	| KW_FONT STR	{ $$ = gen_str(CTL_FONT, $2); }
 	| KW_TEXT STR	{ $$ = gen_str(CTL_TEXT, $2); }	/*easter egg*/
 	| KW_CHARSET STR	{ $$ = gen_str(CTL_CHARSET, $2); }
+	| KW_AREA NUM NUM { $$ = gen_area($2, $3, -1, -1); }
+	| KW_AREA NUM NUM NUM NUM { $$ = gen_area($2, $3, $4, $5); }
 	| KW_PCACHE NUM NUM NUM NUM
 			{ $$ = gen_pcache($2, $3, $4, $5); }
 	| KW_PCACHE NUM
Index: kit/mgp.c
diff -u kit/mgp.c:1.117 kit/mgp.c:1.119
--- kit/mgp.c:1.117	Thu May 24 18:16:04 2001
+++ kit/mgp.c	Sat Aug 11 18:27:49 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.117 2001/05/24 09:16:04 kazu Exp $
+ * $Id: mgp.c,v 1.119 2001/08/11 09:27:49 onoe Exp $
  */
 
 static char *mgp_version = "1.08a (20010524)";
@@ -200,13 +200,14 @@
 	extern char *optarg;
 	extern int optind;
 	char *progname;
-	u_int start_page = 1;
+	int start_page = 1;
 	char buf[BUFSIZ], *p, *p2;
 	extern char *Paths[];
 	extern int NumPaths;
 #ifdef VFLIB
 	char *vfont_name = VFONT;
 #endif
+	char *ep;
 
 #ifdef USE_SETLOCALE
 	setlocale(LC_CTYPE, "");
@@ -261,7 +262,12 @@
 			break;
 
 		case 'p':
+			ep = NULL;
 			start_page = atoi(optarg);
+			if (start_page <= 0) {
+				mgp_usage(progname);
+				/*NOTREACHED*/
+			}
 			break;
 
 		case 'e':
Index: kit/mgp.h
diff -u kit/mgp.h:1.126 kit/mgp.h:1.127
--- kit/mgp.h:1.126	Sun Feb  4 03:46:50 2001
+++ kit/mgp.h	Sat Aug 11 17:50:00 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.126 2001/02/03 18:46:50 nishida Exp $
+ * $Id: mgp.h,v 1.127 2001/08/11 08:50:00 onoe Exp $
  */
 
 #include <stdio.h>
@@ -257,6 +257,13 @@
 	u_int ct_size;   
 };  
 
+struct ctrl_area {
+	u_int ct_xoff;
+	u_int ct_width;
+	u_int ct_yoff;
+	u_int ct_height;
+};
+
 struct ctrl_pcache {
 	u_int ct_cflag;
 	u_int ct_cmode;
@@ -280,6 +287,7 @@
 		struct ctrl_bar ctrl_bar;
 		struct ctrl_args ctrl_args;
 		struct ctrl_icon ctrl_icon;
+		struct ctrl_area ctrl_area;
 		struct ctrl_pcache ctrl_pcache;
 	} ct_val;
 };
@@ -317,6 +325,10 @@
 #define ctic_value	ct_val.ctrl_icon.ct_value
 #define ctic_color	ct_val.ctrl_icon.ct_color
 #define ctic_size	ct_val.ctrl_icon.ct_size
+#define	ctar_xoff	ct_val.ctrl_area.ct_xoff
+#define	ctar_width	ct_val.ctrl_area.ct_width
+#define	ctar_yoff	ct_val.ctrl_area.ct_yoff
+#define	ctar_height	ct_val.ctrl_area.ct_height
 #define ctch_flag	ct_val.ctrl_pcache.ct_cflag
 #define ctch_mode	ct_val.ctrl_pcache.ct_cmode
 #define ctch_effect	ct_val.ctrl_pcache.ct_ceffect
@@ -379,6 +391,8 @@
 	Drawable target;
 	u_int height;
 	u_int width;
+	int xoff;
+	int yoff;
 	u_int ypos;
 	int have_mark;
 	u_int mark_ypos;
Index: kit/parse.c
diff -u kit/parse.c:1.84 kit/parse.c:1.85
--- kit/parse.c:1.84	Sun Feb  4 03:46:50 2001
+++ kit/parse.c	Sat Aug 11 17:50:01 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.84 2001/02/03 18:46:50 nishida Exp $
+ * $Id: parse.c,v 1.85 2001/08/11 08:50:01 onoe Exp $
  */
 
 #include "mgp.h"
@@ -784,6 +784,7 @@
 	struct ctrl *tmpint[10];
 	struct ctrl *tmplong[10];
 	struct ctrl *tmpvoid[10];
+	struct ctrl *tmparea[10];
 	struct ctrl sentinel;
 	int i;
 
@@ -792,6 +793,7 @@
 	memset(tmpint, 0, sizeof(tmpint));
 	memset(tmplong, 0, sizeof(tmplong));
 	memset(tmpvoid, 0, sizeof(tmpvoid));
+	memset(tmparea, 0, sizeof(tmparea));
 
 	/* default value for page 1 */
 	tmpstr[0] = ctlalloc1(CTL_PREFIX);
@@ -839,6 +841,11 @@
 	tmpint[3] = ctlalloc1(CTL_QUALITY);
 	tmpint[3]->cti_value = DEFAULT_BQUALITY;
 	tmpvoid[0] = ctlalloc1(CTL_LEFT);
+	tmparea[0] = ctlalloc1(CTL_AREA);
+	tmparea[0]->ctar_width = 100;
+	tmparea[0]->ctar_height = 100;
+	tmparea[0]->ctar_xoff = 0;
+	tmparea[0]->ctar_yoff = 0;
 
 	/* for page 1 */
 	cp = &sentinel;
@@ -886,6 +893,16 @@
 		cp->ct_next = ctlalloc1(tmpvoid[i]->ct_op);
 		cp = cp->ct_next;
 	}
+	for (i = 0; i < 10; i++) {
+		if (!tmparea[i])
+			continue;
+		cp->ct_next = ctlalloc1(tmparea[i]->ct_op);
+		cp->ct_next->ctar_width = tmparea[i]->ctar_width;
+		cp->ct_next->ctar_height = tmparea[i]->ctar_height;
+		cp->ct_next->ctar_xoff = tmparea[i]->ctar_xoff;
+		cp->ct_next->ctar_yoff = tmparea[i]->ctar_yoff;
+		cp = cp->ct_next;
+	}
 	carryover[0] = sentinel.ct_next;
 
 	/*
@@ -943,6 +960,8 @@
 				case CTL_RIGHT: tmpvoid[0] = cp; break;
 				case CTL_CENTER: tmpvoid[0] = cp; break;
 				case CTL_LEFTFILL: tmpvoid[0] = cp; break;
+
+				case CTL_AREA: tmpvoid[0] = cp; break;
 				}
 			}
 		}
@@ -990,6 +1009,16 @@
 			if (!tmpvoid[i])
 				continue;
 			cp->ct_next = ctlalloc1(tmpvoid[i]->ct_op);
+			cp = cp->ct_next;
+		}
+		for (i = 0; i < 10; i++) {
+			if (!tmparea[i])
+				continue;
+			cp->ct_next = ctlalloc1(tmparea[i]->ct_op);
+			cp->ct_next->ctar_width = tmparea[i]->ctar_width;
+			cp->ct_next->ctar_height = tmparea[i]->ctar_height;
+			cp->ct_next->ctar_xoff = tmparea[i]->ctar_xoff;
+			cp->ct_next->ctar_yoff = tmparea[i]->ctar_yoff;
 			cp = cp->ct_next;
 		}
 
Index: kit/print.c
diff -u kit/print.c:1.94 kit/print.c:1.95
--- kit/print.c:1.94	Mon Mar  5 22:16:14 2001
+++ kit/print.c	Sat Aug 11 17:50:01 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.94 2001/03/05 13:16:14 nishida Exp $
+ * $Id: print.c,v 1.95 2001/08/11 08:50:01 onoe Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -534,8 +534,13 @@
 	for (p = aligns; *p; p++) {
 		fprintf(fp, "/%snewlinecheck {\n", *p);
 		fprintf(fp, "  currentpoint pop add XMARGIN XBODY add gt {\n");
+#if 1
+		fprintf(fp, "    NL %sdefxpos xpos ypos charsize 2 div sub moveto\n",
+			*p);
+#else
 		fprintf(fp, "    NL %sdefxpos xpos ypos charsize sub moveto\n",
 			*p);
+#endif
 		fprintf(fp, "  } if\n");
 		fprintf(fp, "} bind def\n");
 	}
@@ -579,8 +584,13 @@
 	u_int page;
 {
 	fprintf(fp, "%%%%Page: %d %d\n", page, page);
+#if 1 /*XXX*/
+	fprintf(fp, "/ypos YMARGIN -1 mul 4 sub def\n");
+	fprintf(fp, "/xpos 0 def\n");
+#else
 	fprintf(fp, "/ypos YMARGIN -1 mul def\n");
 	fprintf(fp, "/xpos XMARGIN def\n");
+#endif
 	fprintf(fp, "initcharsize\n");
 }
 
Index: kit/scanner.l
diff -u kit/scanner.l:1.21 kit/scanner.l:1.22
--- kit/scanner.l:1.21	Thu Feb  8 17:54:14 2001
+++ kit/scanner.l	Sat Aug 11 17:50:01 2001
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.21 2001/02/08 08:54:14 nishida Exp $
+ * $Id: scanner.l,v 1.22 2001/08/11 08:50:01 onoe Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -164,6 +164,7 @@
 (PCACHE|pcache)	return KW_PCACHE;
 (ANIM|anim)	return KW_ANIM;
 (VALIGN|valign)	return KW_VALIGN;
+(AREA|area)	return KW_AREA;
 
 [ \n\t]		;
 ","		return COMMA;
Index: kit/image/gif.h
diff -u kit/image/gif.h:1.2 kit/image/gif.h:removed
--- kit/image/gif.h:1.2	Mon Dec 28 17:23:03 1998
+++ kit/image/gif.h	Mon Aug 13 05:10:06 2001
@@ -1,72 +0,0 @@
-/* gif.h:
- *
- * gifin.h
- * kirk johnson
- * november 1989
- * external interface to gifin.c
- *
- * Copyright 1989 Kirk L. Johnson (see the included file
- * "kljcpyrght.h" for complete copyright information)
- */
-
-/*
- * gifin return codes
- */
-#define GIFIN_SUCCESS       0   /* success */
-#define GIFIN_DONE          1   /* no more images */
-
-#define GIFIN_ERR_BAD_SD   -1   /* bad screen descriptor */
-#define GIFIN_ERR_BAD_SEP  -2   /* bad image separator */
-#define GIFIN_ERR_BAD_SIG  -3   /* bad signature */
-#define GIFIN_ERR_EOD      -4   /* unexpected end of raster data */
-#define GIFIN_ERR_EOF      -5   /* unexpected end of input stream */
-#define GIFIN_ERR_FAO      -6   /* file already open */
-#define GIFIN_ERR_IAO      -7   /* image already open */
-#define GIFIN_ERR_NFO      -8   /* no file open */
-#define GIFIN_ERR_NIO      -9   /* no image open */
-
-/*
- * colormap indices 
- */
-
-#define GIF_RED  0
-#define GIF_GRN  1
-#define GIF_BLU  2
-
-/*
- * typedef BYTE for convenience
- */
-
-typedef unsigned char BYTE;
-
-static int gifin_open_file();
-static int gifin_open_image();
-static int gifin_get_pixel();
-#if 0
-static int gifin_close_image();
-#endif
-static int gifin_close_file();
-static int gifin_load_cmap();
-static int gifin_skip_extension();
-static int gifin_read_data_block();
-static int gifin_push_string();
-static void gifin_add_string();
-static void gifin_fatal();
-
-/* #defines, typedefs, and such
- */
-
-#define GIF_SIG      "GIF87a"
-#define GIF_SIG_89   "GIF89a"
-#define GIF_SIG_LEN  6          /* GIF signature length */
-#define GIF_SD_SIZE  7          /* GIF screen descriptor size */
-#define GIF_ID_SIZE  9          /* GIF image descriptor size */
-
-#define GIF_SEPARATOR   ','     /* GIF image separator */
-#define GIF_EXTENSION   '!'     /* GIF extension block marker */
-#define GIF_TERMINATOR  ';'     /* GIF terminator */
-
-#define STAB_SIZE  4096         /* string table size */
-#define PSTK_SIZE  4096         /* pixel stack size */
-
-#define NULL_CODE  -1           /* string table null code */
Index: kit/sample/cloud.gif
Index: kit/sample/dad.gif
Index: kit/sample/default.mgp
diff -u kit/sample/default.mgp:1.22 kit/sample/default.mgp:1.23
--- kit/sample/default.mgp:1.22	Wed Apr 11 21:46:01 2001
+++ kit/sample/default.mgp	Sat Aug 11 01:40:54 2001
@@ -19,7 +19,7 @@
 %%
 %% Default settings per each line numbers.
 %%
-%default 1 leftfill, size 2, fore "white", back "black", font "thick"
+%default 1 area 90 90, leftfill, size 2, fore "white", back "black", font "thick"
 %default 2 size 7, vgap 10, prefix " "
 %default 3 size 2, bar "gray70", vgap 10
 %default 4 size 5, fore "white", vgap 30, prefix " ", font "standard"
Index: kit/sample/dns-jp.mgp
diff -u kit/sample/dns-jp.mgp:1.5 kit/sample/dns-jp.mgp:removed
--- kit/sample/dns-jp.mgp:1.5	Fri Sep  4 21:33:18 1998
+++ kit/sample/dns-jp.mgp	Mon Aug 13 05:10:08 2001
@@ -1,130 +0,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%%	This file is automatically created from the file
-%%	main.pre modified at Fri Jan 23 14:31:24 1998
-%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%
-%include "default.mgp"
-%% "noop" cancels definitions in default.mgp
-%default 1 left, size 7, fore "light yellow", back "blue4", font "standard", ccolor "white", vgap 35
-%default 2 noop
-%default 3 fore "white", bar "gray70", vgap 10
-%default 4 noop
-%tab 1 noop
-%tab 2 noop
-%tab 3 noop
-%%%
-%page
-%nodefault
-%fore "red", back "blue4", size 9, vgap 15
-%center, fore "yellow", font "thick"
-%ccolor "white"
-
-
-
-Root DNS `M' $B$K$D$$$F(B
-
-%size 6, fore "red", font "thick"
-$B2CF#(B   $BO/(B
-
-%size 5, fore "white", font "standard"
-$BEl5~Bg3XBg7?7W;;5!%;%s%?!<(B
-
-
-%font "typewriter"
-kato@wide.ad.jp
-%font "standard"
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (1)
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS
-%fore "white", size 5, font "standard"
-       $B!&(B $B#9Bf$G1?MQ(B
-%fore "white", size 5, font "standard"
-          $B!](B $B#8Bf$,(B US
-          $B!](B Stockholm $B$K#1Bf(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B:GBg$G#1#3Bf(B
-%fore "white", size 5, font "standard"
-          $B!](B $B%Q%1%C%HD9$N@)Ls(B
-%fore "red", size 6, font "thick"
-   $B!y(B Root DNS $B$N1?MQ4p=`(B
-%fore "white", size 5, font "standard"
-       $B!&(B RFC 2010
-       $B!&(B gTLD $B$H$N4X78(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B7P0^(B (2)
-%fore "red", size 6, font "thick"
-   $B!y(B IEPG $B$G3HD%$r8!F$(B
-   $B!y(B $B%h!<%m%C%QCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B LINX $B$K?7@_(B : 1997 $BG/(B 4 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B RIPE/NCC $B$,4IM}(B
-          $B!](B `K'
-%fore "red", size 6, font "thick"
-   $B!y(B $B%"%8%"B@J?MNCO0h(B
-%fore "white", size 5, font "standard"
-       $B!&(B NSPIXP-2 $B!'(B 1997 $BG/(B 8 $B7n(B
-%fore "white", size 5, font "standard"
-          $B!](B WIDE $B$,4IM}(B
-          $B!](B `M'
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  `M'
-%fore "red", size 6, font "thick"
-   $B!y(B $B9=@.(B
-%fore "white", size 5, font "standard"
-       $B!&(B $B#2Bf$N(B PentiumPro 200MHz
-       $B!&(B Primary/Backup$B!"(B $B<+F0@Z$jBX$((B
-%fore "red", size 6, font "thick"
-   $B!y(B Root-only $B%5!<%P(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-202.12.27.33
-%font "standard"
-       $B!&(B 400 $B!A(B 500 query/sec
-%fore "red", size 6, font "thick"
-   $B!y(B $B1?MQ4IM}(B
-%fore "white", size 5, font "standard"
-       $B!&(B WIDE $B$*$h$S(B ISP $BM-;V(B
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%page
-
-%back "blue4"
-  $B$*4j$$(B
-%fore "red", size 6, font "thick"
-   $B!y(B $B:G?7$N(B root.cache $B$NF~$l49$((B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-1997082200
-%fore "red", size 6, font "thick"
-   $B!y(B Named $B$N99?7(B
-%fore "white", size 5, font "standard"
-       $B!&(B 4.9.6/8.8.1
-%fore "red", size 6, font "thick"
-   $B!y(B $BM7$P$J$$$G!'(B
-%fore "white", size 5, font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-ping/traceroute
-%font "standard"
-       $B!&(B 
-%cont, font "typewriter"
-telnet/spray/...
-%fore "red", size 6, font "thick"
-   $B!y(B Thanks to
-%fore "white", size 5, font "standard"
-       $B!&(B $BF|K\(B Cisco/$BB?$/$N(B ISP
-       $B!&(B `M' $B4IM}%0%k!<%W(B
Index: kit/sample/mgp-old1.gif
Index: kit/sample/mgp-old2.gif
Index: kit/sample/mgp-old3.gif
Index: kit/sample/mgp1.gif
Index: kit/sample/mgp2.gif
Index: kit/sample/mgp3.gif
Index: kit/sample/sample-fr.mgp
diff -u kit/sample/sample-fr.mgp:1.6 kit/sample/sample-fr.mgp:1.7
--- kit/sample/sample-fr.mgp:1.6	Fri Mar 16 23:58:32 2001
+++ kit/sample/sample-fr.mgp	Sat Aug 11 18:53:53 2001
@@ -58,6 +58,7 @@
 
 Placez le texte ou vous voulez!
 
+%area 40 80 5 20
 %fore "red", size 6
 %center
 centre
@@ -68,6 +69,8 @@
 
 %right
 droite
+%area 40 80 50 20, leftfill, fore "white"
+	You can make a 2 column page by specifying drawing area.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %PAGE
 
Index: kit/sample/sample-jp.mgp
diff -u kit/sample/sample-jp.mgp:1.35 kit/sample/sample-jp.mgp:1.37
--- kit/sample/sample-jp.mgp:1.35	Thu Apr 12 13:42:17 2001
+++ kit/sample/sample-jp.mgp	Sat Aug 11 18:53:53 2001
@@ -19,7 +19,7 @@
 %%
 %% Default settings per each line numbers.
 %%
-%default 1 leftfill, size 2, fore "gray20", back "white", font "standard", hgap 0
+%default 1 area 90 90, leftfill, size 2, fore "gray20", back "white", font "standard", hgap 0
 %default 2 size 5, hgap 20, vgap 10, prefix " ", ccolor "black"
 %default 3 size 2, hgap 10, bar "gray70", vgap 10
 %default 4 size 4, hgap 10, fore "gray20", vgap 30, prefix " ", font "standard"
@@ -93,6 +93,7 @@
 $BI=<(0LCV@)8f(B
 
 
+%area 40 80 5 20
 	$BI=<($N0LCV$r@)8f$G$-$^$9(B
 
 %fore "red"
@@ -104,6 +105,8 @@
 
 %right
 $B1&4s$;(B
+%area 40 80 50 20, leftfill, fore "black"
+	$BI=<(HO0O$r;XDj$9$k$3$H$G!"(B2$B%+%i%`$K$9$k$3$H$b$G$-$^$9(B
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %PAGE
 %bgrad 0 0 256 0 0 "white" "blue"
Index: kit/sample/sample.mgp
diff -u kit/sample/sample.mgp:1.27 kit/sample/sample.mgp:1.29
--- kit/sample/sample.mgp:1.27	Wed Apr 11 21:47:33 2001
+++ kit/sample/sample.mgp	Sat Aug 11 18:53:53 2001
@@ -19,7 +19,7 @@
 %%
 %% Default settings per each line numbers.
 %%
-%default 1 leftfill, size 2, fore "gray20", back "white", font "standard", hgap 0
+%default 1 area 90 90, leftfill, size 2, fore "gray20", back "white", font "standard", hgap 0
 %default 2 size 7, vgap 10, prefix " ", ccolor "black"
 %default 3 size 2, bar "gray70", vgap 10
 %default 4 size 5, fore "gray20", vgap 30, prefix " ", font "standard"
@@ -91,7 +91,7 @@
 Place text whereever you like!
 
 
-
+%area 40 80 5 20
 %fore "red", size 6
 %center
 CENTER
@@ -102,6 +102,8 @@
 
 %right
 RIGHT
+%area 40 80 50 20, leftfill, fore "black"
+	You can make a 2 column page by specifying drawing area.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %PAGE
 %bgrad 25 25 256 45 1 "gray" "gray" "white" "white" "white" "white" "gray" "gray"
Index: kit/sample/v6header.gif
