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 Feb  8 05:10:04 1999
@@ -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.135 kit/draw.c:1.136
--- kit/draw.c:1.135	Mon Dec 28 17:22:27 1998
+++ kit/draw.c	Mon Feb  1 13:38:22 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.135 1998/12/28 08:22:27 itojun Exp $
+ * $Id: draw.c,v 1.136 1999/02/01 04:38:22 onoe Exp $
  */
 
 #include "mgp.h"
@@ -73,7 +73,7 @@
 	u_int, char *));
 static int obj_new_image __P((struct render_state *, int, int, Image *, int, int));
 static int obj_new_icon __P((struct render_state *, int, int, u_int, u_int, u_long, u_int, XPoint *));
-static Pixel obj_image_color __P((Image *, Image *, Pixel));
+static Pixel obj_image_color __P((Image *, Image *, Pixel, int *));
 static Image *obj_image_trans __P((Image *, u_int, u_int));
 static void obj_draw_image __P((Drawable, u_int, u_int, struct render_object *));
 static void obj_draw __P((struct render_state *, Drawable, u_int, u_int));
@@ -1368,14 +1368,15 @@
 }
 
 static Pixel
-obj_image_color(image, bimage, d)
+obj_image_color(image, bimage, d, inithist)
 	Image *image, *bimage;
 	Pixel d;
+	int *inithist;
 {
 	int i, j;
 	RGBMap rgb;
 	int r, g, b;
-	char hist[256];
+	static char hist[256];
 	byte *p;
 
 	switch (bimage->type) {
@@ -1408,14 +1409,20 @@
 		if (i >= 256) {
 			/* search a free slot */
 			if (image->rgb.size == 256) {
-				memset(hist, 0, sizeof(hist));
-				p = image->data;
-				for (j = 0; j < image->height; j++)
-					for (i = 0; i < image->width; i++)
-						hist[*p++] = 1;
-				for (i = 0; i < 256; i++)
-					if (hist[i] == 0)
+				if (!*inithist) {
+					*inithist = 1;
+					memset(hist, 0, sizeof(hist));
+					p = image->data;
+					for (j = 0; j < image->height; j++)
+						for (i = 0; i < image->width; i++)
+							hist[*p++] = 1;
+				}
+				for (i = 0; i < 256; i++) {
+					if (hist[i] == 0) {
+						hist[i] = 1;
 						goto freeslot;
+					}
+				}
 			}
 			return -1;
 		}
@@ -1452,6 +1459,7 @@
 	int pl, bpl;
 	int trans;
 	u_int bw, bh, bx, by;
+	int inithist;
 
 	if (!COMPLEX_BGIMAGE) {
 		if (back_color != xcol.pixel) {
@@ -1500,6 +1508,7 @@
 	pd = -1;
 	n = 0;	/* for lint */
 	trans = image->trans;
+	inithist = 0;
 	for ( ; j < image->height; j++) {
 		by = (y + j) % bh;
 		bx = x % bw;
@@ -1514,7 +1523,7 @@
 			d = memToVal(b, bpl);
 			if (d != pd) {
 				pd = d;
-				n = obj_image_color(image, bg_image, d);
+				n = obj_image_color(image, bg_image, d, &inithist);
 				if (n == -1)
 					goto expand;
 			}
Index: kit/font.c
diff -u kit/font.c:1.21 kit/font.c:1.22
--- kit/font.c:1.21	Mon Dec 21 15:31:52 1998
+++ kit/font.c	Mon Feb  1 11:52:56 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: font.c,v 1.21 1998/12/21 06:31:52 onoe Exp $
+ * $Id: font.c,v 1.22 1999/02/01 02:52:56 onoe Exp $
  */
 
 #include "mgp.h"
@@ -342,6 +342,10 @@
 {
 	struct vfont *vfc, *nvfc;
 
+	/* sanity check */
+	if (vf_curname == NULL)
+		return NULL;
+
 	if (!vfcinitdone)
 		vfc_init();
 	vfc = vfc_lookup(code, width, height, vf_curname);
@@ -372,15 +376,26 @@
 vfc_setfont(fontname)
 	char *fontname;
 {
-	if (vfont_fd < 0) {
+	static char *prev_vfcap;
+
+	if (prev_vfcap != vfcap_name) {
+		/*
+		 * Because the string specified by %vfcap is stored in
+		 * allocated area and never freed, string compare is not
+		 * needed here.
+		 */
+		if (prev_vfcap)
+			VF_Deinit();
 		if (VF_Init(vfcap_name) < 0) {
 			fprintf(stderr, "Error VF_Init\n");
 			cleanup(-1);
 		}
-	} else {
-		VF_CloseFont(vfont_fd);
-		VF_Deinit();
+		prev_vfcap = vfcap_name;
+		if (prev_vfcap == NULL)
+			prev_vfcap = "";	/* XXX: just in case */
 	}
+	if (vfont_fd >= 0)
+		VF_CloseFont(vfont_fd);
 	vfont_fd = VF_OpenFont(fontname);
 	vf_curname = fontname;
 	if (vfont_fd < 0) {
Index: kit/keywords.pl
diff -u kit/keywords.pl:1.1 kit/keywords.pl:removed
--- kit/keywords.pl:1.1	Tue Nov 11 15:07:40 1997
+++ kit/keywords.pl	Mon Feb  8 05:10:08 1999
@@ -1,14 +0,0 @@
-@keywords = ();
-
-die if (@ARGV != 1);
-open(IN, "< $ARGV[0]") || die;
-while (<IN>) {
-	next if (! /^\/\*CTL\*\//);
-	next if (! /CTL_([A-Z0-9]+),/);
-	$t = $1;
-	$t =~ tr/A-Z/a-z/;
-	push(@keywords, $t);
-}
-close(IN);
-
-print join(' ', @keywords) . "\n";
Index: kit/sample/sample-fr.mgp
diff -u /dev/null kit/sample/sample-fr.mgp:1.1
--- /dev/null	Mon Feb  8 05:10:13 1999
+++ kit/sample/sample-fr.mgp	Sat Feb  6 03:43:58 1999
@@ -0,0 +1,209 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%include "default.mgp"
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+%nodefault
+%fore "red", size 7, font "standard", back "darkblue"
+
+
+
+%center, fore "yellow", font "thick"
+MagicPoint
+%font "standard"
+
+
+%size 4, fore "red"
+Keio University
+Yoshifumi Nishida
+%size 3
+nishida@sfc.wide.ad.jp
+
+%size 4, fore "yellow"
+Appuyer sur la barre d'espace!!
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+%bgrad 0 0 16 0 0 "red" "black"
+
+Comment l'utiliser
+
+	Page suivante -> appuyer sur le premier bouton de la souris
+	Page précedente -> appuyer sur le troisieme bouton de la souris
+	Quitter -> Appuer sur q
+%center
+%lcutin
+test message
+%center
+%rcutin
+test message
+%right
+%rmcutin
+test message
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+%bgrad 0 0 16 0 0 "red" "black"
+
+Les options de la ligne de commande.
+
+%prefix "    -h:"
+affiche l'aide .
+%prefix "    -g:"
+geometry. Positionne la taille et l'emplacement de la fenetre.
+%prefix "    -o:"
+Do not override window manager.
+%prefix "    -b:"
+bgcolor. Positionne la couleur de fond. (defaut: noir)
+%prefix ""
+     
+
+           
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+
+Placez le texte ou vous voulez!
+
+%fore "red", size 6
+%center
+centre
+
+
+%left
+gauche
+
+%right
+droite
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Utilisez la fonte que vous voulez!
+
+%CENTER
+%SIZE 10,FORE "orange"
+Bonjour monde
+%SIZE 7,FORE "gray"
+Bonjour monde
+%SIZE 5,FORE "blue"
+Bonjour monde
+%SIZE 4,FORE "yellow"
+Bonjour monde
+%SIZE 3,FORE "green"
+Bonjour monde
+%SIZE 2,FORE "red"
+Bonjour monde
+%SIZE 1,FORE "pink"
+Bonjour monde
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+
+Choisissez la fonte de votre choix
+
+
+%size 4, fore "red", center
+
+%xfont "times-medium-r", tfont "times.ttf"
+Voici  times-medium-r
+
+%xfont "times-medium-i", tfont "timesi.ttf"
+Voici  times-medium-i
+
+%xfont "times-bold-r", tfont "timesbd.ttf"
+Voici times-bold-r
+
+%xfont "times-bold-i", tfont "timesbi.ttf"
+Voici  times-bold-i
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+
+On peut mélanger les fontes sur une ligne
+
+%fore "green", font "standard", size 4
+Ceci est un
+%cont, fore "orange", font "thick", size 6
+Message
+%cont, fore "red", font "typewriter", size 5
+de test.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%page
+
+Cesure automatique des lignes! 
+
+	Bonjour, voici MagicPoint. Je peut gérer proprement les longues lignes. Dans le code source de cette présentation, cette ligne  est implementée comme un seule ligne.
+	Voici la ligne suivante. Bienque l'indentation change, Je peut le gerer.
+		Vous pouvez joindre plusieurs lignes grace a un backslack. \ 
+Une tradition Unix.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+%bgrad 0 0 16 0 0 "red" "black"
+
+Mettez une image
+
+%CENTER
+%IMAGE "cloud.gif"
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Effets spécial!
+
+
+%fore "red", size 6, center
+%shrink
+Message de test
+
+%lcutin
+Message de test
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Pause
+
+	Appuyez sur la barre d'espace pour la suite
+
+%center, fore "red"
+Happy hacking!
+%pause, fore "blue"
+Happy hacking!
+%pause, fore "green"
+Happy hacking!
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Récupérez le résultat d'une commande
+
+	ls -l /kernel /bsd
+
+%size 3, prefix "     "
+%filter "ls -l /kernel /bsd"
+%endfilter
+
+	echo "Ceic est un test" | rev
+
+%filter "rev"
+Ceci est un test.
+%endfilter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Processus extrene (multimedia!)
+
+%system "xeyes -geometry %50x20+25+60"
+
+	Appelez xanim/mpegplay pour vos présentation multimedia ! :-)
+
+	No duplicated subprocess for one declaration.
+	L'emplacement et la geometrie peuvent etre définit par rapport à la fenetre de présentation.
+	xeyes will vanish if you switch the page.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Bonne journée. 
+
+	Allez voir
+		
+%cont, font "typewriter"
+http://www.mew.org/mgp/
+%font "standard"
+	pour de nouvelles aventures.
