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 Jul 24 05:10:03 2000
@@ -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/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 Jul 24 05:10:05 2000
@@ -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.173 kit/draw.c:1.174
--- kit/draw.c:1.173	Sat Jul  8 05:04:08 2000
+++ kit/draw.c	Mon Jul 17 23:21:25 2000
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.173 2000/07/07 20:04:08 nishida Exp $
+ * $Id: draw.c,v 1.174 2000/07/17 14:21:25 nishida Exp $
  */
 
 #include "mgp.h"
@@ -2768,7 +2768,9 @@
 		goto end;
 	}
 
-	draw_line_itemsize(state, 0, height * yzoomrate / 100);
+	/* because vertloc of image is VL_TOP */
+	draw_line_itemsize(state, height * yzoomrate / 100, 0);
+
 	if (centerflag)
 		image_posx = char_size[caching] / 2 - (width * xzoomrate / 100) / 2;
 	else
Index: kit/print.c
diff -u kit/print.c:1.86 kit/print.c:1.87
--- kit/print.c:1.86	Sun Nov 28 23:35:09 1999
+++ kit/print.c	Mon Jul 17 23:21:27 2000
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: print.c,v 1.86 1999/11/28 14:35:09 nishida Exp $
+ * $Id: print.c,v 1.87 2000/07/17 14:21:27 nishida Exp $
  */
 /*
  * Paper size selection code is based on psutil.c by Angus J. C. Duggan
@@ -64,6 +64,7 @@
 	int xsiz;
 	int ysiz;
 	int eps;
+        int target_text;    /* by A. Ito */
 } imagepool[256];		/*enough?*/
 static int nimagepool = 0;
 static struct textpool {
@@ -751,6 +752,16 @@
 		back = cp->ctl_value;
 		break;
 
+/* MARK and AGAIN processing by A.Ito, 14 Jul. 2000 */
+	case CTL_MARK:
+                fprintf(fp,"/markx xpos def /marky ypos def\n");
+		break;
+
+	case CTL_AGAIN:
+                fprintf(fp,"markx marky moveto /xpos markx def /ypos marky def\n");
+		break;
+
+
 	default:
 		break;
 	}
@@ -894,6 +905,7 @@
 				fprintf(fp, "%d 0 rmoveto\n", textpool[i].xsiz);
 			}
 		}
+		fprintf(fp, "/xpos%d currentpoint pop def\n",i);
 	}
 
 	ntextpool = 0;
@@ -905,10 +917,11 @@
 		if (mgp_flag & FL_VERBOSE)
 			fprintf(fp, "%% emit the content of imagepool\n");
 		cp1 = imagepool[i].image;
-		if (!cp1)
+		if (!cp1) {
+		        fprintf(fp, "/xpos xpos%d def xpos ypos moveto\n",
+			        imagepool[i].target_text);
 			continue;
-		fprintf(fp, "xpos %d add ypos moveto\n",
-			imagepool[i].xoffset);
+		}
 		image_load_print(cp1->ctm_fname, cp1->ctm_numcolor,
 			cp1->ctm_ximagesize, cp1->ctm_yimagesize, 0,
 			cp1->ctm_zoomflag);
@@ -1222,6 +1235,11 @@
 		*q++ = '\0';
 		text_remember(buf, ASCII, char_size[0], textstartpos, pfx);
 	}
+	/* by A.Ito 14 Jul. 2000 */
+	/* placeholder */
+	imagepool[nimagepool].image = NULL;
+	imagepool[nimagepool].target_text = ntextpool-1;
+	nimagepool++;
 }
 
 static char *
@@ -1469,8 +1487,13 @@
 					AllPlanes, ZPixmap);
 
 	fprintf(fp, "gsave\n");
+/*
 	fprintf(fp, "%d ypos %d sub translate\n",
 		xpos + paper_xmargin, print_height);
+*/
+/* by A. Ito */
+	fprintf(fp, "xpos ypos %d sub translate\n",
+		print_height); 
 	fprintf(fp, "%d %d scale\n", print_width, print_height);
 	fprintf(fp, "%d %d 8\n", print_width, print_height);
 	fprintf(fp, "[%d 0 0 %d 0 %d]\n", print_width,
@@ -1785,7 +1808,11 @@
 	}
 
 	fprintf(fp, "BeginEPSF\n");
+/*
 	fprintf(fp, "%d XMARGIN add ypos translate\n", xpos);
+*/
+	/* by A.Ito */
+	fprintf(fp, "xpos ypos translate\n");
 	fprintf(fp, "%f %f scale\n", xscale, yscale);
 	fprintf(fp, "%d %d translate\n", -1 * x1, -1 * y2);
 	fprintf(fp, "%%%%BeginDocument: %s\n", filename);
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 Jul 24 05:10:12 2000
@@ -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/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
