[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r9750: update from shared repository.
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r9750: update from shared repository. |
Date: |
Wed, 19 Nov 2008 12:00:37 -0700 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9750
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2008-11-19 12:00:37 -0700
message:
update from shared repository.
removed:
libcore/asobj/xmlattrs.cpp
macros/libXML.m4
added:
libcore/swf.cpp
modified:
configure.ac
gui/Player.cpp
gui/gtk.cpp
gui/gui.cpp
libbase/utf8.h
libcore/Makefile.am
libcore/array.cpp
libcore/array.h
libcore/as_value.cpp
libcore/as_value.h
libcore/asobj/Makefile.am
libcore/asobj/MovieClipLoader.cpp
libcore/asobj/NetStream_as.cpp
libcore/asobj/XMLNode_as.cpp
libcore/asobj/XMLNode_as.h
libcore/asobj/XML_as.cpp
libcore/asobj/XML_as.h
libcore/asobj/flash/display/BitmapData_as.cpp
libcore/asobj/xmlattrs.h
libcore/character.cpp
libcore/swf.h
libcore/vm/Machine.cpp
libmedia/FLVParser.cpp
testsuite/actionscript.all/MovieClip.as
testsuite/actionscript.all/XML.as
testsuite/libcore.all/AsValueTest.cpp
testsuite/swfdec/PASSING
------------------------------------------------------------
revno: 9483.1.799
committer: strk <address@hidden>
branch nick: trunk
timestamp: Sat 2008-11-15 10:44:20 +0100
message:
Don't hot-plug consumers for which a decoder could not be constructed.
Should fix mx1 check with gst (that host fails creating an audio decoder
for audio in square.flv)
modified:
libcore/asobj/NetStream_as.cpp
------------------------------------------------------------
revno: 9483.1.800
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Sat 2008-11-15 14:25:03 +0100
message:
Use numerical value instead of boolean for _visibility. Add tests.
Fixes bug #24839.
modified:
libcore/character.cpp
testsuite/actionscript.all/MovieClip.as
------------------------------------------------------------
revno: 9483.1.801
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Sat 2008-11-15 20:49:41 +0100
message:
libcore/as_value.{cpp,h}: Increase type safety by using templates to
prevent implicit conversions to bool. This allows us to declare a
single numeric constructor. As a side-effect, the compiler will
refuse to compile as_value(NULL) or as_value(0) until you resolve
the ambiguity.
This commit changes all uses of as_value(0) and adds tests.
modified:
libcore/array.cpp
libcore/array.h
libcore/as_value.cpp
libcore/as_value.h
libcore/asobj/MovieClipLoader.cpp
libcore/asobj/flash/display/BitmapData_as.cpp
libcore/vm/Machine.cpp
testsuite/libcore.all/AsValueTest.cpp
------------------------------------------------------------
revno: 9483.1.802
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Sun 2008-11-16 01:32:40 +0100
message:
Fix warning (assigning -1 to unsigned int).
modified:
libbase/utf8.h
------------------------------------------------------------
revno: 9483.1.803
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Mon 2008-11-17 17:52:55 +0100
message:
Add output operator for abc_action_type enum
added:
libcore/swf.cpp
modified:
libcore/Makefile.am
libcore/swf.h
------------------------------------------------------------
revno: 9483.1.804
committer: strk <address@hidden>
branch nick: trunk
timestamp: Mon 2008-11-17 18:24:29 +0100
message:
Add ABC_ACTION_END, 4-spaces tabs
modified:
libcore/swf.cpp
libcore/swf.h
------------------------------------------------------------
revno: 9483.1.805
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 11:18:05 +0100
message:
Rewrite XML parsing.
removed:
libcore/asobj/xmlattrs.cpp
macros/libXML.m4
modified:
configure.ac
libcore/asobj/Makefile.am
libcore/asobj/XMLNode_as.cpp
libcore/asobj/XMLNode_as.h
libcore/asobj/XML_as.cpp
libcore/asobj/XML_as.h
libcore/asobj/xmlattrs.h
testsuite/actionscript.all/XML.as
testsuite/swfdec/PASSING
------------------------------------------------------------
revno: 9483.196.1
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 10:29:12 +0100
message:
Rewrite XML parsing, using swfdec's model as a base.
This:
- removes the dependency on libxml2
- is less strict, so that we can parse XML incorrectly like Flash does
- and consequently fixes many cases where an unescaped entity broke
parsing
completely.
- parses directly into XMLNodes instead of first into memory
- passes some more swfdec tests.
Drop various unused functions and files. Rename enums to make it less
ugly.
Clean up.
Remove libxml checks from configure.
removed:
libcore/asobj/xmlattrs.cpp
macros/libXML.m4
modified:
configure.ac
libcore/asobj/Makefile.am
libcore/asobj/XMLNode_as.cpp
libcore/asobj/XMLNode_as.h
libcore/asobj/XML_as.cpp
libcore/asobj/XML_as.h
libcore/asobj/xmlattrs.h
testsuite/actionscript.all/XML.as
------------------------------------------------------------
revno: 9483.196.2
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 10:34:03 +0100
message:
Swfdec testsuite passes.
modified:
testsuite/swfdec/PASSING
------------------------------------------------------------
revno: 9483.196.3
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 10:42:06 +0100
message:
Drop libxml includes from XMLNode_as.h
modified:
libcore/asobj/XMLNode_as.h
libcore/asobj/XML_as.cpp
------------------------------------------------------------
revno: 9483.196.4
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 10:46:03 +0100
message:
Drop another remnant of libxml.
modified:
libcore/asobj/XML_as.h
------------------------------------------------------------
revno: 9483.196.5
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 10:48:27 +0100
message:
Unused variables.
modified:
libcore/asobj/XML_as.cpp
------------------------------------------------------------
revno: 9483.1.806
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 11:38:41 +0100
message:
register movie definition with gui before calling createWindow, as
the latter may want to use the former for resize events.
modified:
gui/Player.cpp
------------------------------------------------------------
revno: 9483.1.807
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 11:46:54 +0100
message:
Add missing include.
modified:
libcore/asobj/XML_as.cpp
------------------------------------------------------------
revno: 9483.1.808
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 12:21:17 +0100
message:
Quieten debugging.
modified:
libcore/asobj/XML_as.cpp
------------------------------------------------------------
revno: 9483.1.809
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 12:59:41 +0100
message:
Silence more intrusive logging.
modified:
libmedia/FLVParser.cpp
------------------------------------------------------------
revno: 9483.1.810
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 13:24:43 +0100
message:
Fix "click-to-play" for the standalone case. If you like it, we might
use the same model for the plugin, as the bug (#23477) really seem
to depend on the mechanism we use to show the button (no bug with
standalone
and this model)
modified:
gui/gtk.cpp
gui/gui.cpp
------------------------------------------------------------
revno: 9483.1.811
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 15:39:48 +0100
message:
Corrections to and more implementation of XML methods.
modified:
libcore/asobj/XMLNode_as.h
libcore/asobj/XML_as.cpp
libcore/asobj/XML_as.h
testsuite/actionscript.all/XML.as
------------------------------------------------------------
revno: 9483.196.6
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 13:39:43 +0100
message:
Add some tests for malformed XML. Get " and ' the right way
round.
modified:
libcore/asobj/XML_as.cpp
testsuite/actionscript.all/XML.as
------------------------------------------------------------
revno: 9483.196.7
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 14:36:25 +0100
message:
Add doctype to XML.toString output. Make XMLNode::toString virtual so
XML::toString is called. Implement docTypeDecl getter/setter.
modified:
libcore/asobj/XMLNode_as.h
libcore/asobj/XML_as.cpp
libcore/asobj/XML_as.h
testsuite/actionscript.all/XML.as
------------------------------------------------------------
revno: 9483.196.8
committer: Benjamin Wolsey <address@hidden>
branch nick: test
timestamp: Tue 2008-11-18 15:30:05 +0100
message:
Test and implement XML.xmlDecl property.
modified:
libcore/asobj/XML_as.cpp
libcore/asobj/XML_as.h
testsuite/actionscript.all/XML.as
------------------------------------------------------------
revno: 9483.1.812
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Tue 2008-11-18 16:10:31 +0100
message:
Always use a vertical box for the gnash window, embedded or not.
Always add/remove the 'click to start' button to the vbox.
Fixes bug #23477 and gives access to the right-click menu.
Tests highly welcome. In particular, should be tested how the
movie info deals with "entity under the mouse" while paused
(window coordinates might be bogus)
modified:
gui/gtk.cpp
gui/gui.cpp
=== modified file 'configure.ac'
--- a/configure.ac 2008-11-15 03:44:41 +0000
+++ b/configure.ac 2008-11-19 19:00:37 +0000
@@ -1572,8 +1572,6 @@
AM_CONDITIONAL(HAVE_SDL, [ test x$has_SDL = xyes ])
-GNASH_PATH_LIBXML
-
dnl
dnl NOTE: make sure to check for GLIB and LIBXML2
dnl before checking for gstreamer
@@ -2274,18 +2272,6 @@
# out everything that is missing in one pass, hopefully making it
# easy for new developers to get everything they need installed.
-if test x$xml != xno; then
- if test x"$LIBXML_CFLAGS" != x; then
- echo " XML flags are: $LIBXML_CFLAGS"
- echo " XML libs are: $LIBXML_LIBS"
- else
- echo " ERROR: No libxml2 development package installed!" >&3
- echo " To compile this project install" >&3
- echo " or .deb users: apt-get install libxml2-dev" >&3
- echo " or .rpm users: yum install libxml2-devel" >&3
- fi
-fi
-
if test x$build_kde = xyes -o x$kparts = xyes; then
if test x"$has_kde" = xyes; then
echo " KDE flags are: $KDE_CFLAGS"
=== modified file 'gui/Player.cpp'
--- a/gui/Player.cpp 2008-11-14 18:04:41 +0000
+++ b/gui/Player.cpp 2008-11-18 10:38:41 +0000
@@ -402,6 +402,9 @@
if ( ! _height ) _height = 1;
}
+ // Register movie definition before creating the window
+ _gui->setMovieDefinition(_movieDef.get());
+
// Now that we know about movie size, create gui window.
_gui->createWindow(_url.c_str(), _width, _height);
@@ -444,8 +447,6 @@
// intrusive_ptr...
_movieDef->completeLoad();
- _gui->setMovieDefinition(_movieDef.get());
-
if (! _delay) {
//float movie_fps = _movieDef->get_frame_rate();
//_delay = static_cast<unsigned int>(1000 / movie_fps) ; // milliseconds
per frame
=== modified file 'gui/gtk.cpp'
--- a/gui/gtk.cpp 2008-11-03 08:02:31 +0000
+++ b/gui/gtk.cpp 2008-11-18 15:10:31 +0000
@@ -178,25 +178,18 @@
_glue->prepDrawingArea(_drawingArea);
#endif
- // Plugin
- if (_xid) {
- gtk_container_add(GTK_CONTAINER(_window), _drawingArea);
- }
-
- // Stand-alone
- else {
-
- // A vertical box is used to allow display of the menu bar
- _vbox = gtk_vbox_new(FALSE, 0);
- gtk_widget_show(_vbox);
- gtk_container_add(GTK_CONTAINER(_window), _vbox);
+ // A vertical box is used to allow display of the menu bar and paused
widget
+ _vbox = gtk_vbox_new(FALSE, 0);
+ gtk_widget_show(_vbox);
+ gtk_container_add(GTK_CONTAINER(_window), _vbox);
#if defined(USE_MENUS) && !defined(GUI_HILDON)
+ if ( ! _xid ) {
createMenuBar();
+ }
#endif
- gtk_box_pack_start(GTK_BOX(_vbox), _drawingArea, TRUE, TRUE, 0);
- }
+ gtk_box_pack_start(GTK_BOX(_vbox), _drawingArea, TRUE, TRUE, 0);
setupEvents();
@@ -305,7 +298,7 @@
// Reparent drawing area from GtkPlug to fullscreen window
gtk_widget_realize(_overlay);
- gtk_widget_reparent(_drawingArea, _overlay);
+ gtk_widget_reparent(_vbox, _overlay);
// Apply key event callbacks to the new window.
setupWindowEvents();
@@ -339,7 +332,7 @@
// Plugin
if (_xid) {
- gtk_widget_reparent (_drawingArea, _window);
+ gtk_widget_reparent (_vbox, _window);
// Apply key event callbacks to the plugin instance.
setupWindowEvents();
@@ -2541,41 +2534,20 @@
GtkGui::stopHook()
{
- // FIXME: this can't work for the stand-alone player, because
- // _drawingArea is
- // packed into a vbox.
- if (! _xid) return;
-
// Assert they're either both initialised or both uninitialised
- assert ((_resumeButton && _drawingArea) || !(_resumeButton ||
_drawingArea));
-
- if (_drawingArea) {
- gtk_container_remove(GTK_CONTAINER(_window), _drawingArea);
- }
-
+ assert ((_resumeButton && _vbox) || !(_resumeButton || _vbox));
if (_resumeButton) {
- gtk_container_add(GTK_CONTAINER(_window), _resumeButton);
+ gtk_container_add(GTK_CONTAINER(_vbox), _resumeButton);
}
-
}
void
GtkGui::playHook()
{
- // FIXME: this can't work for the stand-alone player, because _drawingArea
is
- // packed into a vbox.
- if (! _xid) return;
-
- // Assert they're either both initialised or both uninitialised
- assert ((_resumeButton && _drawingArea) || !(_resumeButton ||
_drawingArea));
-
+ assert ((_resumeButton && _vbox) || !(_resumeButton || _vbox));
if (_resumeButton) {
- gtk_container_remove(GTK_CONTAINER(_window), _resumeButton);
- }
- if (_drawingArea) {
- gtk_container_add(GTK_CONTAINER(_window), _drawingArea);
- }
-
+ gtk_container_remove(GTK_CONTAINER(_vbox), _resumeButton);
+ }
}
} // end of namespace gnash
=== modified file 'gui/gui.cpp'
--- a/gui/gui.cpp 2008-11-03 08:02:31 +0000
+++ b/gui/gui.cpp 2008-11-18 15:10:31 +0000
@@ -877,6 +877,8 @@
sound::sound_handler* s = _stage->runInfo().soundHandler();
if ( s ) s->pause();
_stopped = true;
+
+ stopHook();
}
}
@@ -1069,6 +1071,15 @@
os << "SWF " << vm.getSWFVersion();
topIter = tr->insert(topIter, StringPair("VM version", os.str()));
+ // This short-cut is to avoid a bug in movie_root's getMovieInfo,
+ // which relies on the availability of a _rootMovie for doing
+ // it's work, while we don't set it if we didn't start..
+ //
+ if ( ! _started )
+ {
+ topIter = tr->insert(topIter, StringPair("Stage properties", "not
constructed yet"));
+ return tr;
+ }
movie_root& stage = vm.getRoot();
stage.getMovieInfo(*tr, topIter);
=== modified file 'libbase/utf8.h'
--- a/libbase/utf8.h 2008-10-15 02:51:58 +0000
+++ b/libbase/utf8.h 2008-11-16 00:32:40 +0000
@@ -24,6 +24,7 @@
#include "dsodefs.h" // For DSOEXPORT
#include <string>
#include <boost/cstdint.hpp> // for C99 int types
+#include <limits>
/// Utilities to convert between std::string and std::wstring.
//
@@ -53,7 +54,7 @@
/// gnash::edit_text_character, ord() and chr().
namespace utf8
{
- static const boost::uint32_t invalid = -1;
+ static const boost::uint32_t invalid =
std::numeric_limits<boost::uint32_t>::max();
/// Converts a std::string with multibyte characters into a
std::wstring.
//
=== modified file 'libcore/Makefile.am'
--- a/libcore/Makefile.am 2008-11-14 16:34:15 +0000
+++ b/libcore/Makefile.am 2008-11-17 16:52:55 +0000
@@ -81,6 +81,7 @@
namedStrings.cpp \
rect.cpp \
MovieClip.cpp \
+ swf.cpp \
swf/TagLoadersTable.cpp \
swf/DefineVideoStreamTag.cpp \
swf/DefineTextTag.cpp \
=== modified file 'libcore/array.cpp'
--- a/libcore/array.cpp 2008-09-24 15:46:11 +0000
+++ b/libcore/array.cpp 2008-11-15 19:49:41 +0000
@@ -363,7 +363,7 @@
bool operator() (const as_value& a, const as_value& b)
{
as_value cmp_method(&_comp);
- as_value ret(0);
+ as_value ret(0.0);
std::auto_ptr< std::vector<as_value> > args ( new
std::vector<as_value> );
args->push_back(b);
=== modified file 'libcore/array.h'
--- a/libcore/array.h 2008-10-30 14:41:00 +0000
+++ b/libcore/array.h 2008-11-15 19:49:41 +0000
@@ -316,7 +316,7 @@
nelem.sort(avc);
if (std::adjacent_find(nelem.begin(), nelem.end(), ave) !=
nelem.end() )
- return as_value(0);
+ return as_value(0.0);
elements.resize(oldSize, false);
size_t idx=0;
@@ -363,7 +363,7 @@
std::sort(ielem.begin(), ielem.end(), avc);
if (std::adjacent_find(ielem.begin(), ielem.end(), ave) !=
ielem.end() )
- return as_value(0);
+ return as_value(0.0);
return get_indices(ielem);
}
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp 2008-11-14 23:40:55 +0000
+++ b/libcore/as_value.cpp 2008-11-15 19:49:41 +0000
@@ -1772,52 +1772,10 @@
{
}
-as_value::as_value(bool val)
- :
- m_type(BOOLEAN),
- _value(val)
-{
-}
-
-as_value::as_value(int val)
- :
- m_type(NUMBER),
- _value(double(val))
-{
-}
-
-as_value::as_value(unsigned int val)
- :
- m_type(NUMBER),
- _value(double(val))
-{
-}
-
-as_value::as_value(float val)
- :
- m_type(NUMBER),
- _value(double(val))
-{
-}
-
-as_value::as_value(double val)
- :
- m_type(NUMBER),
- _value(val)
-{
-}
-
-as_value::as_value(long val)
- :
- m_type(NUMBER),
- _value(double(val))
-{
-}
-
-as_value::as_value(unsigned long val)
- :
- m_type(NUMBER),
- _value(double(val))
+as_value::as_value(double num)
+ :
+ m_type(NUMBER),
+ _value(num)
{
}
@@ -1828,6 +1786,7 @@
set_as_object(obj);
}
+
/// Chad: Document this
as_value::as_value(asNamespace &)
{
=== modified file 'libcore/as_value.h'
--- a/libcore/as_value.h 2008-11-14 23:40:55 +0000
+++ b/libcore/as_value.h 2008-11-15 19:49:41 +0000
@@ -146,36 +146,25 @@
/// Construct an UNDEFINED value
as_value();
- /// Copy-construct a STRING value
- as_value(const as_value& v);
+ /// Copy constructor.
+ as_value(const as_value& value);
/// Construct a STRING value
as_value(const char* str);
-
- /// Construct a STRING value
as_value(const std::string& str);
/// Construct a BOOLEAN value
- as_value(bool val);
-
- /// Construct a NUMBER value
- as_value(int val);
-
- /// Construct a NUMBER value
- as_value(unsigned int val);
-
- /// Construct a NUMBER value
- as_value(float val);
+ template <typename T>
+ as_value(T val, typename boost::enable_if<boost::is_same<bool, T>
>::type* dummy = 0)
+ : m_type(BOOLEAN),
+ _value(val)
+ {
+ UNUSED(dummy);
+ }
/// Construct a NUMBER value
as_value(double val);
- /// Construct a NUMBER value
- as_value(long val);
-
- /// Construct a NUMBER value
- as_value(unsigned long val);
-
/// Chad: Document this
as_value(asNamespace &);
=== modified file 'libcore/asobj/Makefile.am'
--- a/libcore/asobj/Makefile.am 2008-10-30 16:46:00 +0000
+++ b/libcore/asobj/Makefile.am 2008-11-18 09:29:12 +0000
@@ -73,7 +73,6 @@
MovieClipLoader.cpp\
String_as.cpp \
XML_as.cpp \
- xmlattrs.cpp \
XMLNode_as.cpp \
XMLSocket_as.cpp \
flash/display/BitmapData_as.cpp \
=== modified file 'libcore/asobj/MovieClipLoader.cpp'
--- a/libcore/asobj/MovieClipLoader.cpp 2008-10-28 15:32:20 +0000
+++ b/libcore/asobj/MovieClipLoader.cpp 2008-11-15 19:49:41 +0000
@@ -209,7 +209,7 @@
// TODO: find semantic of last argument
as_value met("onLoadError");
as_value arg1("Failed to load movie or jpeg");
- as_value arg2(0);
+ as_value arg2(0.0);
callMethod(NSV::PROP_BROADCAST_MESSAGE, met, targetVal, arg1,
arg2);
return false;
@@ -234,7 +234,7 @@
// Dispatch onLoadComplete
callMethod(NSV::PROP_BROADCAST_MESSAGE, as_value("onLoadComplete"),
targetVal,
- as_value(0)); // TODO: find semantic of last arg
+ as_value(0.0)); // TODO: find semantic of last arg
/// This event must be dispatched when actions
/// in first frame of loaded clip have been executed.
=== modified file 'libcore/asobj/NetStream_as.cpp'
--- a/libcore/asobj/NetStream_as.cpp 2008-11-12 15:31:45 +0000
+++ b/libcore/asobj/NetStream_as.cpp 2008-11-15 09:44:20 +0000
@@ -906,14 +906,14 @@
try {
_videoDecoder = _mediaHandler->createVideoDecoder(info);
- assert ( _videoDecoder.get() ); // PARANOIA_LEVEL ?
+ assert ( _videoDecoder.get() ); // PARANOIA_LEVEL ?
+ log_debug("NetStream_as::initVideoDecoder: hot-plugging video
consumer");
+ _playHead.setVideoConsumerAvailable();
}
catch (MediaException& e) {
log_error("NetStream: Could not create Video decoder: %s",
e.what());
}
- log_debug("NetStream_as::initVideoDecoder: hot-plugging video consumer");
- _playHead.setVideoConsumerAvailable();
}
@@ -929,14 +929,14 @@
try {
_audioDecoder = _mediaHandler->createAudioDecoder(info);
- assert ( _audioDecoder.get() ); // PARANOIA_LEVE ?
+ assert ( _audioDecoder.get() ); // PARANOIA_LEVE ?
+ log_debug("NetStream_as::initAudioDecoder: hot-plugging audio
consumer");
+ _playHead.setAudioConsumerAvailable();
}
catch (MediaException& e) {
log_error("Could not create Audio decoder: %s", e.what());
}
- log_debug("NetStream_as::initAudioDecoder: hot-plugging audio consumer");
- _playHead.setAudioConsumerAvailable();
}
=== modified file 'libcore/asobj/XMLNode_as.cpp'
--- a/libcore/asobj/XMLNode_as.cpp 2008-10-23 09:18:06 +0000
+++ b/libcore/asobj/XMLNode_as.cpp 2008-11-18 09:29:12 +0000
@@ -22,26 +22,17 @@
#include "builtin_function.h"
#include "array.h" // for childNodes
#include "XMLNode_as.h"
+#include "XML_as.h" // escape / unescape
#include "log.h"
#include "Object.h" // for getObjectInterface
-#include "VM.h" // for getting the string_table..
-#include "string_table.h" // ..for using the string_table
-
-#include <boost/algorithm/string/case_conv.hpp>
+#include "VM.h" // for getting the string_table.
+#include "string_table.h"
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/xmlreader.h>
-
//#define DEBUG_MEMORY_ALLOCATION 1
namespace gnash {
@@ -76,7 +67,7 @@
:
as_object(getXMLNodeInterface()),
_parent(0),
- _type(tElement)
+ _type(Element)
{
//log_debug("%s: %p", __PRETTY_FUNCTION__, this);
#ifdef DEBUG_MEMORY_ALLOCATION
@@ -280,8 +271,9 @@
#ifdef GNASH_DEBUG
- log_debug(_("Stringifying node %p with name %s, as_value %s, %u attributes
and %u children"),
- (void*)&xml, nodename, node_value, xml._attributes.size(),
xml._children.size());
+ log_debug(_("Stringifying node %p with name %s, as_value %s, %u "
+ "attributes and %u children"), (void*)&xml, nodename,
+ node_value, xml._attributes.size(), xml._children.size());
#endif
// Create the beginning of the tag
@@ -312,9 +304,14 @@
}
// Node as_value first, then children
- if ( type == tText )
+ if ( type == Text )
{
- encode ? xmlout << URL::encode(node_value) : xmlout << node_value;
+ // Insert entities.
+ std::string escaped(node_value);
+ XML_as::escape(escaped);
+ if (encode) URL::encode(escaped);
+
+ xmlout << escaped;
}
// Childs, after node as_value.
@@ -338,29 +335,41 @@
const int noFlags = 0;
// No prop flags:
- o.init_member("appendChild", new builtin_function(XMLNode_appendchild),
noFlags);
- o.init_member("cloneNode", new builtin_function(XMLNode_clonenode),
noFlags);
- o.init_member("hasChildNodes", new
builtin_function(XMLNode_haschildnodes), noFlags);
- o.init_member("insertBefore", new builtin_function(XMLNode_insertbefore),
noFlags);
- o.init_member("removeNode", new builtin_function(XMLNode_removenode),
noFlags);
+ o.init_member("appendChild", new builtin_function(
+ XMLNode_appendchild), noFlags);
+ o.init_member("cloneNode", new builtin_function(
+ XMLNode_clonenode), noFlags);
+ o.init_member("hasChildNodes", new builtin_function(
+ XMLNode_haschildnodes), noFlags);
+ o.init_member("insertBefore", new builtin_function(
+ XMLNode_insertbefore), noFlags);
+ o.init_member("removeNode", new builtin_function(
+ XMLNode_removenode), noFlags);
o.init_member("toString", new builtin_function(XMLNode_tostring), noFlags);
- o.init_member("getPrefixForNamespace", new
builtin_function(XMLNode_getPrefixForNamespace), noFlags);
- o.init_member("getNamespaceForPrefix", new
builtin_function(XMLNode_getNamespaceForPrefix), noFlags);
+ o.init_member("getPrefixForNamespace", new builtin_function(
+ XMLNode_getPrefixForNamespace), noFlags);
+ o.init_member("getNamespaceForPrefix", new builtin_function(
+ XMLNode_getNamespaceForPrefix), noFlags);
const int protectedFlags = as_prop_flags::isProtected;
// Just the protected flag:
- o.init_property("nodeValue", &XMLNode_node_value, &XMLNode_node_value,
protectedFlags);
- o.init_property("nodeName", &XMLNode_nodename, &XMLNode_nodename,
protectedFlags);
+ o.init_property("nodeValue", &XMLNode_node_value,
+ &XMLNode_node_value, protectedFlags);
+ o.init_property("nodeName", &XMLNode_nodename,
+ &XMLNode_nodename, protectedFlags);
o.init_readonly_property("firstChild", &XMLNode_firstchild,
protectedFlags);
o.init_readonly_property("lastChild", &XMLNode_lastchild, protectedFlags);
o.init_readonly_property("localName", &XMLNode_localName, protectedFlags);
- o.init_readonly_property("namespaceURI", &XMLNode_namespaceURI,
protectedFlags);
- o.init_readonly_property("nextSibling", &XMLNode_nextsibling,
protectedFlags);
+ o.init_readonly_property("namespaceURI",
+ &XMLNode_namespaceURI, protectedFlags);
+ o.init_readonly_property("nextSibling",
+ &XMLNode_nextsibling, protectedFlags);
o.init_readonly_property("prefix", &XMLNode_prefix, protectedFlags);
- o.init_readonly_property("previousSibling", &XMLNode_previoussibling,
protectedFlags);
+ o.init_readonly_property("previousSibling",
+ &XMLNode_previoussibling, protectedFlags);
o.init_readonly_property("nodeType", &XMLNode_nodetype, protectedFlags);
o.init_readonly_property("attributes", &XMLNode_attributes,
protectedFlags);
o.init_readonly_property("childNodes", &XMLNode_childNodes,
protectedFlags);
=== modified file 'libcore/asobj/XMLNode_as.h'
--- a/libcore/asobj/XMLNode_as.h 2008-10-19 19:36:12 +0000
+++ b/libcore/asobj/XMLNode_as.h 2008-11-18 13:36:25 +0000
@@ -26,10 +26,6 @@
#include "xmlattrs.h"
#include "log.h"
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/xmlreader.h>
-
#include <list>
#include <vector>
#include <string>
@@ -46,45 +42,45 @@
{
public:
- typedef enum {
+ enum NodeType {
/// Element
- tElement = 1,
+ Element = 1,
/// Attribute
- tAttribute = 2,
+ Attribute = 2,
/// Text
- tText = 3,
+ Text = 3,
/// CDATA section
- tCdata = 4,
+ Cdata = 4,
/// Entity reference
- tEntityRef = 5,
+ EntityRef = 5,
/// Entity
- tEntity = 6,
+ Entity = 6,
/// Processing instruction
- tProcInstr = 7,
+ ProcInstr = 7,
/// Comment
- tComment = 8,
+ Comment = 8,
/// Document
- tDocument = 9,
+ Document = 9,
/// Document type
- tDocType = 10,
+ DocType = 10,
/// Document fragment
- tDocFgarment = 11,
+ DocFragment = 11,
/// Notation
- tNotation = 12
+ Notation = 12
- } NodeType;
+ };
XMLNode();
@@ -116,7 +112,8 @@
void nodeValueSet(const std::string& value) { _value = value; }
// nodeType XML.nodeType
- /// Returns true if the specified node has child nodes; otherwise,
returns false.
+ /// Returns true if the specified node has child nodes; otherwise,
+ /// returns false.
bool hasChildNodes();
boost::intrusive_ptr<XMLNode> firstChild();
@@ -214,7 +211,7 @@
/// @param encode Whether to URL encode the node values. This
/// is false by default, as it is only necessary
/// for XML.sendAndLoad.
- void toString(std::ostream& str, bool encode = false) const;
+ virtual void toString(std::ostream& str, bool encode = false) const;
// We might turn this back to a dumb pointer, as long
// as we'll make sure in the XMLNode destructor and
=== modified file 'libcore/asobj/XML_as.cpp'
--- a/libcore/asobj/XML_as.cpp 2008-10-23 18:27:11 +0000
+++ b/libcore/asobj/XML_as.cpp 2008-11-18 14:39:48 +0000
@@ -17,6 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
+// The XML parsing algorithms are based on swfdec's parsing model.
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
@@ -34,15 +35,15 @@
#include "VM.h"
#include "namedStrings.h"
#include "array.h"
+#include "StringPredicates.h"
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxml/xmlreader.h>
#include <string>
#include <sstream>
#include <vector>
-#include <boost/algorithm/string/case_conv.hpp>
+#include <algorithm>
+#include <boost/assign/list_of.hpp>
+#include <boost/algorithm/string/compare.hpp>
+#include <boost/algorithm/string/replace.hpp>
namespace gnash {
@@ -54,25 +55,36 @@
// Define this to enable verbosity of XML parsing
//#define DEBUG_XML_PARSE 1
-
-static as_object* getXMLInterface();
-static void attachXMLInterface(as_object& o);
-static void attachXMLProperties(as_object& o);
-
-static as_value xml_new(const fn_call& fn);
-static as_value xml_createelement(const fn_call& fn);
-static as_value xml_createtextnode(const fn_call& fn);
-static as_value xml_getbytesloaded(const fn_call& fn);
-static as_value xml_getbytestotal(const fn_call& fn);
-static as_value xml_parsexml(const fn_call& fn);
-static as_value xml_ondata(const fn_call& fn);
-
+// Forward declarations.
+namespace {
+ as_object* getXMLInterface();
+ void attachXMLInterface(as_object& o);
+ void attachXMLProperties(as_object& o);
+
+ as_value xml_new(const fn_call& fn);
+ as_value xml_createelement(const fn_call& fn);
+ as_value xml_createtextnode(const fn_call& fn);
+ as_value xml_getbytesloaded(const fn_call& fn);
+ as_value xml_getbytestotal(const fn_call& fn);
+ as_value xml_parsexml(const fn_call& fn);
+ as_value xml_ondata(const fn_call& fn);
+ as_value xml_xmlDecl(const fn_call& fn);
+ as_value xml_docTypeDecl(const fn_call& fn);
+
+ bool textAfterWhitespace(const std::string& xml,
+ std::string::const_iterator& it);
+ bool textMatch(const std::string& xml, std::string::const_iterator& it,
+ const std::string& match, bool advance = true);
+ bool parseNodeWithTerminator(const std::string& xml,
+ std::string::const_iterator& it, const std::string& terminator,
+ std::string& content);
+}
XML_as::XML_as()
:
as_object(getXMLInterface()),
_loaded(-1),
- _status(sOK)
+ _status(XML_OK)
{
#ifdef DEBUG_MEMORY_ALLOCATION
log_debug(_("Creating XML data at %p"), this);
@@ -82,36 +94,86 @@
}
-// Parse the ASCII XML string into memory
-XML_as::XML_as(const std::string& xml_in)
+// Parse the ASCII XML string into an XMLNode tree
+XML_as::XML_as(const std::string& xml)
:
as_object(getXMLInterface()),
_loaded(-1),
- _status(sOK)
+ _status(XML_OK)
{
#ifdef DEBUG_MEMORY_ALLOCATION
log_debug(_("Creating XML data at %p"), this);
#endif
- parseXML(xml_in);
+ parseXML(xml);
+}
+
+const XML_as::Entities&
+XML_as::getEntities()
+{
+
+ static Entities entities = boost::assign::map_list_of
+ ("&", "&")
+ (""", "\"")
+ ("<", "<")
+ (">", ">")
+ ("'", "'");
+
+ return entities;
+
+}
+
+void
+XML_as::escape(std::string& text)
+{
+ const Entities& ent = getEntities();
+
+ for (Entities::const_iterator i = ent.begin(), e = ent.end();
+ i != e; ++i)
+ {
+ boost::replace_all(text, i->second, i->first);
+ }
+}
+
+void
+XML_as::unescape(std::string& text)
+{
+ const Entities& ent = getEntities();
+
+ for (Entities::const_iterator i = ent.begin(), e = ent.end();
+ i != e; ++i)
+ {
+ boost::replace_all(text, i->first, i->second);
+ }
+
+}
+
+void
+XML_as::toString(std::ostream& o, bool encode) const
+{
+ if (!_xmlDecl.empty()) o << _xmlDecl;
+ if (!_docTypeDecl.empty()) o << _docTypeDecl;
+
+ XMLNode::toString(o, encode);
}
bool
-XML_as::get_member(string_table::key name, as_value *val, string_table::key
nsname)
+XML_as::get_member(string_table::key name, as_value *val,
+ string_table::key nsname)
{
- if (name == NSV::PROP_STATUS)
- {
- val->set_int(_status);
- return true;
- }
- else if (name == NSV::PROP_LOADED)
- {
- if ( _loaded < 0 ) val->set_undefined();
- else val->set_bool(_loaded);
- return true;
- }
+ if (name == NSV::PROP_STATUS)
+ {
+ val->set_int(_status);
+ return true;
+ }
+ else if (name == NSV::PROP_LOADED)
+ {
+ if ( _loaded < 0 ) val->set_undefined();
+ else val->set_bool(_loaded);
+ return true;
+ }
- return as_object::get_member(name, val, nsname);
+ return as_object::get_member(name, val, nsname);
}
bool
@@ -123,7 +185,8 @@
// TODO: this should really be a proper property (see XML.as)
if ( ! val.is_number() )
{
- _status =
static_cast<ParseStatus>(std::numeric_limits<boost::int32_t>::min());
+ _status = static_cast<ParseStatus>(
+ std::numeric_limits<boost::int32_t>::min());
}
else
{
@@ -136,7 +199,6 @@
{
// TODO: this should really be a proper property
bool b = val.to_bool();
- //log_debug(_("set_member 'loaded' (%s) became boolean %d"), val, b);
if ( b ) _loaded = 1;
else _loaded = 0;
return true;
@@ -145,181 +207,332 @@
return as_object::set_member(name, val, nsname, ifFound);
}
-bool
-XML_as::extractNode(XMLNode& element, xmlNodePtr node, bool mem)
-{
- xmlAttrPtr attr;
- xmlChar *ptr = NULL;
- boost::intrusive_ptr<XMLNode> child;
-
-#ifdef DEBUG_XML_PARSE
- log_debug(_("%s: extracting node %s"), __FUNCTION__, node->name);
-#endif
-
- // See if we have any Attributes (properties)
- attr = node->properties;
- while (attr != NULL)
- {
-#ifdef DEBUG_XML_PARSE
- log_debug(_("extractNode %s has property %s, value is %s"),
- node->name, attr->name, attr->children->content);
-#endif
-
- std::ostringstream name, content;
-
- name << attr->name;
- content << attr->children->content;
-
- XMLAttr attrib(name.str(), content.str());
-
-#ifdef DEBUG_XML_PARSE
- log_debug(_("\tPushing attribute %s for element %s has value %s, next
attribute is %p"),
- attr->name, node->name, attr->children->content, attr->next);
-#endif
-
- element._attributes.push_back(attrib);
- attr = attr->next;
- }
- if (node->type == XML_COMMENT_NODE)
- {
- // Comments apparently not handled until AS3
- // Comments in a text node are a *sibling* of the text node
- // for libxml2.
- return false;
- }
- else if (node->type == XML_ELEMENT_NODE)
- {
- element.nodeTypeSet(tElement);
-
- std::ostringstream name;
- name << node->name;
- element.nodeNameSet(name.str());
- }
- else if ( node->type == XML_TEXT_NODE )
- {
- element.nodeTypeSet(tText);
-
- ptr = xmlNodeGetContent(node);
- if (ptr == NULL) return false;
- if (node->content)
- {
- std::ostringstream in;
- in << ptr;
- // XML_PARSE_NOBLANKS seems not to be working, so here's
- // a custom implementation of it.
- if ( ignoreWhite() )
- {
- if ( in.str().find_first_not_of(" \n\t\r") == std::string::npos )
- {
-#ifdef DEBUG_XML_PARSE
- log_debug("Text node value consists in blanks only,
discarding");
-#endif
- xmlFree(ptr);
- return false;
+void
+XML_as::parseAttribute(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it)
+{
+
+ const std::string terminators("\r\t\n >=");
+
+ std::string::const_iterator end = std::find_first_of(it, xml.end(),
+ terminators.begin(), terminators.end());
+
+ if (end == xml.end()) {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
+ }
+ std::string name(it, end);
+
+ // Point iterator to the character after the name.
+ it = end;
+
+ // Skip any whitespace before the '='. If we reach the end of the string
+ // or don't find an '=', it's a parser error.
+ if (!textAfterWhitespace(xml, it) || *it != '=') {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
+ }
+
+ // Point to the character after the '='
+ ++it;
+
+ // Skip any whitespace. If we reach the end of the string, or don't find
+ // a " or ', it's a parser error.
+ if (!textAfterWhitespace(xml, it) || (*it != '"' && *it != '\'')) {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
+ }
+
+ // Find the end of the attribute, looking for the opening character,
+ // as long as it's not escaped. We begin one after the present position,
+ // which should be the opening character. We want to remember what the
+ // iterator is pointing to for a while, so don't advance it.
+ end = it;
+ do {
+ ++end;
+ end = std::find(end, xml.end(), *it);
+ } while (end != xml.end() && *(end - 1) == '\'');
+
+ if (end == xml.end()) {
+ _status = XML_UNTERMINATED_ATTRIBUTE;
+ return;
+ }
+ ++it;
+
+ std::string value(it, end);
+ //log_debug("adding attribute to node %s: %s, %s", node->nodeName(),
+ // name, value);
+
+ // We've already checked that end != xml.end(), so we can advance at
+ // least once.
+ it = end;
+ // Advance past the last attribute character
+ ++it;
+
+ // Replace entities in the value.
+ escape(value);
+
+ XMLAttr attr(name, value);
+ node->_attributes.push_back(attr);
+
+}
+
+/// Parse and set the docTypeDecl. This is stored without any validation and
+/// with the same case as in the parsed XML.
+void
+XML_as::parseDocTypeDecl(const std::string& xml,
+ std::string::const_iterator& it)
+{
+ std::string content;
+ if (!parseNodeWithTerminator(xml, it, ">", content))
+ {
+ _status = XML_UNTERMINATED_DOCTYPE_DECL;
+ return;
+ }
+ std::ostringstream os;
+ os << '<' << content << '>';
+ _docTypeDecl = os.str();
+}
+
+
+void
+XML_as::parseXMLDecl(const std::string& xml, std::string::const_iterator& it)
+{
+ std::string content;
+ if (!parseNodeWithTerminator(xml, it, "?>", content))
+ {
+ _status = XML_UNTERMINATED_XML_DECL;
+ return;
+ }
+
+ std::ostringstream os;
+ os << "<" << content << "?>";
+
+ // This is appended to any xmlDecl already there.
+ _xmlDecl += os.str();
+
+}
+
+// The iterator should be pointing to the first char after the '<'
+void
+XML_as::parseTag(XMLNode*& node, const std::string& xml,
+ std::string::const_iterator& it)
+{
+ //log_debug("Processing node: %s", node->nodeName());
+
+ bool closing = (*it == '/');
+ if (closing) ++it;
+
+ // These are for terminating the tag name, not (necessarily) the tag.
+ const std::string terminators("\r\n\t >");
+
+ std::string::const_iterator endName = std::find_first_of(it, xml.end(),
+ terminators.begin(), terminators.end());
+
+ // Check that one of the terminators was found; otherwise it's malformed.
+ if (endName == xml.end()) {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
+ }
+
+ // Knock off the "/>" of a self-closing tag.
+ if (std::equal(endName - 1, endName + 1, "/>")) {
+ //log_debug("self-closing tag");
+ --endName;
+ }
+
+ std::string tagName(it, endName);
+ //log_debug("tagName : %s", tagName);
+
+ if (!closing) {
+
+ XMLNode* childNode = new XMLNode;
+ childNode->nodeNameSet(tagName);
+ childNode->nodeTypeSet(Element);
+
+ //log_debug("created childNode with name %s", childNode->nodeName());
+ // Skip to the end of any whitespace after the tag name
+ it = endName;
+
+ if (!textAfterWhitespace(xml, it)) {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
+ }
+
+ // Parse any attributes in an opening tag only, stopping at "/>" or
+ // '>'
+ while (it != xml.end() && *it != '>' && _status == XML_OK)
+ {
+ if (xml.end() - it > 1 && std::equal(it, it + 2, "/>")) break;
+
+ // This advances the iterator
+ parseAttribute(childNode, xml, it);
+
+ // Skip any whitespace. If we reach the end of the string,
+ // it's malformed.
+ if (!textAfterWhitespace(xml, it)) {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
}
}
- element.nodeValueSet(in.str());
- }
- xmlFree(ptr);
- }
-
- // See if we have any data (content)
- xmlNodePtr childnode = node->children;
-
- while (childnode)
- {
- child = new XMLNode();
- child->setParent(&element);
- if ( extractNode(*child, childnode, mem) )
- {
- element._children.push_back(child);
- }
- childnode = childnode->next;
- }
-
- return true;
-}
-
-/*private*/
-bool
-XML_as::parseDoc(xmlNodePtr cur, bool mem)
-{
- GNASH_REPORT_FUNCTION;
-
- while (cur)
- {
- boost::intrusive_ptr<XMLNode> child = new XMLNode();
- child->setParent(this);
-#ifdef DEBUG_XML_PARSE
- log_debug("\tParsing top-level node %s", cur->name);
-#endif
- if ( extractNode(*child, cur, mem) )
- {
- _children.push_back(child);
- }
- cur = cur->next;
- }
-
- return true;
-}
-
-// This parses an XML string into a
-// tree which can be walked through later.
-bool
-XML_as::parseXML(const std::string& xml_in)
-{
-
- if (xml_in.empty())
+
+ node->appendChild(childNode);
+ if (*it == '/') ++it;
+ else node = childNode;
+
+ if (*it == '>') ++it;
+
+ return;
+ }
+
+ // This may be xml.end(), which is okay.
+ it = std::find(endName, xml.end(), '>');
+
+ if (it == xml.end())
+ {
+ _status = XML_UNTERMINATED_ELEMENT;
+ return;
+ }
+ ++it;
+
+ StringNoCaseEqual noCaseCompare;
+
+ if (node->getParent() && noCaseCompare(node->nodeName(), tagName)) {
+ node = node->getParent();
+ }
+ else {
+ // Malformed. Search for the parent node.
+ XMLNode* s = node;
+ while (s && !noCaseCompare(s->nodeName(), tagName)) {
+ //log_debug("parent: %s, this: %s", s->nodeName(), tagName);
+ s = s->getParent();
+ }
+ if (s) {
+ // If there's a parent, the open tag is orphaned.
+ _status = XML_MISSING_CLOSE_TAG;
+ }
+ else {
+ // If no parent, the close tag is orphaned.
+ _status = XML_MISSING_OPEN_TAG;
+ }
+ }
+
+}
+
+void
+XML_as::parseText(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it)
+{
+ std::string::const_iterator end = std::find(it, xml.end(), '<');
+ std::string content(it, end);
+
+ it = end;
+
+ if (ignoreWhite() &&
+ content.find_first_not_of("\t\r\n ") == std::string::npos) return;
+
+ XMLNode* childNode = new XMLNode;
+
+ childNode->nodeTypeSet(XMLNode::Text);
+
+ // Replace any entitites.
+ unescape(content);
+
+ childNode->nodeValueSet(content);
+ node->appendChild(childNode);
+
+ //log_debug("appended text node: %s", content);
+}
+
+
+
+void
+XML_as::parseComment(XMLNode* /*node*/, const std::string& xml,
+ std::string::const_iterator& it)
+{
+ log_debug("discarding comment node");
+
+ std::string content;
+
+ if (!parseNodeWithTerminator(xml, it, "-->", content)) {
+ _status = XML_UNTERMINATED_COMMENT;
+ return;
+ }
+ // Comments are discarded at least up to SWF8
+
+}
+
+void
+XML_as::parseCData(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it)
+{
+ std::string content;
+
+ if (!parseNodeWithTerminator(xml, it, "]]>", content)) {
+ _status = XML_UNTERMINATED_CDATA;
+ return;
+ }
+
+ XMLNode* childNode = new XMLNode;
+ childNode->nodeValueSet(content);
+ childNode->nodeTypeSet(Text);
+ node->appendChild(childNode);
+
+}
+
+
+// This parses an XML string into a tree of XMLNodes.
+void
+XML_as::parseXML(const std::string& xml)
+{
+ GNASH_REPORT_FUNCTION;
+ if (xml.empty())
{
log_error(_("XML data is empty"));
- return false;
+ return;
}
// Clear current data
clear();
+ _status = XML_OK;
- initParser();
-
- xmlNodePtr firstNode;
-
- xmlDocPtr doc = xmlReadMemory(xml_in.c_str(), xml_in.size(), NULL, NULL,
getXMLOptions()); // do NOT recover here !
- if ( doc )
- {
- firstNode = doc->children; // xmlDocGetRootElement(doc);
- }
- else
- {
- log_debug(_("malformed XML, trying to recover"));
- int ret = xmlParseBalancedChunkMemoryRecover(NULL, NULL, NULL,
- 0, (const xmlChar*)xml_in.c_str(), &firstNode, 1);
- log_debug("xmlParseBalancedChunkMemoryRecover returned %d", ret);
- if ( ! firstNode )
- {
- log_error(_("unrecoverable malformed XML "
- "(xmlParseBalancedChunkMemoryRecover returned "
- "%d)."), ret);
- return false;
- }
- else
- {
- log_error(_("recovered malformed XML."));
- }
- }
-
-
-
- bool ret = parseDoc(firstNode, true);
-
- xmlCleanupParser();
- if ( doc ) xmlFreeDoc(doc); // TOCHECK: can it be freed before ?
- else if ( firstNode ) xmlFreeNodeList(firstNode);
- xmlMemoryDump();
-
- return ret;
+
+ std::string::const_iterator it = xml.begin();
+ XMLNode* node = this;
+
+ while (it != xml.end() && _status == XML_OK)
+ {
+ if (*it == '<')
+ {
+ ++it;
+ if (textMatch(xml, it, "!DOCTYPE", false))
+ {
+ // We should not advance past the DOCTYPE label, as
+ // the case is preserved.
+ parseDocTypeDecl(xml, it);
+ }
+ else if (textMatch(xml, it, "?xml", false))
+ {
+ // We should not advance past the xml label, as
+ // the case is preserved.
+ parseXMLDecl(xml, it);
+ }
+ else if (textMatch(xml, it, "!--"))
+ {
+ parseComment(node, xml, it);
+ }
+ else if (textMatch(xml, it, "![CDATA["))
+ {
+ parseCData(node, xml, it);
+ }
+ else parseTag(node, xml, it);
+ }
+ else parseText(node, xml, it);
+ }
+ return;
}
-
bool
XML_as::onLoad()
{
@@ -329,8 +542,51 @@
}
-
-static void
+void
+XML_as::clear()
+{
+ // TODO: should set childs's parent to NULL ?
+ _children.clear();
+ _attributes.clear();
+ _docTypeDecl.clear();
+ _xmlDecl.clear();
+}
+
+bool
+XML_as::ignoreWhite() const
+{
+
+ string_table::key propnamekey = _vm.getStringTable().find("ignoreWhite");
+ as_value val;
+ if (!const_cast<XML_as*>(this)->get_member(propnamekey, &val)) return
false;
+ return val.to_bool();
+}
+
+
+// extern (used by Global.cpp)
+void
+xml_class_init(as_object& global)
+{
+
+ static boost::intrusive_ptr<builtin_function> cl;
+
+ if ( cl == NULL )
+ {
+ cl=new builtin_function(&xml_new, getXMLInterface());
+ }
+
+ global.init_member("XML", cl.get());
+
+}
+
+///
+/// XML object AS interface.
+///
+
+namespace {
+
+
+void
attachXMLProperties(as_object& /*o*/)
{
// if we use a proper member here hasOwnProperty() would return true
@@ -338,7 +594,7 @@
//o.init_member("status", as_value(XML::sOK));
}
-static void
+void
attachXMLInterface(as_object& o)
{
const int flags = 0;
@@ -363,9 +619,11 @@
LoadableObject::loadableobject_sendAndLoad), flags);
o.init_member("onData", new builtin_function(xml_ondata), flags);
+ o.init_property("xmlDecl", &xml_xmlDecl, &xml_xmlDecl, flags);
+ o.init_property("docTypeDecl", &xml_docTypeDecl, &xml_docTypeDecl, flags);
}
-static as_object*
+as_object*
getXMLInterface()
{
static boost::intrusive_ptr<as_object> o;
@@ -426,7 +684,7 @@
/// created XML object that represents the element. This method and
/// the XML.createTextNode() method are the constructor methods for
/// creating nodes for an XML object.
-static as_value
+as_value
xml_createelement(const fn_call& fn)
{
@@ -435,7 +693,7 @@
const std::string& text = fn.arg(0).to_string();
XMLNode *xml_obj = new XMLNode;
xml_obj->nodeNameSet(text);
- xml_obj->nodeTypeSet(XMLNode::tText);
+ xml_obj->nodeTypeSet(XMLNode::Text);
return as_value(xml_obj);
@@ -463,7 +721,7 @@
const std::string& text = fn.arg(0).to_string();
XMLNode* xml_obj = new XMLNode;
xml_obj->nodeValueSet(text);
- xml_obj->nodeTypeSet(XMLNode::tText);
+ xml_obj->nodeTypeSet(XMLNode::Text);
return as_value(xml_obj);
}
else {
@@ -493,7 +751,7 @@
}
-static as_value
+as_value
xml_parsexml(const fn_call& fn)
{
@@ -513,11 +771,53 @@
return as_value();
}
-
-static as_value
+as_value
+xml_xmlDecl(const fn_call& fn)
+{
+ boost::intrusive_ptr<XML_as> ptr = ensureType<XML_as>(fn.this_ptr);
+
+ if (!fn.nargs)
+ {
+ // Getter
+ const std::string& xml = ptr->getXMLDecl();
+ if (xml.empty()) return as_value();
+ return as_value(xml);
+ }
+
+ // Setter
+
+ const std::string& xml = fn.arg(0).to_string();
+ ptr->setDocTypeDecl(xml);
+
+ return as_value();
+
+}
+
+as_value
+xml_docTypeDecl(const fn_call& fn)
+{
+ boost::intrusive_ptr<XML_as> ptr = ensureType<XML_as>(fn.this_ptr);
+
+ if (!fn.nargs)
+ {
+ // Getter
+ const std::string& docType = ptr->getDocTypeDecl();
+ if (docType.empty()) return as_value();
+ return as_value(docType);
+ }
+
+ // Setter
+
+ const std::string& docType = fn.arg(0).to_string();
+ ptr->setDocTypeDecl(docType);
+
+ return as_value();
+
+}
+
+as_value
xml_ondata(const fn_call& fn)
{
- GNASH_REPORT_FUNCTION;
as_object* thisPtr = fn.this_ptr.get();
assert(thisPtr);
@@ -542,78 +842,66 @@
return as_value();
}
-// extern (used by Global.cpp)
-void xml_class_init(as_object& global)
-{
-
- static boost::intrusive_ptr<builtin_function> cl;
-
- if ( cl == NULL )
- {
- cl=new builtin_function(&xml_new, getXMLInterface());
- }
-
- global.init_member("XML", cl.get());
-
-}
-
-
-void
-XML_as::initParser()
-{
- static bool initialized = false;
- if ( ! initialized )
- {
- xmlInitParser();
- //xmlGenericErrorFunc func = _xmlErrorHandler;
- //initGenericErrorDefaultFunc(&func);
- initialized = true;
- }
-}
-
-void
-XML_as::clear()
-{
- // TODO: should set childs's parent to NULL ?
- _children.clear();
-
- _attributes.clear();
-}
-
-/*private*/
-bool
-XML_as::ignoreWhite() const
-{
-
- string_table::key propnamekey = _vm.getStringTable().find("ignoreWhite");
- as_value val;
- if (!const_cast<XML_as*>(this)->get_member(propnamekey, &val) ) return
false;
- return val.to_bool();
-}
-
-/*private*/
-int
-XML_as::getXMLOptions() const
-{
- int options = XML_PARSE_NOENT
- //| XML_PARSE_RECOVER -- don't recover now, we'll call
xmlParseBalancedChunkRecover later
- //| XML_PARSE_NOWARNING
- //| XML_PARSE_NOERROR
- | XML_PARSE_NOCDATA;
- // Using libxml2 to convert CDATA nodes to text seems to be what is
- // required.
-
- if ( ignoreWhite() )
- {
- // This doesn't seem to work, so the blanks skipping
- // is actually implemented in XML::extractNode instead.
- //log_debug("Adding XML_PARSE_NOBLANKS to options");
- options |= XML_PARSE_NOBLANKS;
- }
-
- return options;
-}
-
+/// Case insenstive match of a string, returning false if there too few
+/// characters left or if there is no match. If there is a match, and advance
+/// is not false, the iterator points to the character after the match.
+bool
+textMatch(const std::string& xml, std::string::const_iterator& it,
+ const std::string& match, bool advance)
+{
+
+ const std::string::size_type len = match.length();
+ const std::string::const_iterator end = xml.end();
+
+ if (static_cast<size_t>(end - it) < len) return false;
+
+ if (!std::equal(it, it + len, match.begin(), boost::is_iequal())) {
+ return false;
+ }
+ if (advance) it += len;
+ return true;
+}
+
+/// Advance past whitespace
+//
+/// @return true if there is text after the whitespace, false if we
+/// reach the end of the string.
+bool
+textAfterWhitespace(const std::string& xml, std::string::const_iterator& it)
+{
+ const std::string whitespace("\r\t\n ");
+ while (it != xml.end() && whitespace.find(*it) != std::string::npos) ++it;
+ return (it != xml.end());
+}
+
+/// Parse a complete node up to a specified terminator.
+//
+/// @return false if we reach the end of the text before finding the
+/// terminator.
+/// @param it The current position of the iterator. If the return is true,
+/// this points to the first character after the terminator
+/// after return
+/// @param content If the return is true, this is filled with the content of
+/// the tag.
+/// @param xml The complete XML string.
+bool
+parseNodeWithTerminator(const std::string& xml, std::string::const_iterator&
it,
+ const std::string& terminator, std::string& content)
+{
+ std::string::const_iterator end = std::search(it, xml.end(),
+ terminator.begin(), terminator.end());
+
+ if (end == xml.end()) {
+ return false;
+ }
+
+ content = std::string(it, end);
+ it = end + terminator.length();
+
+ return true;
+}
+
+} // anonymous namespace
} // end of gnash namespace
// Local Variables:
=== modified file 'libcore/asobj/XML_as.h'
--- a/libcore/asobj/XML_as.h 2008-10-19 19:36:12 +0000
+++ b/libcore/asobj/XML_as.h 2008-11-18 14:30:05 +0000
@@ -23,9 +23,8 @@
#include "log.h"
#include "dsodefs.h"
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/xmlreader.h>
+#include <map>
+#include <string>
//#define DEBUG_MEMORY_ALLOCATION 1
@@ -42,52 +41,47 @@
public:
enum ParseStatus {
-
- /// Parsing was successful
- sOK = 0,
-
- /// Unterminated CDATA section
- sECDATA = -2,
-
- /// Unterminated XML declaration
- sEXMLDECL = -3,
-
- /// Unterminated DOCTYPE declaration
- sEDOCTYPEDECL = -4,
-
- /// Unterminated comment
- sECOMM = -5,
-
- /// Malformed XML element structure
- sESTRUCT = -6,
-
- /// Out of memory
- sEMEM = -7,
-
- /// Unterminated attribute value
- sEATTR = -8,
-
- /// Missing close tag (orphaned open tag)
- sEOPENTAG = -9,
-
- /// Missing start tag (orphaned close tag)
- sECLOSETAG = -10
-
+ XML_OK = 0,
+ XML_UNTERMINATED_CDATA = -2,
+ XML_UNTERMINATED_XML_DECL = -3,
+ XML_UNTERMINATED_DOCTYPE_DECL = -4,
+ XML_UNTERMINATED_COMMENT = -5,
+ XML_UNTERMINATED_ELEMENT = -6,
+ XML_OUT_OF_MEMORY = -7,
+ XML_UNTERMINATED_ATTRIBUTE = -8,
+ XML_MISSING_CLOSE_TAG = -9,
+ XML_MISSING_OPEN_TAG = -10
};
-
XML_as();
- XML_as(const std::string& xml_in);
+
+ XML_as(const std::string& xml);
+
~XML_as() {};
/// Convert the XML object to a string
//
- /// This calls XMLNode::toString.
+ /// This calls XMLNode::toString after adding an xmlDecl and
+ /// docTypeDecl
+ //
/// @param o The ostream to write the string to.
/// @param encode Whether to URL encode the node values.
- void toString(std::ostream& o, bool encode) const
- {
- XMLNode::toString(o, encode);
+ void toString(std::ostream& o, bool encode) const;
+
+ const std::string& getXMLDecl() const {
+ return _xmlDecl;
+ }
+
+ void setXMLDecl(const std::string& xml) {
+ _xmlDecl = xml;
+ }
+
+ const std::string& getDocTypeDecl() const {
+ return _docTypeDecl;
+ }
+
+ void setDocTypeDecl(const std::string& docType) {
+ _docTypeDecl = docType;
}
/// This is overridden to provide the 'status' and 'loaded' members,
@@ -108,71 +102,76 @@
/// Parses an XML document into the specified XML object tree.
//
- /// This reads in an XML file from disk and parses into into a memory
resident
- /// tree which can be walked through later.
+ /// This reads in an XML file from disk and parses into into a memory
+ /// resident tree which can be walked through later.
///
/// Calls to this function clear any precedently parsed data.
///
- bool parseXML(const std::string& xml_in);
-
- // An event handler that returns a
+ void parseXML(const std::string& xml);
+
+ void parseTag(XMLNode*& node, const std::string& xml,
+ std::string::const_iterator& it);
+
+ void parseAttribute(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it);
+
+ void parseDocTypeDecl(const std::string& xml,
+ std::string::const_iterator& it);
+
+ void parseText(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it);
+
+ void parseXMLDecl(const std::string& xml,
+ std::string::const_iterator& it);
+
+ void parseComment(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it);
+
+ void parseCData(XMLNode* node, const std::string& xml,
+ std::string::const_iterator& it);
+
+ // An event handler that returns a what?
bool onLoad();
- XMLNode *processNode(xmlTextReaderPtr reader, XMLNode *node);
-
- void change_stack_frame(int frame, gnash::as_object *xml,
gnash::as_environment *env);
-
- XMLNode *createElement(const char *name);
-
- XMLNode *createTextNode(const char *name);
+ /// Escape using XML entities.
+ //
+ /// Note this is not the same as a URL escape.
+ static void escape(std::string& text);
+
+ /// Unescape XML entities.
+ //
+ /// Note this is not the same as a URL unescape.
+ static void unescape(std::string& text);
+
+ XMLNode* createElement(const std::string& name);
+
+ XMLNode* createTextNode(const std::string& name);
private:
- /// Remove all childs
+ typedef std::map<std::string, std::string> Entities;
+
+ static const Entities& getEntities();
+
+ /// Remove all children
void clear();
/// \brief
- /// Return true if ignoreWhite property was set to anythign evaluating
+ /// Return true if ignoreWhite property was set to anything evaluating
/// to true.
bool ignoreWhite() const;
- /// Return the libxml2 options to use during parsing.
- //
- /// The options might depend on current XML object state, like
- /// the 'ignoreWhite' parameter.
- ///
- /// See http://xmlsoft.org/html/libxml-parser.html#xmlParserOption
- ///
- int getXMLOptions() const;
-
- /// Read in an XML document from the specified source
- //
- /// This is the base method used by both parseXML() and load().
- ///
- bool parseDoc(xmlNodePtr startNode, bool mem);
-
// -1 if never asked to load anything
// 0 if asked to load but not yet loaded (or failure)
// 1 if successfully loaded
int _loaded;
ParseStatus _status;
-
- /// Initialize an XMLNode from an xmlNodePtr
- //
- /// @param element
- /// The XMLNode to initialize.
- ///
- /// @return false if the xmlNodePtr shouldn't exist
- /// (ie: an all-blanks node with ignoreWhite set to true).
- ///
- bool extractNode(XMLNode& element, xmlNodePtr node, bool mem);
-
- void setupFrame(gnash::as_object *xml, XMLNode *data, bool src);
-
- /// Initialize the libxml2 parser
- void initParser();
-
+
+ std::string _docTypeDecl;
+
+ std::string _xmlDecl;
+
};
=== modified file 'libcore/asobj/flash/display/BitmapData_as.cpp'
--- a/libcore/asobj/flash/display/BitmapData_as.cpp 2008-09-20 09:19:09
+0000
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp 2008-11-15 19:49:41
+0000
@@ -522,8 +522,8 @@
boost::intrusive_ptr<as_object> obj = init_Rectangle_instance();
- obj->set_member(NSV::PROP_X, 0);
- obj->set_member(NSV::PROP_Y, 0);
+ obj->set_member(NSV::PROP_X, 0.0);
+ obj->set_member(NSV::PROP_Y, 0.0);
obj->set_member(NSV::PROP_WIDTH, ptr->getWidth());
obj->set_member(NSV::PROP_HEIGHT, ptr->getHeight());
=== removed file 'libcore/asobj/xmlattrs.cpp'
--- a/libcore/asobj/xmlattrs.cpp 2008-03-28 16:23:06 +0000
+++ b/libcore/asobj/xmlattrs.cpp 1970-01-01 00:00:00 +0000
@@ -1,51 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-//#include <sys/types.h>
-//#include <sys/stat.h>
-//#include <vector>
-
-//#include "action.h"
-//#include "impl.h"
-//#include "as_function.h"
-
-//#include "xmlattrs.h"
-
-//#ifdef DEBUG_MEMORY_ALLOCATION
-// #include "log.h"
-//#endif
-
-//#include <unistd.h>
-//#include <libxml/xmlmemory.h>
-//#include <libxml/parser.h>
-//#include <libxml/tree.h>
-//#include <libxml/xmlreader.h>
-
-namespace gnash {
-
-//#define DEBUG_MEMORY_ALLOCATION 1
-
-//std::vector<as_object *> _xmlobjs; // FIXME: hack alert
-
-
-} // end of gnash namespace
-
-
-// Local Variables:
-// mode: C++
-// indent-tabs-mode: t
-// End:
=== modified file 'libcore/asobj/xmlattrs.h'
--- a/libcore/asobj/xmlattrs.h 2008-10-02 11:08:11 +0000
+++ b/libcore/asobj/xmlattrs.h 2008-11-18 09:29:12 +0000
@@ -18,21 +18,8 @@
#ifndef GNASH_XML_ATTRS_H
#define GNASH_XML_ATTRS_H
-//#define DEBUG_MEMORY_ALLOCATION 1
-#include "as_object.h" // for inheritance
-
#include "log.h"
-#include <vector>
-
-#ifdef DEBUG_MEMORY_ALLOCATION
- #include "log.h"
-#endif
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/xmlreader.h>
-
namespace gnash {
/// XML Attribute class
@@ -60,29 +47,12 @@
std::string _name;
std::string _value;
- xmlAttributeType _type;
};
-/// XML Attribute ActionScript Object
-class xmlattr_as_object : public as_object
-{
-public:
- //XMLAttr obj;
- int padding;
-#ifdef DEBUG_MEMORY_ALLOCATION
- xmlattr_as_object() {
- log_debug("\t\tCreating xmlattr_as_object at %p\n", this);
- };
- ~xmlattr_as_object() {
- log_debug("\tDeleting xmlattr_as_object at %p \n", this);
- };
-#endif
-};
-
} // end of gnash namespace
-#endif // __XML_ATTRS_H__
+#endif
// Local Variables:
=== modified file 'libcore/character.cpp'
--- a/libcore/character.cpp 2008-10-25 10:38:32 +0000
+++ b/libcore/character.cpp 2008-11-15 13:25:03 +0000
@@ -429,6 +429,8 @@
}
+/// _visible can be set with true/false, but also
+/// 0 and 1.
as_value
character::visible_getset(const fn_call& fn)
{
@@ -441,8 +443,17 @@
}
else // setter
{
- ptr->set_visible(fn.arg(0).to_bool());
- ptr->transformedByScript(); // m_accept_anim_moves = false;
+ /// We cast to number and rely (mostly) on C++'s automatic
+ /// cast to bool, as string "0" should be converted to
+ /// its numeric equivalent, not interpreted as 'true', which
+ /// SWF7+ does for strings.
+ double d = fn.arg(0).to_number();
+
+ // Undefined or NaN is false.
+ if (isInf(d) || isNaN(d)) ptr->set_visible(false);
+ else ptr->set_visible(d);
+
+ ptr->transformedByScript();
}
return rv;
=== added file 'libcore/swf.cpp'
--- a/libcore/swf.cpp 1970-01-01 00:00:00 +0000
+++ b/libcore/swf.cpp 2008-11-17 17:24:29 +0000
@@ -0,0 +1,802 @@
+//
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#include "swf.h"
+#include <iostream>
+
+namespace gnash {
+namespace SWF { // gnash::SWF
+
+std::ostream&
+operator<< (std::ostream& os, const abc_action_type& opcode)
+{
+ switch (opcode)
+ {
+ case ABC_ACTION_END:
+ os << "ABC_ACTION_END";
+ break;
+ case ABC_ACTION_BKPT:
+ os << "ABC_ACTION_BKPT";
+ break;
+ case ABC_ACTION_NOP:
+ os << "ABC_ACTION_NOP";
+ break;
+ case ABC_ACTION_THROW:
+ os << "ABC_ACTION_THROW";
+ break;
+ case ABC_ACTION_GETSUPER:
+ os << "ABC_ACTION_GETSUPER";
+ break;
+ case ABC_ACTION_SETSUPER:
+ os << "ABC_ACTION_SETSUPER";
+ break;
+ case ABC_ACTION_DXNS:
+ os << "ABC_ACTION_DXNS";
+ break;
+ case ABC_ACTION_DXNSLATE:
+ os << "ABC_ACTION_DXNSLATE";
+ break;
+ case ABC_ACTION_KILL:
+ os << "ABC_ACTION_KILL";
+ break;
+ case ABC_ACTION_LABEL:
+ os << "ABC_ACTION_LABEL";
+ break;
+ case ABC_ACTION_0x0A:
+ os << "ABC_ACTION_0x0A";
+ break;
+ case ABC_ACTION_0X0B:
+ os << "ABC_ACTION_0X0B";
+ break;
+ case ABC_ACTION_IFNLT:
+ os << "ABC_ACTION_IFNLT";
+ break;
+ case ABC_ACTION_IFNLE:
+ os << "ABC_ACTION_IFNLE";
+ break;
+ case ABC_ACTION_IFNGT:
+ os << "ABC_ACTION_IFNGT";
+ break;
+ case ABC_ACTION_IFNGE:
+ os << "ABC_ACTION_IFNGE";
+ break;
+ case ABC_ACTION_JUMP:
+ os << "ABC_ACTION_JUMP";
+ break;
+ case ABC_ACTION_IFTRUE:
+ os << "ABC_ACTION_IFTRUE";
+ break;
+ case ABC_ACTION_IFFALSE:
+ os << "ABC_ACTION_IFFALSE";
+ break;
+ case ABC_ACTION_IFEQ:
+ os << "ABC_ACTION_IFEQ";
+ break;
+ case ABC_ACTION_IFNE:
+ os << "ABC_ACTION_IFNE";
+ break;
+ case ABC_ACTION_IFLT:
+ os << "ABC_ACTION_IFLT";
+ break;
+ case ABC_ACTION_IFLE:
+ os << "ABC_ACTION_IFLE";
+ break;
+ case ABC_ACTION_IFGT:
+ os << "ABC_ACTION_IFGT";
+ break;
+ case ABC_ACTION_IFGE:
+ os << "ABC_ACTION_IFGE";
+ break;
+ case ABC_ACTION_IFSTRICTEQ:
+ os << "ABC_ACTION_IFSTRICTEQ";
+ break;
+ case ABC_ACTION_IFSTRICTNE:
+ os << "ABC_ACTION_IFSTRICTNE";
+ break;
+ case ABC_ACTION_LOOKUPSWITCH:
+ os << "ABC_ACTION_LOOKUPSWITCH";
+ break;
+ case ABC_ACTION_PUSHWITH:
+ os << "ABC_ACTION_PUSHWITH";
+ break;
+ case ABC_ACTION_POPSCOPE:
+ os << "ABC_ACTION_POPSCOPE";
+ break;
+ case ABC_ACTION_NEXTNAME:
+ os << "ABC_ACTION_NEXTNAME";
+ break;
+ case ABC_ACTION_HASNEXT:
+ os << "ABC_ACTION_HASNEXT";
+ break;
+ case ABC_ACTION_PUSHNULL:
+ os << "ABC_ACTION_PUSHNULL";
+ break;
+ case ABC_ACTION_PUSHUNDEFINED:
+ os << "ABC_ACTION_PUSHUNDEFINED";
+ break;
+ case ABC_ACTION_0x22:
+ os << "ABC_ACTION_0x22";
+ break;
+ case ABC_ACTION_NEXTVALUE:
+ os << "ABC_ACTION_NEXTVALUE";
+ break;
+ case ABC_ACTION_PUSHBYTE:
+ os << "ABC_ACTION_PUSHBYTE";
+ break;
+ case ABC_ACTION_PUSHSHORT:
+ os << "ABC_ACTION_PUSHSHORT";
+ break;
+ case ABC_ACTION_PUSHTRUE:
+ os << "ABC_ACTION_PUSHTRUE";
+ break;
+ case ABC_ACTION_PUSHFALSE:
+ os << "ABC_ACTION_PUSHFALSE";
+ break;
+ case ABC_ACTION_PUSHNAN:
+ os << "ABC_ACTION_PUSHNAN";
+ break;
+ case ABC_ACTION_POP:
+ os << "ABC_ACTION_POP";
+ break;
+ case ABC_ACTION_DUP:
+ os << "ABC_ACTION_DUP";
+ break;
+ case ABC_ACTION_SWAP:
+ os << "ABC_ACTION_SWAP";
+ break;
+ case ABC_ACTION_PUSHSTRING:
+ os << "ABC_ACTION_PUSHSTRING";
+ break;
+ case ABC_ACTION_PUSHINT:
+ os << "ABC_ACTION_PUSHINT";
+ break;
+ case ABC_ACTION_PUSHUINT:
+ os << "ABC_ACTION_PUSHUINT";
+ break;
+ case ABC_ACTION_PUSHDOUBLE:
+ os << "ABC_ACTION_PUSHDOUBLE";
+ break;
+ case ABC_ACTION_PUSHSCOPE:
+ os << "ABC_ACTION_PUSHSCOPE";
+ break;
+ case ABC_ACTION_PUSHNAMESPACE:
+ os << "ABC_ACTION_PUSHNAMESPACE";
+ break;
+ case ABC_ACTION_HASNEXT2:
+ os << "ABC_ACTION_HASNEXT2";
+ break;
+ case ABC_ACTION_0x33:
+ os << "ABC_ACTION_0x33";
+ break;
+ case ABC_ACTION_0x34:
+ os << "ABC_ACTION_0x34";
+ break;
+ case ABC_ACTION_0x35:
+ os << "ABC_ACTION_0x35";
+ break;
+ case ABC_ACTION_0x36:
+ os << "ABC_ACTION_0x36";
+ break;
+ case ABC_ACTION_0x37:
+ os << "ABC_ACTION_0x37";
+ break;
+ case ABC_ACTION_0x38:
+ os << "ABC_ACTION_0x38";
+ break;
+ case ABC_ACTION_0x39:
+ os << "ABC_ACTION_0x39";
+ break;
+ case ABC_ACTION_0x3A:
+ os << "ABC_ACTION_0x3A";
+ break;
+ case ABC_ACTION_0x3B:
+ os << "ABC_ACTION_0x3B";
+ break;
+ case ABC_ACTION_0x3C:
+ os << "ABC_ACTION_0x3C";
+ break;
+ case ABC_ACTION_0x3D:
+ os << "ABC_ACTION_0x3D";
+ break;
+ case ABC_ACTION_0x3E:
+ os << "ABC_ACTION_0x3E";
+ break;
+ case ABC_ACTION_0x3F:
+ os << "ABC_ACTION_0x3F";
+ break;
+ case ABC_ACTION_NEWFUNCTION:
+ os << "ABC_ACTION_NEWFUNCTION";
+ break;
+ case ABC_ACTION_CALL:
+ os << "ABC_ACTION_CALL";
+ break;
+ case ABC_ACTION_CONSTRUCT:
+ os << "ABC_ACTION_CONSTRUCT";
+ break;
+ case ABC_ACTION_CALLMETHOD:
+ os << "ABC_ACTION_CALLMETHOD";
+ break;
+ case ABC_ACTION_CALLSTATIC:
+ os << "ABC_ACTION_CALLSTATIC";
+ break;
+ case ABC_ACTION_CALLSUPER:
+ os << "ABC_ACTION_CALLSUPER";
+ break;
+ case ABC_ACTION_CALLPROPERTY:
+ os << "ABC_ACTION_CALLPROPERTY";
+ break;
+ case ABC_ACTION_RETURNVOID:
+ os << "ABC_ACTION_RETURNVOID";
+ break;
+ case ABC_ACTION_RETURNVALUE:
+ os << "ABC_ACTION_RETURNVALUE";
+ break;
+ case ABC_ACTION_CONSTRUCTSUPER:
+ os << "ABC_ACTION_CONSTRUCTSUPER";
+ break;
+ case ABC_ACTION_CONSTRUCTPROP:
+ os << "ABC_ACTION_CONSTRUCTPROP";
+ break;
+ case ABC_ACTION_CALLSUPERID:
+ os << "ABC_ACTION_CALLSUPERID";
+ break;
+ case ABC_ACTION_CALLPROPLEX:
+ os << "ABC_ACTION_CALLPROPLEX";
+ break;
+ case ABC_ACTION_CALLINTERFACE:
+ os << "ABC_ACTION_CALLINTERFACE";
+ break;
+ case ABC_ACTION_CALLSUPERVOID:
+ os << "ABC_ACTION_CALLSUPERVOID";
+ break;
+ case ABC_ACTION_CALLPROPVOID:
+ os << "ABC_ACTION_CALLPROPVOID";
+ break;
+ case ABC_ACTION_0x50:
+ os << "ABC_ACTION_0x50";
+ break;
+ case ABC_ACTION_0x51:
+ os << "ABC_ACTION_0x51";
+ break;
+ case ABC_ACTION_0x52:
+ os << "ABC_ACTION_0x52";
+ break;
+ case ABC_ACTION_0x53:
+ os << "ABC_ACTION_0x53";
+ break;
+ case ABC_ACTION_0x54:
+ os << "ABC_ACTION_0x54";
+ break;
+ case ABC_ACTION_NEWOBJECT:
+ os << "ABC_ACTION_NEWOBJECT";
+ break;
+ case ABC_ACTION_NEWARRAY:
+ os << "ABC_ACTION_NEWARRAY";
+ break;
+ case ABC_ACTION_NEWACTIVATION:
+ os << "ABC_ACTION_NEWACTIVATION";
+ break;
+ case ABC_ACTION_NEWCLASS:
+ os << "ABC_ACTION_NEWCLASS";
+ break;
+ case ABC_ACTION_GETDESCENDANTS:
+ os << "ABC_ACTION_GETDESCENDANTS";
+ break;
+ case ABC_ACTION_NEWCATCH:
+ os << "ABC_ACTION_NEWCATCH";
+ break;
+ case ABC_ACTION_0x5B:
+ os << "ABC_ACTION_0x5B";
+ break;
+ case ABC_ACTION_0x5C:
+ os << "ABC_ACTION_0x5C";
+ break;
+ case ABC_ACTION_FINDPROPSTRICT:
+ os << "ABC_ACTION_FINDPROPSTRICT";
+ break;
+ case ABC_ACTION_FINDPROPERTY:
+ os << "ABC_ACTION_FINDPROPERTY";
+ break;
+ case ABC_ACTION_FINDDEF:
+ os << "ABC_ACTION_FINDDEF";
+ break;
+ case ABC_ACTION_GETLEX:
+ os << "ABC_ACTION_GETLEX";
+ break;
+ case ABC_ACTION_SETPROPERTY:
+ os << "ABC_ACTION_SETPROPERTY";
+ break;
+ case ABC_ACTION_GETLOCAL:
+ os << "ABC_ACTION_GETLOCAL";
+ break;
+ case ABC_ACTION_SETLOCAL:
+ os << "ABC_ACTION_SETLOCAL";
+ break;
+ case ABC_ACTION_GETGLOBALSCOPE:
+ os << "ABC_ACTION_GETGLOBALSCOPE";
+ break;
+ case ABC_ACTION_GETSCOPEOBJECT:
+ os << "ABC_ACTION_GETSCOPEOBJECT";
+ break;
+ case ABC_ACTION_GETPROPERTY:
+ os << "ABC_ACTION_GETPROPERTY";
+ break;
+ case ABC_ACTION_0x67:
+ os << "ABC_ACTION_0x67";
+ break;
+ case ABC_ACTION_INITPROPERTY:
+ os << "ABC_ACTION_INITPROPERTY";
+ break;
+ case ABC_ACTION_0x69:
+ os << "ABC_ACTION_0x69";
+ break;
+ case ABC_ACTION_DELETEPROPERTY:
+ os << "ABC_ACTION_DELETEPROPERTY";
+ break;
+ case ABC_ACTION_0x6B:
+ os << "ABC_ACTION_0x6B";
+ break;
+ case ABC_ACTION_GETSLOT:
+ os << "ABC_ACTION_GETSLOT";
+ break;
+ case ABC_ACTION_SETSLOT:
+ os << "ABC_ACTION_SETSLOT";
+ break;
+ case ABC_ACTION_GETGLOBALSLOT:
+ os << "ABC_ACTION_GETGLOBALSLOT";
+ break;
+ case ABC_ACTION_SETGLOBALSLOT:
+ os << "ABC_ACTION_SETGLOBALSLOT";
+ break;
+ case ABC_ACTION_CONVERT_S:
+ os << "ABC_ACTION_CONVERT_S";
+ break;
+ case ABC_ACTION_ESC_XELEM:
+ os << "ABC_ACTION_ESC_XELEM";
+ break;
+ case ABC_ACTION_ESC_XATTR:
+ os << "ABC_ACTION_ESC_XATTR";
+ break;
+ case ABC_ACTION_CONVERT_I:
+ os << "ABC_ACTION_CONVERT_I";
+ break;
+ case ABC_ACTION_CONVERT_U:
+ os << "ABC_ACTION_CONVERT_U";
+ break;
+ case ABC_ACTION_CONVERT_D:
+ os << "ABC_ACTION_CONVERT_D";
+ break;
+ case ABC_ACTION_CONVERT_B:
+ os << "ABC_ACTION_CONVERT_B";
+ break;
+ case ABC_ACTION_CONVERT_O:
+ os << "ABC_ACTION_CONVERT_O";
+ break;
+ case ABC_ACTION_CHECKFILTER:
+ os << "ABC_ACTION_CHECKFILTER";
+ break;
+ case ABC_ACTION_0x79:
+ os << "ABC_ACTION_0x79";
+ break;
+ case ABC_ACTION_0x7A:
+ os << "ABC_ACTION_0x7A";
+ break;
+ case ABC_ACTION_0x7B:
+ os << "ABC_ACTION_0x7B";
+ break;
+ case ABC_ACTION_0x7C:
+ os << "ABC_ACTION_0x7C";
+ break;
+ case ABC_ACTION_0x7D:
+ os << "ABC_ACTION_0x7D";
+ break;
+ case ABC_ACTION_0x7E:
+ os << "ABC_ACTION_0x7E";
+ break;
+ case ABC_ACTION_0x7F:
+ os << "ABC_ACTION_0x7F";
+ break;
+ case ABC_ACTION_COERCE:
+ os << "ABC_ACTION_COERCE";
+ break;
+ case ABC_ACTION_COERCE_B:
+ os << "ABC_ACTION_COERCE_B";
+ break;
+ case ABC_ACTION_COERCE_A:
+ os << "ABC_ACTION_COERCE_A";
+ break;
+ case ABC_ACTION_COERCE_I:
+ os << "ABC_ACTION_COERCE_I";
+ break;
+ case ABC_ACTION_COERCE_D:
+ os << "ABC_ACTION_COERCE_D";
+ break;
+ case ABC_ACTION_COERCE_S:
+ os << "ABC_ACTION_COERCE_S";
+ break;
+ case ABC_ACTION_ASTYPE:
+ os << "ABC_ACTION_ASTYPE";
+ break;
+ case ABC_ACTION_ASTYPELATE:
+ os << "ABC_ACTION_ASTYPELATE";
+ break;
+ case ABC_ACTION_COERCE_U:
+ os << "ABC_ACTION_COERCE_U";
+ break;
+ case ABC_ACTION_COERCE_O:
+ os << "ABC_ACTION_COERCE_O";
+ break;
+ case ABC_ACTION_0x8A:
+ os << "ABC_ACTION_0x8A";
+ break;
+ case ABC_ACTION_0x8B:
+ os << "ABC_ACTION_0x8B";
+ break;
+ case ABC_ACTION_0x8C:
+ os << "ABC_ACTION_0x8C";
+ break;
+ case ABC_ACTION_0x8D:
+ os << "ABC_ACTION_0x8D";
+ break;
+ case ABC_ACTION_0x8E:
+ os << "ABC_ACTION_0x8E";
+ break;
+ case ABC_ACTION_0x8F:
+ os << "ABC_ACTION_0x8F";
+ break;
+ case ABC_ACTION_NEGATE:
+ os << "ABC_ACTION_NEGATE";
+ break;
+ case ABC_ACTION_INCREMENT:
+ os << "ABC_ACTION_INCREMENT";
+ break;
+ case ABC_ACTION_INCLOCAL:
+ os << "ABC_ACTION_INCLOCAL";
+ break;
+ case ABC_ACTION_DECREMENT:
+ os << "ABC_ACTION_DECREMENT";
+ break;
+ case ABC_ACTION_DECLOCAL:
+ os << "ABC_ACTION_DECLOCAL";
+ break;
+ case ABC_ACTION_ABC_TYPEOF:
+ os << "ABC_ACTION_ABC_TYPEOF";
+ break;
+ case ABC_ACTION_NOT:
+ os << "ABC_ACTION_NOT";
+ break;
+ case ABC_ACTION_BITNOT:
+ os << "ABC_ACTION_BITNOT";
+ break;
+ case ABC_ACTION_0x98:
+ os << "ABC_ACTION_0x98";
+ break;
+ case ABC_ACTION_0x99:
+ os << "ABC_ACTION_0x99";
+ break;
+ case ABC_ACTION_CONCAT:
+ os << "ABC_ACTION_CONCAT";
+ break;
+ case ABC_ACTION_ADD_D:
+ os << "ABC_ACTION_ADD_D";
+ break;
+ case ABC_ACTION_0x9C:
+ os << "ABC_ACTION_0x9C";
+ break;
+ case ABC_ACTION_0x9D:
+ os << "ABC_ACTION_0x9D";
+ break;
+ case ABC_ACTION_0x9E:
+ os << "ABC_ACTION_0x9E";
+ break;
+ case ABC_ACTION_0x9F:
+ os << "ABC_ACTION_0x9F";
+ break;
+ case ABC_ACTION_ADD :
+ os << "ABC_ACTION_ADD ";
+ break;
+ case ABC_ACTION_SUBTRACT:
+ os << "ABC_ACTION_SUBTRACT";
+ break;
+ case ABC_ACTION_MULTIPLY:
+ os << "ABC_ACTION_MULTIPLY";
+ break;
+ case ABC_ACTION_DIVIDE:
+ os << "ABC_ACTION_DIVIDE";
+ break;
+ case ABC_ACTION_MODULO:
+ os << "ABC_ACTION_MODULO";
+ break;
+ case ABC_ACTION_LSHIFT:
+ os << "ABC_ACTION_LSHIFT";
+ break;
+ case ABC_ACTION_RSHIFT:
+ os << "ABC_ACTION_RSHIFT";
+ break;
+ case ABC_ACTION_URSHIFT:
+ os << "ABC_ACTION_URSHIFT";
+ break;
+ case ABC_ACTION_BITAND:
+ os << "ABC_ACTION_BITAND";
+ break;
+ case ABC_ACTION_BITOR:
+ os << "ABC_ACTION_BITOR";
+ break;
+ case ABC_ACTION_BITXOR:
+ os << "ABC_ACTION_BITXOR";
+ break;
+ case ABC_ACTION_EQUALS:
+ os << "ABC_ACTION_EQUALS";
+ break;
+ case ABC_ACTION_STRICTEQUALS:
+ os << "ABC_ACTION_STRICTEQUALS";
+ break;
+ case ABC_ACTION_LESSTHAN:
+ os << "ABC_ACTION_LESSTHAN";
+ break;
+ case ABC_ACTION_LESSEQUALS:
+ os << "ABC_ACTION_LESSEQUALS";
+ break;
+ case ABC_ACTION_GREATERTHAN:
+ os << "ABC_ACTION_GREATERTHAN";
+ break;
+ case ABC_ACTION_GREATEREQUALS:
+ os << "ABC_ACTION_GREATEREQUALS";
+ break;
+ case ABC_ACTION_INSTANCEOF:
+ os << "ABC_ACTION_INSTANCEOF";
+ break;
+ case ABC_ACTION_ISTYPE:
+ os << "ABC_ACTION_ISTYPE";
+ break;
+ case ABC_ACTION_ISTYPELATE:
+ os << "ABC_ACTION_ISTYPELATE";
+ break;
+ case ABC_ACTION_IN:
+ os << "ABC_ACTION_IN";
+ break;
+ case ABC_ACTION_0xB5:
+ os << "ABC_ACTION_0xB5";
+ break;
+ case ABC_ACTION_0xB6:
+ os << "ABC_ACTION_0xB6";
+ break;
+ case ABC_ACTION_0xB7:
+ os << "ABC_ACTION_0xB7";
+ break;
+ case ABC_ACTION_0xB8:
+ os << "ABC_ACTION_0xB8";
+ break;
+ case ABC_ACTION_0xB9:
+ os << "ABC_ACTION_0xB9";
+ break;
+ case ABC_ACTION_0xBA:
+ os << "ABC_ACTION_0xBA";
+ break;
+ case ABC_ACTION_0xBB:
+ os << "ABC_ACTION_0xBB";
+ break;
+ case ABC_ACTION_0xBC:
+ os << "ABC_ACTION_0xBC";
+ break;
+ case ABC_ACTION_0xBD:
+ os << "ABC_ACTION_0xBD";
+ break;
+ case ABC_ACTION_0xBE:
+ os << "ABC_ACTION_0xBE";
+ break;
+ case ABC_ACTION_0xBF:
+ os << "ABC_ACTION_0xBF";
+ break;
+ case ABC_ACTION_INCREMENT_I:
+ os << "ABC_ACTION_INCREMENT_I";
+ break;
+ case ABC_ACTION_DECREMENT_I:
+ os << "ABC_ACTION_DECREMENT_I";
+ break;
+ case ABC_ACTION_INCLOCAL_I:
+ os << "ABC_ACTION_INCLOCAL_I";
+ break;
+ case ABC_ACTION_DECLOCAL_I:
+ os << "ABC_ACTION_DECLOCAL_I";
+ break;
+ case ABC_ACTION_NEGATE_I:
+ os << "ABC_ACTION_NEGATE_I";
+ break;
+ case ABC_ACTION_ADD_I:
+ os << "ABC_ACTION_ADD_I";
+ break;
+ case ABC_ACTION_SUBTRACT_I:
+ os << "ABC_ACTION_SUBTRACT_I";
+ break;
+ case ABC_ACTION_MULTIPLY_I:
+ os << "ABC_ACTION_MULTIPLY_I";
+ break;
+ case ABC_ACTION_0xC8:
+ os << "ABC_ACTION_0xC8";
+ break;
+ case ABC_ACTION_0xC9:
+ os << "ABC_ACTION_0xC9";
+ break;
+ case ABC_ACTION_0xCA:
+ os << "ABC_ACTION_0xCA";
+ break;
+ case ABC_ACTION_0xCB:
+ os << "ABC_ACTION_0xCB";
+ break;
+ case ABC_ACTION_0xCC:
+ os << "ABC_ACTION_0xCC";
+ break;
+ case ABC_ACTION_0xCD:
+ os << "ABC_ACTION_0xCD";
+ break;
+ case ABC_ACTION_0xCE:
+ os << "ABC_ACTION_0xCE";
+ break;
+ case ABC_ACTION_0xCF:
+ os << "ABC_ACTION_0xCF";
+ break;
+ case ABC_ACTION_GETLOCAL0:
+ os << "ABC_ACTION_GETLOCAL0";
+ break;
+ case ABC_ACTION_GETLOCAL1:
+ os << "ABC_ACTION_GETLOCAL1";
+ break;
+ case ABC_ACTION_GETLOCAL2:
+ os << "ABC_ACTION_GETLOCAL2";
+ break;
+ case ABC_ACTION_GETLOCAL3:
+ os << "ABC_ACTION_GETLOCAL3";
+ break;
+ case ABC_ACTION_SETLOCAL0:
+ os << "ABC_ACTION_SETLOCAL0";
+ break;
+ case ABC_ACTION_SETLOCAL1:
+ os << "ABC_ACTION_SETLOCAL1";
+ break;
+ case ABC_ACTION_SETLOCAL2:
+ os << "ABC_ACTION_SETLOCAL2";
+ break;
+ case ABC_ACTION_SETLOCAL3:
+ os << "ABC_ACTION_SETLOCAL3";
+ break;
+ case ABC_ACTION_0xD8:
+ os << "ABC_ACTION_0xD8";
+ break;
+ case ABC_ACTION_0xD9:
+ os << "ABC_ACTION_0xD9";
+ break;
+ case ABC_ACTION_0xDA:
+ os << "ABC_ACTION_0xDA";
+ break;
+ case ABC_ACTION_0xDB:
+ os << "ABC_ACTION_0xDB";
+ break;
+ case ABC_ACTION_0xDC:
+ os << "ABC_ACTION_0xDC";
+ break;
+ case ABC_ACTION_0xDD:
+ os << "ABC_ACTION_0xDD";
+ break;
+ case ABC_ACTION_0xDE:
+ os << "ABC_ACTION_0xDE";
+ break;
+ case ABC_ACTION_0xDF:
+ os << "ABC_ACTION_0xDF";
+ break;
+ case ABC_ACTION_0xE0:
+ os << "ABC_ACTION_0xE0";
+ break;
+ case ABC_ACTION_0xE1:
+ os << "ABC_ACTION_0xE1";
+ break;
+ case ABC_ACTION_0xE2:
+ os << "ABC_ACTION_0xE2";
+ break;
+ case ABC_ACTION_0xE3:
+ os << "ABC_ACTION_0xE3";
+ break;
+ case ABC_ACTION_0xE4:
+ os << "ABC_ACTION_0xE4";
+ break;
+ case ABC_ACTION_0xE5:
+ os << "ABC_ACTION_0xE5";
+ break;
+ case ABC_ACTION_0xE6:
+ os << "ABC_ACTION_0xE6";
+ break;
+ case ABC_ACTION_0xE7:
+ os << "ABC_ACTION_0xE7";
+ break;
+ case ABC_ACTION_0xE8:
+ os << "ABC_ACTION_0xE8";
+ break;
+ case ABC_ACTION_0xE9:
+ os << "ABC_ACTION_0xE9";
+ break;
+ case ABC_ACTION_0xEA:
+ os << "ABC_ACTION_0xEA";
+ break;
+ case ABC_ACTION_0xEB:
+ os << "ABC_ACTION_0xEB";
+ break;
+ case ABC_ACTION_0xEC:
+ os << "ABC_ACTION_0xEC";
+ break;
+ case ABC_ACTION_0xED:
+ os << "ABC_ACTION_0xED";
+ break;
+ case ABC_ACTION_ABS_JUMP:
+ os << "ABC_ACTION_ABS_JUMP";
+ break;
+ case ABC_ACTION_DEBUG:
+ os << "ABC_ACTION_DEBUG";
+ break;
+ case ABC_ACTION_DEBUGLINE:
+ os << "ABC_ACTION_DEBUGLINE";
+ break;
+ case ABC_ACTION_DEBUGFILE:
+ os << "ABC_ACTION_DEBUGFILE";
+ break;
+ case ABC_ACTION_BKPTLINE:
+ os << "ABC_ACTION_BKPTLINE";
+ break;
+ case ABC_ACTION_TIMESTAMP:
+ os << "ABC_ACTION_TIMESTAMP";
+ break;
+ case ABC_ACTION_0xF4:
+ os << "ABC_ACTION_0xF4";
+ break;
+ case ABC_ACTION_VERIFYPASS:
+ os << "ABC_ACTION_VERIFYPASS";
+ break;
+ case ABC_ACTION_ALLOC:
+ os << "ABC_ACTION_ALLOC";
+ break;
+ case ABC_ACTION_MARK:
+ os << "ABC_ACTION_MARK";
+ break;
+ case ABC_ACTION_WB:
+ os << "ABC_ACTION_WB";
+ break;
+ case ABC_ACTION_PROLOGUE:
+ os << "ABC_ACTION_PROLOGUE";
+ break;
+ case ABC_ACTION_SENDENTER:
+ os << "ABC_ACTION_SENDENTER";
+ break;
+ case ABC_ACTION_DOUBLETOATOM:
+ os << "ABC_ACTION_DOUBLETOATOM";
+ break;
+ case ABC_ACTION_SWEEP:
+ os << "ABC_ACTION_SWEEP";
+ break;
+ case ABC_ACTION_CODEGENOP:
+ os << "ABC_ACTION_CODEGENOP";
+ break;
+ case ABC_ACTION_VERIFYOP:
+ os << "ABC_ACTION_VERIFYOP";
+ break;
+ default:
+ os << "UNKNOWN";
+ break;
+ }
+ return os;
+}
+
+} // namespace gnash::SWF
+} // namespace gnash
=== modified file 'libcore/swf.h'
--- a/libcore/swf.h 2008-11-07 12:47:31 +0000
+++ b/libcore/swf.h 2008-11-17 17:24:29 +0000
@@ -18,6 +18,9 @@
#ifndef GNASH_SWF_H
#define GNASH_SWF_H
+//#include <iofwd.h>
+#include <iostream> // for std::ostream
+
namespace gnash {
/// SWF format parsing classes
@@ -541,6 +544,7 @@
typedef enum
{
/// AS3 Actions go below here.
+ ABC_ACTION_END = 0x00,
/// Do: Enter the debugger if one has been invoked.
ABC_ACTION_BKPT = 0x01,
@@ -1712,6 +1716,9 @@
} abc_action_type;
+/// Output operator for abc_action_type
+std::ostream& operator<< (std::ostream& os, const abc_action_type& typ);
+
/// SWF fill style types. Symbolic names copied from Ming.
//
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-11-14 23:40:55 +0000
+++ b/libcore/vm/Machine.cpp 2008-11-15 19:49:41 +0000
@@ -959,7 +959,7 @@
{
mStack.top(0).set_bool(false);
mFrame.value(oindex).set_null();
- mFrame.value(iindex) = 0;
+ mFrame.value(iindex) = 0.0;
}
break;
}
=== modified file 'libmedia/FLVParser.cpp'
--- a/libmedia/FLVParser.cpp 2008-11-12 09:23:42 +0000
+++ b/libmedia/FLVParser.cpp 2008-11-18 11:59:41 +0000
@@ -171,7 +171,8 @@
CuePointsMap::iterator it = _cuePoints.lower_bound(tag.timestamp);
if ( it == _cuePoints.end() || it->first - tag.timestamp >= 5000)
{
- log_debug("Added cue point at timestamp %d and position %d
(audio frame)", tag.timestamp, thisTagPos);
+ //log_debug("Added cue point at timestamp %d and position %d "
+ //"(audio frame)", tag.timestamp, thisTagPos);
_cuePoints[tag.timestamp] = thisTagPos;
}
}
@@ -183,7 +184,8 @@
return;
}
- log_debug("Added cue point at timestamp %d and position %d (key video
frame)", tag.timestamp, thisTagPos);
+ //log_debug("Added cue point at timestamp %d and position %d "
+ //"(key video frame)", tag.timestamp, thisTagPos);
_cuePoints[tag.timestamp] = thisTagPos;
}
=== removed file 'macros/libXML.m4'
--- a/macros/libXML.m4 2008-03-05 03:55:48 +0000
+++ b/macros/libXML.m4 1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
-dnl
-dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-dnl
-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 3 of the License, or
-dnl (at your option) any later version.
-dnl
-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 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([GNASH_PATH_LIBXML], [
- has_xml=no
- dnl Look for the header
- AC_ARG_WITH(libxml-incl, AC_HELP_STRING([--with-libxml-incl], [directory
where libxml2 header is]), with_libxml_incl=${withval})
- AC_CACHE_VAL(ac_cv_path_libxml_incl, [
- if test x"${with_libxml_incl}" != x ; then
- if test -f ${with_libxml_incl}/libxml/xmlmemory.h ; then
- ac_cv_path_libxml_incl="-I`(cd ${with_libxml_incl}; pwd)`"
- else
- AC_MSG_ERROR([${with_libxml_incl} directory doesn't contain
libxml/xmlmemory.h])
- fi
- fi
- ])
- dnl Look for the library
- AC_ARG_WITH(libxml_lib, AC_HELP_STRING([--with-libxml-lib], [directory where
libxml2 library is]), with_libxml_lib=${withval})
- AC_CACHE_VAL(ac_cv_path_libxml_lib, [
- if test x"${with_libxml_lib}" != x ; then
- if test -f ${with_libxml_libs}/libxml2.a -o -f
${with_libxml_lib}/libxml2.${shlibext}; then
- ac_cv_path_libxml_lib="-L`(cd ${with_libxml_lib}; pwd)` -lxml2"
- fi
- fi
- ])
-
- if test x"${ac_cv_path_libxml_incl}" = x -o x"${ac_cv_path_libxml_lib}" = x;
then
- AC_PATH_PROG(XML2_CONFIG, xml2-config, ,[${pathlist}])
- if test x"$XML2_CONFIG" != x -a x"${darwin}" = xno ; then
- if test x"$XML2_CFLAGS" = x -a x"${ac_cv_path_libxml_incl}" = x; then
- ac_cv_path_libxml_incl=`$XML2_CONFIG --cflags`
- fi
- if test x"$XML2_LIBS" = x -a x"${ac_cv_path_libxml_lib}" = x; then
- ac_cv_path_libxml_lib=`$XML2_CONFIG --libs | sed -e 's:-L/usr/lib::'`
- fi
- fi
- fi
-
- gnash_libxml2_topdir=""
- gnash_libxml2_version=""
- AC_MSG_CHECKING([for libxml2 header])
- if test x"${ac_cv_path_libxml_incl}" = x; then
- for i in ${incllist}; do
- for j in `ls -dr $i/libxml2 2>/dev/null`; do
- if test -f $j/libxml/xmlmemory.h; then
- gnash_libxml_topdir=`basename $j`
- gnash_libxml_version=`echo ${gnash_libxml2_topdir} | sed -e
's:libxml2::' -e 's:-::'`
- ac_cv_path_libxml_incl="-I$j"
- break
- fi
- done
- done
- fi
-
- if test x"${ac_cv_path_libxml_incl}" = x ; then
- AC_CHECK_HEADERS(libxml/xmlmemory.h, [ac_cv_path_libxml_incl=""])
- fi
-
- AC_MSG_RESULT(${ac_cv_path_libxml_incl})
-
- dnl AC_MSG_CHECKING([for libxml2 library])
- if test x"${ac_cv_path_libxml_lib}" = x ; then
- for i in $libslist; do
- if test -f $i/libxml2.a -o -f $i/libxml2.${shlibext}; then
- if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
- ac_cv_path_libxml_lib="-L$i -lxml2"
- break
- else
- ac_cv_path_libxml_lib="-lxml2"
- has_xml=yes
- break
- fi
- fi
- done
- fi
- if test x"${ac_cv_path_libxml_lib}" = x ; then
- AC_CHECK_LIB(xml2, xmlInitParser, [ac_cv_path_libxml_lib="-lxml2"])
- fi
-
- AC_MSG_CHECKING([for libxml2 library])
- AC_MSG_RESULT(${ac_cv_path_libxml_lib})
-
- if test x"${ac_cv_path_libxml_incl}" != x ; then
- LIBXML_CFLAGS="${ac_cv_path_libxml_incl}"
- else
- LIBXML_CFLAGS=""
- fi
- if test x"${ac_cv_path_libxml_lib}" != x ; then
- LIBXML_LIBS="${ac_cv_path_libxml_lib}"
- has_xml=yes
- AC_DEFINE(HAVE_LIBXML_H, [1], [We have libxml2 support])
- else
- has_xml=no
- LIBXML_LIBS=""
- fi
- AC_SUBST(LIBXML_CFLAGS)
- AC_SUBST(LIBXML_LIBS)
-])
-
-# Local Variables:
-# c-basic-offset: 2
-# tab-width: 2
-# indent-tabs-mode: nil
-# End:
=== modified file 'testsuite/actionscript.all/MovieClip.as'
--- a/testsuite/actionscript.all/MovieClip.as 2008-11-13 15:33:38 +0000
+++ b/testsuite/actionscript.all/MovieClip.as 2008-11-15 13:25:03 +0000
@@ -115,15 +115,15 @@
#endif
#if OUTPUT_VERSION == 6
- check_totals(815); // SWF6
+ check_totals(823); // SWF6
#endif
#if OUTPUT_VERSION == 7
- check_totals(832); // SWF7
+ check_totals(840); // SWF7
#endif
#if OUTPUT_VERSION >= 8
- check_totals(906); // SWF8+
+ check_totals(914); // SWF8+
#endif
play();
@@ -2139,6 +2139,27 @@
#endif
+// Test _visible property
+
+#if OUTPUT_VERSION > 5
+vis = _root.createEmptyMovieClip("vis", getNextHighestDepth());
+check_equals(vis._visible, true);
+vis._visible = false;
+check_equals(vis._visible, false);
+vis._visible = "1";
+check_equals(vis._visible, true);
+vis._visible = 0;
+check_equals(vis._visible, false);
+vis._visible = "true";
+check_equals(vis._visible, false);
+vis._visible = "false";
+check_equals(vis._visible, false);
+vis._visible = "gibberish";
+check_equals(vis._visible, false);
+vis._visible = undefined;
+check_equals(vis._visible, false);
+#endif
+
//_root.loadVariables(MEDIA(vars.txt), "GET");
// Can't rely on this to call onData!
=== modified file 'testsuite/actionscript.all/XML.as'
--- a/testsuite/actionscript.all/XML.as 2008-09-17 12:54:54 +0000
+++ b/testsuite/actionscript.all/XML.as 2008-11-18 14:30:05 +0000
@@ -123,6 +123,7 @@
check(! tmp.hasOwnProperty("status"));
xcheck(tmp.__proto__.hasOwnProperty('status') );
+tmp = new XML();
check_equals(tmp.status, 0);
tmp.status = -1;
check_equals(tmp.status, -1);
@@ -282,7 +283,6 @@
var xml_out = '<TOPNODE tna1="tna1val" tna2="tna2val" tna3="tna3val"><SUBNODE1
sna1="sna1val" sna2="sna2val"><SUBSUBNODE1 ssna1="ssna1val"
ssna2="ssna2val">sub sub1 node data 1</SUBSUBNODE1><SUBSUBNODE2>sub /sub1
<br>"node data
2"</SUBSUBNODE2></SUBNODE1><SUBNODE2><SUBSUBNODE1>sub sub2 node data
1</SUBSUBNODE1><SUBSUBNODE2>sub sub2 node data
2</SUBSUBNODE2></SUBNODE2></TOPNODE>';
//var xml_out = "<TOPNODE tna1=\"tna1val\" tna2=\"tna2val\"
tna3=\"tna3val\"><SUBNODE1 sna1=\"sna1val\" sna2=\"sna2val\"><SUBSUBNODE1
ssna1=\"ssna1val\" ssna2=\"ssna2val\">sub sub1 node data
1</SUBSUBNODE1><SUBSUBNODE2>sub /\sub1 \<br\>\"node data
2\"</SUBSUBNODE2></SUBNODE1><SUBNODE2><SUBSUBNODE1>sub sub2 node data
1</SUBSUBNODE1><SUBSUBNODE2>sub sub2 node data
2</SUBSUBNODE2></SUBNODE2></TOPNODE>";
-
check(XML);
tmp.checkParsed = function ()
{
@@ -448,7 +448,7 @@
//note("Parsed XML: "+tmp.toString());
// TODO: FIX THIS !
-xcheck_equals(tmp.toString(), xml_out);
+check_equals(tmp.toString(), xml_out);
//------------------------------------------------
// Test XML editing
@@ -864,9 +864,9 @@
if ( this.onLoadCalls == 2 )
{
#if OUTPUT_VERSION < 6
- check_totals(361);
+ check_totals(386);
#else
- check_totals(401);
+ check_totals(426);
#endif
play();
}
@@ -948,5 +948,70 @@
myxml2.parseXML("<X1> t </X1>");
check_equals(myxml2.toString(), "<X1> t </X1>");
+/// Check various malformed XMLs
+
+h = new XML("<open>");
+check_equals(h.toString(), "<open />");
+
+h = new XML("<open></close>");
+check_equals(h.toString(), "<open />");
+
+h = new XML("<open><open2></open>");
+check_equals(h.toString(), "<open><open2 /></open>");
+
+h = new XML("<open att='");
+xcheck_equals(h.toString(), "");
+
+h = new XML("<open att r='kk'");
+xcheck_equals(h.toString(), "");
+
+h = new XML("<open>& ' \"<");
+check_equals(h.toString(), "<open>& ' "</open>");
+
+h = new XML("</open><open>node with \"</open>");
+check_equals(h.toString(), "");
+
+h = new XML("<open/><open><!-- lkjsdcölkj<hello>");
+check_equals(h.toString(), "<open /><open />");
+
+h = new XML("<open><![CDATA[jlkjdc</open>");
+check_equals(h.toString(), "<open />");
+
+// Check DOCTYPE and xml declarations.
+
+check_equals(h.docTypeDecl, undefined);
+check_equals(h.xmlDecl, undefined);
+
+h = new XML("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'><tag></tag>");
+check_equals(h.toString(), "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'><tag />");
+check_equals(h.docTypeDecl, "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01
Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>");
+
+h = new XML("<!DOcTyPE text><tag></tag>");
+check_equals(h.toString(), "<!DOcTyPE text><tag />");
+check_equals(h.docTypeDecl, "<!DOcTyPE text>");
+
+h = new XML("<?xml declaration goes here?><tag>content</tag>");
+check_equals(h.toString(), "<?xml declaration goes here?><tag>content</tag>");
+check_equals(h.xmlDecl, "<?xml declaration goes here?>");
+
+h = new XML("<?xMl declaration goes here?><tag>content</tag>");
+check_equals(h.toString(), "<?xMl declaration goes here?><tag>content</tag>");
+check_equals(h.xmlDecl, "<?xMl declaration goes here?>");
+
+// Check order
+h = new XML("<!doctype d><?xMl declaration goes here?><tag>content</tag>");
+check_equals(h.toString(), "<?xMl declaration goes here?><!doctype
d><tag>content</tag>");
+check_equals(h.xmlDecl, "<?xMl declaration goes here?>");
+check_equals(h.docTypeDecl, "<!doctype d>");
+
+// Check order
+h = new XML("<tag></tag><!doctype d><?xMl declaration goes
here?><tag>content</tag>");
+check_equals(h.toString(), "<?xMl declaration goes here?><!doctype d><tag
/><tag>content</tag>");
+
+// Check multiple declarations
+h = new XML("<tag></tag><!doctype d><?xMl decl?><!dOcType new><?XMl new?>");
+check_equals(h.toString(), "<?xMl decl?><?XMl new?><!dOcType new><tag />");
+check_equals(h.xmlDecl, "<?xMl decl?><?XMl new?>");
+
stop();
=== modified file 'testsuite/libcore.all/AsValueTest.cpp'
--- a/testsuite/libcore.all/AsValueTest.cpp 2008-10-28 15:32:20 +0000
+++ b/testsuite/libcore.all/AsValueTest.cpp 2008-11-15 19:49:41 +0000
@@ -57,6 +57,7 @@
static void test_el();
static void test_obj();
static void test_isnan();
+static void test_conversion();
// Enable the display of memory allocation and timing data
static bool memdebug = false;
@@ -118,7 +119,68 @@
test_isnan();
test_el();
test_obj();
-}
+ test_conversion();
+
+}
+
+void
+test_bool(as_value boolval)
+{
+ if (boolval.is_bool()) {
+ runtest.pass("as_value(bool)");
+ } else {
+ runtest.fail("as_value(bool)");
+ }
+}
+
+void
+test_int(as_value val)
+{
+ if (val.is_number()) {
+ runtest.pass("as_value(int)");
+ } else {
+ runtest.fail("as_value(int)");
+ }
+}
+
+void
+test_string(as_value val)
+{
+ if (val.is_string()) {
+ runtest.pass("as_value(string)");
+ } else {
+ runtest.fail("as_value(string)");
+ }
+}
+
+
+typedef enum {
+ ONE = 0,
+ TWO = 1,
+ THREE = 2
+} enumbers;
+
+void
+test_conversion()
+{
+ test_bool(true);
+ test_bool(false);
+ test_int(5);
+ test_int(1);
+ test_int(double(0));
+ test_int(0.0);
+
+ test_int(THREE);
+ test_int(ONE);
+ test_int(TWO);
+
+ test_string(std::string("lar"));
+
+ test_string("lar");
+
+
+}
+
void
test_el()
=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING 2008-11-06 14:03:09 +0000
+++ b/testsuite/swfdec/PASSING 2008-11-18 09:34:03 +0000
@@ -266,6 +266,10 @@
crash-0.8.0-huffmann-table-6.swf:a269bc06dd35de125087b2444622f130
crash-0.8.0-huffmann-table-7.swf:2134c93509e1fc5d2eff527e79e1ea60
crash-0.8.0-huffmann-table-8.swf:4548f1e9d10a5cd70852c367c8f39af6
+crash-0.8.2-copyPixels-5.swf:54ff82671f1aed95c9af6812ec84a559
+crash-0.8.2-copyPixels-6.swf:b683c00022ef469dcd5b3d9312e1b6f6
+crash-0.8.2-copyPixels-7.swf:490a05f3e8637f23fae76fbd9ff921a7
+crash-0.8.2-copyPixels-8.swf:135d28bfa9d79977c26e6dd61885103c
crash-0.8.2-gotoAndPlay-5.swf:8b4ebc57963ce4c0b8c80a1ba79a2ed0
crash-0.8.2-gotoAndPlay-6.swf:808289d1821d14debfaea5aca5f14273
crash-0.8.2-gotoAndPlay-7.swf:434c0a520e86655e14ac3767cb745dbc
@@ -1166,6 +1170,9 @@
with-prototypes-5.swf:4fbad4d181fef388e50d993d61c16917
with-prototypes-6.swf:6b9dcb482fe520cbc9dc4a8456688905
with-prototypes-7.swf:20f1f3b8905c8a3f3a61cb18e7e59e76
+xml-cdata-6.swf:d7559375e07591033d7739671a8c4d42
+xml-cdata-7.swf:5e51dafbe7f6af8206041ecabf0016f8
+xml-cdata-8.swf:d5537f4fb83eaf49d615eecb89b2ae95
xml-init-5.swf:2ba1da174f2b1958749fede5667a60c4
xml-init-5.swf:bb54cac64e38396084a147266f7d9711
xml-node-init-5.swf:12fd3762a2bfa787b01fc0b8abfaa492
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r9750: update from shared repository.,
rob <=