Index: kit/SYNTAX
diff -u kit/SYNTAX:1.24 kit/SYNTAX:1.25
--- kit/SYNTAX:1.24	Thu May 27 12:22:49 1999
+++ kit/SYNTAX	Mon Jun  7 02:55:09 1999
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.24 1999/05/27 03:22:49 nishida Exp $
+$Id: SYNTAX,v 1.25 1999/06/06 17:55:09 nishida Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -124,8 +124,7 @@
 
 %tmfont "font"
 	<font> :: use TrueType font <font> to draw Kanji characters.
-		<font> can be full pathname, or just filename.  Use %tfdir
-		for setting default font directory.
+		<font> can be full pathname, or just filename. 
 
 %tfont0 "font"
 	<font> :: use TrueType font <font>, if none of the font specified by
@@ -313,3 +312,13 @@
 
 %noop
 	No operation
+
+%pcache <flag> <mode> <effect> <value>
+	<flag> :: enable or disable forward page cache
+			0 means disable forward page cache
+			1 means enable forward page cache
+	<mode> :: cache mode
+			0 means disable forward page cache
+			1 means enable forward page cache
+	<effect> :: type of 'special effect' in forward page cache (0-1)
+	<value> ::  speed of 'special effect'. value 1 means the highest speed.
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 Jun  7 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.149 kit/draw.c:1.150
--- kit/draw.c:1.149	Sun May 30 01:38:35 1999
+++ kit/draw.c	Mon Jun  7 02:55:10 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.149 1999/05/29 16:38:35 nishida Exp $
+ * $Id: draw.c,v 1.150 1999/06/06 17:55:10 nishida Exp $
  */
 
 #include "mgp.h"
@@ -46,6 +46,15 @@
 	0x2242, 0x2244, 0
 };
 
+static struct pcache {
+	u_int flag;
+	u_int page;
+	u_int mgpflag;
+	u_int mode;
+	u_int effect;
+	u_int value;
+} pcache;
+
 #define	COMPLEX_BGIMAGE \
     (bg_image_prev[caching]				\
      && ((bg_image_prev[caching]->ct_op == CTL_BIMAGE)	\
@@ -116,6 +125,7 @@
 static void cache_effect1 __P((void));
 static void cache_effect2 __P((void));
 static void set_from_cache __P((struct render_state *));
+static void pcache_process __P((int));
 
 #define CHECK_CACHE {if (caching){caching = -1; return;}}
 
@@ -193,11 +203,11 @@
 	if (page_attribute[state->page].pg_linenum < state->line) {
 		if (state->page < maxpage) {
 			purgechild(state->page);
-
 			if (mgp_flag & FL_FRDCACHE &&
 				cached_page == state->page + 1){
 					/* Hit cache */
 					set_from_cache(state);
+					pcache_process(state->page);
 					cache_hit = 1;
 			} else {
 				state->phase = P_NONE;
@@ -437,7 +447,6 @@
 		debug0(cp);
 	}
 
-
 	switch(cp->ct_op) {
 	case CTL_SIZE:
 		char_size[caching] = state->height * cp->ctf_value / 100;
@@ -716,6 +725,25 @@
 			"\"%s\"\n", ctl_words[cp->ct_op].ctl_string);
 		exit(1);
 		/*NOTREACHED*/
+	
+	case CTL_PCACHE:
+		if (!caching) { 
+			if (cp->ctch_flag)
+				mgp_flag |= FL_FRDCACHE;
+			else 
+				mgp_flag ^= FL_FRDCACHE;
+			cache_mode   = cp->ctch_mode;	
+			cache_effect = cp->ctch_effect;	
+			cache_value  = cp->ctch_value;
+		} else {
+			pcache.flag = 1;
+			pcache.page = state->page;
+			pcache.mgpflag = cp->ctch_flag;
+			pcache.mode = cp->ctch_mode;
+			pcache.effect = cp->ctch_effect;
+			pcache.value = cp->ctch_value;
+		}
+		break;
 
 	default:
 		fprintf(stderr,
@@ -3918,7 +3946,10 @@
 static void
 cache_effect1()
 {
-	int x, step = window_width / 30; /* XXX */
+	int x, step;
+
+	step = cache_value ? window_width / cache_value : 1;
+	if (!step) step = 1;
 
 	for (x = window_width; x > 0; x -= step){
 		XCopyArea(display, window, window, gc_cache,
@@ -3935,8 +3966,11 @@
 static void
 cache_effect2()
 {
-	int x, step = window_width / 60; /* XXX */
+	int x, step;
 
+	step = cache_value ? window_width / (cache_value * 2) : 1;
+	if (!step) step = 1;
+
 	for (x = 0; x < window_width; x += step){
 		XCopyArea(display, window, window, gc_cache,
 			x, 0,  window_width - step -x , window_height, x + step, 0);
@@ -3948,3 +3982,25 @@
 	}
 }
 
+/*
+	pcache directive process
+*/
+static void
+pcache_process(page)
+int	page;
+{
+	if (!pcache.flag)
+		return;
+
+	if (pcache.page != page)
+		return;
+
+	if (pcache.mgpflag)
+		mgp_flag |= FL_FRDCACHE;
+	else 
+		mgp_flag ^= FL_FRDCACHE;
+	cache_mode   = pcache.mode;
+	cache_effect = pcache.effect;
+	cache_value  =  pcache.value;
+	pcache.flag  = 0;
+}
Index: kit/globals.c
diff -u kit/globals.c:1.36 kit/globals.c:1.37
--- kit/globals.c:1.36	Sun May 16 00:50:28 1999
+++ kit/globals.c	Mon Jun  7 02:55:13 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.36 1999/05/15 15:50:28 nishida Exp $
+ * $Id: globals.c,v 1.37 1999/06/06 17:55:13 nishida Exp $
  */
 
 #include "mgp.h"
@@ -64,6 +64,7 @@
 int cache_hit = 0;
 int cache_mode = 0;
 int cache_effect = 0;
+int cache_value = 60;
 Pixmap pixmap;
 Pixmap cachewin;
 Pixmap cacheback;
@@ -140,5 +141,6 @@
 /*CTL*/	{ CTL_ENDEMBED,		T_VOID,	"endembed", 8 },
 /*CTL*/	{ CTL_CHARSET,		T_STR,	"charset", 7 },
 /*CTL*/	{ CTL_TMFONT,		T_STR,	"tmfont", 6 },
+/*CTL*/	{ CTL_PCACHE,		T_SP,	"pcache", 6 },
 	{ 0, 0, NULL, 0 },
 };
Index: kit/grammar.y
diff -u kit/grammar.y:1.29 kit/grammar.y:1.30
--- kit/grammar.y:1.29	Mon Apr 12 03:14:19 1999
+++ kit/grammar.y	Mon Jun  7 02:55:14 1999
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.29 1999/04/11 18:14:19 nishida Exp $
+ * $Id: grammar.y,v 1.30 1999/06/06 17:55:14 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -492,6 +492,25 @@
 	return ct;
 }
 
+static struct ctrl *
+gen_pcache(flag, mode, effect, value)
+	int	flag;
+	int	mode;
+	int	effect;
+	int	value;
+{
+	struct ctrl *ct;
+
+	if (!(ct = ctlalloc1(CTL_PCACHE))) {
+		yyerror("cannot allocate node (op=PCACHE)");
+		return ct;
+	}
+	ct->ctch_flag = flag;
+	ct->ctch_mode = mode;
+	ct->ctch_effect = effect;
+	ct->ctch_value = value;
+}
+
 #if 0
 
 static struct ctrl *
@@ -643,7 +662,7 @@
 %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
+%token KW_CHARSET KW_TMFONT KW_PCACHE
 
 %type <ct> toplevel
 %type <ct> line defaultline tabline shellline deffontline
@@ -861,6 +880,10 @@
 	| KW_FONT STR	{ $$ = gen_str(CTL_FONT, $2); }
 	| KW_TEXT STR	{ $$ = gen_str(CTL_TEXT, $2); }	/*easter egg*/
 	| KW_CHARSET STR	{ $$ = gen_str(CTL_CHARSET, $2); }
+	| KW_PCACHE NUM NUM NUM NUM
+			{ $$ = gen_pcache($2, $3, $4, $5); }
+	| KW_PCACHE NUM
+			{ $$ = gen_pcache($2, 0, 0, 0); }
 	;
 tabcmd:	  KW_TAB NUM	{ $$ = gen_int(CTL_TAB, $2); }
 	| KW_TAB ID	{ $$ = gen_str(CTL_TAB, $2); }
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 Jun  7 05:10:09 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/mgp.c
diff -u kit/mgp.c:1.100 kit/mgp.c:1.101
--- kit/mgp.c:1.100	Sun May 30 01:38:37 1999
+++ kit/mgp.c	Mon Jun  7 02:55:16 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.c,v 1.100 1999/05/29 16:38:37 nishida Exp $
+ * $Id: mgp.c,v 1.101 1999/06/06 17:55:16 nishida Exp $
  */
 
 static char *mgp_version = "1.04a (980906)";
@@ -199,7 +199,7 @@
 	extern int optind;
 	char *progname;
 	u_int start_page = 1;
-	char buf[BUFSIZ], *p;
+	char buf[BUFSIZ], *p, *p2;
 	extern char *Paths[];
 	extern int NumPaths;
 #ifdef VFLIB
@@ -343,8 +343,13 @@
 
 		case 'F':
 			mgp_flag |= FL_FRDCACHE;
-			cache_mode = atoi(optarg)%10;
-			cache_effect = atoi(optarg)/10;
+			p = optarg;
+			if ((p2 = strsep(&p, ",")))
+				cache_mode = atoi(p2);
+			if ((p2 = strsep(&p, ",")))
+				cache_effect = atoi(p2);
+			if ((p2 = strsep(&p, ",")))
+				cache_value = atoi(p2);
 			break;
 
 		case 'h':
@@ -982,6 +987,11 @@
 
 				mgp_flag ^= FL_FRDCACHE;
                 break;
+
+			case XK_a:
+				XCopyArea(display, cachewin, window, gc_cache,
+						0, 0, window_width, window_height, 0, 0);
+				break;
 
 			default:
 				number = 0;
Index: kit/mgp.h
diff -u kit/mgp.h:1.107 kit/mgp.h:1.108
--- kit/mgp.h:1.107	Sun May 30 01:38:39 1999
+++ kit/mgp.h	Mon Jun  7 02:55:18 1999
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.107 1999/05/29 16:38:39 nishida Exp $
+ * $Id: mgp.h,v 1.108 1999/06/06 17:55:18 nishida Exp $
  */
 
 #include <stdio.h>
@@ -255,6 +255,13 @@
 	u_int ct_size;   
 };  
 
+struct ctrl_pcache {
+	u_int ct_cflag;
+	u_int ct_cmode;
+	u_int ct_ceffect;
+	u_int ct_cvalue;
+};
+
 struct ctrl {
 	u_char ct_op;
 	u_char ct_flag;
@@ -271,6 +278,7 @@
 		struct ctrl_bar ctrl_bar;
 		struct ctrl_args ctrl_args;
 		struct ctrl_icon ctrl_icon;
+		struct ctrl_pcache ctrl_pcache;
 	} ct_val;
 };
 
@@ -307,6 +315,10 @@
 #define ctic_value	ct_val.ctrl_icon.ct_value
 #define ctic_color	ct_val.ctrl_icon.ct_color
 #define ctic_size	ct_val.ctrl_icon.ct_size
+#define ctch_flag	ct_val.ctrl_pcache.ct_cflag
+#define ctch_mode	ct_val.ctrl_pcache.ct_cmode
+#define ctch_effect	ct_val.ctrl_pcache.ct_ceffect
+#define ctch_value	ct_val.ctrl_pcache.ct_cvalue
 
 struct ctl_words {
         u_char ctl_type;
@@ -336,6 +348,7 @@
 extern int	cache_hit;
 extern int	cache_mode;
 extern int	cache_effect;
+extern int	cache_value;
 
 struct render_state {
 	/* state of the parser */
Index: kit/scanner.l
diff -u kit/scanner.l:1.17 kit/scanner.l:1.18
--- kit/scanner.l:1.17	Mon Apr 12 03:14:24 1999
+++ kit/scanner.l	Mon Jun  7 02:55:19 1999
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.17 1999/04/11 18:14:24 nishida Exp $
+ * $Id: scanner.l,v 1.18 1999/06/06 17:55:19 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -160,6 +160,7 @@
 (EMBED|embed)		return KW_EMBED;
 (ENDEMBED|endembed)	return KW_ENDEMBED;
 (CHARSET|charset)	return KW_CHARSET;
+(PCACHE|pcache)	return KW_PCACHE;
 
 [ \n\t]		;
 ","		return COMMA;
Index: kit/sample/default.mgp
diff -u kit/sample/default.mgp:1.18 kit/sample/default.mgp:1.19
--- kit/sample/default.mgp:1.18	Sat May 15 14:15:31 1999
+++ kit/sample/default.mgp	Mon Jun  7 02:55:24 1999
@@ -15,9 +15,9 @@
 %%
 %% see README.fonts{,.jp} for more detailed milage you take.
 %%
-%deffont "standard" xfont "helvetica-medium-r", vfont "goth", tfont "arial.ttf", tmfont "wadalab-gothic.ttf"
-%deffont "thick" xfont "helvetica-bold-r", vfont "goth", tfont "arialbd.ttf", tmfont "wadalab-gothic.ttf"
-%deffont "typewriter" xfont "courier-medium-r", vfont "goth", tfont "courbd.ttf", tmfont "wadalab-gothic.ttf"
+%deffont "standard" xfont "helvetica-medium-r", vfont "goth", tfont "arial.ttf"
+%deffont "thick" xfont "helvetica-bold-r", vfont "goth", tfont "arialbd.ttf"
+%deffont "typewriter" xfont "courier-medium-r", vfont "goth", tfont "courbd.ttf"
 %%
 %% Default settings per each line numbers.
 %%
Index: kit/sample/sample.mgp
diff -u kit/sample/sample.mgp:1.17 kit/sample/sample.mgp:1.18
--- kit/sample/sample.mgp:1.17	Sat Sep  5 06:59:46 1998
+++ kit/sample/sample.mgp	Mon Jun  7 02:55:25 1999
@@ -188,9 +188,39 @@
 	No duplicated subprocess for one declaration.
 	Geometry can be presentation-screen relative.
 	xeyes will vanish if you switch the page.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+
+Embed Subprocess
+
+	You can embed x-applications in magicpoint!
+
+	example
+%center
+%xsystem "xclock -geometry %30x30+25+60 -update 1 -bg black -fg blue -hands green"
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+%PCACHE 1 1 0 30
+
+Forward page cache (1)
+
+	The next slide is cached inwardly by using
+		'%pcache' directive
+		-F option
+
+
+	Next slide will appear quicker than before!
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%PAGE
+%PCACHE 1 1 1 50
+
+Forward page cache (2)
 
+	You can specify 'special effect' in forward page cache.
+		tap space bar to see the 'special effect'. 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %PAGE
+%PCACHE 0 
 
 Have a nice day!
 
