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 Feb  5 05:10:00 2001
@@ -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/FAQ
diff -u kit/FAQ:1.3 kit/FAQ:1.4
--- kit/FAQ:1.3	Sun Oct  8 22:38:47 2000
+++ kit/FAQ	Sun Feb  4 03:46:49 2001
@@ -1,7 +1,6 @@
 MagicPoint FAQ
-$Id: FAQ,v 1.3 2000/10/08 13:38:47 itojun Exp $
+$Id: FAQ,v 1.4 2001/02/03 18:46:49 nishida Exp $
 
-
 Q: When I incorporate postscript in MagicPoint presentation, "ghostscript"
    dies with "WARN: cannot generate pnmraw+ file from test.eps".
 A:	install more recent version of "ghostscript", which supports "pnmraw"
@@ -42,3 +41,17 @@
 A:	the behavior of %system/xsystem command heavily depends on the behavior
 	of your window manager, and they may not work right for some of those.
 	as there are so many window managers, we have trouble supporting them.
+
+Q: What is MNG?
+A: MNG (Multiple-image Network Graphics) is the animation extension of 
+   the popular PNG image-format. See http://www.libpng.org/pub/mng and
+   http://www.mng.com/
+
+Q: Can I convert my animation gif files into mng format?
+A: Yes. I would like to recommand you to use the convert command in 
+   ImageMagick. See http://www.simplesystems.org/ImageMagick/ for more
+   information.
+
+Q: Can I write Magicpoint presentation with XML?
+A: The sdoc2mgp.xsl can convert XML into mgp syntax. 
+   See http://xml.da-cha.org/ for more information.
Index: kit/Imakefile.in
diff -u kit/Imakefile.in:1.50 kit/Imakefile.in:1.51
--- kit/Imakefile.in:1.50	Fri Mar  3 03:05:30 2000
+++ kit/Imakefile.in	Sun Feb  4 03:46:49 2001
@@ -1,13 +1,13 @@
-# $Id: Imakefile.in,v 1.50 2000/03/02 18:05:30 nishida Exp $
+# $Id: Imakefile.in,v 1.51 2001/02/03 18:46:49 nishida Exp $
 
 @SET_MAKE@
 srcdir=	@srcdir@
 VPATH=	@srcdir@
 SRCS=	mgp.c draw.c parse.c plist.c print.c globals.c x11.c x11dummy.c \
 	font.c background.c scanner.c grammar.c postscript.c tfont.c \
-	embed.c unimap.c
+	embed.c unimap.c mng.c
 TPOBJS=	mgp.o draw.o parse.o plist.o globals.o x11.o font.o background.o \
-	scanner.o grammar.o postscript.o tfont.o embed.o unimap.o
+	scanner.o grammar.o postscript.o tfont.o embed.o unimap.o mng.o
 PROBJS=	print.o parse.o globals.o x11dummy.o scanner.o grammar.o postscript.o \
 	embed.o 
 LIBOBJS=	@LIBOBJS@
@@ -68,6 +68,7 @@
 SpecialObjectRule(scanner.o,scanner.c, $(DEFS) $(OPTFLAGS))
 SpecialObjectRule(grammar.o,grammar.c, $(DEFS) $(OPTFLAGS))
 SpecialObjectRule(embed.o,embed.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(mng.o,mng.c, $(DEFS) $(OPTFLAGS))
 
 #define PassCDebugFlags
 #define IHaveSubdirs
Index: kit/SYNTAX
diff -u kit/SYNTAX:1.29 kit/SYNTAX:1.30
--- kit/SYNTAX:1.29	Wed Aug 18 12:18:23 1999
+++ kit/SYNTAX	Sun Feb  4 04:00:44 2001
@@ -1,4 +1,4 @@
-$Id: SYNTAX,v 1.29 1999/08/18 03:18:23 itojun Exp $
+$Id: SYNTAX,v 1.30 2001/02/03 19:00:44 nishida Exp $
 
 placement restriction for directives:
 		.mgprc		preamble	main pages
@@ -330,3 +330,6 @@
 			1 means caching is executed immediately.
 	<effect> :: type of 'special effect' for the forward page cache (0-2)
 	<value> ::  speed of 'special effect'. value 1 means the highest speed.
+
+%anim "filename"
+	display animation file. (currently, only mng format is supported.)
Index: kit/configure
diff -u kit/configure:1.81 kit/configure:1.82
--- kit/configure:1.81	Thu Jan 18 18:07:14 2001
+++ kit/configure	Sun Feb  4 03:49:37 2001
@@ -2231,12 +2231,115 @@
 	fi
 done
 
+for i in /usr/pkg /usr/local /usr; do
+	if test -f $i/include/libmng.h; then 
+		if test -f $i/lib/libmng.a ; then
+			DEPLIBS="$DEPLIBS $i/lib/libmng.a"
+		elif test -f $i/lib/libmng.so ; then
+			DEPLIBS="$DEPLIBS $i/lib/libmng.so"
+		else
+			break;
+		fi
+		LIBS="$LIBS -L$i/lib"
+		OPTFLAGS="$OPTFLAGS -I$i/include"
+		echo $ac_n "checking for mng_initialize in -lmng""... $ac_c" 1>&6
+echo "configure:2247: checking for mng_initialize in -lmng" >&5
+ac_lib_var=`echo mng'_'mng_initialize | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmng  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2255 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char mng_initialize();
+
+int main() {
+mng_initialize()
+; return 0; }
+EOF
+if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -Wl,-rpath,$i/lib -lmng"
+			 cat >> confdefs.h <<\EOF
+#define MNG 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for mng_readdisplay in -lmng""... $ac_c" 1>&6
+echo "configure:2289: checking for mng_readdisplay in -lmng" >&5
+ac_lib_var=`echo mng'_'mng_readdisplay | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lmng -ljpeg $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2297 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char mng_readdisplay();
+
+int main() {
+mng_readdisplay()
+; return 0; }
+EOF
+if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBS="$LIBS -lmng -ljpeg"
+			 cat >> confdefs.h <<\EOF
+#define MNG 1
+EOF
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+		break
+	fi
+done
+
 # If we find X, set shell vars x_includes and x_libraries to the
 # paths, otherwise set no_x=yes.
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2240: checking for X" >&5
+echo "configure:2343: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -2298,12 +2401,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 2302 "configure"
+#line 2405 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2372,14 +2475,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2376 "configure"
+#line 2479 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:2383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -2466,7 +2569,7 @@
 fi
 
 echo $ac_n "checking if --enable-gif option specified""... $ac_c" 1>&6
-echo "configure:2470: checking if --enable-gif option specified" >&5
+echo "configure:2573: checking if --enable-gif option specified" >&5
 # Check whether --enable-gif or --disable-gif was given.
 if test "${enable_gif+set}" = set; then
   enableval="$enable_gif"
@@ -2478,7 +2581,7 @@
 echo "$ac_t""$mgp_gif" 1>&6
 if test $mgp_gif = "yes"; then
 	echo $ac_n "checking for DGifOpenFileHandle in -lungif""... $ac_c" 1>&6
-echo "configure:2482: checking for DGifOpenFileHandle in -lungif" >&5
+echo "configure:2585: checking for DGifOpenFileHandle in -lungif" >&5
 ac_lib_var=`echo ungif'_'DGifOpenFileHandle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2486,7 +2589,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lungif  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2490 "configure"
+#line 2593 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2497,7 +2600,7 @@
 DGifOpenFileHandle()
 ; return 0; }
 EOF
-if { (eval echo configure:2501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2521,7 +2624,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for DGifOpenFileHandle in -lgif""... $ac_c" 1>&6
-echo "configure:2525: checking for DGifOpenFileHandle in -lgif" >&5
+echo "configure:2628: checking for DGifOpenFileHandle in -lgif" >&5
 ac_lib_var=`echo gif'_'DGifOpenFileHandle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2529,7 +2632,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgif  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2533 "configure"
+#line 2636 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2540,7 +2643,7 @@
 DGifOpenFileHandle()
 ; return 0; }
 EOF
-if { (eval echo configure:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2564,7 +2667,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for DGifOpenFileName in -lungif""... $ac_c" 1>&6
-echo "configure:2568: checking for DGifOpenFileName in -lungif" >&5
+echo "configure:2671: checking for DGifOpenFileName in -lungif" >&5
 ac_lib_var=`echo ungif'_'DGifOpenFileName | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2572,7 +2675,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lungif -L$x_libraries -lX11 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2576 "configure"
+#line 2679 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2583,7 +2686,7 @@
 DGifOpenFileName()
 ; return 0; }
 EOF
-if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2607,7 +2710,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for DGifOpenFilename in -lgif""... $ac_c" 1>&6
-echo "configure:2611: checking for DGifOpenFilename in -lgif" >&5
+echo "configure:2714: checking for DGifOpenFilename in -lgif" >&5
 ac_lib_var=`echo gif'_'DGifOpenFilename | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2615,7 +2718,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgif -L$x_libraries -lX11 $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2619 "configure"
+#line 2722 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2626,7 +2729,7 @@
 DGifOpenFilename()
 ; return 0; }
 EOF
-if { (eval echo configure:2630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2680,7 +2783,7 @@
 USE_IMLIB=0
 
 echo $ac_n "checking if --enable-imlib option specified""... $ac_c" 1>&6
-echo "configure:2684: checking if --enable-imlib option specified" >&5
+echo "configure:2787: checking if --enable-imlib option specified" >&5
 # Check whether --enable-imlib or --disable-imlib was given.
 if test "${enable_imlib+set}" = set; then
   enableval="$enable_imlib"
@@ -2692,7 +2795,7 @@
 echo "$ac_t""$mgp_imlib" 1>&6
 if test $mgp_imlib = "yes"; then
 	echo $ac_n "checking for Imlib_init in -lImlib""... $ac_c" 1>&6
-echo "configure:2696: checking for Imlib_init in -lImlib" >&5
+echo "configure:2799: checking for Imlib_init in -lImlib" >&5
 ac_lib_var=`echo Imlib'_'Imlib_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2700,7 +2803,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lImlib -L$x_libraries -lX11 -lXext $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2704 "configure"
+#line 2807 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2711,7 +2814,7 @@
 Imlib_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
Index: kit/configure.in
diff -u kit/configure.in:1.78 kit/configure.in:1.79
--- kit/configure.in:1.78	Thu Jan 18 18:07:14 2001
+++ kit/configure.in	Sun Feb  4 03:46:50 2001
@@ -3,7 +3,7 @@
 dnl independent (using srcdir), however, xmkmf and Imake.tmpl do not
 dnl allow us to switch compilation directory.
 dnl
-dnl $Id: configure.in,v 1.78 2001/01/18 09:07:14 nishida Exp $
+dnl $Id: configure.in,v 1.79 2001/02/03 18:46:50 nishida Exp $
 AC_INIT(image/imagetypes.c)
 
 dnl Checks for programs.
@@ -261,6 +261,28 @@
 			[LIBS="$LIBS -lpng -lz"
 			 AC_DEFINE(USE_PNG)],
 			[], [-lz])])
+		break
+	fi
+done
+
+for i in /usr/pkg /usr/local /usr; do
+	if test -f $i/include/libmng.h; then 
+		if test -f $i/lib/libmng.a ; then
+			DEPLIBS="$DEPLIBS $i/lib/libmng.a"
+		elif test -f $i/lib/libmng.so ; then
+			DEPLIBS="$DEPLIBS $i/lib/libmng.so"
+		else
+			break;
+		fi
+		LIBS="$LIBS -L$i/lib"
+		OPTFLAGS="$OPTFLAGS -I$i/include"
+		AC_CHECK_LIB(mng, mng_initialize, 
+			[LIBS="$LIBS -Wl,-rpath,$i/lib -lmng"
+			 AC_DEFINE(MNG)], 
+		[AC_CHECK_LIB(mng, mng_readdisplay,
+			[LIBS="$LIBS -lmng -ljpeg"
+			 AC_DEFINE(MNG)],
+			[], [-ljpeg])])
 		break
 	fi
 done
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  5 05:10:01 2001
@@ -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.179 kit/draw.c:1.180
--- kit/draw.c:1.179	Tue Dec 26 20:54:17 2000
+++ kit/draw.c	Sun Feb  4 03:46:50 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: draw.c,v 1.179 2000/12/26 11:54:17 nishida Exp $
+ * $Id: draw.c,v 1.180 2001/02/03 18:46:50 nishida Exp $
  */
 
 #include "mgp.h"
@@ -127,6 +127,11 @@
 static void set_background_pixmap __P((struct ctrl *));
 static void get_background_pixmap __P((struct ctrl *, struct render_state *));
 static void regist_background_pixmap __P((XImageInfo *, Image *));
+#ifdef MNG
+static void process_anim __P((struct render_state *, struct ctrl *));
+static void obj_draw_anim __P((struct render_state *, 
+	u_int, u_int, struct render_object *));
+#endif
 
 #define CHECK_CACHE {if (caching){caching = -1; return;}}
 
@@ -773,6 +778,16 @@
 		strcpy(mgp_charset, cp->ctc_value);
 		break;
 
+#ifdef MNG
+	case CTL_ANIM:
+		if (state->align == AL_LEFTFILL0) {
+			state->align = AL_LEFTFILL1;
+			state->leftfillpos = state->linewidth;
+		}
+		process_anim(state, cp);
+		break;
+#endif
+
 	default:
 		fprintf(stderr,
 			"undefined directive %d at page %d line %d:\n\t",
@@ -1385,6 +1400,10 @@
 		if (obj->data.icon.xpoint)
 			free(obj->data.icon.xpoint);
 		break;
+#ifdef MNG
+	case O_ANIM:
+		break;
+#endif /* MNG */
 	}
 	free(obj);
 }
@@ -1991,6 +2010,11 @@
 		y += ypos;
 #endif
 		switch (obj->type) {
+#ifdef MNG
+		case O_ANIM:
+			obj_draw_anim(state, x, y, obj);
+			break;
+#endif MNG /* MNG */
 		case O_IMAGE:
 			obj_draw_image(target, x, y, obj);
 			break;
@@ -4209,3 +4233,73 @@
 	} else
 		return -1;
 }
+
+#ifdef MNG
+int
+obj_new_anim(state, x, y, width, height, filename, key)
+    struct render_state *state;
+    int x, y;
+    int width, height;
+    char *filename;
+	void *key;
+{
+	struct render_object *obj;
+
+	obj = obj_alloc(state);
+	if (obj == NULL)
+		return 0;
+	obj->x = x;
+	obj->y = y;
+	obj->type = O_ANIM;
+	obj->data.anim.width = width;
+	obj->data.anim.height = height;
+	obj->data.anim.filename = strdup(filename);
+	obj->data.anim.key = key;	/* for regchild */
+	obj->ascent = 0;	/*XXX*/
+	obj->descent = height;	/*XXX*/
+	obj->vertloc = VL_CENTER;
+
+	return 1;
+}
+
+static void
+obj_draw_anim(state, x, y, obj)
+    struct render_state *state;
+	u_int x, y;
+	struct render_object *obj;
+{
+	pid_t 	pid;
+
+	if (!(pid = fork())){
+		mngload(obj->data.anim.filename, x, y, 
+			obj->data.anim.width, obj->data.anim.height);
+		while(1) sleep(1);
+	}
+	regchild(pid, obj->data.anim.key, -1, state->page);
+}
+
+static void
+process_anim(state, cp)
+    struct render_state *state;
+	struct ctrl *cp;
+{
+	int width, height;
+
+	width = 200;
+	height = 100;
+
+	/*
+	 * we support only mng so far
+	 */
+	mngpreload(state, cp->ctc_value, &width, &height);
+
+	obj_new_anim(state, state->linewidth, - height, 
+		width, height, cp->ctc_value, cp);
+
+	/* XXX specify VL_CENTER. This suites my taste. :P  */
+	draw_line_itemsize(state, height /2 , height /2);
+
+	state->linewidth += width;
+	state->brankline = 0;
+}
+#endif
Index: kit/globals.c
diff -u kit/globals.c:1.42 kit/globals.c:1.43
--- kit/globals.c:1.42	Sat Jul  8 05:04:11 2000
+++ kit/globals.c	Sun Feb  4 03:46:50 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: globals.c,v 1.42 2000/07/07 20:04:11 nishida Exp $
+ * $Id: globals.c,v 1.43 2001/02/03 18:46:50 nishida Exp $
  */
 
 #include "mgp.h"
@@ -145,5 +145,6 @@
 /*CTL*/	{ CTL_TMFONT,		T_STR,	"tmfont", 6 },
 /*CTL*/	{ CTL_TMFONT0,		T_STR,	"tmfont0", 7 },
 /*CTL*/	{ CTL_PCACHE,		T_SP,	"pcache", 6 },
+/*CTL*/	{ CTL_ANIM,		T_STR,	"anim", 4 },
 	{ 0, 0, NULL, 0 },
 };
Index: kit/grammar.y
diff -u kit/grammar.y:1.35 kit/grammar.y:1.36
--- kit/grammar.y:1.35	Fri Jul 28 14:04:12 2000
+++ kit/grammar.y	Sun Feb  4 03:46:50 2001
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: grammar.y,v 1.35 2000/07/28 05:04:12 itojun Exp $
+ * $Id: grammar.y,v 1.36 2001/02/03 18:46:50 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -669,7 +669,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 KW_PCACHE KW_TMFONT0
+%token KW_CHARSET KW_TMFONT KW_PCACHE KW_TMFONT0 KW_ANIM
 
 %type <ct> toplevel
 %type <ct> line defaultline tabline shellline deffontline
@@ -915,6 +915,16 @@
 			{ $$ = gen_pcache($2, $3, $4, $5); }
 	| KW_PCACHE NUM
 			{ $$ = gen_pcache($2, 0, 0, 0); }
+	| KW_ANIM STRorID 	{
+#ifdef MNG
+			$$ = gen_str(CTL_ANIM, $2);
+			chkfile($2);
+#else
+			$$ = gen_str(CTL_NOOP, $2);
+			yywarn("directive \"anim\" not supported "
+					"in this configuration");
+#endif
+	}
 	;
 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.125 kit/mgp.h:1.126
--- kit/mgp.h:1.125	Mon Jan  1 19:43:49 2001
+++ kit/mgp.h	Sun Feb  4 03:46:50 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: mgp.h,v 1.125 2001/01/01 10:43:49 itojun Exp $
+ * $Id: mgp.h,v 1.126 2001/02/03 18:46:50 nishida Exp $
  */
 
 #include <stdio.h>
@@ -411,6 +411,9 @@
 #endif /* FREETYPE */
 		O_XFONT,
 		O_IMAGE,
+#ifdef MNG
+		O_ANIM,
+#endif /* MNG */
 		O_ICON
 	} type;
 	u_long fore;
@@ -437,6 +440,14 @@
 			u_int npoint;
 			XPoint *xpoint;
 		} icon;
+#ifdef MNG
+		struct {
+			u_int width;
+			u_int height;
+			char *filename;
+			void *key;
+		} anim;
+#endif /* MNG */
 	} data;
 };
 
@@ -719,3 +730,4 @@
 #define DITHERED_BGRAD
 #define COLOR_BUGFIX
 #endif
+
Index: kit/mgp.spec
diff -u kit/mgp.spec:1.1 kit/mgp.spec:1.2
--- kit/mgp.spec:1.1	Thu Mar  9 17:22:14 2000
+++ kit/mgp.spec	Sun Feb  4 03:46:50 2001
@@ -1,5 +1,5 @@
 %define name	mgp
-%define version	1.07a
+%define version	1.08a
 %define release	1
 %define serial	1
 %define prefix	/usr/X11R6
Index: kit/mng.c
diff -u /dev/null kit/mng.c:1.1
--- /dev/null	Mon Feb  5 05:10:01 2001
+++ kit/mng.c	Sun Feb  4 03:46:50 2001
@@ -0,0 +1,397 @@
+/*
+ *	modified by Yoshifumi Nishida <nishida@csl.sony.co.jp> for magicpoint
+ */
+/*
+	mngplay
+
+	$Date: 2001/02/03 18:46:50 $
+
+	Ralph Giles <giles@ashlu.bc.ca>
+
+	This program my be redistributed under the terms of the
+	GNU General Public Licence, version 2, or at your preference,
+	any later version.
+
+	(this assuming there's no problem with libmng not being GPL...)
+
+
+	this is an SDL based mng player. the code is very rough;
+	patches welcome.
+*/
+/*
+ * $Id: mng.c,v 1.1 2001/02/03 18:46:50 nishida Exp $
+ */
+
+#ifdef MNG
+
+#include <sys/time.h>
+#include <libmng.h>
+#include "mgp.h"
+
+static GC gcmng;
+static Display *mngdisplay;
+static int mngscreen;
+static Visual  *mngvisual;
+static mng_handle mng;
+
+/* structure for keeping track of our mng stream inside the callbacks */
+typedef struct {
+	FILE		*file;	   /* pointer to the file we're decoding */
+	char		*filename; /* pointer to the file's path/name */
+	Image 		*image;	
+	Window 		window;
+	mng_uint32	delay;     /* ticks to wait before resuming decode */
+} mngstuff;
+
+/* callbacks for the mng decoder */
+
+/* memory allocation; data must be zeroed */
+mng_ptr mymngalloc(mng_uint32 size)
+{
+	return (mng_ptr)calloc(1, size);
+}
+
+/* memory deallocation */
+void mymngfree(mng_ptr p, mng_uint32 size)
+{
+	free(p);
+	return;
+}
+
+mng_bool mymngopenstream(mng_handle mng)
+{
+	mngstuff	*mymng;
+
+	/* look up our stream struct */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+	
+	/* open the file */
+	mymng->file = fopen(mymng->filename, "rb");
+	if (mymng->file == NULL) {
+		fprintf(stderr, "unable to open '%s'\n", mymng->filename);
+		return MNG_FALSE;
+	}
+
+	return MNG_TRUE;
+}
+
+mng_bool mymngclosestream(mng_handle mng)
+{
+	mngstuff	*mymng;
+
+	/* look up our stream struct */
+        mymng = (mngstuff*)mng_get_userdata(mng);
+
+	/* close the file */
+	fclose(mymng->file);
+	mymng->file = NULL;	/* for safety */
+
+	return MNG_TRUE;
+}
+
+/* feed data to the decoder */
+mng_bool mymngreadstream(mng_handle mng, mng_ptr buffer,
+		mng_uint32 size, mng_uint32 *bytesread)
+{
+	mngstuff *mymng;
+
+	/* look up our stream struct */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+
+	/* read the requested amount of data from the file */
+	*bytesread = fread(buffer, 1, size, mymng->file);
+
+	return MNG_TRUE;
+}
+
+/* the header's been read. set up the display stuff */
+mng_bool mymngprocessheader(mng_handle mng,
+		mng_uint32 width, mng_uint32 height)
+{
+	mngstuff	*mymng;
+	Image 		*image;
+	Visual		*get_visual();
+
+	image = (Image *)malloc(sizeof(Image));
+	image->type= ITRUE;
+	image->title= strdup("");
+	image->rgb.used= image->rgb.size= 0;
+	image->width= width;
+	image->height= height;
+	image->depth= 24;
+	image->pixlen= 3;
+	image->data = (char *)malloc(width * height * 24);
+
+	if (image->data == NULL){
+		fprintf(stderr, "unable to allocate %dx%d video memory \n", 
+			width, height);
+		return MNG_FALSE;
+	}
+
+	/* save the image pointer */
+ 	mymng = (mngstuff*)mng_get_userdata(mng);
+	mymng->image = image;
+
+	/* tell the mng decoder about our bit-depth choice */
+	/* FIXME: this works on intel. is it correct in general? */
+	mng_set_canvasstyle(mng, MNG_CANVAS_RGB8);
+
+	return MNG_TRUE;
+}
+
+/* return a row pointer for the decoder to fill */
+mng_ptr mymnggetcanvasline(mng_handle mng, mng_uint32 line)
+{
+	mngstuff	*mymng;
+	mng_ptr		row;
+
+	/* dereference our structure */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+
+	/* we assume any necessary locking has happened 
+	   outside, in the frame level code */
+	row = mymng->image->data + 
+				mymng->image->pixlen * mymng->image->width * line;
+
+	return (row);
+}
+
+/* timer */
+mng_uint32 mymnggetticks(mng_handle mng)
+{
+	struct timeval now;
+	mng_uint32 ticks;
+
+    gettimeofday(&now, NULL);
+    ticks=(now.tv_sec)*1000+(now.tv_usec)/1000;
+
+	return(ticks);
+}
+
+mng_bool mymngrefresh(mng_handle mng, mng_uint32 x, mng_uint32 y,
+			mng_uint32 w, mng_uint32 h)
+{
+	XImageInfo *ximageinfo;
+	mngstuff	*mymng;
+
+	/* dereference our structure */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+
+	ximageinfo= imageToXImage(mngdisplay, mngscreen, mngvisual, depth,
+			mymng->image, 0, 0, 0, 0);
+	if (ximageinfo == NULL) {
+		fprintf(stderr, "Cannot convert Image to XImage\n");
+		exit(-1);
+	}
+	XPutImage(mngdisplay, mymng->window, gcmng, ximageinfo->ximage, 
+		0, 0, 0, 0, mymng->image->width, mymng->image->height);
+
+	freeXImage(ximageinfo->ximage, ximageinfo);
+
+	return MNG_TRUE;
+}
+
+/* interframe delay callback */
+mng_bool mymngsettimer(mng_handle mng, mng_uint32 msecs)
+{
+	mngstuff	*mymng;
+
+	/* look up our stream struct */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+
+	/* set the timer for when the decoder wants to be woken */
+	mymng->delay = msecs;
+
+	return MNG_TRUE;
+}
+
+mng_bool mymngerror(mng_handle mng, mng_int32 code, mng_int8 severity,
+	mng_chunkid chunktype, mng_uint32 chunkseq,
+	mng_int32 extra1, mng_int32 extra2, mng_pchar text)
+{
+	mngstuff	*mymng;
+	char		chunk[5];
+	
+	/* dereference our data so we can get the filename */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+
+	/* pull out the chuck type as a string */
+	// FIXME: does this assume unsigned char?
+	chunk[0] = (char)((chunktype >> 24) & 0xFF);
+	chunk[1] = (char)((chunktype >> 16) & 0xFF);
+	chunk[2] = (char)((chunktype >>  8) & 0xFF);
+	chunk[3] = (char)((chunktype      ) & 0xFF);
+	chunk[4] = '\0';
+
+	/* output the error */
+
+	return (0);
+}
+
+int mymngquit()
+{
+	mngstuff	*mymng;
+
+	/* dereference our data so we can free it */
+	mymng = (mngstuff*)mng_get_userdata(mng);
+
+	XDestroyWindow(display, mymng->window);	
+
+	/* cleanup. this will call mymngclosestream */
+	mng_cleanup(&mng);
+
+	/* free our data */
+	free(mymng);
+
+	/* quit */
+	exit(0);
+}
+
+int checkevents(mng_handle mng)
+{
+	/* not implemented yet */
+}
+
+void
+mngload(mngfile, x, y, width, height)
+	char *mngfile;
+	int x, y;
+	int width, height;
+{
+	mngstuff	*mymng;
+	u_int		myretcode;
+
+	signal(SIGTERM, mymngquit);
+
+	/* allocate our stream data structure */
+	mymng = (mngstuff*)calloc(1, sizeof(*mymng));
+	if (mymng == NULL) {
+		fprintf(stderr, "could not allocate stream structure.\n");
+		exit(0);
+	}
+
+	/* pass the name of the file we want to play */
+	mymng->filename = mngfile;
+
+	/* set up the mng decoder for our stream */
+	mng = mng_initialize(mymng, mymngalloc, mymngfree, MNG_NULL);
+	if (mng == MNG_NULL) {
+		fprintf(stderr, "could not initialize libmng.\n");
+		exit(1);
+	}
+
+	/* set the callbacks */
+	mng_setcb_errorproc(mng, mymngerror);
+	mng_setcb_openstream(mng, mymngopenstream);
+	mng_setcb_closestream(mng, mymngclosestream);
+	mng_setcb_readdata(mng, mymngreadstream);
+	mng_setcb_gettickcount(mng, mymnggetticks);
+	mng_setcb_settimer(mng, mymngsettimer);
+	mng_setcb_processheader(mng, mymngprocessheader);
+	mng_setcb_getcanvasline(mng, mymnggetcanvasline);
+	mng_setcb_refresh(mng, mymngrefresh);
+	/* FIXME: should check for errors here */
+
+	myretcode = mng_set_suspensionmode(mng, MNG_TRUE);
+	if (myretcode != MNG_NOERROR){
+		fprintf(stderr, "something happen.\n");
+		exit(-1);
+	}
+
+	mng_window_setup(mymng, x, y, width, height);
+	mng_readdisplay(mng);
+
+	/* loop though the frames */
+	while (mymng->delay) {
+
+		usleep(mymng->delay * 1000);
+
+		/* reset the delay in case the decoder
+		   doesn't update it again */
+		mymng->delay = 0;
+
+		mng_display_resume(mng);
+
+		/* check for user input (just quit at this point) */
+		checkevents(mng);
+	}
+}
+
+void 
+mng_window_setup(mymng, x, y, width, height)
+	mngstuff	*mymng;
+	int x, y;
+	int width, height;
+{
+	Visual		*get_visual();
+
+	if (!mngdisplay){
+	    if ((mngdisplay = XOpenDisplay(NULL)) == NULL) {
+			fprintf(stderr, "Can't open display\n");
+			exit(-1);
+		}
+		mngscreen = DefaultScreen(mngdisplay);
+		mngvisual = get_visual(mngdisplay, mngscreen, &depth);
+	}
+
+	mymng->window = XCreateSimpleWindow(mngdisplay, 
+		window,
+		0, 0,
+		width, height, 0, 
+		WhitePixel(display, 0), WhitePixel(display, 0));
+
+	XMoveWindow(mngdisplay, mymng->window, x, y);
+	XMapRaised(mngdisplay, mymng->window);
+	XFlush(mngdisplay);
+
+	if (!gcmng)
+		gcmng = XCreateGC(mngdisplay, mymng->window, 0, 0);
+}
+
+void
+mngpreload(state, mngfile, width, height)
+	struct render_state *state;
+	char *mngfile;
+	int *width, *height;
+{
+	mngstuff	*mymng;
+	mng_handle	mng;
+	u_int		myretcode;
+
+	/* allocate our stream data structure */
+	mymng = (mngstuff*)calloc(1, sizeof(*mymng));
+	if (mymng == NULL) {
+		fprintf(stderr, "could not allocate stream structure.\n");
+		exit(0);
+	}
+
+	/* pass the name of the file we want to play */
+	mymng->filename = mngfile;
+
+	/* set up the mng decoder for our stream */
+	mng = mng_initialize(mymng, mymngalloc, mymngfree, MNG_NULL);
+	if (mng == MNG_NULL) {
+		fprintf(stderr, "could not initialize libmng.\n");
+		exit(1);
+	}
+
+	/* set the callbacks */
+	mng_setcb_errorproc(mng, mymngerror);
+	mng_setcb_openstream(mng, mymngopenstream);
+	mng_setcb_closestream(mng, mymngclosestream);
+	mng_setcb_readdata(mng, mymngreadstream);
+	mng_setcb_gettickcount(mng, mymnggetticks);
+	mng_setcb_settimer(mng, mymngsettimer);
+	mng_setcb_processheader(mng, mymngprocessheader);
+	mng_setcb_getcanvasline(mng, mymnggetcanvasline);
+	mng_setcb_refresh(mng, mymngrefresh);
+	/* FIXME: should check for errors here */
+
+	mng_read(mng);
+	*width = mymng->image->width;
+	*height = mymng->image->height;
+
+	mng_cleanup(&mng);
+	free(mymng);
+}
+#endif
Index: kit/parse.c
diff -u kit/parse.c:1.83 kit/parse.c:1.84
--- kit/parse.c:1.83	Sat Jul  8 02:58:19 2000
+++ kit/parse.c	Sun Feb  4 03:46:50 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: parse.c,v 1.83 2000/07/07 17:58:19 nishida Exp $
+ * $Id: parse.c,v 1.84 2001/02/03 18:46:50 nishida Exp $
  */
 
 #include "mgp.h"
@@ -649,10 +649,11 @@
 					ctlappend(*ch, cp);
 
 				/*
-				 * special case: %image and %line has to be
+				 * special case: %image and %bar has to be
 				 * treated as independent item
 				 */
 				if (cp->ct_op == CTL_IMAGE
+				 || cp->ct_op == CTL_ANIM
 				 || cp->ct_op == CTL_BAR) {
 					line_cont = 0;
 					*line = *line + 1;
@@ -736,7 +737,11 @@
 				 * check if this page contains only texts
 				 */
 				if (cp->ct_op == CTL_BIMAGE || cp->ct_op == CTL_BGRAD ||
-					cp->ct_op == CTL_IMAGE || cp->ct_op == CTL_PAUSE) 
+					cp->ct_op == CTL_IMAGE  || 
+#ifdef MNG
+					cp->ct_op == CTL_ANIM   || 
+#endif /* MNG */
+					cp->ct_op == CTL_PAUSE) 
 						text = 0; 
 				}
 		}
@@ -1034,6 +1039,9 @@
 				if (cp->ct_op == CTL_TEXT
 				 || cp->ct_op == CTL_IMAGE
 				 || cp->ct_op == CTL_BAR
+#ifdef MNG
+				 || cp->ct_op == CTL_ANIM
+#endif /* MNG */
 				 || cp->ct_op == CTL_ICON) {
 					textseen++;
 					break;
@@ -1065,6 +1073,9 @@
 					if ((*ch)->ct_op == CTL_TEXT
 					 || (*ch)->ct_op == CTL_IMAGE
 					 || (*ch)->ct_op == CTL_BAR
+#ifdef MNG
+					 || (*ch)->ct_op == CTL_ANIM
+#endif /* MNG */
 					 || (*ch)->ct_op == CTL_ICON) {
 					    break;
 					}
@@ -1096,6 +1107,9 @@
 					if (cp1->ct_op == CTL_TEXT
 					 || cp1->ct_op == CTL_IMAGE
 					 || cp1->ct_op == CTL_BAR
+#ifdef MNG
+					 || cp1->ct_op == CTL_ANIM
+#endif /* MNG */
 					 || cp1->ct_op == CTL_ICON) {
 					    cp2 = cp1;
 					}
@@ -1210,6 +1224,9 @@
 			for (cp = cp1; cp->ct_next; cp = cp->ct_next) {
 				if (cp->ct_next->ct_op == CTL_TEXT
 				 || cp->ct_next->ct_op == CTL_IMAGE
+#ifdef MNG
+				 || cp->ct_next->ct_op == CTL_ANIM
+#endif /* MNG */
 				 || cp->ct_next->ct_op == CTL_ICON) {
 					break;
 				}
Index: kit/scanner.l
diff -u kit/scanner.l:1.19 kit/scanner.l:1.20
--- kit/scanner.l:1.19	Fri Sep 10 16:13:39 1999
+++ kit/scanner.l	Sun Feb  4 03:46:50 2001
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: scanner.l,v 1.19 1999/09/10 07:13:39 itojun Exp $
+ * $Id: scanner.l,v 1.20 2001/02/03 18:46:50 nishida Exp $
  */
 /*
  * partly derived from lbl libpcap source code, which has the following
@@ -162,6 +162,7 @@
 (ENDEMBED|endembed)	return KW_ENDEMBED;
 (CHARSET|charset)	return KW_CHARSET;
 (PCACHE|pcache)	return KW_PCACHE;
+(ANIM|anim)	return KW_ANIM;
 
 [ \n\t]		;
 ","		return COMMA;
Index: kit/x11.c
diff -u kit/x11.c:1.27 kit/x11.c:1.28
--- kit/x11.c:1.27	Sun Mar  5 16:26:39 2000
+++ kit/x11.c	Sun Feb  4 03:46:50 2001
@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  */
 /*
- * $Id: x11.c,v 1.27 2000/03/05 07:26:39 nishida Exp $
+ * $Id: x11.c,v 1.28 2001/02/03 18:46:50 nishida Exp $
  */
 
 #include "mgp.h"
@@ -71,7 +71,7 @@
 int window_x;
 int window_y;
 
-static Visual *
+Visual *
 get_visual(display, screen, depthp)
 	Display *display;
 	int screen;
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 Feb  5 05:10:02 2001
@@ -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/mgp.mng
Index: kit/sample/mgp1.gif
Index: kit/sample/mgp2.gif
Index: kit/sample/mgp3.gif
Index: kit/sample/v6header.gif
