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 Sep 24 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.32 kit/SYNTAX:1.33
--- kit/SYNTAX:1.32	Sat Aug 11 17:44:39 2001
+++ kit/SYNTAX	Mon Sep 17 23:48:29 2001
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.32 2001/08/11 08:44:39 onoe Exp $
+$Id: SYNTAX,v 1.33 2001/09/17 14:48:29 nishida Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -191,6 +191,9 @@
 
 	The effect of %prefix command in %tab command is local to
 	tab-indented line.
+
+%prefix <size>
+	Place specified size of space at the beginning of line.
 
 %icon <arc|box|delta1|delta2|delta3|delta4|dia> <color> <size>
 %icon <imagefile> <color> <size>
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 Sep 24 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.190 kit/draw.c:1.191
--- kit/draw.c:1.190	Wed Aug 15 14:59:08 2001
+++ kit/draw.c	Mon Sep 17 23:48:29 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.190 2001/08/15 05:59:08 nishida Exp $
+ * $Id: draw.c,v 1.191 2001/09/17 14:48:29 nishida Exp $
  */
 
 #include "mgp.h"
@@ -624,10 +624,18 @@
 		state->curprefix = cp->ctc_value;
 		break;
 
+	case CTL_PREFIXN:
+		state->xprefix = state->width * cp->ctf_value / 100;
+		break;
+
 	case CTL_TABPREFIX:
 		state->tabprefix = cp->ctc_value;
 		break;
 
+	case CTL_TABPREFIXN:
+		state->tabxprefix = state->width * cp->ctf_value / 100;
+		break;
+
 	case CTL_PREFIXPOS:
 	    {
 		char *p;
@@ -698,6 +706,7 @@
 		draw_line_end(state);
 		/* reset single-line oriented state */
 		state->tabprefix = NULL;
+		state->tabxprefix = 0;
 		state->special = 0;
 		if (state->align == AL_LEFTFILL1) {
 			state->align = AL_LEFTFILL0;
@@ -1856,6 +1865,7 @@
 	 *			leftmost and uppermost dot.
 	 *	state->ypos	absolute y position in main window.
 	 */
+	xpos += state->tabxprefix ? state->tabxprefix : state->xprefix;
 	width = (state->linewidth <= state->width - xpos)
 			? state->linewidth
 			: state->width - xpos;
@@ -3416,7 +3426,8 @@
 	XGetGeometry(display, window_id, &dumwin, 
 		&xloc, &yloc, &xsiz, &ysiz, &dumint, &dumint);
 	state->linewidth = xsiz;
-	xloc = set_position(state) + state->xoff;
+	xloc = set_position(state) + state->xoff 
+		+ state->tabxprefix ? state->tabxprefix : state->xprefix;
 	yloc = state->ypos + state->yoff;
 	XMoveWindow(display, window_id, xloc, yloc);
 	state->ypos += ysiz;
Index: kit/globals.c
diff -u kit/globals.c:1.45 kit/globals.c:1.46
--- kit/globals.c:1.45	Sat Aug 11 17:50:00 2001
+++ kit/globals.c	Mon Sep 17 23:48:30 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.45 2001/08/11 08:50:00 onoe Exp $
+ * $Id: globals.c,v 1.46 2001/09/17 14:48:30 nishida Exp $
  */
 
 #include "mgp.h"
@@ -117,7 +117,9 @@
 /*CTL*/	{ CTL_GAP,		T_INT,	"gap", 3 },
 /*CTL*/	{ CTL_PAUSE,		T_SP,	"pause", 5 },
 /*CTL*/	{ CTL_PREFIX,		T_STR,	"prefix", 6 },
+/*CTL*/	{ CTL_PREFIXN,		T_STR,	"*prefixn*", 9 },
 /*CTL*/	{ CTL_TABPREFIX,	T_STR,	"*tabprefix*", 11 },
+/*CTL*/	{ CTL_TABPREFIXN,	T_STR,	"*tabprefixn*", 12 },
 /*CTL*/	{ CTL_PREFIXPOS,	T_VOID,	"*prefixpos*", 11 },
 /*CTL*/	{ CTL_AGAIN,		T_VOID,	"again", 5 },
 /*CTL*/	{ CTL_CCOLOR,		T_LONG,	"ccolor", 6 },
Index: kit/grammar.y
diff -u kit/grammar.y:1.40 kit/grammar.y:1.41
--- kit/grammar.y:1.40	Sat Aug 11 19:23:12 2001
+++ kit/grammar.y	Mon Sep 17 23:48:30 2001
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.40 2001/08/11 10:23:12 onoe Exp $
+ * $Id: grammar.y,v 1.41 2001/09/17 14:48:30 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -920,6 +920,8 @@
 			  }
 			}
 	| KW_PREFIX STR	{ $$ = gen_str(CTL_PREFIX, $2); }
+	| KW_PREFIX NUM	{ $$ = gen_double_int(CTL_PREFIXN, $2); }
+	| KW_PREFIX DOUBLE	{ $$ = gen_double(CTL_PREFIXN, $2); }
 	| KW_NEWIMAGE args
 			{ $$ = gen_newimage($2); }
 	| KW_IMAGE STRorID WINSIZ
Index: kit/mgp.h
diff -u kit/mgp.h:1.127 kit/mgp.h:1.128
--- kit/mgp.h:1.127	Sat Aug 11 17:50:00 2001
+++ kit/mgp.h	Mon Sep 17 23:48:30 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.127 2001/08/11 08:50:00 onoe Exp $
+ * $Id: mgp.h,v 1.128 2001/09/17 14:48:30 nishida Exp $
  */
 
 #include <stdio.h>
@@ -391,6 +391,8 @@
 	Drawable target;
 	u_int height;
 	u_int width;
+	int xprefix;
+	int tabxprefix;
 	int xoff;
 	int yoff;
 	u_int ypos;
Index: kit/parse.c
diff -u kit/parse.c:1.85 kit/parse.c:1.86
--- kit/parse.c:1.85	Sat Aug 11 17:50:01 2001
+++ kit/parse.c	Mon Sep 17 23:48:30 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.85 2001/08/11 08:50:01 onoe Exp $
+ * $Id: parse.c,v 1.86 2001/09/17 14:48:30 nishida Exp $
  */
 
 #include "mgp.h"
@@ -754,6 +754,8 @@
 		for (cp = tab_control[l]; cp; cp = cp->ct_next) {
 			if (cp->ct_op == CTL_PREFIX)
 				cp->ct_op = CTL_TABPREFIX;
+			if (cp->ct_op == CTL_PREFIXN)
+				cp->ct_op = CTL_TABPREFIXN;
 		}
 	}
 }
Index: kit/print.c
diff -u kit/print.c:1.96 kit/print.c:1.97
--- kit/print.c:1.96	Wed Aug 15 09:24:48 2001
+++ kit/print.c	Mon Sep 17 23:48:30 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.96 2001/08/15 00:24:48 onoe Exp $
+ * $Id: print.c,v 1.97 2001/09/17 14:48:30 nishida Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -53,6 +53,8 @@
 static int painticon = 0;
 static u_int curlinenum;
 static u_int curpagenum;
+static u_int xprefix = 0;
+static u_int tabxprefix = 0;
 static u_int valign = VL_BOTTOM;
 
 #ifdef FREETYPE
@@ -720,10 +722,18 @@
 		curprefix = cp->ctc_value;
 		break;
 
+	case CTL_PREFIXN:
+		xprefix = window_width * cp->ctf_value / 100;
+		break;
+
 	case CTL_TABPREFIX:
 		tabprefix = cp->ctc_value;
 		break;
 
+	case CTL_TABPREFIXN:
+		tabxprefix = window_width * cp->ctf_value / 100;
+		break;
+
 	case CTL_PREFIXPOS:
 		if (tabprefix)
 			print_line(tabprefix, 1);
@@ -889,6 +899,7 @@
 	 *	}
 	 */
 	fprintf(fp, "/totlen exch def\n");
+	fprintf(fp, "/totlen totlen %d add def\n", tabxprefix ? tabxprefix:xprefix);
 	fprintf(fp, "/inmargin true def /fillzero XMARGIN def\n");
 	fprintf(fp, "%sdefxpos ", alignstr);
 
@@ -916,6 +927,7 @@
 		fprintf(fp, " { 0 } { imgsize charsize sub 2 div } ifelse sub def\n");
 		break;
 	}
+	fprintf(fp, "/xpos xpos %d add def\n", tabxprefix ? tabxprefix:xprefix);
 	fprintf(fp, "xpos yypos ymax sub moveto\n");
 
 	for (i = 0; i < ntextpool; i++) {
@@ -995,6 +1007,7 @@
 done:
 	fprintf(fp, "NL\n");
 	tabprefix = NULL;
+	tabxprefix = 0;
 }
 
 static void
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 Sep 24 05:10:03 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/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 Sep 24 05:10:03 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/v6header.gif
