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 Apr 14 05:10:01 2003
@@ -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.35 kit/SYNTAX:1.36
--- kit/SYNTAX:1.35	Sat Mar 16 05:14:43 2002
+++ kit/SYNTAX	Sat Apr 12 07:05:41 2003
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.35 2002/03/15 20:14:43 nishida Exp $
+$Id: SYNTAX,v 1.36 2003/04/11 22:05:41 nishida Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -361,3 +361,8 @@
 	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.
+
+%opaque <value>
+	<value> :: transparency of the font. (0-100) 
+	Value 0 means that the font will be drawn with full tranparency.
+	NOTE: To use this directive, you need to build mgp with Xft2.
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 Apr 14 05:10:01 2003
@@ -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.201 kit/draw.c:1.202
--- kit/draw.c:1.201	Sun Apr  6 18:43:18 2003
+++ kit/draw.c	Sat Apr 12 07:05:41 2003
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.201 2003/04/06 09:43:18 nishida Exp $
+ * $Id: draw.c,v 1.202 2003/04/11 22:05:41 nishida Exp $
  */
 
 #include "mgp.h"
@@ -137,7 +137,7 @@
 #define CHECK_CACHE {if (caching){caching = -1; return;}}
 
 #ifdef USE_XFT2
-static void set_xrender_color  __P((long));
+static void set_xrender_color  __P((long, int));
 static XftDraw * xft_getdraw __P((Drawable)); 
 static char *xft_draw_fragment __P((struct render_state *, 
 						u_char *, u_int, char *, int));
@@ -831,6 +831,18 @@
 		state->ypos = 0;
 		break;
 
+	case CTL_OPAQUE:
+#ifdef USE_XFT2
+		if (cp->cti_value > 100){
+			fprintf(stderr, "%%opaque: value should be 0-100\n");
+			cp->cti_value = 100;
+		}
+		state->opaque = cp->cti_value;
+#else
+		printf("this mgp cannot use \%opaque\n");
+#endif
+		break;
+
 	default:
 		fprintf(stderr,
 			"undefined directive %d at page %d line %d:\n\t",
@@ -1183,7 +1195,6 @@
 #ifdef USE_XFT2
 	char *p0;
 
-//printf("XXXX %s\n", registry);
 	p0 = xft_draw_fragment(state, p, len, registry, charset16);
 	if (p0) return p0;
 #endif
@@ -2100,7 +2111,7 @@
 			break;
 #ifdef USE_XFT2
 		case O_XTFONT:
-			set_xrender_color(obj->fore);
+			set_xrender_color(obj->fore, state->opaque);
 			if (xft_font) XftFontClose(display, xft_font);
 			xft_font = xft_setfont(obj->data.xftfont.fontname, 
 							obj->data.xftfont.size, obj->data.xftfont.registry);
@@ -4451,12 +4462,14 @@
 #endif
 #ifdef USE_XFT2
 void
-set_xrender_color(value)
+set_xrender_color(value, opaque)
 		long value; 
+		int opaque;
 {	
 	XColor xc;
 	XRenderColor render_color;
 
+	xft_forecolor.color.alpha = 65535 * opaque / 100;
 	if (value == xft_forecolor.pixel) return;
 
 	xc.flags = DoRed | DoGreen | DoBlue;
@@ -4467,7 +4480,6 @@
 	xft_forecolor.color.red = xc.red;
 	xft_forecolor.color.green = xc.green;
 	xft_forecolor.color.blue = xc.blue;
-	xft_forecolor.color.alpha = 65535;
 }
 
 static char *
@@ -4630,13 +4642,37 @@
 	int csize;
 	char *registry;
 {
-	XftFont *xftfont;
-
-	xftfont = XftFontOpen(display, screen,
-        XFT_FAMILY, XftTypeString, xfont,
-        XFT_ENCODING, XftTypeString, registry,
-		XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
-	if (xftfont == 0) return NULL;
+	static XftFont *xftfont;
+	static char lastfont[100];
+	char *p;
+	char style[100];
+	char font[100];
+	int stlen;
+
+//	if (!strcmp(xfont, lastfont)) return xftfont;
+
+//printf("xfont [%s] : nonstyle \n", xfont);
+	if (!(p = strchr(xfont, ':'))){
+		xftfont = XftFontOpen(display, screen,
+			XFT_FAMILY, XftTypeString, xfont,
+			XFT_ENCODING, XftTypeString, registry,
+			XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
+		if (xftfont == 0) return NULL;
+	} else {
+		bzero(style, sizeof(style));
+		bzero(font, sizeof(font));
+		stlen = strlen(p) - 1;
+		strncpy(font, xfont, (strlen(xfont) - (stlen +1) >= 100) ? 
+						99 : (strlen(xfont) - (stlen +1)));	
+		strncpy(style, p +1, (stlen >= 100) ? 99 : stlen);	
+		xftfont = XftFontOpen(display, screen,
+			XFT_FAMILY, XftTypeString, font,
+			XFT_ENCODING, XftTypeString, registry,
+			XFT_STYLE, XftTypeString, style,
+			XFT_SIZE, XftTypeDouble, (float)csize * 0.75, 0);
+		if (xftfont == 0) return NULL;
+	}
+//	strncpy(lastfont, xfont, 99);
 	return xftfont;
 }
 #endif
Index: kit/grammar.y
diff -u kit/grammar.y:1.41 kit/grammar.y:1.42
--- kit/grammar.y:1.41	Mon Sep 17 23:48:30 2001
+++ kit/grammar.y	Sat Apr 12 07:05:42 2003
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.41 2001/09/17 14:48:30 nishida Exp $
+ * $Id: grammar.y,v 1.42 2003/04/11 22:05:42 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -731,7 +731,8 @@
 %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 KW_AREA
+%token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM KW_VALIGN KW_AREA 
+%token KW_OPAQUE
 
 %type <ct> toplevel
 %type <ct> line defaultline tabline shellline deffontline
@@ -994,6 +995,7 @@
 	| KW_VALIGN STRorID	{
 			$$ = gen_valign($2);
 	}
+	| KW_OPAQUE NUM	{ $$ = gen_int(CTL_OPAQUE, $2); }
 	;
 tabcmd:	  KW_TAB NUM	{ $$ = gen_int(CTL_TAB, $2); }
 	| KW_TAB ID	{ $$ = gen_str(CTL_TAB, $2); }
Index: kit/mgp.h
diff -u kit/mgp.h:1.131 kit/mgp.h:1.132
--- kit/mgp.h:1.131	Mon Feb 17 14:25:22 2003
+++ kit/mgp.h	Sat Apr 12 07:05:42 2003
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.131 2003/02/17 05:25:22 nishida Exp $
+ * $Id: mgp.h,v 1.132 2003/04/11 22:05:42 nishida Exp $
  */
 
 #include <stdio.h>
@@ -112,6 +112,7 @@
 #define DEFAULT_HGAP		0
 #define DEFAULT_VGAP		15
 #define DEFAULT_BQUALITY	100
+#define DEFAULT_OPAQUE		100	
 
 #define XLFD_HYPHEN	14
 #define FONT_FORMAT	"-*-%s-*-*-%s-*-*-*-*-*-%s"
@@ -411,6 +412,7 @@
 	int maxdescent;
 	u_int linewidth;
 	u_int brankline;
+	u_int opaque;
 	struct ctrl *xfont;
 	struct render_object *obj, *objlast;
 };
Index: kit/parse.c
diff -u kit/parse.c:1.89 kit/parse.c:1.90
--- kit/parse.c:1.89	Tue Mar 25 05:02:50 2003
+++ kit/parse.c	Sat Apr 12 07:05:42 2003
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.89 2003/03/24 20:02:50 nishida Exp $
+ * $Id: parse.c,v 1.90 2003/04/11 22:05:42 nishida Exp $
  */
 
 #include "mgp.h"
@@ -844,6 +844,8 @@
 	tmpint[2]->cti_value = DEFAULT_VGAP;
 	tmpint[3] = ctlalloc1(CTL_QUALITY);
 	tmpint[3]->cti_value = DEFAULT_BQUALITY;
+	tmpint[4] = ctlalloc1(CTL_OPAQUE);
+	tmpint[4]->cti_value = DEFAULT_OPAQUE;
 	tmpvoid[0] = ctlalloc1(CTL_LEFT);
 	tmparea[0] = ctlalloc1(CTL_AREA);
 	tmparea[0]->ctar_width = 100;
@@ -959,6 +961,7 @@
 				case CTL_HGAP: tmpint[1] = cp; break;
 				case CTL_VGAP: tmpint[2] = cp; break;
 				case CTL_QUALITY: tmpint[3] = cp; break;
+				case CTL_OPAQUE: tmpint[4] = cp; break;
 
 				case CTL_LEFT: tmpvoid[0] = cp; break;
 				case CTL_RIGHT: tmpvoid[0] = cp; break;
Index: kit/scanner.l
diff -u kit/scanner.l:1.22 kit/scanner.l:1.23
--- kit/scanner.l:1.22	Sat Aug 11 17:50:01 2001
+++ kit/scanner.l	Sat Apr 12 07:05:42 2003
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.22 2001/08/11 08:50:01 onoe Exp $
+ * $Id: scanner.l,v 1.23 2003/04/11 22:05:42 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -165,6 +165,7 @@
 (ANIM|anim)	return KW_ANIM;
 (VALIGN|valign)	return KW_VALIGN;
 (AREA|area)	return KW_AREA;
+(OPAQUE|opaque)	return KW_OPAQUE;
 
 [ \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 Apr 14 05:10:02 2003
@@ -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 Apr 14 05:10:02 2003
@@ -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
