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 13 05:10:01 2004
@@ -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/RELNOTES
diff -u kit/RELNOTES:1.8 kit/RELNOTES:1.9
--- kit/RELNOTES:1.8	Tue Aug 10 14:00:02 2004
+++ kit/RELNOTES	Wed Sep  8 02:00:06 2004
@@ -2,7 +2,7 @@
 
 		     Release Notes for MagicPoint
 
-			    Aug ?, 2004
+			    Sep ?, 2004
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -29,6 +29,8 @@
 * support for symbol font added 
 
 * new option: --title 'title' for mgp.
+
+* add -raise option for %newimage directive 
   
 * many bug fixes.
 
Index: kit/SYNTAX
diff -u kit/SYNTAX:1.39 kit/SYNTAX:1.40
--- kit/SYNTAX:1.39	Sat Feb 28 07:43:07 2004
+++ kit/SYNTAX	Wed Sep  8 01:57:42 2004
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.39 2004/02/27 22:43:07 itojun Exp $
+$Id: SYNTAX,v 1.40 2004/09/07 16:57:42 nishida Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -212,6 +212,10 @@
 		width/height, "50" means half the screen width/height.
 		-xscrzoom and -yscrzoom scales image with aspect
 		ratio unchanged.
+        -raise percentage 
+		raise the baseline of the image in the line.	
+		Percentage is against the height of the image. 
+		"100" means the height of the image.
 
 	TODO: supersede %image by %newimage?
 	TODO: option for auto resize mode (fit image into the room left on
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 13 05:10:01 2004
@@ -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.223 kit/draw.c:1.224
--- kit/draw.c:1.223	Sat Sep  4 02:58:30 2004
+++ kit/draw.c	Wed Sep  8 01:57:42 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.223 2004/09/03 17:58:30 nishida Exp $
+ * $Id: draw.c,v 1.224 2004/09/07 16:57:42 nishida Exp $
  */
 
 #include "mgp.h"
@@ -103,8 +103,13 @@
 	char *, int));
 
 static void back_gradation __P((struct render_state *, struct ctrl_grad *));
+#if 1  /* by h.kakugawa@computer.org */
+static void image_load __P((struct render_state *, char *, int, int, int, int, int, int, int));
+static void image_load_ps __P((struct render_state *, char *, int, int, int, int, int, int, int));
+#else
 static void image_load __P((struct render_state *, char *, int, int, int, int, int, int));
 static void image_load_ps __P((struct render_state *, char *, int, int, int, int, int, int));
+#endif
 static void process_icon __P((struct render_state *, struct ctrl *));
 static void draw_bar __P((struct render_state *, struct ctrl *));
 static void process_system __P((struct render_state *, struct ctrl *));
@@ -639,13 +644,25 @@
 
 		/* quickhack for postscript */
 		if (ispsfilename(cp->ctm_fname)) {
+#if 1  /* by h.kakugawa@computer.org */
+			image_load_ps(state, cp->ctm_fname, cp->ctm_numcolor,
+				cp->ctm_ximagesize, cp->ctm_yimagesize, 0,
+				cp->ctm_zoomflag, 0, cp->ctm_raise);
+#else
 			image_load_ps(state, cp->ctm_fname, cp->ctm_numcolor,
 				cp->ctm_ximagesize, cp->ctm_yimagesize, 0,
 				cp->ctm_zoomflag, 0);
+#endif
 		} else {
+#if 1  /* by h.kakugawa@computer.org */
+			image_load(state, cp->ctm_fname, cp->ctm_numcolor,
+				cp->ctm_ximagesize, cp->ctm_yimagesize, 0,
+				cp->ctm_zoomflag, 0, cp->ctm_raise);
+#else
 			image_load(state, cp->ctm_fname, cp->ctm_numcolor,
 				cp->ctm_ximagesize, cp->ctm_yimagesize, 0,
 				cp->ctm_zoomflag, 0);
+#endif
 		}
 		state->brankline = 0;
 	    }
@@ -2951,7 +2968,7 @@
 }
 
 static void
-image_load(state, filename, numcolor, ximagesize, yimagesize, backflag, zoomflag, centerflag)
+image_load(state, filename, numcolor, ximagesize, yimagesize, backflag, zoomflag, centerflag, raise)
 	struct render_state *state;
 	char *filename;
 	int numcolor;
@@ -2965,7 +2982,7 @@
 	Pixmap mypixmap;
 	XImageInfo *ximageinfo;
 	u_int image_posx;
-	int width, height;
+	int width, height, yoffset;
 	float xzoomrate, yzoomrate;
 	int	private = mgp_flag & FL_PRIVATE;
 	static Cursor curs;
@@ -3066,6 +3083,25 @@
 		goto end;
 	}
 
+#if 1  /* by h.kakugawa@computer.org */
+	switch(valign){
+	case VL_TOP:
+		draw_line_itemsize(state, 
+				   (height * raise) * yzoomrate / 10000,
+				   height * (100 + raise) * yzoomrate / 10000, 0);
+		break;
+	case VL_BOTTOM:
+		draw_line_itemsize(state, 
+				   height * (100 + raise) * yzoomrate / 10000,
+				   (height * raise) * yzoomrate / 10000, 0);
+		break;
+	case VL_CENTER:
+		draw_line_itemsize(state, 
+				   height * (100 + raise) * yzoomrate / 20000,
+				   height * (100 + raise) * yzoomrate / 20000, 0);
+		break;
+	}
+#else
 	switch(valign){
 	case VL_TOP:
 		draw_line_itemsize(state, 0, height * yzoomrate / 100, 0);
@@ -3078,6 +3114,7 @@
 			height * yzoomrate / 200, 0);
 		break;
 	}
+#endif
 
 	if (centerflag)
 		image_posx = char_size[caching] / 2 - (width * xzoomrate / 100) / 2;
@@ -3096,7 +3133,7 @@
 }
 
 static void
-image_load_ps(state, filename, numcolor, ximagesize, yimagesize, backflag, zoomflag, centerflag)
+image_load_ps(state, filename, numcolor, ximagesize, yimagesize, backflag, zoomflag, centerflag, raise)
 	struct render_state *state;
 	char *filename;
 	int numcolor;
@@ -3185,7 +3222,7 @@
 			filename, gsdevice, imagefile);
 	}
 	image_load(state, imagefile, numcolor, 100, 100, backflag,
-		Z_NORMAL | (Z_NORMAL << Z_YSHIFT), centerflag);
+		Z_NORMAL | (Z_NORMAL << Z_YSHIFT), centerflag, raise);
 	/* XXX: unlink imagefile in /tmp */
 	if ((p = strrchr(imagefile, '/')) != NULL)
 		p++;
@@ -3291,7 +3328,7 @@
 		if (icon_y == 0) icon_y = 1;
 		tmp_color = fore_color[caching];
 		fore_color[caching] = cp->ctic_color;
-		image_load(state, cp->ctic_value, 0, icon_x, icon_y, 0, 0, 1);
+		image_load(state, cp->ctic_value, 0, icon_x, icon_y, 0, 0, 1, 0);
 		fore_color[caching] = tmp_color;
 		break;
 
@@ -4394,7 +4431,7 @@
 		case CTL_BIMAGE: 
 			image_load(state, ctl->ctm_fname, ctl->ctm_numcolor,
 						ctl->ctm_ximagesize, ctl->ctm_yimagesize, 1,
-						ctl->ctm_zoomflag, 0);
+						ctl->ctm_zoomflag, 0, 0);
 			break;
 		case CTL_BGRAD:
 			back_gradation(state, &ctl->ct_val.ctrl_grad);
Index: kit/grammar.y
diff -u kit/grammar.y:1.44 kit/grammar.y:1.45
--- kit/grammar.y:1.44	Thu Jul  8 15:09:54 2004
+++ kit/grammar.y	Wed Sep  8 01:57:42 2004
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.44 2004/07/08 06:09:54 nishida Exp $
+ * $Id: grammar.y,v 1.45 2004/09/07 16:57:42 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -356,6 +356,7 @@
 	ct->ctm_ximagesize = 100;
 	ct->ctm_yimagesize = 100;
 	ct->ctm_zoomflag = Z_NORMAL | (Z_NORMAL << Z_YSHIFT);
+	ct->ctm_raise = 0;
 
 	for (p = arg; p; p = p->ct_next) {
 		if (p->ctc_value[0] != '-')
@@ -405,6 +406,9 @@
 			p = p->ct_next;
 			ct->ctm_yimagesize = atoi(p->ctc_value);
 			ct->ctm_zoomflag = Z_SCREEN | (Z_SCREEN << Z_YSHIFT);
+		} else if (strcmp(p->ctc_value, "-raise") == 0 && p->ct_next) {
+			p = p->ct_next;
+			ct->ctm_raise = atoi(p->ctc_value);
 		} else {
 			yyerror("invalid argument %s specified for newimage",
 				p->ctc_value);
Index: kit/mgp.c
diff -u kit/mgp.c:1.134 kit/mgp.c:1.135
--- kit/mgp.c:1.134	Fri Jul  9 23:27:02 2004
+++ kit/mgp.c	Wed Sep  8 01:57:42 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.134 2004/07/09 14:27:02 nishida Exp $
+ * $Id: mgp.c,v 1.135 2004/09/07 16:57:42 nishida Exp $
  */
 
 static char *mgp_version = "1.10a (20030624)";
@@ -1129,6 +1129,10 @@
 			}
 			break;
 
+#if 1  /* by h.kakugawa@computer.org */
+		case MapNotify:
+		  goto repaint;
+#endif
 		case Expose:
 			if (e.xexpose.window != window) 
 				break;
Index: kit/mgp.h
diff -u kit/mgp.h:1.139 kit/mgp.h:1.140
--- kit/mgp.h:1.139	Thu Jul 29 00:47:31 2004
+++ kit/mgp.h	Wed Sep  8 01:57:42 2004
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.139 2004/07/28 15:47:31 nishida Exp $
+ * $Id: mgp.h,v 1.140 2004/09/07 16:57:42 nishida Exp $
  */
 
 #include <stdio.h>
@@ -245,6 +245,7 @@
 	u_int ct_ximagesize;
 	u_int ct_yimagesize;
 	u_int ct_zoomflag;
+	u_int ct_raise;
 #define Z_XMASK		0x0f
 #define Z_YMASK		0xf0
 #define Z_YSHIFT	4
@@ -342,6 +343,7 @@
 #define ctm_ximagesize	ct_val.ctrl_image.ct_ximagesize
 #define ctm_yimagesize	ct_val.ctrl_image.ct_yimagesize
 #define ctm_zoomflag	ct_val.ctrl_image.ct_zoomflag
+#define ctm_raise	ct_val.ctrl_image.ct_raise
 #define ctd_colors	ct_val.ctrl_grad.colors
 #define ctd_g_colors	ct_val.ctrl_grad.ct_g_colors
 #define ctd_numcolor	ct_val.ctrl_grad.ct_numcolor
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 13 05:10:02 2004
@@ -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 13 05:10:02 2004
@@ -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
