gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ./ChangeLog ./configure.ac backend/Makefi...


From: Rob Savoye
Subject: [Gnash-commit] gnash ./ChangeLog ./configure.ac backend/Makefi...
Date: Sat, 28 Jan 2006 01:14:33 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Rob Savoye <address@hidden>     06/01/28 01:14:33

Modified files:
        .              : ChangeLog configure.ac 
        backend        : Makefile.am gnash.cpp sound_handler_sdl.cpp 
        libbase        : Makefile.am triangulate_impl.h tu_config.h 
                         tu_file.h 
        libgeometry    : Makefile.am 
        macros         : jpeg.m4 libXML.m4 mad.m4 ogg.m4 opengl.m4 
                         png.m4 sdl.m4 
        plugin         : Makefile.am ogl_sdl.cpp player.cpp player.h 
                         plugin.cpp plugin.h 
        plugin/mozilla-sdk: Makefile.am 
        server         : Makefile.am Movie.cpp MovieClipLoader.cpp 
                         Sprite.cpp Sprite.h action.cpp array.cpp 
                         gnash.h impl.cpp xml.cpp xml.h xmlsocket.cpp 
                         xmlsocket.h 
        utilities      : Makefile.am 
Added files:
        macros         : pthreads.m4 

Log message:
        * plugin/player.cpp: Use GLinitialized instead of
        surface_activated, which turns out to be a system definition on
        some Unixes. Make main_loop take a nsPluginInstance as an argument
        so we have all the data we need. Setup a thread to run the
        player.
        * server/Makefile.am, backend/Makefile.am,
        plugin/Makefile.am, utility/Makefile.am,
        plugin/mozilla-sdk/Makefile.am: Don't use VORBIS variables
        anymore.
        * macros/libXML.m4: Use xml2-config instead of pkg-config.
        * maxros/mad.m4: Add BSD path prefix, /usr/pkg.
        * libbase/triangulate_impl.h: Drop the long modifier when printing
        a size.
        * libbase/Makefile.am: Make dmalloc build conditionally when
        --enable-dmalloc is passed to configure.
        * backend/sound_handler_sdl.cpp: Only compile if SDL_Mixer is
        installed.
        * backend/gnash.cpp: xml_fd should always be defined. Make using
        SDL_Mixer for sound be conditional, since a machine may have SDL
        installed, but not SDL_Mixer, but we still want the player to
        build.
        * server/xmlsocket.h, xmlsocket.cpp: Include config.h as generated
        by configue if it exists.
        * server/xml.h, xml.cpp: Include config.h as generated
        by configue if it exists.
        * configure.ac: Enable test for pthread.h and libpthread. Don't
        look for Vorbis, the OGG tests aer enough.
        * server/Movie.cpp, Sprite.cpp, impl.cpp, array.cpp: Include
        pthread.h to get around a data type definition problem on
        NetBSD. This seems to be required when using STL containers on
        NetBSD.
        * macros/opengl.m4: Use mad.m4 as a template and rewrite to be
        more portable.
        * macros/png.m4: Use mad.m4 as a template and rewrite to be
        more portable.
        * macros/jpeg.m4: Use mad.m4 as a template and rewrite to be
        more portable.
        * macros/sdl.m4: Look for SDL specific directory before and after
        the include or lib sinc some platforms install these differently.
        * macros/pthreads.m4: Look for POSIX Thread support. This turns
        out to be very messy with NetBSD, as the old version is also
        installed, and we have to link with the right one for any
        executable to work.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/configure.ac.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/backend/Makefile.am.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/backend/gnash.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/backend/sound_handler_sdl.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/Makefile.am.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/triangulate_impl.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/tu_config.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/tu_file.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libgeometry/Makefile.am.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/jpeg.m4.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/libXML.m4.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/mad.m4.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/ogg.m4.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/opengl.m4.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/png.m4.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/pthreads.m4?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/sdl.m4.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/Makefile.am.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/ogl_sdl.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/player.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/player.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/plugin.cpp.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/plugin.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/mozilla-sdk/Makefile.am.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Makefile.am.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Movie.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/MovieClipLoader.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Sprite.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/Sprite.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/action.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/array.cpp.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/gnash.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/impl.cpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xml.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xml.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xmlsocket.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/server/xmlsocket.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/utilities/Makefile.am.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.45 gnash/ChangeLog:1.46
--- gnash/ChangeLog:1.45        Fri Jan 27 06:21:04 2006
+++ gnash/ChangeLog     Sat Jan 28 01:14:33 2006
@@ -1,3 +1,49 @@
+2006-01-27  Rob Savoye  <address@hidden>
+
+       * plugin/player.cpp: Use GLinitialized instead of
+       surface_activated, which turns out to be a system definition on
+       some Unixes. Make main_loop take a nsPluginInstance as an argument
+       so we have all the data we need. Setup a thread to run the
+       player.
+       * server/Makefile.am, backend/Makefile.am,
+       plugin/Makefile.am, utility/Makefile.am,
+       plugin/mozilla-sdk/Makefile.am: Don't use VORBIS variables
+       anymore.
+       * macros/libXML.m4: Use xml2-config instead of pkg-config.
+       * maxros/mad.m4: Add BSD path prefix, /usr/pkg.
+       * libbase/triangulate_impl.h: Drop the long modifier when printing
+       a size.
+       * libbase/Makefile.am: Make dmalloc build conditionally when
+       --enable-dmalloc is passed to configure.
+       * backend/sound_handler_sdl.cpp: Only compile if SDL_Mixer is
+       installed.
+       * backend/gnash.cpp: xml_fd should always be defined. Make using
+       SDL_Mixer for sound be conditional, since a machine may have SDL
+       installed, but not SDL_Mixer, but we still want the player to
+       build.
+       * server/xmlsocket.h, xmlsocket.cpp: Include config.h as generated
+       by configue if it exists.
+       * server/xml.h, xml.cpp: Include config.h as generated
+       by configue if it exists.
+       * configure.ac: Enable test for pthread.h and libpthread. Don't
+       look for Vorbis, the OGG tests aer enough.
+       * server/Movie.cpp, Sprite.cpp, impl.cpp, array.cpp: Include
+       pthread.h to get around a data type definition problem on
+       NetBSD. This seems to be required when using STL containers on
+       NetBSD. 
+       * macros/opengl.m4: Use mad.m4 as a template and rewrite to be
+       more portable.
+       * macros/png.m4: Use mad.m4 as a template and rewrite to be
+       more portable.
+       * macros/jpeg.m4: Use mad.m4 as a template and rewrite to be
+       more portable.
+       * macros/sdl.m4: Look for SDL specific directory before and after
+       the include or lib sinc some platforms install these differently.
+       * macros/pthreads.m4: Look for POSIX Thread support. This turns
+       out to be very messy with NetBSD, as the old version is also
+       installed, and we have to link with the right one for any
+       executable to work.
+
 2006-01-26  Rob Savoye  <address@hidden>
 
        * plugin/Makefile.am: Link in shared libraries. Install the plugin
Index: gnash/backend/Makefile.am
diff -u gnash/backend/Makefile.am:1.10 gnash/backend/Makefile.am:1.11
--- gnash/backend/Makefile.am:1.10      Tue Jan 24 01:33:01 2006
+++ gnash/backend/Makefile.am   Sat Jan 28 01:14:33 2006
@@ -28,48 +28,48 @@
 AM_CPPFLAGS = -Wall
 
 AM_LDFLAGS =  \
-       ../server/libserver.a \
-       ../libgeometry/libgeometry.a \
-       ../libbase/libbase.a \
        $(JPEG_LIBS)            \
        $(PNG_LIBS)             \
+        $(OGG_LIBS)            \
         $(LIBXML_LIBS)         \
         $(SDL_LIBS)            \
         $(SDL_CFLAGS)          \
         $(SDL_MIXER_LIBS)      \
         $(OPENGL_LIBS)         \
        $(DMALLOC_LIBS)         \
-       $(MP3_LIBS)             \
-        $(OGG_LIBS)            \
-        $(VORBIS_LIBS)
+       $(MP3_LIBS)
 
 INCLUDES = -I.. \
         -I$(top_srcdir)        \
         -I$(top_srcdir)/server  \
         -I$(top_srcdir)/libbase \
+        -I$(top_srcdir)/backend \
         -I$(top_srcdir)/libgeometry \
+        $(SDL_CFLAGS)  \
         $(SDL_MIXER_CFLAGS)    \
        $(LIBXML_CFLAGS)        \
        $(OPENGL_CFLAGS)        \
-       $(DMALLOC_CFLAGS)               \
+       $(DMALLOC_CFLAGS)       \
        $(MP3_CFLAGS)           \
-       $(OGG_CFLAGS)           \
-       $(VORBIS_CFLAGS)
+       $(OGG_CFLAGS)
 
 bin_PROGRAMS = gnash
 
 # noinst_LTLIBRARIES = libgbackend.la
-# lib_LTLIBRARIES = libgbackend.la
-noinst_LIBRARIES = libgbackend.a
+lib_LTLIBRARIES = libgbackend.la
 
-libgbackend_a_SOURCES = \
+libgbackend_la_SOURCES = \
        render_handler_ogl.cpp  \
        sound_handler_sdl.cpp
 
 gnash_SOURCES = gnash.cpp
 gnash_LDFLAGS = -module -avoid-version -no-undefined
+gnash_LDADD =  $(AM_LDFLAGS) \
+       ./libgbackend.la \
+       ../server/libserver.la \
+       ../libgeometry/libgeometry.la \
+       ../libbase/libbase.la
 
-gnash_LDADD = $(AM_LDFLAGS) libgbackend.a
 # gnash_DEPENDENCIES = 
 
 MUDFLAP_OPT = -fmudflap
Index: gnash/backend/gnash.cpp
diff -u gnash/backend/gnash.cpp:1.7 gnash/backend/gnash.cpp:1.8
--- gnash/backend/gnash.cpp:1.7 Fri Jan 27 06:21:15 2006
+++ gnash/backend/gnash.cpp     Sat Jan 28 01:14:33 2006
@@ -44,7 +44,7 @@
                                // SendCommand(""). This way a movie
                                // can optimize it's own performance
                                // when needed,
-extern int xml_fd;             // FIXME: this is the file descriptor
+int xml_fd;                     // FIXME: this is the file descriptor
                                // from XMLSocket::connect(). This
                                // needs to be propogated up through
                                // the layers properly, but first I
@@ -367,8 +367,10 @@
   gnash::render_handler *render = NULL;
   if (do_render) {
     if (do_sound) {
+#ifdef HAVE_SDL_MIXER_H
       sound = gnash::create_sound_handler_sdl();
       gnash::set_sound_handler(sound);
+#endif
     }
     render = gnash::create_render_handler_ogl();
     gnash::set_render_handler(render);
Index: gnash/backend/sound_handler_sdl.cpp
diff -u gnash/backend/sound_handler_sdl.cpp:1.2 
gnash/backend/sound_handler_sdl.cpp:1.3
--- gnash/backend/sound_handler_sdl.cpp:1.2     Tue Jan 24 01:33:01 2006
+++ gnash/backend/sound_handler_sdl.cpp Sat Jan 28 01:14:33 2006
@@ -5,7 +5,11 @@
 
 // A sound_handler that uses SDL_mixer for output
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
+#ifdef HAVE_SDL_MIXER_H
 #include "gnash.h"
 #include "container.h"
 #include "SDL_mixer.h"
@@ -305,6 +309,7 @@
        return new SDL_sound_handler;
 }
 
+#endif
 
 // Local Variables:
 // mode: C++
Index: gnash/configure.ac
diff -u gnash/configure.ac:1.21 gnash/configure.ac:1.22
--- gnash/configure.ac:1.21     Fri Jan 27 06:34:20 2006
+++ gnash/configure.ac  Sat Jan 28 01:14:33 2006
@@ -28,18 +28,6 @@
 AM_MAINTAINER_MODE
 AC_PROG_MAKE_SET
 
-dnl dnl Use the POSIX Threads library, if specified.
-dnl AC_ARG_ENABLE(pthreads, [  --enable-pthreads       Enable support for 
pthreads],
-dnl [case "${enableval}" in
-dnl   yes) pthreads=yes ;;
-dnl   no)  pthreads=no ;;
-dnl   *)   AC_MSG_ERROR([bad value ${enableval} for enable-pthreads option]) ;;
-dnl esac], pthreads=yes)
-
-dnl if test x$pthreads = xyes; then
-dnl     AC_DEFINE([HAVE_PTHREADS], [], [Use POSIX Threads])
-dnl fi
-
 dnl Add XML support, if specified.
 AC_ARG_ENABLE(libxml, [  --disable-xml           Disable support for xml and 
xmlsocket],
 [case "${enableval}" in
@@ -125,12 +113,14 @@
 AC_PROG_CXX
 AC_EXEEXT
 AC_PROG_INSTALL
-AC_PROG_LIBTOOL
 AM_COMPILER_LIB
 GNASH_PATH_DMALLOC
 AC_CHECK_FUNCS(mallinfo)
 
 AC_PATH_XTRA
+AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation)
+AC_CHECK_LIB(Xi, XInput_find_display)
+AC_CHECK_LIB(X11, XDisableAccessControl)
 AM_PATH_ZLIB
 AM_PATH_JPEG
 AM_PATH_PNG
@@ -139,22 +129,14 @@
 AC_PATH_PROG(DOXYGEN, doxygen)
 AM_CONDITIONAL(ENABLE_DOXYGEN, [ test x"$DOXYGEN" != x ])
 
-AC_CHECK_HEADER(X11/Xmu/Xmu.h)
-LIBS_SAVE="$LIBS"
-LIBS="$LIBS $X_LIBS"
-AC_CHECK_LIB(Xmu, XmuCvtStringToOrientation, [],
-  AC_MSG_ERROR([
-Failed to link test code against the Xmu library. Maybe you need to
-install the development files for libxmu?
-]))
-LIBS="$LIBS_SAVE"
-
 AM_PATH_MP3
-XIPH_PATH_OGG
-XIPH_PATH_VORBIS
+AM_PATH_OGG
 AM_PATH_SDL
 AM_PATH_SDL_MIXER
 AM_PATH_OPENGL
+GNASH_PATH_PTHREADS
+
+AC_PROG_LIBTOOL
 
 dnl Define winsock if we're on windows. We could do something complicated,
 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
@@ -162,12 +144,6 @@
   AC_DEFINE(HAVE_WINSOCK,1,[This is defined is we are on Win32])
 fi
 
-dnl Look for pthreads
-if test x"$pthreads" = x"yes"; then
-  AC_CHECK_HEADER(pthread.h)
-  AC_CHECK_LIB(pthread, main)
-fi
-
 AC_OUTPUT(Makefile
 libbase/Makefile
 libgeometry/Makefile
@@ -201,12 +177,11 @@
   echo "        MP3 (libmad) support disabled (default). Use --enable-mp3 to 
enable"
 fi
 
-dnl if test x"$pthreads" = x"yes"; then
-dnl   echo "        
-dnl POSIX Threads support enabled"
-dnl else
-dnl   echo "        POSIX Thread support disabled"
-dnl fi
+if test x"$pthreads" = x"yes"; then
+  echo "        POSIX Threads support enabled"
+else
+  echo "        POSIX Thread support disabled"
+fi
 
 if test x"$http" = x"yes"; then
   echo "        Web server support enabled"
@@ -310,31 +285,31 @@
   nogo=true
 fi
 
-if test x"$VORBIS_LIBS" != x; then
-  if test x"$VORBIS_CFLAGS" != x; then
-    echo "        VORBIS flags are: $VORBIS_CFLAGS"
-  else
-    echo "        VORBIS flags are: default include path"
-  fi
-  echo "        VORBIS libs are: $VORBIS_LIBS"
-else
-  echo "ERROR: No VORBIS Vorbis development package installed!"
-  nogo=true
-fi
+dnl if test x"$VORBIS_LIBS" != x; then
+dnl   if test x"$VORBIS_CFLAGS" != x; then
+dnl     echo "        VORBIS flags are: $VORBIS_CFLAGS"
+dnl   else
+dnl     echo "        VORBIS flags are: default include path"
+dnl   fi
+dnl   echo "        VORBIS libs are: $VORBIS_LIBS"
+dnl else
+dnl   echo "ERROR: No VORBIS Vorbis development package installed!"
+dnl   nogo=true
+dnl fi
 
 if test x"$opengl" = x"yes"; then
   if test x"$OPENGL_LIBS" != x; then
-  if test x"$OPENGL_CFLAGS" != x; then
-    echo "        OPENGL flags are: $OPENGL_CFLAGS"
-  else
-    echo "        OPENGL flags are: default include path"
-  fi
-    echo "        Opengl libs are: $OPENGL_LIBS"
-  else
-    echo "ERROR: No Opengl development package installed!\
+    if test x"$OPENGL_CFLAGS" != x; then
+      echo "        OPENGL flags are: $OPENGL_CFLAGS"
+    else
+      echo "        OPENGL flags are: default include path"
+    fi
+      echo "        Opengl libs are: $OPENGL_LIBS"
+    else
+      echo "ERROR: No Opengl development package installed!\
  You need to have the libmesa development package installed\
- to compile this project.\
- or install libgl1-mesa-dev (using apt-get) or libmesa-devel (using yum)."
+ to compile this project or install libgl1-mesa-dev\
+ (using apt-get) or libmesa-devel (using yum)."
     nogo=true
   fi
 fi
@@ -343,7 +318,10 @@
     echo "        SDL flags are: $SDL_CFLAGS"
     echo "        SDL libs are: $SDL_LIBS"
 else
-    echo "ERROR: No SDL development package installed!"
+    echo "ERROR: No SDL development package installed!\
+ You need to have the SDL development package installed\
+ to compile, or install libsdl1.2-dev (using apt-get)\
+ or SDL-devel (using yum)."
     nogo=true
 fi
 
@@ -351,8 +329,10 @@
     echo "        SDL_Mixer flags are: $SDL_MIXER_CFLAGS"
     echo "        SDL_Mixer libs are: $SDL_MIXER_LIBS"
 else
-    echo "ERROR: No SDL_Mixer development package installed!"
-    nogo=true
+    echo "ERROR: No SDL_Mixer development package installed!\
+ You need to have the SDL Mixer development package installed\
+ to compile this project with SDL sound support or install\
+ libsdl-mixer1.2-dev (using apt-get) or SDL_mixer-devel (using yum)."
 fi
 
 if test x"$plugin" = x"yes"; then
@@ -365,6 +345,20 @@
   fi
 fi
 
+if test x"$pthreads" = x"yes"; then
+  if test x"$PTHREAD_LIBS" != x; then
+    if test x"$PTHREAD_CFLAGS" != x; then
+      echo "        POSIX Threads flags are: $PTHREAD_CFLAGS"
+    else
+      echo "        POSIX Threads flags are: default include path"
+    fi
+    echo "        POSIX Threads libs are: $PTHREAD_LIBS"
+  else
+    echo "ERROR: No pthread development package installed!"
+    nogo=true
+  fi
+fi
+
 # If anything critical is missing, don't bother to continue
 if test x"$nogo" = x"true"; then
 echo ""
Index: gnash/libbase/Makefile.am
diff -u gnash/libbase/Makefile.am:1.9 gnash/libbase/Makefile.am:1.10
--- gnash/libbase/Makefile.am:1.9       Tue Jan 24 01:33:01 2006
+++ gnash/libbase/Makefile.am   Sat Jan 28 01:14:33 2006
@@ -24,23 +24,30 @@
 # AM_LDFLAGS = $(OPENGL_LIBS) $(GLU_LIBS) $(SDL_LIBS)
 
 # noinst_LTLIBRARIES = libbase.la
-# lib_LTLIBRARIES = libbase.la
-noinst_LIBRARIES = libbase.a
+lib_LTLIBRARIES = libbase.la
+# noinst_LIBRARIES = libbase.a
 
 # These headers get installed
 # include_HEADERS = log.h err.h proc.h serial.h xantrex.h outback.h
 
-INCLUDES = -I.. -I$(srcdir) \
-        $(LIBPNG_INCLUDE) \
-        $(ZLIB_INCLUDE) \
-        $(JPEGLIB_INCLUDE) \
+# Don't build Dmalloc support if it's not configured in
+if DMALLOC
+DMALLOC_FILE = dlmalloc.c
+endif
+
+INCLUDES = -I.. -I$(srcdir)    \
+        $(LIBPNG_INCLUDE)      \
+        $(ZLIB_INCLUDE)                \
+        $(JPEGLIB_INCLUDE)     \
+        $(LIBXML_CFLAGS)       \
+       $(OPENGL_CFLAGS)        \
         -I$(top_srcdir)
 
-libbase_a_SOURCES = \
+libbase_la_SOURCES = \
        config.cpp              \
        container.cpp           \
        demo.cpp                \
-       dlmalloc.c              \
+       $(DMALLOC_FILE)         \
        file_util.cpp           \
        image.cpp               \
        image_filters.cpp       \
Index: gnash/libbase/triangulate_impl.h
diff -u gnash/libbase/triangulate_impl.h:1.3 
gnash/libbase/triangulate_impl.h:1.4
--- gnash/libbase/triangulate_impl.h:1.3        Tue Jan 24 01:33:01 2006
+++ gnash/libbase/triangulate_impl.h    Sat Jan 28 01:14:33 2006
@@ -1870,7 +1870,7 @@
                {
                        // Bad input, odd number of coords.
                        assert(0);
-                       fprintf(stderr, "path[%d] has odd number of coords 
(%ld), dropping last value\n", i, path.size());//xxxx
+                       fprintf(stderr, "path[%d] has odd number of coords 
(%d), dropping last value\n", i, path.size());//xxxx
                        path_size--;
                }
                for (int j = 0; j < path_size; j += 2)  // vertex coords come 
in pairs.
Index: gnash/libbase/tu_config.h
diff -u gnash/libbase/tu_config.h:1.1 gnash/libbase/tu_config.h:1.2
--- gnash/libbase/tu_config.h:1.1       Tue Dec 20 20:57:00 2005
+++ gnash/libbase/tu_config.h   Sat Jan 28 01:14:33 2006
@@ -9,11 +9,6 @@
 #ifndef TU_CONFIG_H
 #define TU_CONFIG_H
 
-
-// In case you need some unusual stuff to be predefined.  For example,
-// maybe you #define new/delete to be something special.
-#include "compatibility_include.h"
-
 #include "dlmalloc.h"
 
 // #define these in compatibility_include.h if you want something different.
Index: gnash/libbase/tu_file.h
diff -u gnash/libbase/tu_file.h:1.1 gnash/libbase/tu_file.h:1.2
--- gnash/libbase/tu_file.h:1.1 Tue Dec 20 20:57:00 2005
+++ gnash/libbase/tu_file.h     Sat Jan 28 01:14:33 2006
@@ -226,7 +226,7 @@
        return u.f;
 }
 
-
+#if 0
 inline void            tu_file::write_double64(double value)
 // Write a 64-bit little-endian double to this file.
 {
@@ -253,7 +253,7 @@
        u.l = read_le64();
        return u.d;
 }
-
+#endif
 
 #endif // TU_FILE_H
 
Index: gnash/libgeometry/Makefile.am
diff -u gnash/libgeometry/Makefile.am:1.6 gnash/libgeometry/Makefile.am:1.7
--- gnash/libgeometry/Makefile.am:1.6   Tue Jan 24 01:33:01 2006
+++ gnash/libgeometry/Makefile.am       Sat Jan 28 01:14:33 2006
@@ -24,8 +24,8 @@
 # AM_LDFLAGS  = $(OPENGL_LIBNS) $(SDL_LIBS)
 
 # noinst_LTLIBRARIES = libgeometry.la
-# lib_LTLIBRARIES = libgeometry.la
-noinst_LIBRARIES = libgeometry.a
+lib_LTLIBRARIES = libgeometry.la
+# noinst_LIBRARIES = libgeometry.a
 
 # These headers get installed
 # include_HEADERS = log.h err.h proc.h serial.h xantrex.h outback.h
@@ -40,7 +40,7 @@
         $(ZLIB_CFLAGS)                 \
         $(JPEGLIB_CFLAGS)
 
-libgeometry_a_SOURCES =        \
+libgeometry_la_SOURCES =       \
        axial_box.cpp           \
        bsp.cpp                 \
        collision.cpp           \
Index: gnash/macros/jpeg.m4
diff -u gnash/macros/jpeg.m4:1.2 gnash/macros/jpeg.m4:1.3
--- gnash/macros/jpeg.m4:1.2    Thu Jan 19 23:50:11 2006
+++ gnash/macros/jpeg.m4        Sat Jan 28 01:14:33 2006
@@ -1,4 +1,3 @@
-dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl  Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 dnl
@@ -18,102 +17,115 @@
 
 AC_DEFUN([AM_PATH_JPEG],
 [
-  dnl Lool for the header
-  AC_ARG_WITH(jpeg_incl, [  --with-jpeg-incl        directory where jpeg 
header is], with_jpeg_incl=${withval})
-  AC_CACHE_VAL(ac_cv_path_jpeg_incl,[
-  if test x"${with_jpeg_incl}" != x ; then
-    if test -f ${with_jpeg_incl}/jpeglib.h ; then
-      ac_cv_path_jpeg_incl=`(cd ${with_jpeg_incl}; pwd)`
-    elif test -f ${with_jpeg_incl}/jpeglib.h ; then
-      ac_cv_path_jpeg_incl=`(cd ${with_jpeg_incl}; pwd)`
-    else
-      AC_MSG_ERROR([${with_jpeg_incl} directory doesn't contain jpeglib.h])
+  AC_ARG_ENABLE(jpeg, [  --enable-jpeg       Enable support for jpeg images],
+  [case "${enableval}" in
+    yes) jpeg=yes ;;
+    no)  jpeg=no ;;
+    *)   AC_MSG_ERROR([bad value ${enableval} for enable-jpeg option]) ;;
+  esac], jpeg=yes)
+
+  if test x"$jpeg" = x"yes"; then
+    dnl Look for the header
+  AC_ARG_WITH(jpeg_incl, [  --with-jpeg_incl         directory where libjpeg 
header is], with_jpeg_incl=${withval})
+    AC_CACHE_VAL(ac_cv_path_jpeg_incl,[
+    if test x"${with_jpeg_incl}" != x ; then
+      if test -f ${with_jpeg_incl}/jpeglib.h ; then
+       ac_cv_path_jpeg_incl=`(cd ${with_jpeg_incl}; pwd)`
+      else
+       AC_MSG_ERROR([${with_jpeg_incl} directory doesn't contain jpeglib.h])
     fi
-  fi
-  ])
+    ])
 
-  if test x"${ac_cv_path_jpeg_incl}" = x ; then
-    AC_MSG_CHECKING([for jpeg header])
-    incllist="/sw/include /usr/local/include /home/latest/include /opt/include 
/usr/include .. ../.."
-
-    for i in $incllist; do
-      if test -f $i/jpeglib.h; then
-        ac_cv_path_jpeg_incl=$i
-        break
-      fi
-    done
-
-    JPEG_CFLAGS=""
-    if test x"${ac_cv_path_jpeg_incl}" = x ; then
-      AC_MSG_RESULT(none)
-      AC_CHECK_HEADERS(jpeglib.h, [ac_cv_path_jpeg_incl=""])
+    dnl If the path hasn't been specified, go look for it.
+    if test x"${ac_cv_path_jpeg_incl}" = x; then
+      AC_CHECK_HEADERS(jpeglib.h, [ac_cv_path_jpeg_incl=""],[
+      if test x"${ac_cv_path_jpeg_incl}" = x; then
+        AC_MSG_CHECKING([for libjpeg header])
+        incllist="/sw/include /usr/local/include /home/latest/include 
/opt/include /usr/include /usr/pkg/include .. ../.."
+
+        for i in $incllist; do
+         if test -f $i/jpeglib.h; then
+           if test x"$i" != x"/usr/include"; then
+             ac_cv_path_jpeg_incl="-I$i"
+             break
+            else
+             ac_cv_path_jpeg_incl=""
+             break
+           fi
+         fi
+        done
+      fi])
     else
-      AC_MSG_RESULT(${ac_cv_path_jpeg_incl})
+      AC_MSG_RESULT(-I${ac_cv_path_jpeg_incl})
       if test x"${ac_cv_path_jpeg_incl}" != x"/usr/include"; then
-        ac_cv_path_jpeg_incl="-I${ac_cv_path_jpeg_incl}"
-      else
-        ac_cv_path_jpeg_incl=""
+       ac_cv_path_jpeg_incl="-I${ac_cv_path_jpeg_incl}"
+       else
+       ac_cv_path_jpeg_incl=""
       fi
     fi
-  fi
 
-  if test x"${ac_cv_path_jpeg_incl}" != x ; then
-    JPEG_CFLAGS="${ac_cv_path_jpeg_incl}"
-  fi
-
-  dnl Look for the library
-  AC_ARG_WITH(jpeg_lib, [  --with-jpeg-lib         directory where jpeg 
library is], with_jpeg_lib=${withval})
-  AC_MSG_CHECKING([for jpeg library])
-  AC_CACHE_VAL(ac_cv_path_jpeg_lib,[
-  if test x"${with_jpeg_lib}" != x ; then
-    if test -f ${with_jpeg_lib}/libjpeg.a ; then
-      ac_cv_path_jpeg_lib=`(cd ${with_jpeg_lib}; pwd)`
-    elif test -f ${with_jpeg_lib}/libjpeg.a -o -f ${with_jpeg_lib}/libjpeg.so; 
then
-      ac_cv_path_jpeg_lib=`(cd ${with_jpeg_incl}; pwd)`
+    if test x"${ac_cv_path_jpeg_incl}" != x ; then
+      JPEG_CFLAGS="${ac_cv_path_jpeg_incl}"
+      AC_MSG_RESULT(${ac_cv_path_jpeg_incl})
     else
-      AC_MSG_ERROR([${with_jpeg_lib} directory doesn't contain libjpeg.a])
+      JPEG_CFLAGS=""
     fi
-  fi
-  ])
 
-  if test x"${ac_cv_path_jpeg_lib}" = x ; then
-    liblist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib .. 
../.."
+      dnl Look for the library
+      AC_ARG_WITH(jpeg_lib, [  --with-jpeg-lib          directory where jpeg 
library is], with_jpeg_lib=${withval})
+      AC_CACHE_VAL(ac_cv_path_jpeg_lib,[
+      if test x"${with_jpeg_lib}" != x ; then
+        if test -f ${with_jpeg_lib}/libjpeg.a -o -f 
${with_jpeg_lib}/libjpeg.so; then
+         ac_cv_path_jpeg_lib=`(cd ${with_jpeg_incl}; pwd)`
+        else
+         AC_MSG_ERROR([${with_jpeg_lib} directory doesn't contain libjpeg.])
+        fi
+      fi
+      ])
 
-    for i in $liblist; do
-    if test -f $i/libjpeg.a -o -f $i/libjpeg.so; then
-       ac_cv_path_jpeg_lib=$i
-       break
-    fi
-    done
+      dnl If the header doesn't exist, there is no point looking for the 
library.
+      if test x"${ac_cv_path_jpeg_lib}" = x; then
+        AC_CHECK_LIB(jpeg, jpeg_mem_init, [ac_cv_path_jpeg_lib="-ljpeg"],[
+          AC_MSG_CHECKING([for libjpeg library])
+          libslist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib 
/usr/pkg/lib .. ../.."
+          for i in $libslist; do
+           if test -f $i/libjpeg.a -o -f $i/libjpeg.so; then
+             if test x"$i" != x"/usr/lib"; then
+               ac_cv_path_jpeg_lib="-L$i"
+                AC_MSG_RESULT(${ac_cv_path_jpeg_lib})
+               break
+              else
+               ac_cv_path_jpeg_lib=""
+                AC_MSG_RESULT(yes)
+               break
+             fi
+           fi
+          done])
+      else
+        if test -f ${ac_cv_path_jpeg_lib}/libjpeg.a -o -f 
${ac_cv_path_jpeg_lib}/libjpeg.so; then
 
-    JPEG_LIBS=""
-    if test x"${ac_cv_path_jpeg_lib}" = x ; then
-      AC_MSG_RESULT(none)
-      dnl if we can't find libjpeg via the path, see if it's in the compiler 
path
-      AC_CHECK_LIB(jpeg, jpeg_mem_init, JPEG_LIBS="-ljpeg")
-    else
-      AC_MSG_RESULT(${ac_cv_path_jpeg_lib})
-      if test x"${ac_cv_path_jpeg_lib}" != x"/usr/lib"; then
-        ac_cv_path_jpeg_lib="-L${ac_cv_path_jpeg_lib} -ljpeg"
+          if test x"${ac_cv_path_jpeg_lib}" != x"/usr/lib"; then
+           ac_cv_path_jpeg_lib="-L${ac_cv_path_jpeg_lib}"
+           else
+           ac_cv_path_jpeg_lib=""
+          fi
+        fi
+      fi
+
+      if test x"${ac_cv_path_jpeg_lib}" != x ; then
+        JPEG_LIBS="${ac_cv_path_jpeg_lib}"
       else
-        ac_cv_path_jpeg_lib="-ljpeg"
+        JPEG_LIBS=""
       fi
     fi
   fi
 
   if test x"${ac_cv_path_jpeg_lib}" != x ; then
-    JPEG_LIBS="${ac_cv_path_jpeg_lib}"
+      JPEG_LIBS="${ac_cv_path_jpeg_lib}"
   fi
 
+  AM_CONDITIONAL(HAVE_JPEG, [test x$jpeg = xyes])
+
   AC_SUBST(JPEG_CFLAGS)
   AC_SUBST(JPEG_LIBS)
 ])
-
-dnl   AC_LINK_IFELSE([AC_LANG_PROGRAM([[void *f;
-dnl                                      #libude <stdlib.h>
-dnl                                      #libude <stdio.h>
-dnl                                      #libude <jpeglib.h>]],
-dnl                                    [[f = jpeg_has_multiple_scans;]])],
-dnl                   [have_jpeg="yes"], [have_jpeg="no"])
-
-
Index: gnash/macros/libXML.m4
diff -u gnash/macros/libXML.m4:1.7 gnash/macros/libXML.m4:1.8
--- gnash/macros/libXML.m4:1.7  Mon Jan 23 14:33:19 2006
+++ gnash/macros/libXML.m4      Sat Jan 28 01:14:33 2006
@@ -37,28 +37,30 @@
     LIBXML_CFLAGS="-I$libxml_prefix/include"
   fi
 
-  AC_MSG_CHECKING(for libxml2)
-
   dnl
   dnl Give pkg-config a chance
   dnl
   #no_libxml=""
-  AC_PATH_PROG(PKG_CONFIG, pkg-config, , ,[$PATH])
+  AC_PATH_PROG(PKG_CONFIG, xml2-config, , ,[$PATH])
   if test "x$PKG_CONFIG" != "x" ; then
     if test "x$LIBXML_CFLAGS" = "x" ; then
-      LIBXML_CFLAGS=`$PKG_CONFIG --cflags libxml-2.0`
+      LIBXML_CFLAGS=`$PKG_CONFIG --cflags`
     fi
 
     if test "x$LIBXML_LIBS" = "x" ; then
-      LIBXML_LIBS=`$PKG_CONFIG --libs libxml-2.0`
+      LIBXML_LIBS=`$PKG_CONFIG --libs`
     fi
+  else
+    AC_MSG_RESULT(no)
   fi
 
+  AC_MSG_CHECKING(for libxml2)
+
   dnl
   dnl Try finding out yourself
   dnl
   if test "x$LIBXML_CFLAGS" = "x" -o "x$LIBXML_LIBS" = "x"; then
-    dirlist="/usr /usr/local /opt /home/latest"
+    dirlist="/usr/pkg /usr /usr/local /opt /home/latest"
     for i in $dirlist; do
       if test "x$LIBXML_CFLAGS" = "x"; then
         for j in `ls -dr $i/include/libxml2* 2>/dev/null ` ; do
Index: gnash/macros/mad.m4
diff -u gnash/macros/mad.m4:1.2 gnash/macros/mad.m4:1.3
--- gnash/macros/mad.m4:1.2     Tue Jan 24 01:33:01 2006
+++ gnash/macros/mad.m4 Sat Jan 28 01:14:33 2006
@@ -42,7 +42,7 @@
       AC_CHECK_HEADERS(mad.h, [ac_cv_path_mad_incl=""],[
       if test x"${ac_cv_path_mad_incl}" = x; then
         AC_MSG_CHECKING([for libmad header])
-        incllist="/sw/include /usr/local/include /home/latest/include 
/opt/include /usr/include .. ../.."
+        incllist="/sw/include /usr/local/include /home/latest/include 
/opt/include /usr/include /usr/pkg/include .. ../.."
 
         for i in $incllist; do
          if test -f $i/mad.h; then
@@ -88,7 +88,7 @@
       if test x"${ac_cv_path_mad_lib}" = x; then
         AC_CHECK_LIB(mad, mad_copyright, [ac_cv_path_mad_lib="-lmad"],[
           AC_MSG_CHECKING([for libmad library])
-          libslist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib 
.. ../.."
+          libslist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib 
/usr/pkg/lib .. ../.."
           for i in $libslist; do
            if test -f $i/libmad.a -o -f $i/libmad.so; then
              if test x"$i" != x"/usr/lib"; then
@@ -106,7 +106,7 @@
         if test -f ${ac_cv_path_mad_lib}/libmad.a -o -f 
${ac_cv_path_mad_lib}/libmad.so; then
 
           if test x"${ac_cv_path_mad_lib}" != x"/usr/lib"; then
-           ac_cv_path_mad_lib="-I${ac_cv_path_mad_lib}"
+           ac_cv_path_mad_lib="-L${ac_cv_path_mad_lib}"
            else
            ac_cv_path_mad_lib=""
           fi
Index: gnash/macros/ogg.m4
diff -u gnash/macros/ogg.m4:1.1 gnash/macros/ogg.m4:1.2
--- gnash/macros/ogg.m4:1.1     Mon Jan 23 12:30:03 2006
+++ gnash/macros/ogg.m4 Sat Jan 28 01:14:33 2006
@@ -1,102 +1,131 @@
-# Configure paths for libogg
-# Jack Moffitt <address@hidden> 10-21-2000
-# Shamelessly stolen from Owen Taylor and Manish Singh
-
-dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
 dnl
-AC_DEFUN([XIPH_PATH_OGG],
-[dnl 
-dnl Get the cflags and libraries
+dnl  Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 dnl
-AC_ARG_WITH(ogg,[  --with-ogg=PFX   Prefix where libogg is installed 
(optional)], ogg_prefix="$withval", ogg_prefix="")
-AC_ARG_WITH(ogg-libraries,[  --with-ogg-libraries=DIR   Directory where libogg 
library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
-AC_ARG_WITH(ogg-includes,[  --with-ogg-includes=DIR   Directory where libogg 
header files are installed (optional)], ogg_includes="$withval", 
ogg_includes="")
-AC_ARG_ENABLE(oggtest, [  --disable-oggtest       Do not try to compile and 
run a test Ogg program],, enable_oggtest=yes)
-
-  if test "x$ogg_libraries" != "x" ; then
-    OGG_LIBS="-L$ogg_libraries"
-  elif test "x$ogg_prefix" != "x" ; then
-    OGG_LIBS="-L$ogg_prefix/lib"
-  elif test "x$prefix" != "xNONE" ; then
-    OGG_LIBS="-L$prefix/lib"
-  fi
-
-  OGG_LIBS="$OGG_LIBS -logg"
-
-  if test "x$ogg_includes" != "x" ; then
-    OGG_CFLAGS="-I$ogg_includes"
-  elif test "x$ogg_prefix" != "x" ; then
-    OGG_CFLAGS="-I$ogg_prefix/include"
-  elif test "x$prefix" != "xNONE"; then
-    OGG_CFLAGS="-I$prefix/include"
-  fi
-
-  AC_MSG_CHECKING(for Ogg)
-  no_ogg=""
-
-
-  if test "x$enable_oggtest" = "xyes" ; then
-    ac_save_CFLAGS="$CFLAGS"
-    ac_save_LIBS="$LIBS"
-    CFLAGS="$CFLAGS $OGG_CFLAGS"
-    LIBS="$LIBS $OGG_LIBS"
+dnl  This program is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU General Public License as published by
+dnl  the Free Software Foundation; either version 2 of the License, or
+dnl  (at your option) any later version.
 dnl
-dnl Now check if the installed Ogg is sufficiently new.
+dnl  This program is distributed in the hope that it will be useful,
+dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl  GNU General Public License for more details.
 dnl
-      rm -f conf.oggtest
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ogg/ogg.h>
-
-int main ()
-{
-  system("touch conf.oggtest");
-  return 0;
-}
-
-],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-  fi
+dnl  You should have received a copy of the GNU General Public License
+dnl  along with this program; if not, write to the Free Software
+dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+AC_DEFUN([AM_PATH_OGG],
+[
+  AC_ARG_ENABLE(ogg, [  --enable-ogg       Enable support for playing oggs],
+  [case "${enableval}" in
+    yes) ogg=yes ;;
+    no)  ogg=no ;;
+    *)   AC_MSG_ERROR([bad value ${enableval} for enable-ogg option]) ;;
+  esac], ogg=yes)
+
+  if test x"$ogg" = x"yes"; then
+    dnl Look for the header
+  AC_ARG_WITH(ogg_incl, [  --with-ogg_incl         directory where libogg 
header is], with_ogg_incl=${withval})
+    AC_CACHE_VAL(ac_cv_path_ogg_incl,[
+    if test x"${with_ogg_incl}" != x ; then
+      if test -f ${with_ogg_incl}/ogg.h ; then
+       ac_cv_path_ogg_incl=`(cd ${with_ogg_incl}; pwd)`
+      else
+       AC_MSG_ERROR([${with_ogg_incl} directory doesn't contain ogg.h])
+      fi
+    fi
+    ])
+
+    dnl If the path hasn't been specified, go look for it.
+    if test x"${ac_cv_path_ogg_incl}" = x; then
+      AC_CHECK_HEADERS(ogg.h, [ac_cv_path_ogg_incl=""],[
+      if test x"${ac_cv_path_ogg_incl}" = x; then
+        AC_MSG_CHECKING([for libogg header])
+        incllist="/sw/include /usr/local/include /home/latest/include 
/opt/include /usr/include /usr/pkg/include .. ../.."
+
+        for i in $incllist; do
+         if test -f $i/ogg/ogg.h; then
+           if test x"$i" != x"/usr/include"; then
+             ac_cv_path_ogg_incl="-I$i"
+             break
+            else
+             ac_cv_path_ogg_incl=""
+             break
+           fi
+         fi
+        done
+      fi])
+    else
+      AC_MSG_RESULT(-I${ac_cv_path_ogg_incl})
+      if test x"${ac_cv_path_ogg_incl}" != x"/usr/include"; then
+       ac_cv_path_ogg_incl="-I${ac_cv_path_ogg_incl}"
+       else
+       ac_cv_path_ogg_incl=""
+      fi
+    fi
+
+    if test x"${ac_cv_path_ogg_incl}" != x ; then
+      OGG_CFLAGS="${ac_cv_path_ogg_incl}"
+      AC_MSG_RESULT(${ac_cv_path_ogg_incl})
+    else
+      OGG_CFLAGS=""
+    fi
+
+      dnl Look for the library
+      AC_ARG_WITH(ogg_lib, [  --with-ogg-lib          directory where ogg 
library is], with_ogg_lib=${withval})
+      AC_CACHE_VAL(ac_cv_path_ogg_lib,[
+      if test x"${with_ogg_lib}" != x ; then
+        if test -f ${with_ogg_lib}/libogg.a -o -f ${with_ogg_lib}/libogg.so; 
then
+         ac_cv_path_ogg_lib=`(cd ${with_ogg_incl}; pwd)`
+        else
+         AC_MSG_ERROR([${with_ogg_lib} directory doesn't contain libogg.])
+        fi
+      fi
+      ])
+
+      dnl If the header doesn't exist, there is no point looking for the 
library.
+      if test x"${ac_cv_path_ogg_lib}" = x; then
+        AC_CHECK_LIB(ogg, ogg_sync_init, [ac_cv_path_ogg_lib="-logg"],[
+          AC_MSG_CHECKING([for libogg library])
+          libslist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib 
/usr/pkg/lib .. ../.."
+          for i in $libslist; do
+           if test -f $i/libogg.a -o -f $i/libogg.so; then
+             if test x"$i" != x"/usr/lib"; then
+               ac_cv_path_ogg_lib="-L$i"
+                AC_MSG_RESULT(${ac_cv_path_ogg_lib})
+               break
+              else
+               ac_cv_path_ogg_lib=""
+                AC_MSG_RESULT(yes)
+               break
+             fi
+           fi
+          done])
+      else
+        if test -f ${ac_cv_path_ogg_lib}/libogg.a -o -f 
${ac_cv_path_ogg_lib}/libogg.so; then
+
+          if test x"${ac_cv_path_ogg_lib}" != x"/usr/lib"; then
+           ac_cv_path_ogg_lib="-L${ac_cv_path_ogg_lib}"
+           else
+           ac_cv_path_ogg_lib=""
+          fi
+        fi
+      fi
+
+      if test x"${ac_cv_path_ogg_lib}" != x ; then
+        OGG_LIBS="${ac_cv_path_ogg_lib}"
+      else
+        OGG_LIBS=""
+      fi
+    fi
 
-  if test "x$no_ogg" = "x" ; then
-     AC_MSG_RESULT(yes)
-     ifelse([$1], , :, [$1])     
-  else
-     AC_MSG_RESULT(no)
-     if test -f conf.oggtest ; then
-       :
-     else
-       echo "*** Could not run Ogg test program, checking why..."
-       CFLAGS="$CFLAGS $OGG_CFLAGS"
-       LIBS="$LIBS $OGG_LIBS"
-       AC_TRY_LINK([
-#include <stdio.h>
-#include <ogg/ogg.h>
-],     [ return 0; ],
-       [ echo "*** The test program compiled, but did not run. This usually 
means"
-       echo "*** that the run-time linker is not finding Ogg or finding the 
wrong"
-       echo "*** version of Ogg. If it is not finding Ogg, you'll need to set 
your"
-       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf 
to point"
-       echo "*** to the installed location  Also, make sure you have run 
ldconfig if that"
-       echo "*** is required on your system"
-       echo "***"
-       echo "*** If you have an old version installed, it is best to remove 
it, although"
-       echo "*** you may also be able to get things to work by modifying 
LD_LIBRARY_PATH"],
-       [ echo "*** The test program failed to compile or link. See the file 
config.log for the"
-       echo "*** exact error that occured. This usually means Ogg was 
incorrectly installed"
-       echo "*** or that you have moved Ogg since it was installed." ])
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-     OGG_CFLAGS=""
-     OGG_LIBS=""
-     ifelse([$2], , :, [$2])
+  if test x"${ac_cv_path_ogg_lib}" != x ; then
+      OGG_LIBS="${ac_cv_path_ogg_lib} -logg"
   fi
+
+  AM_CONDITIONAL(OGG, [test x$ogg = xyes])
+
   AC_SUBST(OGG_CFLAGS)
   AC_SUBST(OGG_LIBS)
-  rm -f conf.oggtest
 ])
Index: gnash/macros/opengl.m4
diff -u gnash/macros/opengl.m4:1.4 gnash/macros/opengl.m4:1.5
--- gnash/macros/opengl.m4:1.4  Thu Jan 19 23:50:11 2006
+++ gnash/macros/opengl.m4      Sat Jan 28 01:14:33 2006
@@ -1,4 +1,3 @@
-dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl  Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 dnl
@@ -16,72 +15,116 @@
 dnl  along with this program; if not, write to the Free Software
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-dnl Check for OpenGL & [Glut | GLU]
-AC_DEFUN([AM_PATH_OPENGL], [
-
-dnl Add XML support, if specified.
+AC_DEFUN([AM_PATH_OPENGL],
+[
   AC_ARG_ENABLE(opengl, [  --disable-opengl           Disable support for 
OpenGL],
   [case "${enableval}" in
-    yes) opengl=no ;;
-    no)  pengl=yes ;;
+    yes) opengl=no  ;;
+    no)  opengl=yes ;;
     *)   AC_MSG_ERROR([bad value ${enableval} for disable-opengl option]) ;;
-  esac],opengl=yes)
-
-  AM_CONDITIONAL(OPENGL, test x$opengl = xyes)
+  esac], opengl=yes)
 
-  AC_ARG_WITH(opengl,[  --with-opengl=PFX   Prefix where opengl is installed 
(optional)], opengl_prefix="$withval", opengl_prefix="")
-  AC_ARG_WITH(opengl-libraries,[  --with-opengl-libraries=DIR   Directory 
where opengl library is installed (optional)], opengl_libraries="$withval", 
opengl_libraries="")
-  AC_ARG_WITH(opengl-includes,[  --with-opengl-includes=DIR   Directory where 
opengl header files are installed (optional)], opengl_includes="$withval", 
opengl_includes="")
-
-  if test "x$opengl_libraries" != "x" ; then
-    OPENGL_LIBS="-L$opengl_libraries -lxml2"
-  elif test "x$opengl_prefix" != "x" ; then
-    OPENGL_LIBS="-L$opengl_prefix/lib -lxml2"
-  fi
+  if test x"$opengl" = x"yes"; then
+    dnl Look for the headers.
+    AC_ARG_WITH(opengl_includes, [  --with-opengl-includes         directory 
where OpenGL headers are], with_opengl_includes=${withval})
+    AC_CACHE_VAL(ac_cv_path_opengl_includes,[
+    if test x"${with_opengl_includes}" != x ; then
+      if test -f ${with_opengl_includes}/GL/gl.h ; then
+        ac_cv_path_opengl_includes=`(cd ${with_opengl_includes}; pwd)`
+      else
+        AC_MSG_ERROR([${with_opengl_includes} directory doesn't contain GL.h])
+      fi
+    fi
+    ])
 
-  if test "x$opengl_includes" != "x" ; then
-    OPENGL_CFLAGS="-I$opengl_includes"
-  elif test "x$opengl_prefix" != "x" ; then
-    OPENGL_CFLAGS="-I$opengl_prefix/include"
-  fi
+    dnl If the include path hasn't been specified, go look for it.
+    if test x"${ac_cv_path_opengl_includes}" = x; then
+      AC_CHECK_HEADERS(GL/gl.h, [ac_cv_path_opengl_includes=""],[
+      if test x"${ac_cv_path_opengl_includes}" = x; then
+        AC_MSG_CHECKING([for OpenGL headers])
+        incllist="/usr/include /usr/local/include /opt/include 
/usr/X11R6/include /usr/pkg/include .. ../.."
+
+        for i in $incllist; do
+          if test -f $i/GL/gl.h; then
+            if test x"$i" != x"/usr/include"; then
+              ac_cv_path_opengl_includes="-I$i"
+              break
+            else
+              ac_cv_path_opengl_includes=""
+              break
+            fi
+          fi
+        done
+      fi])
+    else
+      AC_MSG_RESULT(-I${ac_cv_path_opengl_includes})
+      if test x"${ac_cv_path_opengl_includes}" != x"/usr/include"; then
+        ac_cv_path_opengl_includes="-I${ac_cv_path_opengl_includes}"
+       else
+        ac_cv_path_opengl_includes=""
+      fi
+    fi
 
-  if test x"$opengl" = x"yes"; then
-    LIBS_SAVE="$LIBS"
-    LIBS="$LIBS $OPENGL_LIBS"
-    AC_CHECK_LIB(GL, glBegin)
-    LIBS="$LIBS_SAVE"
-    AC_CHECK_HEADERS(GL/gl.h)
-    AC_CHECK_LIB(GLU, gluPerspective)
-    if test x"$HAVE_GL" = x; then
-      AC_MSG_CHECKING(futher locations for OpenGL Header files)
-      dirlist="/usr/X11R6 /usr /usr/local /opt /home/latest"
-      for i in $dirlist; do
-        if test -f $i/include/GL/gl.h; then
-          OPENGL_CFLAGS=-I`(cd $i/include; pwd)`
-          break
-        fi
-      done
-      if test x"$OPENGL_CFLAGS" != x; then
-       AC_MSG_RESULT(yes)
+    if test x"${ac_cv_path_opengl_includes}" != x ; then
+      OPENGL_CFLAGS="${ac_cv_path_opengl_includes}"
+      AC_MSG_RESULT(${ac_cv_path_opengl_includes})
+    else
+      OPENGL_CFLAGS=""
+    fi
+
+    dnl Look for the libraries.
+    AC_ARG_WITH(opengl_lib, [  --with-opengl-libraries      directory where 
OpenGL libraries are], with_opengl_libraries=${withval})
+    AC_CACHE_VAL(ac_cv_path_opengl_libraries,[
+    if test x"${with_opengl_libraries}" != x ; then
+      if test -f ${with_opengl_libraries}/libGL.a -o -f 
${with_opengl_libraries}/libGL.so; then
+        ac_cv_path_opengl_libraries=`(cd ${with_opengl_libraries}; pwd)`
       else
-       AC_MSG_RESULT(no)
+        AC_MSG_ERROR([${with_opengl_libraries} directory doesn't contain 
libGL.])
       fi
-      AC_MSG_CHECKING(futher locations for OpenGL library files)
-      for i in $dirlist; do
-        if test -f $i/lib/libGL.a; then
-          OPENGL_LIBS="-L`(cd $i/lib; pwd)` -lGL -lGLU"
-          break
+    fi
+    ])
+
+    dnl If the header doesn't exist, there is no point looking for the library.
+    if test x"${ac_cv_path_opengl_libraries}" = x; then
+      AC_CHECK_LIB(GL, glBegin, [ac_cv_path_opengl_libraries="-lGL -lGLU"],[
+        AC_MSG_CHECKING([for libGL library])
+        libslist="/usr/lib /usr/local/lib /opt/lib /usr/X11R6/lib /usr/pkg/lib 
.. ../.."
+        for i in $libslist; do
+          if test -f $i/libGL.a -o -f $i/libGL.so; then
+            if test x"$i" != x"/usr/lib"; then
+              ac_cv_path_opengl_libraries="-L$i"
+              AC_MSG_RESULT(${ac_cv_path_opengl_libraries})
+              break
+            else
+              ac_cv_path_opengl_libraries=""
+              AC_MSG_RESULT(yes)
+              break
+            fi
+          fi
+        done])
+    else
+      if test -f ${ac_cv_path_opengl_libraries}/libGL.a -o -f 
${ac_cv_path_opengl_libraries}/libGL.so; then
+        if test x"${ac_cv_path_opengl_libraries}" != x"/usr/lib"; then
+          ac_cv_path_opengl_libraries="-L${ac_cv_path_opengl_libraries}"
+         else
+          ac_cv_path_opengl_libraries=""
         fi
-      done
-      if test x"$OPENGL_LIBS" != x; then
-       AC_MSG_RESULT(yes)
-      else
-       AC_MSG_RESULT(no)
       fi
-    fi 
+    fi
+
+    if test x"${ac_cv_path_opengl_libraries}" != x ; then
+      OPENGL_LIBS="${ac_cv_path_opengl_libraries}"
+    else
+      OPENGL_LIBS=""
+    fi
+  fi
+
+  if test x"${ac_cv_path_opengl_libraries}" != x ; then
+      OPENGL_LIBS="${ac_cv_path_opengl_libraries}"
   fi
 
+  AM_CONDITIONAL(opengl, [test x$opengl = xyes])
+
   AC_SUBST(OPENGL_CFLAGS)
   AC_SUBST(OPENGL_LIBS)
-  AM_CONDITIONAL(HAVE_OPENGL, [test x$ac_use_opengl = "xyes"])
 ])
Index: gnash/macros/png.m4
diff -u gnash/macros/png.m4:1.2 gnash/macros/png.m4:1.3
--- gnash/macros/png.m4:1.2     Thu Jan 19 23:50:11 2006
+++ gnash/macros/png.m4 Sat Jan 28 01:14:33 2006
@@ -1,4 +1,3 @@
-dnl Process this file with autoconf to produce a configure script.
 dnl
 dnl  Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 dnl
@@ -18,93 +17,109 @@
 
 AC_DEFUN([AM_PATH_PNG],
 [
-  dnl Lool for the header
-  AC_ARG_WITH(png_incl, [  --with-png-incl         directory where png header 
is], with_png_incl=${withval})
-  AC_CACHE_VAL(ac_cv_path_png_incl,[
-  if test x"${with_png_incl}" != x ; then
-    if test -f ${with_png_incl}/png.h ; then
-      ac_cv_path_png_incl=`(cd ${with_png_incl}; pwd)`
-    elif test -f ${with_png_incl}/png.h ; then
-      ac_cv_path_png_incl=`(cd ${with_png_incl}; pwd)`
-    else
-      AC_MSG_ERROR([${with_png_incl} directory doesn't contain pnglib.h])
-    fi
-  fi
-  ])
-
-  if test x"${ac_cv_path_png_incl}" = x ; then
-    AC_MSG_CHECKING([for png header])
-    incllist="/sw/include /usr/local/include /home/latest/include /opt/include 
/usr/include .. ../.."
-
-    for i in $incllist; do
-      if test -f $i/png.h; then
-        ac_cv_path_png_incl=$i
-        break
+  AC_ARG_ENABLE(png, [  --enable-png       Enable support for png images],
+  [case "${enableval}" in
+    yes) png=yes ;;
+    no)  png=no ;;
+    *)   AC_MSG_ERROR([bad value ${enableval} for enable-png option]) ;;
+  esac], png=yes)
+
+  if test x"$png" = x"yes"; then
+    dnl Look for the header
+  AC_ARG_WITH(png_incl, [  --with-png_incl         directory where libpng 
header is], with_png_incl=${withval})
+    AC_CACHE_VAL(ac_cv_path_png_incl,[
+    if test x"${with_png_incl}" != x ; then
+      if test -f ${with_png_incl}/png.h ; then
+       ac_cv_path_png_incl=`(cd ${with_png_incl}; pwd)`
+      else
+       AC_MSG_ERROR([${with_png_incl} directory doesn't contain png.h])
       fi
-    done
+    fi
+    ])
 
-    PNG_CFLAGS=""
-    if test x"${ac_cv_path_png_incl}" = x ; then
-      AC_MSG_RESULT(none)
-      AC_CHECK_HEADERS(png.h, [ac_cv_path_png_incl=""])
+    dnl If the path hasn't been specified, go look for it.
+    if test x"${ac_cv_path_png_incl}" = x; then
+      AC_CHECK_HEADERS(png.h, [ac_cv_path_png_incl=""],[
+      if test x"${ac_cv_path_png_incl}" = x; then
+        AC_MSG_CHECKING([for libpng header])
+        incllist="/sw/include /usr/local/include /home/latest/include 
/opt/include /usr/include /usr/pkg/include .. ../.."
+
+        for i in $incllist; do
+         if test -f $i/png.h; then
+           if test x"$i" != x"/usr/include"; then
+             ac_cv_path_png_incl="-I$i"
+             break
+            else
+             ac_cv_path_png_incl=""
+             break
+           fi
+         fi
+        done
+      fi])
     else
-      AC_MSG_RESULT(${ac_cv_path_png_incl})
+      AC_MSG_RESULT(-I${ac_cv_path_png_incl})
       if test x"${ac_cv_path_png_incl}" != x"/usr/include"; then
-        ac_cv_path_png_incl="-I${ac_cv_path_png_incl}"
-      else
-        ac_cv_path_png_incl=""
+       ac_cv_path_png_incl="-I${ac_cv_path_png_incl}"
+       else
+       ac_cv_path_png_incl=""
       fi
     fi
-  fi
-
-  if test x"${ac_cv_path_png_incl}" != x ; then
-    PNG_CFLAGS="${ac_cv_path_png_incl}"
-  fi
 
-  dnl Look for the library
-  AC_ARG_WITH(png_lib, [  --with-png-lib          directory where png library 
is], with_png_lib=${withval})
-  AC_MSG_CHECKING([for png library])
-  AC_CACHE_VAL(ac_cv_path_png_lib,[
-  if test x"${with_png_lib}" != x ; then
-    if test -f ${with_png_lib}/libpng.a ; then
-      ac_cv_path_png_lib=`(cd ${with_png_lib}; pwd)`
-    elif test -f ${with_png_lib}/libpng.a -o -f ${with_png_lib}/libpng.so; then
-      ac_cv_path_png_lib=`(cd ${with_png_incl}; pwd)`
+    if test x"${ac_cv_path_png_incl}" != x ; then
+      PNG_CFLAGS="${ac_cv_path_png_incl}"
+      AC_MSG_RESULT(${ac_cv_path_png_incl})
     else
-      AC_MSG_ERROR([${with_png_lib} directory doesn't contain libpng.a])
+      PNG_CFLAGS=""
     fi
-  fi
-  ])
 
-  if test x"${ac_cv_path_png_lib}" = x ; then
-    liblist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib .. 
../.."
-
-    for i in $liblist; do
-    if test -f $i/libpng.a -o -f $i/libpng.so; then
-       ac_cv_path_png_lib=$i
-       break
-    fi
-    done
+      dnl Look for the library
+      AC_ARG_WITH(png_lib, [  --with-png-lib          directory where png 
library is], with_png_lib=${withval})
+      AC_CACHE_VAL(ac_cv_path_png_lib,[
+      if test x"${with_png_lib}" != x ; then
+        if test -f ${with_png_lib}/libpng.a -o -f ${with_png_lib}/libpng.so; 
then
+         ac_cv_path_png_lib=`(cd ${with_png_incl}; pwd)`
+        else
+         AC_MSG_ERROR([${with_png_lib} directory doesn't contain libpng.])
+        fi
+      fi
+      ])
 
-    PNG_LIBS=""
-    if test x"${ac_cv_path_png_lib}" = x ; then
-      AC_MSG_RESULT(none)
-      dnl if we can't find libpng via the path, see if it's in the compiler 
path
-      AC_CHECK_LIB(png, png_check_sig, PNG_LIBS="-lpng")
-    else
-      AC_MSG_RESULT(${ac_cv_path_png_lib})
-      if test x"${ac_cv_path_png_lib}" != x"/usr/lib"; then
-        ac_cv_path_png_lib="-L${ac_cv_path_png_lib} -lpng"
+      dnl If the header doesn't exist, there is no point looking for the 
library.
+      if test x"${ac_cv_path_png_lib}" = x; then
+        AC_CHECK_LIB(png, png_crc_read, [ac_cv_path_png_lib="-lpng"],[
+          AC_MSG_CHECKING([for libpng library])
+          libslist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib 
/usr/pkg/lib .. ../.."
+          for i in $libslist; do
+           if test -f $i/libpng.a -o -f $i/libpng.so; then
+             if test x"$i" != x"/usr/lib"; then
+               ac_cv_path_png_lib="-L$i"
+                AC_MSG_RESULT(${ac_cv_path_png_lib})
+               break
+              else
+               ac_cv_path_png_lib=""
+                AC_MSG_RESULT(yes)
+               break
+             fi
+           fi
+          done])
       else
-        ac_cv_path_png_lib="-lpng"
+        if test -f ${ac_cv_path_png_lib}/libpng.a -o -f 
${ac_cv_path_png_lib}/libpng.so; then
+
+          if test x"${ac_cv_path_png_lib}" != x"/usr/lib"; then
+           ac_cv_path_png_lib="-L${ac_cv_path_png_lib}"
+           else
+           ac_cv_path_png_lib=""
+          fi
+        fi
       fi
     fi
-  fi
 
   if test x"${ac_cv_path_png_lib}" != x ; then
-    PNG_LIBS="${ac_cv_path_png_lib}"
+      PNG_LIBS="${ac_cv_path_png_lib}"
   fi
 
+  AM_CONDITIONAL(HAVE_PNG, [test x$png = xyes])
+
   AC_SUBST(PNG_CFLAGS)
   AC_SUBST(PNG_LIBS)
 ])
Index: gnash/macros/sdl.m4
diff -u gnash/macros/sdl.m4:1.4 gnash/macros/sdl.m4:1.5
--- gnash/macros/sdl.m4:1.4     Mon Jan 23 13:26:28 2006
+++ gnash/macros/sdl.m4 Sat Jan 28 01:14:33 2006
@@ -195,11 +195,15 @@
 
   if test x"${ac_cv_path_sdl_mixer_incl}" = x ; then
     AC_MSG_CHECKING([for SDL_mixer header])
-    incllist="/sw/include /sw/include /usr/local/include /home/latest/include 
/opt/include /usr/include .. ../.."
+    incllist="/usr/pkg /sw /usr/local /home/latest /opt /usr .. ../.."
 
     for i in $incllist; do
-      if test -f $i/SDL/SDL_mixer.h; then
-        ac_cv_path_sdl_mixer_incl=$i/SDL
+      if test -f $i/SDL/include/SDL_mixer.h; then
+        ac_cv_path_sdl_mixer_incl=$i/SDL/include
+        break
+      fi
+      if test -f $i/include/SDL/SDL_mixer.h; then
+        ac_cv_path_sdl_mixer_incl=$i/include/SDL
         break
       fi
     done
@@ -236,7 +240,7 @@
   ])
 
   if test x"${ac_cv_path_sdl_mixer_lib}" = x ; then
-    liblist="/sw/lib /usr/local/lib /home/latest/lib /opt/lib /usr/lib .. 
../.."
+    liblist="/usr/pkg/lib /sw/lib /usr/local/lib /home/latest/lib /opt/lib 
/usr/lib .. ../.."
 
     for i in $liblist; do
     if test -f $i/libSDL_mixer.a -o -f $i/libSDL_mixer.so -o -f 
$i/libSDL_mixer.dylib; then
Index: gnash/plugin/Makefile.am
diff -u gnash/plugin/Makefile.am:1.7 gnash/plugin/Makefile.am:1.8
--- gnash/plugin/Makefile.am:1.7        Tue Jan 24 01:33:01 2006
+++ gnash/plugin/Makefile.am    Sat Jan 28 01:14:33 2006
@@ -44,10 +44,9 @@
        $(SDL_CFLAGS)           \
        $(SDL_MIXER_CFLAGS)     \
        $(X_CFLAGS)             \
-       $(DMALLOC_CFLAGS)               \
+       $(DMALLOC_CFLAGS)       \
        $(MP3_CFLAGS)           \
-       $(OGG_CFLAGS)           \
-       $(VORBIS_CFLAGS)
+       $(OGG_CFLAGS)
 
 
 AM_CXXFLAGS = $(INCLUDES)
@@ -55,37 +54,50 @@
 # PLUGIN_TRACE Enable this define to get debug prints whenever the plugin
 #              api gets control.
 AM_CPPFLAGS = -Wall -DPLUGIN_TRACE -DXP_UNIX $(FIREFOX_DEFS)
-AM_LDFLAGS  = $(FIREFOX_LIBS) \
-       $(X_LIBS) -lX11 -lXi -lXmu \
-       $(SDL_LIBS)             \
-       $(SDL_MIXER_LIBS)       \
-       $(OPENGL_LIBS)          \
-       $(LIBXML_LIBS)          \
-       $(JPEG_LIBS)            \
-       $(PNG_LIBS)             \
-       $(DMALLOC_LIBS)         \
-       $(DMALLOC_LIBS)         \
-       $(OGG_LIBS)             \
-        $(VORBIS_LIBS)
-
+AM_LDFLAGS  = $(FIREFOX_LIBS) $(X_LIBS) -lX11 -lXi -lXmu \
+       $(SDL_LIBS)\
+       $(SDL_MIXER_LIBS)\
+       $(OPENGL_LIBS)\
+       $(LIBXML_LIBS)\
+       $(JPEG_LIBS)\
+       $(PNG_LIBS)\
+       $(DMALLOC_LIBS)\
+       $(OGG_LIBS)\
+       $(DMALLOC_LIBS)
+#      $(X_LIBS)\
+#      $(X_EXTRA_LIBS)
 
 plugin_LTLIBRARIES = libgnash.la
 
 noinst_HEADERS = plugin.h player.h ogl_sdl.h
 
 libgnash_la_SOURCES  = plugin.cpp player.cpp ogl_sdl.cpp
-libgnash_la_LIBADD   =         $(AM_LDFLAGS)   \
-       mozilla-sdk/libmozsdk.a         \
-       ../backend/libgbackend.a        \
-       ../server/libserver.a           \
-       ../libgeometry/libgeometry.a    \
-       ../libbase/libbase.a
+libgnash_la_LIBADD   = $(AM_LDFLAGS) \
+       mozilla-sdk/libmozsdk.la\
+       ../backend/libgbackend.la\
+       ../server/libserver.la\
+       ../libgeometry/libgeometry.la\
+       ../libbase/libbase.la
+
 
-libgnash_la_DEPENDENCIES   = mozilla-sdk/libmozsdk.a
+libgnash_la_DEPENDENCIES   = mozilla-sdk/libmozsdk.la 
../backend/libgbackend.la ../server/libserver.la ../libgeometry/libgeometry.la 
../libbase/libbase.la
 libgnash_la_LDFLAGS = -module -avoid-version -no-undefined
 
+# For now the plugin has to be installed in the root plugin
+# directory for Firefox. For some reason if the same file is
+# installed in the users $(HOME)/.firefox.plugins, the plugin
+# won't load due to errors with an undefined MaiAtkObject.
 install-pluginLTLIBRARIES: $(plugin_LIBRARIES)
        cp .libs/libgnash.so $(plugindir)/libgnash.so
 
+# install-pluginLTLIBRARIES: $(plugin_LIBRARIES)
+#      if test -d $(HOME)/.firefox ; then \
+#         $(mkinstalldirs) $(HOME)/.firefox/plugins; \
+#         $(INSTALL) .libs/libgnash.so $(HOME)/.firefox/plugins/libgnash.so; \
+#      else \
+#          $(mkinstalldirs) $(HOME)/.mozilla/plugins; \
+#         $(INSTALL) .libs/libgnash.so $(HOME)/.mozilla/plugins/libgnash.so; \
+#      fi
+
 uninstall-pluginLTLIBRARIES: $(plugin_LIBRARIES)
        rm -f $(plugindir)/libgnash.so
Index: gnash/plugin/mozilla-sdk/Makefile.am
diff -u gnash/plugin/mozilla-sdk/Makefile.am:1.5 
gnash/plugin/mozilla-sdk/Makefile.am:1.6
--- gnash/plugin/mozilla-sdk/Makefile.am:1.5    Tue Jan 24 01:33:01 2006
+++ gnash/plugin/mozilla-sdk/Makefile.am        Sat Jan 28 01:14:33 2006
@@ -28,11 +28,10 @@
 # AM_LDFLAGS  = $(FIREFOX_LIBS)
 
 # noinst_LTLIBRARIES = libmozsdk.la
-# lib_LTLIBRARIES = libmozsdk.la
-noinst_LIBRARIES = libmozsdk.a
+lib_LTLIBRARIES = libmozsdk.la
 
 noinst_HEADERS = npplat.h pluginbase.h
-libmozsdk_a_SOURCES = \
+libmozsdk_la_SOURCES = \
        npn_gate.cpp \
         npp_gate.cpp \
         np_entry.cpp
Index: gnash/plugin/ogl_sdl.cpp
diff -u gnash/plugin/ogl_sdl.cpp:1.1 gnash/plugin/ogl_sdl.cpp:1.2
--- gnash/plugin/ogl_sdl.cpp:1.1        Tue Jan 24 01:33:01 2006
+++ gnash/plugin/ogl_sdl.cpp    Sat Jan 28 01:14:33 2006
@@ -477,7 +477,7 @@
     // way the atexit() call should ensure that SDL will be
     // shut down properly and the screen returned to a
     // reasonable state.
-    atexit(SDL_Quit);
+    //atexit(SDL_Quit);
 
 #if 0
     // 16-bit color, surface creation is likely to succeed.
Index: gnash/plugin/player.cpp
diff -u gnash/plugin/player.cpp:1.1 gnash/plugin/player.cpp:1.2
--- gnash/plugin/player.cpp:1.1 Tue Jan 24 01:33:01 2006
+++ gnash/plugin/player.cpp     Sat Jan 28 01:14:33 2006
@@ -35,6 +35,7 @@
 #include "tu_file.h"
 #include "tu_types.h"
 #include "xmlsocket.h"
+#include "ogl_sdl.h"
 
 #ifdef HAVE_LIBXML
 bool gofast = false;           // FIXME: this flag gets set based on
@@ -54,6 +55,9 @@
                                // want to make sure it all works.
 #endif // HAVE_LIBXML
 
+bool GLinitialized = false;
+bool processing = false;
+
 #define OVERSIZE       1.0f
 
 static int runThread(void *nothing);
@@ -113,7 +117,7 @@
 }
 
 int
-main_loop(WinData *wdata)
+main_loop(nsPluginInstance *inst)
 {
     assert(tu_types_validate());
     float      exit_timeout = 0;
@@ -124,7 +128,7 @@
     int  delay = 31;
     float      tex_lod_bias;
     
-    const char *infile = wdata->_file;
+    const char *infile = inst->getFilename();
     
     printf("%s: Playing %s\n", __PRETTY_FUNCTION__, infile);
     
@@ -136,6 +140,16 @@
         exit(1);
     }
     
+#if 0
+    int stall = 0;
+    while (stall++ < 3) {
+        printf("Stalling for GDB at pid %ld\n", getpid());
+        sleep(10);
+    }
+#endif
+    gnash::set_verbose_action(true);
+    gnash::set_verbose_parse(true);    
+
     gnash::register_file_opener_callback(file_opener);
     gnash::register_fscommand_callback(fs_callback);
     if (s_verbose == true) {
@@ -168,18 +182,22 @@
     int        width = int(movie_width * s_scale);
     int        height = int(movie_height * s_scale);
     
-    printf("Passed in width is %d, height is %d\n", wdata->_width, 
wdata->_height);
+    printf("Passed in width is %d, height is %d\n", inst->getWidth(),
+          inst->getHeight());
     printf("Calculated width is %d, height is %d\n", width, height);
-    //  atexit(SDL_Quit);
+    //atexit(SDL_Quit);
     
     SDL_EnableKeyRepeat(250, 33);  
     
+    printf("%s: at line %d\n", __PRETTY_FUNCTION__, __LINE__);
+    
     // Load the actual movie.
     gnash::movie_definition*   md = gnash::create_library_movie(infile);
     if (md == NULL) {
         fprintf(stderr, "error: can't create a movie from '%s'\n", infile);
         exit(1);
     }
+
     gnash::movie_interface*    m = create_library_movie_inst(md);
     if (m == NULL) {
         fprintf(stderr, "error: can't create movie instance\n");
@@ -188,6 +206,7 @@
     gnash::set_current_root(m);
     
     // Mouse state.
+
     int        mouse_x = 0;
     int        mouse_y = 0;
     int        mouse_buttons = 0;
@@ -202,14 +221,6 @@
     int        frame_counter = 0;
     int        last_logged_fps = last_ticks;
     
-#if 0
-    bool stall = true;
-    while (stall) {
-        printf("Stalling for GDB at pid %ld\n", getpid());
-        sleep(10);
-    }
-#endif
-    
     for (;;) {
         Uint32 ticks;
         if (do_render) {
@@ -229,16 +240,17 @@
             break;
         }
         
-#if 1
+#if 0
         drawGLScene();
 #else
         m = gnash::get_current_root();
         gnash::delete_unused_root();
         
-//   m->set_display_viewport(0, 0, width, height);
-//    m->set_background_alpha(s_background ? 1.0f : 0.05f);
-//    m->notify_mouse_state(mouse_x, mouse_y, mouse_buttons);    
-        
+//     m->set_display_viewport(0, 0, width, height);
+       m->set_background_alpha(s_background ? 1.0f : 0.05f);
+       m->notify_mouse_state(mouse_x, mouse_y, mouse_buttons);    
+//         SDL_mutexP(mutex);
+       
         m->advance(delta_t * speed_scale);
         
 //     if (do_render) {
@@ -246,15 +258,16 @@
 //       glDrawBuffer(GL_BACK);
 //     }
         m->display();
+//        SDL_mutexV(mutex);
         frame_counter++;
         
-#endif
         if (do_render) {
             SDL_GL_SwapBuffers();
             //glPopAttrib ();
             
             // Don't hog the CPU.
         }
+#endif
         SDL_Delay(delay);
         
         // See if we should exit.
@@ -268,8 +281,8 @@
     
   done:
     doneYet = 1;
-    // SDL_KillThread(thread); // kill the network read thread
-    // SDL_Quit();
+//    SDL_KillThread(thread);  // kill the network read thread
+//     SDL_Quit();
     
     if (md) md->drop_ref();
     if (m) m->drop_ref();
@@ -347,17 +360,28 @@
 int
 playerThread(void *arg)
 {
-    WinData wdata;
-    memcpy(&wdata, arg, sizeof(WinData));
+    printf("%s:\n", __PRETTY_FUNCTION__);
+    nsPluginInstance *inst = (nsPluginInstance *)arg;
+    int retries;
+    
+     if (!GLinitialized) {
+        initGL(inst);
+       GLinitialized = true;
+     }
     
-    printf("%s: Playing file %s\n", __PRETTY_FUNCTION__, wdata._file);
-
+     while (retries++ < 2) {
 #if 1
-    drawGLScene();
+        drawGLScene();
 #else
-    main_loop(&wdata);
+        main_loop(inst);
 #endif
-    
+        SDL_Delay(20);      // don't trash the CPU
+        // So we don't run forever for now.
+        printf("%s(%d): FIXME: loop timed out\n",
+               __PRETTY_FUNCTION__, __LINE__);
+        break;
+    }     
+   
     return 0;
 }
 
Index: gnash/plugin/player.h
diff -u gnash/plugin/player.h:1.1 gnash/plugin/player.h:1.2
--- gnash/plugin/player.h:1.1   Tue Jan 24 01:33:01 2006
+++ gnash/plugin/player.h       Sat Jan 28 01:14:33 2006
@@ -19,8 +19,8 @@
 #ifndef __GNASH_PLAYER_H__
 #define __GNASH_PLAYER_H__
 
-int playerThread(void *nothing);
-int main_loop(const char *infile);
+int playerThread(void *inst);
+int main_loop(nsPluginInstance *inst);
 
 // EOF of __GNASH_PLAYER_H__
 #endif
Index: gnash/plugin/plugin.cpp
diff -u gnash/plugin/plugin.cpp:1.9 gnash/plugin/plugin.cpp:1.10
--- gnash/plugin/plugin.cpp:1.9 Tue Jan 24 01:33:01 2006
+++ gnash/plugin/plugin.cpp     Sat Jan 28 01:14:33 2006
@@ -25,7 +25,9 @@
 // plugin version to load.
 #define PLUGIN_NAME     "Shockwave Flash 7.0"
 #define MIME_TYPES_DESCRIPTION  MIME_TYPES_HANDLED":swf:"PLUGIN_NAME
-#define PLUGIN_DESCRIPTION  PLUGIN_NAME
+#define PLUGIN_DESCRIPTION PLUGIN_NAME
+
+//"Copyright 2005, 2006 Free Software Foundation, Inc. This is free software 
with ABSOLUTELY NO WARRANTY. For details type see the file COPYING in the 
sources."
 
 #include <GL/gl.h>              // Header File For The OpenGL32 Library
 #include <GL/glu.h>             // Header File For The GLu32 Library
@@ -45,16 +47,24 @@
 #include <string>
 
 #include "ogl_sdl.h"
+#include "player.h"
 #include "xmlsocket.h"
 
-bool processing = false;
-bool surface_activated = false;
-int  streamfd = -1;
-
-const int INBUFSIZE = 1024;
+#include "tu_file.h"
+#include "tu_types.h"
 
 using namespace std;
 
+extern bool GLinitialized;
+extern bool processing;
+
+static int   streamfd = -1;
+static float s_scale = 1.0f;
+static bool  s_verbose = false;
+static int   doneYet = 0;
+
+const int INBUFSIZE = 1024;
+
 #ifdef HAVE_LIBXML
 extern int xml_fd;             // FIXME: this is the file descriptor
                                // from XMLSocket::connect(). This
@@ -62,7 +72,8 @@
                                // the layers properly, but first I
                                // want to make sure it all works.
 #endif // HAVE_LIBXML
-static int eventThread(void *nothing);
+static int eventThread(void *inst);
+int playswf(nsPluginInstance *inst);
 
 SDL_Thread *thread = NULL;
 
@@ -209,11 +220,12 @@
       case Expose:
           // get rid of all other exposure events
           if (plugin) {
-              if (surface_activated) {
-                  drawGLScene();
+              if (GLinitialized) {
+//                   drawGLScene();
+                  printf("HACK ALERT! ignoring expose event!\n");
               } else {
                   printf("GL Surface not initialized yet, ignoring expose 
event!\n");
-              }
+             }
           }
           break;
       case ButtonPress:
@@ -305,8 +317,9 @@
     printf("%s(%d): Entering. Thread_count is %d\n", __PRETTY_FUNCTION__, 
__LINE__, thr_count);
     mInitialized = FALSE;
 
-    surface_activated = false;
 
+    GLinitialized = false;
+    
     thr_count--;
     
 #if 0
@@ -445,7 +458,8 @@
             WriteStatus(tmp);
         }
     }
-  
+
+    swf_file = fname;
     processing = true;
     return NPERR_NO_ERROR;
 }
@@ -463,6 +477,7 @@
 
 //     cond = SDL_CreateCond();
     thr_count++;
+//    thread = SDL_CreateThread(playerThread, (void *)this);
     thread = SDL_CreateThread(eventThread, (void *)this);
   
 //     SDL_mutexP(mutex);
@@ -503,25 +518,29 @@
 static int
 eventThread(void *arg)
 {
+    printf("%s: \n", __PRETTY_FUNCTION__);
     int retries = 0;
   
     nsPluginInstance *inst = (nsPluginInstance *)arg;
-    printf("%s: \n", __PRETTY_FUNCTION__);
 
-    if (!surface_activated) {
+    if (!GLinitialized) {
         initGL(inst);
-        surface_activated = true;
+        GLinitialized = true;
     }
     
     while (retries++ < 2) {
-        if (drawGLScene() > 5000) {
-            SDL_Delay(20);      // don't trash the CPU
-            // So we don't run forever for now.
-            printf("%s(%d): FIXME: loop timed out\n",
-                   __PRETTY_FUNCTION__, __LINE__);
-            break;
-        }
-    }        
+#if 1
+        drawGLScene();
+#else
+//        playswf(inst);
+        main_loop(inst);
+#endif
+        SDL_Delay(20);      // don't trash the CPU
+        // So we don't run forever for now.
+        printf("%s(%d): FIXME: loop timed out\n",
+               __PRETTY_FUNCTION__, __LINE__);
+        break;
+    }     
   
     return 0;
 }
Index: gnash/plugin/plugin.h
diff -u gnash/plugin/plugin.h:1.3 gnash/plugin/plugin.h:1.4
--- gnash/plugin/plugin.h:1.3   Tue Jan 24 01:33:01 2006
+++ gnash/plugin/plugin.h       Sat Jan 28 01:14:33 2006
@@ -77,6 +77,7 @@
     unsigned int getDepth()     { return mDepth; };
     int         getWidth()      { return mWidth; };
     int         getHeight()     { return mHeight; };
+    const char *getFilename()   { return swf_file.c_str(); };
     
 private:
     NPP           mInstance;
Index: gnash/server/Makefile.am
diff -u gnash/server/Makefile.am:1.12 gnash/server/Makefile.am:1.13
--- gnash/server/Makefile.am:1.12       Wed Jan 25 18:03:25 2006
+++ gnash/server/Makefile.am    Sat Jan 28 01:14:33 2006
@@ -19,12 +19,10 @@
 
 AUTOMAKE_OPTIONS = 
 
-AM_CXXFLAGS = $(CFLAGS) $(SDL_CFLAGS) $(SDL_MIXER_CFLAGS) $(INCLUDES)
 AM_CPPFLAGS = -Wall
 
 # noinst_LTLIBRARIES = libserver.la
-# lib_LTLIBRARIES = libserver.la
-noinst_LIBRARIES = libserver.a
+lib_LTLIBRARIES = libserver.la
 
 # Only enable if we're configured with --enable-mp3
 INCLUDES = -I.. \
@@ -33,7 +31,11 @@
         -I$(top_srcdir)                \
         $(ENGINE_INCLUDE)      \
         $(ZLIB_CFLAGS)         \
+        $(OGG_CFLAGS)          \
+        $(JPEG_CFLAGS)         \
+        $(SDL_CFLAGS)          \
         $(SDL_MIXER_CFLAGS)    \
+        $(OPENGL_CFLAGS)       \
        $(DMALLOC_CFLAGS)       \
         $(LIBXML_CFLAGS)
 
@@ -43,7 +45,7 @@
 MP3_HANDLER = sound_handler_mp3.cpp
 endif
 
-libserver_a_SOURCES = \
+libserver_la_SOURCES = \
         textformat.cpp   \
         timers.cpp       \
         xml.cpp          \
Index: gnash/server/Movie.cpp
diff -u gnash/server/Movie.cpp:1.1 gnash/server/Movie.cpp:1.2
--- gnash/server/Movie.cpp:1.1  Wed Jan 25 18:03:25 2006
+++ gnash/server/Movie.cpp      Sat Jan 28 01:14:33 2006
@@ -7,6 +7,17 @@
 
 // Implementation for Movie object
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+// This needs to be included first for NetBSD systems or we get a weird
+// problem with pthread_t being defined too many times if we use any
+// STL containers.
+#ifdef HAVE_PTHREADS
+#include <pthread.h>
+#endif
+
 #include "Movie.h"
 #include "tu_file.h"
 #include "zlib_adapter.h"
Index: gnash/server/MovieClipLoader.cpp
diff -u gnash/server/MovieClipLoader.cpp:1.2 
gnash/server/MovieClipLoader.cpp:1.3
--- gnash/server/MovieClipLoader.cpp:1.2        Fri Jan 27 00:54:38 2006
+++ gnash/server/MovieClipLoader.cpp    Sat Jan 28 01:14:33 2006
@@ -18,6 +18,10 @@
 
 // Implementation of ActionScript MovieClipLoader class.
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "tu_config.h"
 #include <sys/types.h>
 #include <sys/stat.h>
Index: gnash/server/Sprite.cpp
diff -u gnash/server/Sprite.cpp:1.2 gnash/server/Sprite.cpp:1.3
--- gnash/server/Sprite.cpp:1.2 Fri Jan 27 00:54:38 2006
+++ gnash/server/Sprite.cpp     Sat Jan 28 01:14:33 2006
@@ -17,11 +17,21 @@
 
 // Implementation for MovieClip object.
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+// This needs to be included first for NetBSD systems or we get a weird
+// problem with pthread_t being defined too many times.
+#ifdef HAVE_PTHREADS
+#include <pthread.h>
+#endif
+#include <vector>
+
 #include "action.h" 
 #include "gnash.h"
 #include "Sprite.h"
 #include "MovieClipLoader.h" // @@ temp hack for loading tests
-#include <vector>
 
 namespace gnash {
 
Index: gnash/server/Sprite.h
diff -u gnash/server/Sprite.h:1.3 gnash/server/Sprite.h:1.4
--- gnash/server/Sprite.h:1.3   Fri Jan 27 00:54:38 2006
+++ gnash/server/Sprite.h       Sat Jan 28 01:14:33 2006
@@ -39,10 +39,15 @@
 #ifndef GNASH_SPRITE_H
 #define GNASH_SPRITE_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vector>
+
 #include "Movie.h"
 #include "dlist.h" // display_list 
 #include "stream.h"
-#include <vector>
 
 namespace gnash
 {
Index: gnash/server/action.cpp
diff -u gnash/server/action.cpp:1.7 gnash/server/action.cpp:1.8
--- gnash/server/action.cpp:1.7 Fri Jan 27 00:54:38 2006
+++ gnash/server/action.cpp     Sat Jan 28 01:14:33 2006
@@ -1,17 +1,20 @@
-// action.cpp  -- Thatcher Ulrich <address@hidden> 2003
+// button.cpp  -- Thatcher Ulrich <address@hidden> 2003
 
 // This source code has been donated to the Public Domain.  Do
 // whatever you want with it.
 
-// Implementation and helpers for SWF actions.
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
+#include <typeinfo> 
+#include <pthread.h> 
 
 #include "action.h"
 #include "impl.h"
 #include "log.h"
 #include "stream.h"
 #include "tu_random.h"
-#include <typeinfo> 
 
 #include "gstring.h"
 #include "MovieClipLoader.h"
Index: gnash/server/array.cpp
diff -u gnash/server/array.cpp:1.7 gnash/server/array.cpp:1.8
--- gnash/server/array.cpp:1.7  Tue Jan 24 09:33:48 2006
+++ gnash/server/array.cpp      Sat Jan 28 01:14:33 2006
@@ -16,12 +16,23 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+// This needs to be included first for NetBSD systems or we get a weird
+// problem with pthread_t being defined too many times if we use any
+// STL containers.
+#ifdef HAVE_PTHREADS
+#include <pthread.h>
+#endif
+
+#include <string>
+
 #include "array.h"
 #include "action.h"
 #include "log.h"
 
-#include <string>
-
 namespace gnash {
 
 // @@ TODO : implement as_array_object's unimplemented functions
Index: gnash/server/gnash.h
diff -u gnash/server/gnash.h:1.4 gnash/server/gnash.h:1.5
--- gnash/server/gnash.h:1.4    Fri Jan 27 00:54:38 2006
+++ gnash/server/gnash.h        Sat Jan 28 01:14:33 2006
@@ -47,987 +47,984 @@
 class tu_stringi;
 
 namespace gnash {
-       // Forward declarations.
-       struct action_buffer;
-       struct as_value;
-       struct bitmap_info;
-       struct character;
-       struct execute_tag;
-       struct font;
-       struct movie;
-       struct movie_interface;
-       struct render_handler;
-       struct resource;
-       struct rgba;
-       struct sound_handler;
-       struct stream;
+// Forward declarations.
+struct action_buffer;
+struct as_value;
+struct bitmap_info;
+struct character;
+struct execute_tag;
+struct font;
+struct movie;
+struct movie_interface;
+struct render_handler;
+struct resource;
+struct rgba;
+struct sound_handler;
+struct stream;
+
+///
+/// Log & error reporting control.
+///
+
+/// Supply a function pointer to receive log & error messages.
+void   register_log_callback(void (*callback)(bool error, const char* 
message));
+
+/// Control verbosity of action processing
+void   set_verbose_action(bool verbose);
+
+/// Control verbosity of SWF parsing
+void   set_verbose_parse(bool verbose);
+
+/// Set the render handler.  This is one of the first
+/// things you should do to initialise the player (assuming you
+/// want to display anything).
+void    set_render_handler(render_handler* s);
+
+/// Pass in a sound handler, so you can handle audio on behalf of
+/// gnash.  This is optional; if you don't set a handler, or set
+/// NULL, then sounds won't be played.
+///
+/// If you want sound support, you should set this at startup,
+/// before loading or playing any movies!
+void   set_sound_handler(sound_handler* s);
+
+/// You probably don't need this. (@@ make it private?)
+sound_handler* get_sound_handler();
+
+/// Signature of file opener callback function
+typedef tu_file* (*file_opener_callback)(const char* url_or_path);
+
+/// Register a callback to the host, for providing a file,
+/// given a "URL" (i.e. a path name).  This is the only means
+/// by which the gnash library accesses file data, for
+/// loading movies, cache files, and so on.
+///
+/// gnash will call this when it needs to open a file.
+///
+/// NOTE: the returned tu_file* will be delete'd by gnash
+/// when it is done using it.  Your file_opener_function may
+/// return NULL in case the requested file can't be opened.
+void   register_file_opener_callback(file_opener_callback opener);
+
+/// Signature of progress callback function
+typedef void (*progress_callback)(unsigned int loaded_bytes, unsigned int 
total_bytes);
+
+/// Register a callback for displaying SWF load progress.
+void   register_progress_callback(progress_callback progress_handle);
+
+/// Signature of fscommand callback function
+typedef void (*fscommand_callback)(movie_interface* movie, const char* 
command, const char* arg);
+
+/// ActionScripts embedded in a movie can use the built-in
+/// fscommand() function to send data back to the host
+/// application.  If you are interested in this data, register
+/// a handler, which will be called when the embedded scripts
+/// call fscommand().
+///
+/// The handler gets the movie_interface* that the script is
+/// embedded in, and the two string arguments passed by the
+/// script to fscommand().
+void   register_fscommand_callback(fscommand_callback handler);
+
+/// Use this to control how finely curves are subdivided.  1.0
+/// is the default; it's a pretty good value.  Larger values
+/// result in coarser, more angular curves with fewer vertices.
+void   set_curve_max_pixel_error(float pixel_error);
+float  get_curve_max_pixel_error();
+
+// Some helpers that may or may not be compiled into your
+// version of the library, depending on platform etc.
+render_handler*        create_render_handler_xbox();
+render_handler*        create_render_handler_ogl();
+sound_handler* create_sound_handler_sdl();
+
+
+/// For stuff that's tricky to keep track of w/r/t ownership & cleanup.
+struct ref_counted
+{
+       ref_counted();
+       virtual ~ref_counted();
+       void    add_ref() const;
+       void    drop_ref() const;
+       int     get_ref_count() const { return m_ref_count; }
+       weak_proxy*     get_weak_proxy() const;
+private:
+       mutable int     m_ref_count;
+       mutable weak_proxy*     m_weak_proxy;
+};
+
+struct font;
+struct character_def;
+struct sound_sample;
+
+/// An interface for casting to different types of resources.
+struct resource : public ref_counted
+{
+       virtual ~resource() {}
+       
+       // Override in derived classes that implement corresponding interfaces.
+       virtual font*   cast_to_font() { return 0; }
+       virtual character_def*  cast_to_character_def() { return 0; }
+       virtual sound_sample*   cast_to_sound_sample() { return 0; }
+};
+
+
+/// This is the base class for all ActionScript-able objects
+//
+// ("as_" stands for ActionScript).
+struct as_object_interface : public resource
+{
+       virtual ~as_object_interface() {}
+       
+       /// So that text_character's can return something reasonable.
+       virtual const char*     get_text_value() const { return 0; }
+       
+       /// Set a member of this ActionScript object
+       virtual void    set_member(const tu_stringi& name, const as_value& val) 
= 0;
+       
+       /// Get a member of this ActionScript object
+       virtual bool    get_member(const tu_stringi& name, as_value* val) = 0;
+       /// Convert this object to a movie
+       virtual movie*  to_movie() = 0;
+};
+
+
+/// For caching precomputed stuff.  Generally of
+/// interest to gnash_processor and programs like it.
+struct cache_options
+{
+       bool    m_include_font_bitmaps;
+       
+       cache_options()
+               :
+               m_include_font_bitmaps(true)
+               {
+               }
+};
+
+
+/// Immutable data representing the template of a movie element.
+//
+/// This is not really a public interface.  It's here so it
+/// can be mixed into movie_definition, movie_definition_sub,
+/// and sprite_definition, without using multiple inheritance.
+///
+struct character_def : public resource
+{
+private:
+       int     m_id;
+       
+public:
+       character_def()
+               :
+               m_id(-1)
+               {
+               }
        
-       ///
-       /// Log & error reporting control.
-       ///
+       virtual ~character_def() {}
        
-       /// Supply a function pointer to receive log & error messages.
-       void    register_log_callback(void (*callback)(bool error, const char* 
message));
+       virtual void    display(character* instance_info) {}
+       virtual bool    point_test_local(float x, float y) { return false; }
+       virtual float   get_height_local() { return 0.0f; }
+       virtual float   get_width_local() { return 0.0f; }
        
-       /// Control verbosity of action processing
-       void    set_verbose_action(bool verbose);
-
-       /// Control verbosity of SWF parsing
-       void    set_verbose_parse(bool verbose);
+       /// Should stick the result in a smart_ptr immediately.
+       virtual character*      create_character_instance(movie* parent, int 
id);       // default is to make a generic_character
        
-       /// Set the render handler.  This is one of the first
-       /// things you should do to initialise the player (assuming you
-       /// want to display anything).
-       void    set_render_handler(render_handler* s);
-
-       /// Pass in a sound handler, so you can handle audio on behalf of
-       /// gnash.  This is optional; if you don't set a handler, or set
-       /// NULL, then sounds won't be played.
-       ///
-       /// If you want sound support, you should set this at startup,
-       /// before loading or playing any movies!
-       void    set_sound_handler(sound_handler* s);
-
-       /// You probably don't need this. (@@ make it private?)
-       sound_handler*  get_sound_handler();
-
-       /// Signature of file opener callback function
-       typedef tu_file* (*file_opener_callback)(const char* url_or_path);
-
-       /// Register a callback to the host, for providing a file,
-       /// given a "URL" (i.e. a path name).  This is the only means
-       /// by which the gnash library accesses file data, for
-       /// loading movies, cache files, and so on.
-       ///
-       /// gnash will call this when it needs to open a file.
-       ///
-       /// NOTE: the returned tu_file* will be delete'd by gnash
-       /// when it is done using it.  Your file_opener_function may
-       /// return NULL in case the requested file can't be opened.
-       void    register_file_opener_callback(file_opener_callback opener);
-
-       /// Signature of progress callback function
-       typedef void (*progress_callback)(unsigned int loaded_bytes, unsigned 
int total_bytes);
-
-       /// Register a callback for displaying SWF load progress.
-       void    register_progress_callback(progress_callback progress_handle);
-
-       /// Signature of fscommand callback function
-       typedef void (*fscommand_callback)(movie_interface* movie, const char* 
command, const char* arg);
-
-       /// ActionScripts embedded in a movie can use the built-in
-       /// fscommand() function to send data back to the host
-       /// application.  If you are interested in this data, register
-       /// a handler, which will be called when the embedded scripts
-       /// call fscommand().
-       ///
-       /// The handler gets the movie_interface* that the script is
-       /// embedded in, and the two string arguments passed by the
-       /// script to fscommand().
-       void    register_fscommand_callback(fscommand_callback handler);
-
-       /// Use this to control how finely curves are subdivided.  1.0
-       /// is the default; it's a pretty good value.  Larger values
-       /// result in coarser, more angular curves with fewer vertices.
-       void    set_curve_max_pixel_error(float pixel_error);
-       float   get_curve_max_pixel_error();
-       
-       // Some helpers that may or may not be compiled into your
-       // version of the library, depending on platform etc.
-       render_handler* create_render_handler_xbox();
-       render_handler* create_render_handler_ogl();
-       sound_handler*  create_sound_handler_sdl();
-
-
-       /// For stuff that's tricky to keep track of w/r/t ownership & cleanup.
-       struct ref_counted
-       {
-               ref_counted();
-               virtual ~ref_counted();
-               void    add_ref() const;
-               void    drop_ref() const;
-               int     get_ref_count() const { return m_ref_count; }
-               weak_proxy*     get_weak_proxy() const;
-
-       private:
-               mutable int     m_ref_count;
-               mutable weak_proxy*     m_weak_proxy;
-       };
-
-
-       struct font;
-       struct character_def;
-       struct sound_sample;
+       // From resource interface.
+       virtual character_def*  cast_to_character_def() { return this; }
        
-       /// An interface for casting to different types of resources.
-       struct resource : public ref_counted
-       {
-               virtual ~resource() {}
-
-               // Override in derived classes that implement corresponding 
interfaces.
-               virtual font*   cast_to_font() { return 0; }
-               virtual character_def*  cast_to_character_def() { return 0; }
-               virtual sound_sample*   cast_to_sound_sample() { return 0; }
-       };
-
-
-       /// This is the base class for all ActionScript-able objects
        //
-       // ("as_" stands for ActionScript).
-       struct as_object_interface : public resource
-       {
-               virtual ~as_object_interface() {}
-
-               /// So that text_character's can return something reasonable.
-               virtual const char*     get_text_value() const { return 0; }
-
-               /// Set a member of this ActionScript object
-               virtual void    set_member(const tu_stringi& name, const 
as_value& val) = 0;
-
-               /// Get a member of this ActionScript object
-               virtual bool    get_member(const tu_stringi& name, as_value* 
val) = 0;
-               /// Convert this object to a movie
-               virtual movie*  to_movie() = 0;
-       };
-
-
-       /// For caching precomputed stuff.  Generally of
-       /// interest to gnash_processor and programs like it.
-       struct cache_options
-       {
-               bool    m_include_font_bitmaps;
-               
-               cache_options()
-                       :
-                       m_include_font_bitmaps(true)
-               {
-               }
-       };
-
-
-       /// Immutable data representing the template of a movie element.
+       // Caching.
        //
-       /// This is not really a public interface.  It's here so it
-       /// can be mixed into movie_definition, movie_definition_sub,
-       /// and sprite_definition, without using multiple inheritance.
-       ///
-       struct character_def : public resource
-       {
-       private:
-               int     m_id;
-               
-       public:
-               character_def()
-                       :
-                       m_id(-1)
-               {
-               }
-
-               virtual ~character_def() {}
-
-               virtual void    display(character* instance_info) {}
-               virtual bool    point_test_local(float x, float y) { return 
false; }
-               virtual float   get_height_local() { return 0.0f; }
-               virtual float   get_width_local() { return 0.0f; }
-
-               /// Should stick the result in a smart_ptr immediately.
-               virtual character*      create_character_instance(movie* 
parent, int id);       // default is to make a generic_character
-
-               // From resource interface.
-               virtual character_def*  cast_to_character_def() { return this; }
-
-               //
-               // Caching.
-               //
-
-               virtual void    output_cached_data(tu_file* out, const 
cache_options& options) {}
-               virtual void    input_cached_data(tu_file* in) {}
-       };
+       
+       virtual void    output_cached_data(tu_file* out, const cache_options& 
options) {}
+       virtual void    input_cached_data(tu_file* in) {}
+};
 
 
-       /// Client program's interface to the definition of a movie
-       //
-       /// (i.e. the shared constant source info).
+/// Client program's interface to the definition of a movie
+//
+/// (i.e. the shared constant source info).
+///
+struct movie_definition : public character_def
+{
+       virtual int     get_version() const = 0;
+       virtual float   get_width_pixels() const = 0;
+       virtual float   get_height_pixels() const = 0;
+       virtual int     get_frame_count() const = 0;
+       virtual float   get_frame_rate() const = 0;
+       
+       /// This calls add_ref() on the movie_interface internally.
+       /// Call drop_ref() on the movie_interface when you're done with it.
+       /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
+       virtual movie_interface*        create_instance() = 0;
+       
+       virtual void    output_cached_data(tu_file* out, const cache_options& 
options) = 0;
+       virtual void    input_cached_data(tu_file* in) = 0;
+       
+       /// Causes this movie def to generate texture-mapped
+       /// versions of all the fonts it owns.  This improves
+       /// speed and quality of text rendering.  The
+       /// texture-map data is serialized in the
+       /// output/input_cached_data() calls, so you can
+       /// preprocess this if you load cached data.
+       virtual void    generate_font_bitmaps() = 0;
+       
+       //
+       // (optional) API to support gnash::create_movie_no_recurse().
+       //
+       
+       /// Call visit_imported_movies() to retrieve a list of
+       /// names of movies imported into this movie.
+       /// visitor->visit() will be called back with the name
+       /// of each imported movie.
+       struct import_visitor
+       {
+               virtual void    visit(const char* imported_movie_filename) = 0;
+       };
+       virtual void    visit_imported_movies(import_visitor* visitor) = 0;
+       
+       /// Call this to resolve an import of the given movie.
+       /// Replaces the dummy placeholder with the real
+       /// movie_definition* given.
+       virtual void    resolve_import(const char* name, movie_definition* def) 
= 0;
+       
+       //
+       // (optional) API to support host-driven creation of textures.
+       //
+       // Create the movie using gnash::create_movie_no_recurse(..., 
DO_NOT_LOAD_BITMAPS),
+       // and then initialize each bitmap info via get_bitmap_info_count(), 
get_bitmap_info(),
+       // and bitmap_info::init_*_image() or your own subclassed API.
+       //
+       // E.g.:
+       //
+       // // During preprocessing:
+       // // This will create bitmap_info's using the rgba, rgb, alpha 
contructors.
+       // my_def = gnash::create_movie_no_recurse("myfile.swf", 
DO_LOAD_BITMAPS);
+       // int ct = my_def->get_bitmap_info_count();
+       // for (int i = 0; i < ct; i++)
+       // {
+       //      my_bitmap_info_subclass*        bi = NULL;
+       //      my_def->get_bitmap_info(i, (bitmap_info**) &bi);
+       //      
my_precomputed_textures.push_back(bi->m_my_internal_texture_reference);
+       // }
+       // // Save out my internal data.
+       // my_precomputed_textures->write_into_some_cache_stream(...);
+       //
+       // // Later, during run-time loading:
+       // my_precomputed_textures->read_from_some_cache_stream(...);
+       // // This will create blank bitmap_info's.
+       // my_def = gnash::create_movie_no_recurse("myfile.swf", 
DO_NOT_LOAD_BITMAPS);
+       // 
+       // // Push cached texture info into the movie's bitmap_info structs.
+       // int  ct = my_def->get_bitmap_info_count();
+       // for (int i = 0; i < ct; i++)
+       // {
+       //      my_bitmap_info_subclass*        bi = (my_bitmap_info_subclass*) 
my_def->get_bitmap_info(i);
+       //      bi->set_internal_texture_reference(my_precomputed_textures[i]);
+       // }
+       virtual int     get_bitmap_info_count() const = 0;
+       virtual bitmap_info*    get_bitmap_info(int i) const = 0;
+};
+
+
+/// An independent stateful live movie.
+//
+/// This is the client program's interface to an instance of a
+/// movie. 
+///
+struct movie_interface : public as_object_interface
+{
+       virtual movie_definition*       get_movie_definition() = 0;
+       
+       /// Frame counts in this API are 0-based (unlike ActionScript)
+       virtual int     get_current_frame() const = 0;
+       virtual bool    has_looped() const = 0;
+       
+       virtual void    restart() = 0;
+       virtual void    advance(float delta_time) = 0;
+       virtual void    goto_frame(int frame_number) = 0;
+       /// Returns true if labeled frame is found.
+       virtual bool    goto_labeled_frame(const char* label) = 0;
+       virtual void    display() = 0;
+       
+       enum play_state
+       {
+               PLAY,
+               STOP
+       };
+       
+       virtual void    set_play_state(play_state s) = 0;
+       virtual play_state      get_play_state() const = 0;
+       
+       virtual void    set_background_color(const rgba& bg_color) = 0;
+       
+       /// Set to 0 if you don't want the movie to render its
+       /// background at all.  1 == full opacity.
+       virtual void    set_background_alpha(float alpha) = 0;
+       virtual float   get_background_alpha() const = 0;
+       
+       /// move/scale the movie...
+       virtual void    set_display_viewport(int x0, int y0, int w, int h) = 0;
+       
+       /// Input.
+       virtual void    notify_mouse_state(int x, int y, int buttons) = 0;
+       
+       /// Set an ActionScript variable within this movie.
+       /// You can use this to set the value of text fields,
+       /// ordinary variables, or properties of characters
+       /// within the script.
+       ///
+       /// This version accepts UTF-8
+       virtual void    set_variable(const char* path_to_var, const char* 
new_value) = 0;
+       /// This version accepts UCS-2 or UCS-4, depending on sizeof(wchar_t)
+       virtual void    set_variable(const char* path_to_var, const wchar_t* 
new_value) = 0;
+       // @@ do we want versions that take a number?
+       
+       /// Get the value of an ActionScript variable.
+       ///
+       /// Value is ephemeral & not thread safe!!!  Use it or
+       /// copy it immediately.
+       ///
+       /// Returns UTF-8
+       virtual const char*     get_variable(const char* path_to_var) const = 0;
+       // @@ do we want a version that returns a number?
+       
+       /// ActionScript method call.  Return value points to a
+       /// static string buffer with the result; caller should
+       /// use the value immediately before making more calls
+       /// to gnash.  NOT THREAD SAFE!!!
+       /// 
+       /// method_name is the name of the method (possibly namespaced).
+       ///
+       /// method_arg_fmt is a printf-style declaration of
+       /// the method call, where the arguments are
+       /// represented by { %d, %s, %f, %ls }, followed by the
+       /// vararg list of actual arguments.
+       /// 
+       /// E.g.
+       ///
+       /// m->call_method("path.to.method_name", "%d, %s, %f", i, "hello", 
2.7f);
+       ///
+       /// The format args are a small subset of printf, namely:
+       ///
+       /// %d -- integer arg
+       /// %s -- 0-terminated char* string arg
+       /// %ls -- 0-terminated wchar_t* string arg
+       /// %f -- float/double arg
        ///
-       struct movie_definition : public character_def
-       {
-               virtual int     get_version() const = 0;
-               virtual float   get_width_pixels() const = 0;
-               virtual float   get_height_pixels() const = 0;
-               virtual int     get_frame_count() const = 0;
-               virtual float   get_frame_rate() const = 0;
-
-               /// This calls add_ref() on the movie_interface internally.
-               /// Call drop_ref() on the movie_interface when you're done 
with it.
-               /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
-               virtual movie_interface*        create_instance() = 0;
-
-               virtual void    output_cached_data(tu_file* out, const 
cache_options& options) = 0;
-               virtual void    input_cached_data(tu_file* in) = 0;
-
-               /// Causes this movie def to generate texture-mapped
-               /// versions of all the fonts it owns.  This improves
-               /// speed and quality of text rendering.  The
-               /// texture-map data is serialized in the
-               /// output/input_cached_data() calls, so you can
-               /// preprocess this if you load cached data.
-               virtual void    generate_font_bitmaps() = 0;
-
-               //
-               // (optional) API to support gnash::create_movie_no_recurse().
-               //
-
-               /// Call visit_imported_movies() to retrieve a list of
-               /// names of movies imported into this movie.
-               /// visitor->visit() will be called back with the name
-               /// of each imported movie.
-               struct import_visitor
-               {
-                       virtual void    visit(const char* 
imported_movie_filename) = 0;
-               };
-               virtual void    visit_imported_movies(import_visitor* visitor) 
= 0;
-
-               /// Call this to resolve an import of the given movie.
-               /// Replaces the dummy placeholder with the real
-               /// movie_definition* given.
-               virtual void    resolve_import(const char* name, 
movie_definition* def) = 0;
-
-               //
-               // (optional) API to support host-driven creation of textures.
-               //
-               // Create the movie using gnash::create_movie_no_recurse(..., 
DO_NOT_LOAD_BITMAPS),
-               // and then initialize each bitmap info via 
get_bitmap_info_count(), get_bitmap_info(),
-               // and bitmap_info::init_*_image() or your own subclassed API.
-               //
-               // E.g.:
-               //
-               // // During preprocessing:
-               // // This will create bitmap_info's using the rgba, rgb, alpha 
contructors.
-               // my_def = gnash::create_movie_no_recurse("myfile.swf", 
DO_LOAD_BITMAPS);
-               // int ct = my_def->get_bitmap_info_count();
-               // for (int i = 0; i < ct; i++)
-               // {
-               //      my_bitmap_info_subclass*        bi = NULL;
-               //      my_def->get_bitmap_info(i, (bitmap_info**) &bi);
-               //      
my_precomputed_textures.push_back(bi->m_my_internal_texture_reference);
-               // }
-               // // Save out my internal data.
-               // my_precomputed_textures->write_into_some_cache_stream(...);
-               //
-               // // Later, during run-time loading:
-               // my_precomputed_textures->read_from_some_cache_stream(...);
-               // // This will create blank bitmap_info's.
-               // my_def = gnash::create_movie_no_recurse("myfile.swf", 
DO_NOT_LOAD_BITMAPS);
-               // 
-               // // Push cached texture info into the movie's bitmap_info 
structs.
-               // int  ct = my_def->get_bitmap_info_count();
-               // for (int i = 0; i < ct; i++)
-               // {
-               //      my_bitmap_info_subclass*        bi = 
(my_bitmap_info_subclass*) my_def->get_bitmap_info(i);
-               //      
bi->set_internal_texture_reference(my_precomputed_textures[i]);
-               // }
-               virtual int     get_bitmap_info_count() const = 0;
-               virtual bitmap_info*    get_bitmap_info(int i) const = 0;
-       };
-
-
-       /// An independent stateful live movie.
-       //
-       /// This is the client program's interface to an instance of a
-       /// movie. 
+       /// Whitespace and commas in the format string are ignored.
        ///
-       struct movie_interface : public as_object_interface
-       {
-               virtual movie_definition*       get_movie_definition() = 0;
-
-               /// Frame counts in this API are 0-based (unlike ActionScript)
-               virtual int     get_current_frame() const = 0;
-               virtual bool    has_looped() const = 0;
-               
-               virtual void    restart() = 0;
-               virtual void    advance(float delta_time) = 0;
-               virtual void    goto_frame(int frame_number) = 0;
-               /// Returns true if labeled frame is found.
-               virtual bool    goto_labeled_frame(const char* label) = 0;
-               virtual void    display() = 0;
-
-               enum play_state
-               {
-                       PLAY,
-                       STOP
-               };
-
-               virtual void    set_play_state(play_state s) = 0;
-               virtual play_state      get_play_state() const = 0;
-               
-               virtual void    set_background_color(const rgba& bg_color) = 0;
-
-               /// Set to 0 if you don't want the movie to render its
-               /// background at all.  1 == full opacity.
-               virtual void    set_background_alpha(float alpha) = 0;
-               virtual float   get_background_alpha() const = 0;
-               
-               /// move/scale the movie...
-               virtual void    set_display_viewport(int x0, int y0, int w, int 
h) = 0;
-               
-               /// Input.
-               virtual void    notify_mouse_state(int x, int y, int buttons) = 
0;
-               
-               /// Set an ActionScript variable within this movie.
-               /// You can use this to set the value of text fields,
-               /// ordinary variables, or properties of characters
-               /// within the script.
-               ///
-               /// This version accepts UTF-8
-               virtual void    set_variable(const char* path_to_var, const 
char* new_value) = 0;
-               /// This version accepts UCS-2 or UCS-4, depending on 
sizeof(wchar_t)
-               virtual void    set_variable(const char* path_to_var, const 
wchar_t* new_value) = 0;
-               // @@ do we want versions that take a number?
-
-               /// Get the value of an ActionScript variable.
-               ///
-               /// Value is ephemeral & not thread safe!!!  Use it or
-               /// copy it immediately.
-               ///
-               /// Returns UTF-8
-               virtual const char*     get_variable(const char* path_to_var) 
const = 0;
-               // @@ do we want a version that returns a number?
-
-               /// ActionScript method call.  Return value points to a
-               /// static string buffer with the result; caller should
-               /// use the value immediately before making more calls
-               /// to gnash.  NOT THREAD SAFE!!!
-               /// 
-               /// method_name is the name of the method (possibly namespaced).
-               ///
-               /// method_arg_fmt is a printf-style declaration of
-               /// the method call, where the arguments are
-               /// represented by { %d, %s, %f, %ls }, followed by the
-               /// vararg list of actual arguments.
-               /// 
-               /// E.g.
-               ///
-               /// m->call_method("path.to.method_name", "%d, %s, %f", i, 
"hello", 2.7f);
-               ///
-               /// The format args are a small subset of printf, namely:
-               ///
-               /// %d -- integer arg
-               /// %s -- 0-terminated char* string arg
-               /// %ls -- 0-terminated wchar_t* string arg
-               /// %f -- float/double arg
-               ///
-               /// Whitespace and commas in the format string are ignored.
-               ///
-               /// This is not an ActionScript language parser, it
-               /// doesn't recognize expressions or anything tricky.
+       /// This is not an ActionScript language parser, it
+       /// doesn't recognize expressions or anything tricky.
 #ifdef __GNUC__
-               // use the following to catch errors: (only with gcc)
-               virtual const char*     call_method(const char* method_name, 
const char* method_arg_fmt, ...)
-                       __attribute__((format (printf, 3, 4))) = 0;     // 
"this" is an implied param, so fmt is 3 and ... is 4!
+       // use the following to catch errors: (only with gcc)
+       virtual const char*     call_method(const char* method_name, const 
char* method_arg_fmt, ...)
+               __attribute__((format (printf, 3, 4))) = 0;     // "this" is an 
implied param, so fmt is 3 and ... is 4!
 #else  // not __GNUC__
-               virtual const char*     call_method(const char* method_name, 
const char* method_arg_fmt, ...) = 0;
+       virtual const char*     call_method(const char* method_name, const 
char* method_arg_fmt, ...) = 0;
 #endif // not __GNUC__
-               virtual const char*     call_method_args(const char* 
method_name, const char* method_arg_fmt, va_list args) = 0;
-
-
-               /// Make the movie visible/invisible. 
-               //
-               /// An invisible
-               /// movie does not advance and does not render.
-               virtual void    set_visible(bool visible) = 0;
-
-               /// Return visibility status.
-               virtual bool    get_visible() const = 0;
-
-               /// Get userdata, that's useful for the fs_command handler.
-               virtual void   *get_userdata() = 0;
-
-               /// Set userdata, that's useful for the fs_command handler.
-               virtual void   set_userdata(void *) = 0;
-
-               /// Display callbacks, for client rendering. 
-               //
-               /// Callback is called after rendering the object
-               /// it's attached to.
-               ///
-               /// Attach NULL to disable the callback.
-               virtual void    attach_display_callback(const char* 
path_to_object, void (*callback)(void* user_ptr), void* user_ptr) = 0;
-
-               virtual int add_interval_timer(void *timer) = 0;
-               virtual void clear_interval_timer(int x) = 0;
-
-               /// for external movies
-               virtual movie*  get_root_movie() = 0;
-       };
-
-       /// Try to grab movie info from the header of the given .swf
-       /// file.
-       ///
-       /// Sets *version to 0 if info can't be extracted.
-       ///
-       /// You can pass NULL for any entries you're not interested in.
-       void    get_movie_info(
-               const char*     filename,
-               int*            version,
-               int*            width,
-               int*            height,
-               float*          frames_per_second,
-               int*            frame_count,
-               int*            tag_count
-               );
-
-       /// Enable/disable attempts to read cache files (.gsc) when
-       /// loading movies.
-       void    set_use_cache_files(bool use_cache);
-       
-       /// @@ Hm, need to think about these creation API's.  Perhaps
-       /// divide it into "low level" and "high level" calls.  Also,
-       /// perhaps we need a "context" object that contains all
-       /// global-ish flags, libraries, callback pointers, font
-       /// library, etc.
-       ///
-       /// Create a gnash::movie_definition from the given file name.
-       /// Normally, will also try to load any cached data file
-       /// (".gsc") that corresponds to the given movie file.  This
-       /// will still work even if there is no cache file.  You can
-       /// disable the attempts to load cache files by calling
-       /// gnash::use_cache_files(false).
-       ///
-       /// Uses the registered file-opener callback to read the files
-       /// themselves.
-       ///
-       /// This calls add_ref() on the newly created definition; call
-       /// drop_ref() when you're done with it.
-       /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
-       movie_definition*       create_movie(const char* filename);
-
-       /// Creates the movie from the given input stream.  Only reads
-       /// from the given stream; does not open files.  If the movie
-       /// imports resources from other movies, the created movie
-       /// inserts proxy stubs in place of those resources.  The list
-       /// of imported movie filenames can be retrieved with
-       /// movie_definition::visit_imported_movies().  The proxies can
-       /// be replaced with actual movie_definition's via
-       /// movie_definition::resolve_proxy(name,def).
-       ///
-       /// Use DO_NOT_LOAD_BITMAPS if you have pre-processed bitmaps
-       /// stored externally somewhere, and you plan to install them
-       /// via get_bitmap_info()->...
-       enum create_bitmaps_flag
-       {
-               DO_LOAD_BITMAPS,
-               DO_NOT_LOAD_BITMAPS
-       };
-
-       /// Use DO_NOT_LOAD_FONT_SHAPES if you know you have
-       /// precomputed texture glyphs (in cached data) and you know
-       /// you always want to render text using texture glyphs.
-       enum create_font_shapes_flag
-       {
-               DO_LOAD_FONT_SHAPES,
-               DO_NOT_LOAD_FONT_SHAPES
-       };
-
-       movie_definition*       create_movie_no_recurse(
-               tu_file*                input_stream,
-               create_bitmaps_flag     cbf,
-               create_font_shapes_flag cfs);
-
-       /// \brief
-       /// Create a gnash::movie_definition from the given file name.
-       ///
-       /// This is just like create_movie(), except that it checks the
-       /// "library" to see if a movie of this name has already been
-       /// created, and returns that movie if so.  Also, if it creates
-       /// a new movie, it adds it back into the library.
-       ///
-       /// The "library" is used when importing symbols from external
-       /// movies, so this call might be useful if you want to
-       /// explicitly load a movie that you know exports symbols
-       /// (e.g. fonts) to other movies as well.
-       ///
-       /// @@ this explanation/functionality could be clearer!
-       ///
-       /// This calls add_ref() on the newly created definition; call
-       /// drop_ref() when you're done with it.
-       /// Or use smart_ptr<T> from base/smart_ptr.h if you want.
-       movie_definition*       create_library_movie(const char* filename);
-       
-
-       /// Helper to pregenerate cached data (basically, shape
-       /// tesselations).  Does this by running through each frame of
-       /// the movie and displaying the shapes with a null renderer.
-       /// The pregenerated data is stored in the movie_definition
-       /// object itself, and is included with the cached data written
-       /// by movie_definition::output_cached_data().
-       ///
-       /// Note that this tesselates shapes to the resolution they
-       /// explicitly appear in the linear frames of the movie.  Does
-       /// not try very hard to run your ActionScript to account for
-       /// dynamic scaling (that's more or less futile anyway due to
-       /// the halting problem).
-       void    precompute_cached_data(movie_definition* movie_def);
-
-       /// Maximum release of resources.  Calls clear_library() and
-       /// fontlib::clear(), and also clears some extra internal stuff
-       /// that may have been allocated (e.g. global ActionScript
-       /// objects).  This should get all gnash structures off the
-       /// heap, with the exception of any objects that are still
-       /// referenced by the host program and haven't had drop_ref()
-       /// called on them.
-       void    clear();
-
-
-       //
-       // Library management
-       //
-       
-       /// Release any library movies we've cached.  Do this when you want
-       /// maximum cleanup.
-       void    clear_library();
-       
-       //
-       // Font library control.  gnash is able to substitute fonts
-       // from the font library, in case a movie lacks glyphs for a
-       // declared font.  This would come into play since in recent
-       // versions of SWF, the movie is allowed to use "system
-       // fonts".  E.g. it can declare a font named "Arial", but not
-       // provide glyphs for it, and then the OS is expected to
-       // provide the font or a suitable replacement.
-       //
-       // gnash does not try to handle this automatically; if your
-       // host program wants to emulate this behavior, it needs to
-       // load a movie that includes glyph info for the standard
-       // fonts you want, and then explicitly pull those fonts out of
-       // the movie_def and add them to fontlib.
-       //
-       // @@ TODO: not all public APIs to enable this are in place
-       // yet!  Need md::get_font_count()/get_font(), and
-       // fontlib::add_font().
-       //
-       // Otherwise, text written in a font with no glyphs just
-       // doesn't render at all.  (@@ Hm, should probably render it
-       // as boxes or something?)
-
-       struct font;
-       namespace fontlib
-       {
-               // Controls how large to render textured glyphs.
-               // Applies to fonts processed *after* this call only.
-               // The "nominal" size is perhaps around twice the
-               // average glyph height.
-               void    set_nominal_glyph_pixel_size(int pixel_size);
-
-               // For accessing the fonts in the library.
-               void    clear();
-               int     get_font_count();
-               font*   get_font(int index);
-               font*   get_font(const char* name);
-               const char*     get_font_name(const font* f);
-               
-               // @@ also need to add color controls (or just set the diffuse 
color
-               // in the API?), perhaps matrix xform, and maybe spacing, etc.
-               //
-               // // For direct text rendering from the host app.
-               void    draw_string(const font* f, float x, float y, float 
size, const char* text);
-               // void draw_string(const font* f, float x, float y, float 
size, const wchar_t* text);  // wide-char version
-       }
+       virtual const char*     call_method_args(const char* method_name, const 
char* method_arg_fmt, va_list args) = 0;
        
        
+       /// Make the movie visible/invisible. 
        //
-       // Sound callback handler.
-       //
-       
-       // You may define a subclass of this, and pass an instance to
-       // set_sound_handler().
-       struct sound_handler
-       {
-               enum format_type
-               {
-                       FORMAT_RAW = 0,         // unspecified format.  Useful 
for 8-bit sounds???
-                       FORMAT_ADPCM = 1,       // gnash doesn't pass this 
through; it uncompresses and sends FORMAT_NATIVE16
-                       FORMAT_MP3 = 2,
-                       FORMAT_UNCOMPRESSED = 3,        // 16 bits/sample, 
little-endian
-                       FORMAT_NELLYMOSER = 6,  // Mystery proprietary format; 
see nellymoser.com
+       /// An invisible
+       /// movie does not advance and does not render.
+       virtual void    set_visible(bool visible) = 0;
+       
+       /// Return visibility status.
+       virtual bool    get_visible() const = 0;
+       
+       /// Get userdata, that's useful for the fs_command handler.
+       virtual void   *get_userdata() = 0;
+       
+       /// Set userdata, that's useful for the fs_command handler.
+       virtual void   set_userdata(void *) = 0;
+       
+       /// Display callbacks, for client rendering. 
+       //
+       /// Callback is called after rendering the object
+       /// it's attached to.
+       ///
+       /// Attach NULL to disable the callback.
+       virtual void    attach_display_callback(const char* path_to_object, 
void (*callback)(void* user_ptr), void* user_ptr) = 0;
+
+       virtual int add_interval_timer(void *timer) = 0;
+       virtual void clear_interval_timer(int x) = 0;
+
+       /// for external movies
+       virtual movie*  get_root_movie() = 0;
+};
+
+/// Try to grab movie info from the header of the given .swf
+/// file.
+///
+/// Sets *version to 0 if info can't be extracted.
+///
+/// You can pass NULL for any entries you're not interested in.
+void   get_movie_info(
+       const char*     filename,
+       int*            version,
+       int*            width,
+       int*            height,
+       float*          frames_per_second,
+       int*            frame_count,
+       int*            tag_count
+       );
+
+/// Enable/disable attempts to read cache files (.gsc) when
+/// loading movies.
+void   set_use_cache_files(bool use_cache);
+       
+/// @@ Hm, need to think about these creation API's.  Perhaps
+/// divide it into "low level" and "high level" calls.  Also,
+/// perhaps we need a "context" object that contains all
+/// global-ish flags, libraries, callback pointers, font
+/// library, etc.
+///
+/// Create a gnash::movie_definition from the given file name.
+/// Normally, will also try to load any cached data file
+/// (".gsc") that corresponds to the given movie file.  This
+/// will still work even if there is no cache file.  You can
+/// disable the attempts to load cache files by calling
+/// gnash::use_cache_files(false).
+///
+/// Uses the registered file-opener callback to read the files
+/// themselves.
+///
+/// This calls add_ref() on the newly created definition; call
+/// drop_ref() when you're done with it.
+/// Or use smart_ptr<T> from base/smart_ptr.h if you want.
+movie_definition*      create_movie(const char* filename);
+
+/// Creates the movie from the given input stream.  Only reads
+/// from the given stream; does not open files.  If the movie
+/// imports resources from other movies, the created movie
+/// inserts proxy stubs in place of those resources.  The list
+/// of imported movie filenames can be retrieved with
+/// movie_definition::visit_imported_movies().  The proxies can
+/// be replaced with actual movie_definition's via
+/// movie_definition::resolve_proxy(name,def).
+///
+/// Use DO_NOT_LOAD_BITMAPS if you have pre-processed bitmaps
+/// stored externally somewhere, and you plan to install them
+/// via get_bitmap_info()->...
+enum create_bitmaps_flag
+{
+       DO_LOAD_BITMAPS,
+       DO_NOT_LOAD_BITMAPS
+};
+
+/// Use DO_NOT_LOAD_FONT_SHAPES if you know you have
+/// precomputed texture glyphs (in cached data) and you know
+/// you always want to render text using texture glyphs.
+enum create_font_shapes_flag
+{
+       DO_LOAD_FONT_SHAPES,
+       DO_NOT_LOAD_FONT_SHAPES
+};
+
+movie_definition*      create_movie_no_recurse(
+       tu_file*                input_stream,
+       create_bitmaps_flag     cbf,
+       create_font_shapes_flag cfs);
+
+/// \brief
+/// Create a gnash::movie_definition from the given file name.
+///
+/// This is just like create_movie(), except that it checks the
+/// "library" to see if a movie of this name has already been
+/// created, and returns that movie if so.  Also, if it creates
+/// a new movie, it adds it back into the library.
+///
+/// The "library" is used when importing symbols from external
+/// movies, so this call might be useful if you want to
+/// explicitly load a movie that you know exports symbols
+/// (e.g. fonts) to other movies as well.
+///
+/// @@ this explanation/functionality could be clearer!
+///
+/// This calls add_ref() on the newly created definition; call
+/// drop_ref() when you're done with it.
+/// Or use smart_ptr<T> from base/smart_ptr.h if you want.
+movie_definition*      create_library_movie(const char* filename);
+       
+
+/// Helper to pregenerate cached data (basically, shape
+/// tesselations).  Does this by running through each frame of
+/// the movie and displaying the shapes with a null renderer.
+/// The pregenerated data is stored in the movie_definition
+/// object itself, and is included with the cached data written
+/// by movie_definition::output_cached_data().
+///
+/// Note that this tesselates shapes to the resolution they
+/// explicitly appear in the linear frames of the movie.  Does
+/// not try very hard to run your ActionScript to account for
+/// dynamic scaling (that's more or less futile anyway due to
+/// the halting problem).
+void   precompute_cached_data(movie_definition* movie_def);
+
+/// Maximum release of resources.  Calls clear_library() and
+/// fontlib::clear(), and also clears some extra internal stuff
+/// that may have been allocated (e.g. global ActionScript
+/// objects).  This should get all gnash structures off the
+/// heap, with the exception of any objects that are still
+/// referenced by the host program and haven't had drop_ref()
+/// called on them.
+void   clear();
+
+//
+// Library management
+//
+       
+/// Release any library movies we've cached.  Do this when you want
+/// maximum cleanup.
+void   clear_library();
+       
+//
+// Font library control.  gnash is able to substitute fonts
+// from the font library, in case a movie lacks glyphs for a
+// declared font.  This would come into play since in recent
+// versions of SWF, the movie is allowed to use "system
+// fonts".  E.g. it can declare a font named "Arial", but not
+// provide glyphs for it, and then the OS is expected to
+// provide the font or a suitable replacement.
+//
+// gnash does not try to handle this automatically; if your
+// host program wants to emulate this behavior, it needs to
+// load a movie that includes glyph info for the standard
+// fonts you want, and then explicitly pull those fonts out of
+// the movie_def and add them to fontlib.
+//
+// @@ TODO: not all public APIs to enable this are in place
+// yet!  Need md::get_font_count()/get_font(), and
+// fontlib::add_font().
+//
+// Otherwise, text written in a font with no glyphs just
+// doesn't render at all.  (@@ Hm, should probably render it
+// as boxes or something?)
+
+struct font;
+namespace fontlib
+{
+// Controls how large to render textured glyphs.
+// Applies to fonts processed *after* this call only.
+// The "nominal" size is perhaps around twice the
+// average glyph height.
+void   set_nominal_glyph_pixel_size(int pixel_size);
+
+// For accessing the fonts in the library.
+void   clear();
+int    get_font_count();
+font*  get_font(int index);
+font*  get_font(const char* name);
+const char*    get_font_name(const font* f);
+
+// @@ also need to add color controls (or just set the diffuse color
+// in the API?), perhaps matrix xform, and maybe spacing, etc.
+//
+// // For direct text rendering from the host app.
+void   draw_string(const font* f, float x, float y, float size, const char* 
text);
+// void        draw_string(const font* f, float x, float y, float size, const 
wchar_t* text);  // wide-char version
+}
+       
+       
+//
+// Sound callback handler.
+//
+       
+// You may define a subclass of this, and pass an instance to
+// set_sound_handler().
+struct sound_handler
+{
+       enum format_type
+       {
+               FORMAT_RAW = 0,         // unspecified format.  Useful for 
8-bit sounds???
+               FORMAT_ADPCM = 1,       // gnash doesn't pass this through; it 
uncompresses and sends FORMAT_NATIVE16
+               FORMAT_MP3 = 2,
+               FORMAT_UNCOMPRESSED = 3,        // 16 bits/sample, little-endian
+               FORMAT_NELLYMOSER = 6,  // Mystery proprietary format; see 
nellymoser.com
                                
-                       // gnash tries to convert data to this format when 
possible:
-                       FORMAT_NATIVE16 = 7     // gnash extension: 16 
bits/sample, native-endian
-               };
-               // If stereo is true, samples are interleaved w/ left sample 
first.
-               
-               // gnash calls at load-time with sound data, to be
-               // played later.  You should create a sample with the
-               // data, and return a handle that can be used to play
-               // it later.  If the data is in a format you can't
-               // deal with, then you can return 0 (for example), and
-               // then ignore 0's in play_sound() and delete_sound().
-               //
-               // Assign handles however you like.
-               virtual int     create_sound(
-                       void*           data,
-                       int             data_bytes,
-                       int             sample_count,
-                       format_type     format,
-                       int             sample_rate,    /* one of 5512, 11025, 
22050, 44100 */
-                       bool            stereo
-                       ) = 0;
-               
-               // gnash calls this when it wants you to play the defined sound.
-               //
-               // loop_count == 0 means play the sound once (1 means play it 
twice, etc)
-               virtual void    play_sound(int sound_handle, int loop_count /* 
, volume, pan, etc? */) = 0;
-               
-               // Stop the specified sound if it's playing.
-               // (Normally a full-featured sound API would take a
-               // handle specifying the *instance* of a playing
-               // sample, but SWF is not expressive that way.)
-               virtual void    stop_sound(int sound_handle) = 0;
-               
-               // gnash calls this when it's done with a particular sound.
-               virtual void    delete_sound(int sound_handle) = 0;
-               
-               virtual ~sound_handler() {};
+               // gnash tries to convert data to this format when possible:
+               FORMAT_NATIVE16 = 7     // gnash extension: 16 bits/sample, 
native-endian
        };
+       // If stereo is true, samples are interleaved w/ left sample first.
        
+       // gnash calls at load-time with sound data, to be
+       // played later.  You should create a sample with the
+       // data, and return a handle that can be used to play
+       // it later.  If the data is in a format you can't
+       // deal with, then you can return 0 (for example), and
+       // then ignore 0's in play_sound() and delete_sound().
+       //
+       // Assign handles however you like.
+       virtual int     create_sound(
+               void*           data,
+               int             data_bytes,
+               int             sample_count,
+               format_type     format,
+               int             sample_rate,    /* one of 5512, 11025, 22050, 
44100 */
+               bool            stereo
+               ) = 0;
+               
+       // gnash calls this when it wants you to play the defined sound.
+       //
+       // loop_count == 0 means play the sound once (1 means play it twice, 
etc)
+       virtual void    play_sound(int sound_handle, int loop_count /* , 
volume, pan, etc? */) = 0;
+               
+       // Stop the specified sound if it's playing.
+       // (Normally a full-featured sound API would take a
+       // handle specifying the *instance* of a playing
+       // sample, but SWF is not expressive that way.)
+       virtual void    stop_sound(int sound_handle) = 0;
+               
+       // gnash calls this when it's done with a particular sound.
+       virtual void    delete_sound(int sound_handle) = 0;
+               
+       virtual ~sound_handler() {};
+};
+       
+
+//
+// matrix type, used by render handler
+//
+
+struct point;
+struct matrix
+{
+       float   m_[2][3];
+       
+       static matrix   identity;
+       
+       matrix();
+       bool    is_valid() const;
+       void    set_identity();
+       void    concatenate(const matrix& m);
+       void    concatenate_translation(float tx, float ty);
+       void    concatenate_scale(float s);
+       void    set_lerp(const matrix& m1, const matrix& m2, float t);
+       void    set_scale_rotation(float x_scale, float y_scale, float 
rotation);
+       void    read(stream* in);
+       void    print() const;
+       void    transform(point* result, const point& p) const;
+       void    transform_vector(point* result, const point& p) const;
+       void    transform_by_inverse(point* result, const point& p) const;
+       void    set_inverse(const matrix& m);
+       bool    does_flip() const;      // return true if we flip handedness
+       float   get_determinant() const;        // determinant of the 2x2 
rotation/scale part only
+       float   get_max_scale() const;  // return the maximum scale factor that 
this transform applies
+       float   get_x_scale() const;    // return the magnitude scale of our x 
coord output
+       float   get_y_scale() const;    // return the magnitude scale of our y 
coord output
+       float   get_rotation() const;   // return our rotation component (in 
radians)
+};
+
+
+//
+// point: used by rect which is used by render_handler (otherwise would be in 
internal gnash_types.h)
+//
+
+
+struct point
+{
+       float   m_x, m_y;
 
-       //
-       // matrix type, used by render handler
-       //
+       point() : m_x(0), m_y(0) {}
+       point(float x, float y) : m_x(x), m_y(y) {}
 
-       struct point;
-       struct matrix
-       {
-               float   m_[2][3];
-
-               static matrix   identity;
-
-               matrix();
-               bool    is_valid() const;
-               void    set_identity();
-               void    concatenate(const matrix& m);
-               void    concatenate_translation(float tx, float ty);
-               void    concatenate_scale(float s);
-               void    set_lerp(const matrix& m1, const matrix& m2, float t);
-               void    set_scale_rotation(float x_scale, float y_scale, float 
rotation);
-               void    read(stream* in);
-               void    print() const;
-               void    transform(point* result, const point& p) const;
-               void    transform_vector(point* result, const point& p) const;
-               void    transform_by_inverse(point* result, const point& p) 
const;
-               void    set_inverse(const matrix& m);
-               bool    does_flip() const;      // return true if we flip 
handedness
-               float   get_determinant() const;        // determinant of the 
2x2 rotation/scale part only
-               float   get_max_scale() const;  // return the maximum scale 
factor that this transform applies
-               float   get_x_scale() const;    // return the magnitude scale 
of our x coord output
-               float   get_y_scale() const;    // return the magnitude scale 
of our y coord output
-               float   get_rotation() const;   // return our rotation 
component (in radians)
-       };
-
-
-       //
-       // point: used by rect which is used by render_handler (otherwise would 
be in internal gnash_types.h)
-       //
-
-
-       struct point
-       {
-               float   m_x, m_y;
-
-               point() : m_x(0), m_y(0) {}
-               point(float x, float y) : m_x(x), m_y(y) {}
-
-               void    set_lerp(const point& a, const point& b, float t)
+       void    set_lerp(const point& a, const point& b, float t)
                // Set to a + (b - a) * t
                {
                        m_x = a.m_x + (b.m_x - a.m_x) * t;
                        m_y = a.m_y + (b.m_y - a.m_y) * t;
                }
 
-               bool operator==(const point& p) const { return m_x == p.m_x && 
m_y == p.m_y; }
+       bool operator==(const point& p) const { return m_x == p.m_x && m_y == 
p.m_y; }
 
-               bool    bitwise_equal(const point& p) const;
-       };
+       bool    bitwise_equal(const point& p) const;
+};
 
 
-       //
-       // rect: rectangle type, used by render handler
-       //
+//
+// rect: rectangle type, used by render handler
+//
 
 
-       struct rect
-       {
-               float   m_x_min, m_x_max, m_y_min, m_y_max;
+struct rect
+{
+       float   m_x_min, m_x_max, m_y_min, m_y_max;
 
-               void    read(stream* in);
-               void    print() const;
-               bool    point_test(float x, float y) const;
-               void    expand_to_point(float x, float y);
-               float   width() const { return m_x_max-m_x_min; }
-               float   height() const { return m_y_max-m_y_min; }
+       void    read(stream* in);
+       void    print() const;
+       bool    point_test(float x, float y) const;
+       void    expand_to_point(float x, float y);
+       float   width() const { return m_x_max-m_x_min; }
+       float   height() const { return m_y_max-m_y_min; }
 
-               point   get_corner(int i) const;
+       point   get_corner(int i) const;
 
-               void    enclose_transformed_rect(const matrix& m, const rect& 
r);
+       void    enclose_transformed_rect(const matrix& m, const rect& r);
 
-               void    set_lerp(const rect& a, const rect& b, float t);
-       };
+       void    set_lerp(const rect& a, const rect& b, float t);
+};
 
 
-       //
-       // cxform: color transform type, used by render handler
-       //
-       struct cxform
-       {
-               float   m_[4][2];       // [RGBA][mult, add]
+//
+// cxform: color transform type, used by render handler
+//
+struct cxform
+{
+       float   m_[4][2];       // [RGBA][mult, add]
 
-               cxform();
-               void    concatenate(const cxform& c);
-               rgba    transform(const rgba in) const;
-               void    read_rgb(stream* in);
-               void    read_rgba(stream* in);
-               void    print() const;
+       cxform();
+       void    concatenate(const cxform& c);
+       rgba    transform(const rgba in) const;
+       void    read_rgb(stream* in);
+       void    read_rgba(stream* in);
+       void    print() const;
 
-               static cxform   identity;
-       };
+       static cxform   identity;
+};
 
 
-       //
-       // texture and render callback handler.
-       //
+//
+// texture and render callback handler.
+//
 
-       // Your render_handler creates bitmap_info's for gnash.  You
-       // need to subclass bitmap_info in order to add the
-       // information and functionality your app needs to render
-       // using textures.
-       struct bitmap_info : public ref_counted
-       {
-               unsigned int    m_texture_id;           // nuke?
-               int             m_original_width;       // nuke?
-               int             m_original_height;      // nuke?
-               
-               bitmap_info()
-                       :
-                       m_texture_id(0),
-                       m_original_width(0),
-                       m_original_height(0)
+// Your render_handler creates bitmap_info's for gnash.  You
+// need to subclass bitmap_info in order to add the
+// information and functionality your app needs to render
+// using textures.
+struct bitmap_info : public ref_counted
+{
+       unsigned int    m_texture_id;           // nuke?
+       int             m_original_width;       // nuke?
+       int             m_original_height;      // nuke?
+               
+       bitmap_info()
+               :
+               m_texture_id(0),
+               m_original_width(0),
+               m_original_height(0)
                {
                }
-       };
+};
        
-       // You must define a subclass of render_handler, and pass an
-       // instance to set_render_handler().
-       struct render_handler
-       {
-               virtual ~render_handler() {}
-
-               // Your handler should return these with a ref-count of 0.  (@@ 
is that the right policy?)
-               virtual bitmap_info*    create_bitmap_info_empty() = 0; // used 
when DO_NOT_LOAD_BITMAPS is set
-               virtual bitmap_info*    create_bitmap_info_alpha(int w, int h, 
unsigned char* data) = 0;
-               virtual bitmap_info*    create_bitmap_info_rgb(image::rgb* im) 
= 0;
-               virtual bitmap_info*    create_bitmap_info_rgba(image::rgba* 
im) = 0;
-
-               virtual void    delete_bitmap_info(bitmap_info* bi) = 0;
-               
-               // Bracket the displaying of a frame from a movie.
-               // Fill the background color, and set up default
-               // transforms, etc.
-               virtual void    begin_display(
-                       rgba background_color,
-                       int viewport_x0, int viewport_y0,
-                       int viewport_width, int viewport_height,
-                       float x0, float x1, float y0, float y1) = 0;
-               virtual void    end_display() = 0;
-               
-               // Geometric and color transforms for mesh and line_strip 
rendering.
-               virtual void    set_matrix(const matrix& m) = 0;
-               virtual void    set_cxform(const cxform& cx) = 0;
-               
-               // Draw triangles using the current fill-style 0.
-               // Clears the style list after rendering.
-               //
-               // coords is a list of (x,y) coordinate pairs, in
-               // triangle-strip order.  The type of the array should
-               // be Sint16[vertex_count*2]
-               virtual void    draw_mesh_strip(const void* coords, int 
vertex_count) = 0;
-               
-               // Draw a line-strip using the current line style.
-               // Clear the style list after rendering.
-               //
-               // Coords is a list of (x,y) coordinate pairs, in
-               // sequence.  Each coord is a 16-bit signed integer.
-               virtual void    draw_line_strip(const void* coords, int 
vertex_count) = 0;
-               
-               // Set line and fill styles for mesh & line_strip
-               // rendering.
-               enum bitmap_wrap_mode
-               {
-                       WRAP_REPEAT,
-                       WRAP_CLAMP
-               };
-               virtual void    fill_style_disable(int fill_side) = 0;
-               virtual void    fill_style_color(int fill_side, rgba color) = 0;
-               virtual void    fill_style_bitmap(int fill_side, const 
bitmap_info* bi, const matrix& m, bitmap_wrap_mode wm) = 0;
-               
-               virtual void    line_style_disable() = 0;
-               virtual void    line_style_color(rgba color) = 0;
-               virtual void    line_style_width(float width) = 0;
-               
-               // Special function to draw a rectangular bitmap;
-               // intended for textured glyph rendering.  Ignores
-               // current transforms.
-               virtual void    draw_bitmap(
-                       const matrix&           m,
-                       const bitmap_info*      bi,
-                       const rect&             coords,
-                       const rect&             uv_coords,
-                       rgba                    color) = 0;
-               
-               virtual void    set_antialiased(bool enable) = 0;
-               
-               virtual void begin_submit_mask() = 0;
-               virtual void end_submit_mask() = 0;
-               virtual void disable_mask() = 0;
-       };
-       
-       // Keyboard handling
-       namespace key {
-               enum code
-               {
-                       INVALID = 0,
-                       A = 65,
-                       B,
-                       C,
-                       D,
-                       E,
-                       F,
-                       G,
-                       H,
-                       I,
-                       J,
-                       K,
-                       L,
-                       M,
-                       N,
-                       O,
-                       P,
-                       Q,
-                       R,
-                       S,
-                       T,
-                       U,
-                       V,
-                       W,
-                       X,
-                       Y,
-                       Z,
-                       _0 = 48,
-                       _1,
-                       _2,
-                       _3,
-                       _4,
-                       _5,
-                       _6,
-                       _7,
-                       _8,
-                       _9,
-                       KP_0 = 96,
-                       KP_1,
-                       KP_2,
-                       KP_3,
-                       KP_4,
-                       KP_5,
-                       KP_6,
-                       KP_7,
-                       KP_8,
-                       KP_9,
-                       KP_MULTIPLY,
-                       KP_ADD,
-                       KP_ENTER,
-                       KP_SUBTRACT,
-                       KP_DECIMAL,
-                       KP_DIVIDE,
-                       F1 = 112,
-                       F2,
-                       F3,
-                       F4,
-                       F5,
-                       F6,
-                       F7,
-                       F8,
-                       F9,
-                       F10,
-                       F11,
-                       F12,
-                       F13,
-                       F14,
-                       F15,
-                       BACKSPACE = 8,
-                       TAB,
-                       CLEAR = 12,
-                       ENTER,
-                       SHIFT = 16,
-                       CONTROL,
-                       ALT,
-                       CAPSLOCK = 20,
-                       ESCAPE = 27,
-                       SPACE = 32,
-                       PGDN,
-                       PGUP,
-                       END = 35,
-                       HOME,
-                       LEFT,
-                       UP,
-                       RIGHT,
-                       DOWN,
-                       INSERT = 45,
-                       DELETEKEY,
-                       HELP,
-                       NUM_LOCK = 144,
-                       SEMICOLON = 186,
-                       EQUALS = 187,
-                       MINUS = 189,
-                       SLASH = 191,
-                       BACKTICK = 192,
-                       LEFT_BRACKET = 219,
-                       BACKSLASH = 220,
-                       RIGHT_BRACKET = 221,
-                       QUOTE = 222,
-
-                       KEYCOUNT
-               };
-       }       // end namespace key
+// You must define a subclass of render_handler, and pass an
+// instance to set_render_handler().
+struct render_handler
+{
+       virtual ~render_handler() {}
+
+       // Your handler should return these with a ref-count of 0.  (@@ is that 
the right policy?)
+       virtual bitmap_info*    create_bitmap_info_empty() = 0; // used when 
DO_NOT_LOAD_BITMAPS is set
+       virtual bitmap_info*    create_bitmap_info_alpha(int w, int h, unsigned 
char* data) = 0;
+       virtual bitmap_info*    create_bitmap_info_rgb(image::rgb* im) = 0;
+       virtual bitmap_info*    create_bitmap_info_rgba(image::rgba* im) = 0;
+
+       virtual void    delete_bitmap_info(bitmap_info* bi) = 0;
+               
+       // Bracket the displaying of a frame from a movie.
+       // Fill the background color, and set up default
+       // transforms, etc.
+       virtual void    begin_display(
+               rgba background_color,
+               int viewport_x0, int viewport_y0,
+               int viewport_width, int viewport_height,
+               float x0, float x1, float y0, float y1) = 0;
+       virtual void    end_display() = 0;
+               
+       // Geometric and color transforms for mesh and line_strip rendering.
+       virtual void    set_matrix(const matrix& m) = 0;
+       virtual void    set_cxform(const cxform& cx) = 0;
+               
+       // Draw triangles using the current fill-style 0.
+       // Clears the style list after rendering.
+       //
+       // coords is a list of (x,y) coordinate pairs, in
+       // triangle-strip order.  The type of the array should
+       // be Sint16[vertex_count*2]
+       virtual void    draw_mesh_strip(const void* coords, int vertex_count) = 
0;
+               
+       // Draw a line-strip using the current line style.
+       // Clear the style list after rendering.
+       //
+       // Coords is a list of (x,y) coordinate pairs, in
+       // sequence.  Each coord is a 16-bit signed integer.
+       virtual void    draw_line_strip(const void* coords, int vertex_count) = 
0;
+               
+       // Set line and fill styles for mesh & line_strip
+       // rendering.
+       enum bitmap_wrap_mode
+       {
+               WRAP_REPEAT,
+               WRAP_CLAMP
+       };
+       virtual void    fill_style_disable(int fill_side) = 0;
+       virtual void    fill_style_color(int fill_side, rgba color) = 0;
+       virtual void    fill_style_bitmap(int fill_side, const bitmap_info* bi, 
const matrix& m, bitmap_wrap_mode wm) = 0;
+               
+       virtual void    line_style_disable() = 0;
+       virtual void    line_style_color(rgba color) = 0;
+       virtual void    line_style_width(float width) = 0;
+               
+       // Special function to draw a rectangular bitmap;
+       // intended for textured glyph rendering.  Ignores
+       // current transforms.
+       virtual void    draw_bitmap(
+               const matrix&           m,
+               const bitmap_info*      bi,
+               const rect&             coords,
+               const rect&             uv_coords,
+               rgba                    color) = 0;
+               
+       virtual void    set_antialiased(bool enable) = 0;
+               
+       virtual void begin_submit_mask() = 0;
+       virtual void end_submit_mask() = 0;
+       virtual void disable_mask() = 0;
+};
+       
+// Keyboard handling
+namespace key {
+enum code
+{
+       INVALID = 0,
+       A = 65,
+       B,
+       C,
+       D,
+       E,
+       F,
+       G,
+       H,
+       I,
+       J,
+       K,
+       L,
+       M,
+       N,
+       O,
+       P,
+       Q,
+       R,
+       S,
+       T,
+       U,
+       V,
+       W,
+       X,
+       Y,
+       Z,
+       _0 = 48,
+       _1,
+       _2,
+       _3,
+       _4,
+       _5,
+       _6,
+       _7,
+       _8,
+       _9,
+       KP_0 = 96,
+       KP_1,
+       KP_2,
+       KP_3,
+       KP_4,
+       KP_5,
+       KP_6,
+       KP_7,
+       KP_8,
+       KP_9,
+       KP_MULTIPLY,
+       KP_ADD,
+       KP_ENTER,
+       KP_SUBTRACT,
+       KP_DECIMAL,
+       KP_DIVIDE,
+       F1 = 112,
+       F2,
+       F3,
+       F4,
+       F5,
+       F6,
+       F7,
+       F8,
+       F9,
+       F10,
+       F11,
+       F12,
+       F13,
+       F14,
+       F15,
+       BACKSPACE = 8,
+       TAB,
+       CLEAR = 12,
+       ENTER,
+       SHIFT = 16,
+       CONTROL,
+       ALT,
+       CAPSLOCK = 20,
+       ESCAPE = 27,
+       SPACE = 32,
+       PGDN,
+       PGUP,
+       END = 35,
+       HOME,
+       LEFT,
+       UP,
+       RIGHT,
+       DOWN,
+       INSERT = 45,
+       DELETEKEY,
+       HELP,
+       NUM_LOCK = 144,
+       SEMICOLON = 186,
+       EQUALS = 187,
+       MINUS = 189,
+       SLASH = 191,
+       BACKTICK = 192,
+       LEFT_BRACKET = 219,
+       BACKSLASH = 220,
+       RIGHT_BRACKET = 221,
+       QUOTE = 222,
+
+       KEYCOUNT
+};
+}      // end namespace key
 
        // Key events are global throughout gnash.
        // @@ Maybe someday make these local to the movie_interface?
-       void    notify_key_event(key::code k, bool down);
+void   notify_key_event(key::code k, bool down);
 
 
-       // Some optional helpers.
-       namespace tools
-       {
-               struct process_options
+// Some optional helpers.
+namespace tools
+{
+struct process_options
+{
+       bool    m_zip_whole_file;       // @@ not implemented yet (low 
priority?)
+       bool    m_remove_image_data;    // removes existing image data; leaves 
minimal placeholder tags
+       bool    m_remove_font_glyph_shapes;
+
+       process_options()
+               :
+               m_zip_whole_file(false),
+               m_remove_image_data(false),
+               m_remove_font_glyph_shapes(false)
                {
-                       bool    m_zip_whole_file;       // @@ not implemented 
yet (low priority?)
-                       bool    m_remove_image_data;    // removes existing 
image data; leaves minimal placeholder tags
-                       bool    m_remove_font_glyph_shapes;
-
-                       process_options()
-                               :
-                               m_zip_whole_file(false),
-                               m_remove_image_data(false),
-                               m_remove_font_glyph_shapes(false)
-                       {
-                       }
-               };
-
-               // Copy tags from *in to *out, applying the given
-               // options.  *in should be a SWF-format stream.  The
-               // output will be a SWF-format stream.
-               //
-               // Returns 0 on success, or a non-zero error-code on
-               // failure.
-               int     process_swf(tu_file* swf_out, tu_file* swf_in, const 
process_options& options);
-       }
+               }
+};
+
+// Copy tags from *in to *out, applying the given
+// options.  *in should be a SWF-format stream.  The
+// output will be a SWF-format stream.
+//
+// Returns 0 on success, or a non-zero error-code on
+// failure.
+int    process_swf(tu_file* swf_out, tu_file* swf_in, const process_options& 
options);
+}
 
 }      // namespace gnash
 
@@ -1037,7 +1034,5 @@
 
 // Local Variables:
 // mode: C++
-// c-basic-offset: 8 
-// tab-width: 8
 // indent-tabs-mode: t
 // End:
Index: gnash/server/impl.cpp
diff -u gnash/server/impl.cpp:1.10 gnash/server/impl.cpp:1.11
--- gnash/server/impl.cpp:1.10  Fri Jan 27 00:54:38 2006
+++ gnash/server/impl.cpp       Sat Jan 28 01:14:33 2006
@@ -20,6 +20,15 @@
 #include "config.h"
 #endif
 
+// This needs to be included first for NetBSD systems or we get a weird
+// problem with pthread_t being defined too many times if we use any
+// STL containers.
+#ifdef HAVE_PTHREADS
+#include <pthread.h>
+#endif
+
+#include <zlib.h>
+
 #include "tu_file.h"
 #include "utility.h"
 #include "action.h"
@@ -40,15 +49,6 @@
 #include "zlib_adapter.h"
 #include "Sprite.h"
 #include "Movie.h"
-#include <string.h>    // for memset
-#include <typeinfo>
-#include <float.h>
-
-
-#if TU_CONFIG_LINK_TO_ZLIB
-#include <zlib.h>
-#endif // TU_CONFIG_LINK_TO_ZLIB
-
 
 namespace gnash
 {
@@ -293,6 +293,8 @@
     // Put extracted info in the given vars.
     // Sets *version to 0 if info can't be extracted.
 {
+    printf("%s: filename is %s\n",  __PRETTY_FUNCTION__, filename);
+
     if (s_opener_function == NULL)
        {
            log_error("error: get_movie_info(): no file opener function 
registered\n");
@@ -327,28 +329,27 @@
     bool       compressed = (header & 255) == 'C';
 
     tu_file*   original_in = NULL;
-    if (compressed)
-       {
+    if (compressed) {
 #if TU_CONFIG_LINK_TO_ZLIB == 0
-           log_error("get_movie_info(): can't read zipped SWF data; 
TU_CONFIG_LINK_TO_ZLIB is 0!\n");
-           return;
+       log_error("get_movie_info(): can't read zipped SWF data; 
TU_CONFIG_LINK_TO_ZLIB is 0!\n");
+       return;
 #endif
-           original_in = in;
-
-           // Uncompress the input as we read it.
-           in = zlib_adapter::make_inflater(original_in);
-
-           // Subtract the size of the 8-byte header, since
-           // it's not included in the compressed
-           // stream length.
-           file_length -= 8;
-       }
-
+       original_in = in;
+       
+       // Uncompress the input as we read it.
+       in = zlib_adapter::make_inflater(original_in);
+       
+       // Subtract the size of the 8-byte header, since
+       // it's not included in the compressed
+       // stream length.
+       file_length -= 8;
+    }
+    
     stream     str(in);
-
+    
     rect       frame_size;
     frame_size.read(&str);
-
+    
     float      local_frame_rate = str.read_u16() / 256.0f;
     int        local_frame_count = str.read_u16();
 
@@ -357,7 +358,7 @@
     if (height) *height = int(frame_size.height() / 20.0f + 0.5f);
     if (frames_per_second) *frames_per_second = local_frame_rate;
     if (frame_count) *frame_count = local_frame_count;
-
+    
     if (tag_count)
        {
            // Count tags.
@@ -380,6 +381,7 @@
 movie_definition*      create_movie(const char* filename)
     // Create the movie definition from the specified .swf file.
 {
+    printf("%s: filename is %s\n",  __PRETTY_FUNCTION__, filename);
     return create_movie_sub(filename);
 }
 
Index: gnash/server/xml.cpp
diff -u gnash/server/xml.cpp:1.2 gnash/server/xml.cpp:1.3
--- gnash/server/xml.cpp:1.2    Thu Jan 19 23:50:11 2006
+++ gnash/server/xml.cpp        Sat Jan 28 01:14:33 2006
@@ -16,6 +16,10 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 
Index: gnash/server/xml.h
diff -u gnash/server/xml.h:1.2 gnash/server/xml.h:1.3
--- gnash/server/xml.h:1.2      Thu Jan 19 23:50:11 2006
+++ gnash/server/xml.h  Sat Jan 28 01:14:33 2006
@@ -19,6 +19,10 @@
 #ifndef __XML_H__
 #define __XML_H__
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 //#define DEBUG_MEMORY_ALLOCATION 1
 
 #include "tu_config.h"
Index: gnash/server/xmlsocket.cpp
diff -u gnash/server/xmlsocket.cpp:1.3 gnash/server/xmlsocket.cpp:1.4
--- gnash/server/xmlsocket.cpp:1.3      Thu Jan 19 23:50:11 2006
+++ gnash/server/xmlsocket.cpp  Sat Jan 28 01:14:33 2006
@@ -16,6 +16,10 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <SDL.h>
 
 #include "utility.h"
Index: gnash/server/xmlsocket.h
diff -u gnash/server/xmlsocket.h:1.2 gnash/server/xmlsocket.h:1.3
--- gnash/server/xmlsocket.h:1.2        Thu Jan 19 23:50:11 2006
+++ gnash/server/xmlsocket.h    Sat Jan 28 01:14:33 2006
@@ -19,6 +19,9 @@
 #ifndef __XMLSOCKET_H__
 #define __XMLSOCKET_H__
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "tu_config.h"
 #include "xml.h"
Index: gnash/utilities/Makefile.am
diff -u gnash/utilities/Makefile.am:1.6 gnash/utilities/Makefile.am:1.7
--- gnash/utilities/Makefile.am:1.6     Tue Jan 24 01:33:02 2006
+++ gnash/utilities/Makefile.am Sat Jan 28 01:14:33 2006
@@ -27,9 +27,9 @@
 
 AM_CPPFLAGS = -Wall
 AM_LDFLAGS = \
-       ../server/libserver.a \
-       ../libgeometry/libgeometry.a \
-        ../libbase/libbase.a \
+       ../server/libserver.la \
+       ../libgeometry/libgeometry.la \
+        ../libbase/libbase.la \
         $(OPENGL_LIBS)      \
         $(SDL_LIBS)         \
         $(SDL_MIXER_LIBS)   \
@@ -38,8 +38,7 @@
         $(LIBXML_LIBS)      \
        $(DMALLOC_LIBS)     \
        $(MP3_LIBS)         \
-       $(OGG_LIBS)         \
-        $(VORBIS_LIBS)
+       $(OGG_LIBS)
 
 INCLUDES = -I.. \
         -I$(top_srcdir)                \
@@ -51,7 +50,6 @@
        $(DMALLOC_CFLAGS)       \
        $(MP3_CFLAGS)           \
        $(OGG_CFLAGS)           \
-       $(VORBIS_CFLAGS)        \
         $(SDL_CFLAGS)          \
         $(SDL_MIXER_CFLAGS)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]