[Swfdec] 15 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt INSTALL libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.h libswfdec/swfdec_as_string.h libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_debugger.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c player/swfdec_debug_stack.c

Benjamin Otte company at kemper.freedesktop.org
Thu Jul 12 14:24:44 PDT 2007


 INSTALL                         |  236 ----------------------------------------
 doc/Makefile.am                 |    3 
 doc/swfdec-docs.sgml            |    1 
 doc/swfdec-sections.txt         |   40 ++++++
 libswfdec/swfdec_as_context.c   |   10 +
 libswfdec/swfdec_as_frame.c     |   93 +++++++++++++++
 libswfdec/swfdec_as_frame.h     |   13 ++
 libswfdec/swfdec_as_interpret.h |  103 +++++++++++++++++
 libswfdec/swfdec_as_object.h    |    4 
 libswfdec/swfdec_as_string.h    |    3 
 libswfdec/swfdec_as_types.c     |    2 
 libswfdec/swfdec_as_types.h     |  103 -----------------
 libswfdec/swfdec_debugger.c     |    1 
 libswfdec/swfdec_net_stream.c   |   11 +
 libswfdec/swfdec_player.c       |    2 
 player/swfdec_debug_stack.c     |   12 --
 16 files changed, 281 insertions(+), 356 deletions(-)

New commits:
diff-tree 576a51e3a4a0e2a9d4c6c4e031ef27ba62b8199a (from dc507c661ecefe5cc761ae5119922bec50b647a4)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 23:24:50 2007 +0200

    add SwfdecAsObject uncoditionally

diff --git a/doc/swfdec-docs.sgml b/doc/swfdec-docs.sgml
index 537817a..4d1fe45 100644
--- a/doc/swfdec-docs.sgml
+++ b/doc/swfdec-docs.sgml
@@ -25,5 +25,6 @@
     <xi:include href="xml/Internals.xml"/>
     <xi:include href="xml/SwfdecAsValue.xml"/>
     <xi:include href="xml/SwfdecAsContext.xml"/>
+    <xi:include href="xml/SwfdecAsObject.xml"/>
   </chapter>
 </book>
diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index 96dbcb1..33565a8 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -246,3 +246,39 @@ SWFDEC_IS_AS_CONTEXT_CLASS
 SWFDEC_TYPE_AS_CONTEXT
 </SECTION>
 
+<SECTION>
+<FILE>SwfdecAsObject</FILE>
+<TITLE>SwfdecAsObject</TITLE>
+SwfdecAsObject
+swfdec_as_object_add
+swfdec_as_object_add_function
+swfdec_as_object_call
+swfdec_as_object_collect
+swfdec_as_object_create
+swfdec_as_object_delete_variable
+swfdec_as_object_foreach
+swfdec_as_object_foreach_remove
+swfdec_as_object_foreach_rename
+swfdec_as_object_get_debug
+swfdec_as_object_get_variable
+swfdec_as_object_get_variable_and_flags
+swfdec_as_object_has_function
+swfdec_as_object_init_context
+swfdec_as_object_new
+swfdec_as_object_new_empty
+swfdec_as_object_resolve
+swfdec_as_object_run
+swfdec_as_object_set_constructor
+swfdec_as_object_set_variable
+swfdec_as_object_set_variable_flags
+swfdec_as_object_unset_variable_flags
+<SUBSECTION Standard>
+swfdec_as_object_get_type
+SwfdecAsObjectClass
+SWFDEC_AS_OBJECT
+SWFDEC_AS_OBJECT_CLASS
+SWFDEC_AS_OBJECT_GET_CLASS
+SWFDEC_IS_AS_OBJECT
+SWFDEC_IS_AS_OBJECT_CLASS
+SWFDEC_TYPE_AS_OBJECT
+</SECTION>
diff-tree dc507c661ecefe5cc761ae5119922bec50b647a4 (from 5cc02fe654a0fbaab833d064437888313c8a6704)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 23:24:23 2007 +0200

    exclude swfdec_as_scope.h

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 0b9b85d..540729e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -59,6 +59,7 @@ IGNORE_HFILES= \
 	swfdec_as_interpret.h \
 	swfdec_as_math.h \
 	swfdec_as_number.h \
+	swfdec_as_scope.h \
 	swfdec_as_stack.h \
 	swfdec_as_string.h \
 	swfdec_as_strings.h \
diff-tree 5cc02fe654a0fbaab833d064437888313c8a6704 (from 9cb965f4bf684ba88de23914dab745bf135f30f5)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 23:23:58 2007 +0200

    add docs

diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c
index 66157bf..1b444e2 100644
--- a/libswfdec/swfdec_as_context.c
+++ b/libswfdec/swfdec_as_context.c
@@ -127,6 +127,16 @@
  */
 
 /**
+ * SwfdecAsContext
+ *
+ * This is the main object ued to hold the state of a script engine. All members 
+ * are private and should not be accessed.
+ *
+ * Subclassing this structure to get scripting support in your own appliation is
+ * encouraged.
+ */
+
+/**
  * SwfdecAsContextState
  * @SWFDEC_AS_CONTEXT_NEW: the context is not yet initialized, 
  *                         swfdec_as_context_startup() needs to be called.
diff-tree 9cb965f4bf684ba88de23914dab745bf135f30f5 (from 3cf73adcae332b29cd30bd8747cfe0a8fdcb9aae)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 22:56:49 2007 +0200

    fix typo

diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index 1bbfdaf..430c67d 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -165,7 +165,7 @@ swfdec_player_add_timeout (SwfdecPlayer 
  * @player: a #SwfdecPlayer
  * @timeout: a timeout that should be removed
  *
- * Removes the @timeout from the list of scheduled timeouts. THe tiemout must 
+ * Removes the @timeout from the list of scheduled timeouts. The timeout must 
  * have been added with swfdec_player_add_timeout() before.
  **/
 void
diff-tree 3cf73adcae332b29cd30bd8747cfe0a8fdcb9aae (from 669fa2ea385c64323bbab3d40721251da265d0d8)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 22:44:16 2007 +0200

    <ds> INSTALL shouldn't be checked in

diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 23e5f25..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,236 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-These are generic installation instructions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
-
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
-     the package.
-
-  4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
-     for the package's developers.  If you use it, you may have to get
-     all sorts of other programs in order to regenerate files that came
-     with the distribution.
-
-Compilers and Options
-=====================
-
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
-
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
-
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
-   *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc.  You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
-   In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
-     CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
-     OS KERNEL-OS
-
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
-   If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
-   If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
-
-     ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).  Here is a another example:
-
-     /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
-
-`configure' Invocation
-======================
-
-`configure' recognizes the following options to control how it operates.
-
-`--help'
-`-h'
-     Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`--cache-file=FILE'
-     Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
-     disable caching.
-
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
-     messages will still be shown).
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
-
diff-tree 669fa2ea385c64323bbab3d40721251da265d0d8 (from f0e73ade09a589470364bfceff91fcc5c999a710)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:58:43 2007 +0200

    move SwfdecAsAction to swfdec_as_interpret.h

diff --git a/libswfdec/swfdec_as_interpret.h b/libswfdec/swfdec_as_interpret.h
index 320f799..557abf4 100644
--- a/libswfdec/swfdec_as_interpret.h
+++ b/libswfdec/swfdec_as_interpret.h
@@ -41,5 +41,108 @@ typedef struct {
 
 extern const SwfdecActionSpec swfdec_as_actions[256];
 
+/* all known actions */
+typedef enum {
+  SWFDEC_AS_ACTION_NEXT_FRAME = 0x04,
+  SWFDEC_AS_ACTION_PREVIOUS_FRAME = 0x05,
+  SWFDEC_AS_ACTION_PLAY = 0x06,
+  SWFDEC_AS_ACTION_STOP = 0x07,
+  SWFDEC_AS_ACTION_TOGGLE_QUALITY = 0x08,
+  SWFDEC_AS_ACTION_STOP_SOUNDS = 0x09,
+  SWFDEC_AS_ACTION_ADD = 0x0A,
+  SWFDEC_AS_ACTION_SUBTRACT = 0x0B,
+  SWFDEC_AS_ACTION_MULTIPLY = 0x0C,
+  SWFDEC_AS_ACTION_DIVIDE = 0x0D,
+  SWFDEC_AS_ACTION_EQUALS = 0x0E,
+  SWFDEC_AS_ACTION_LESS = 0x0F,
+  SWFDEC_AS_ACTION_AND = 0x10,
+  SWFDEC_AS_ACTION_OR = 0x11,
+  SWFDEC_AS_ACTION_NOT = 0x12,
+  SWFDEC_AS_ACTION_STRING_EQUALS = 0x13,
+  SWFDEC_AS_ACTION_STRING_LENGTH = 0x14,
+  SWFDEC_AS_ACTION_STRING_EXTRACT = 0x15,
+  SWFDEC_AS_ACTION_POP = 0x17,
+  SWFDEC_AS_ACTION_TO_INTEGER = 0x18,
+  SWFDEC_AS_ACTION_GET_VARIABLE = 0x1C,
+  SWFDEC_AS_ACTION_SET_VARIABLE = 0x1D,
+  SWFDEC_AS_ACTION_SET_TARGET2 = 0x20,
+  SWFDEC_AS_ACTION_STRING_ADD = 0x21,
+  SWFDEC_AS_ACTION_GET_PROPERTY = 0x22,
+  SWFDEC_AS_ACTION_SET_PROPERTY = 0x23,
+  SWFDEC_AS_ACTION_CLONE_SPRITE = 0x24,
+  SWFDEC_AS_ACTION_REMOVE_SPRITE = 0x25,
+  SWFDEC_AS_ACTION_TRACE = 0x26,
+  SWFDEC_AS_ACTION_START_DRAG = 0x27,
+  SWFDEC_AS_ACTION_END_DRAG = 0x28,
+  SWFDEC_AS_ACTION_STRING_LESS = 0x29,
+  SWFDEC_AS_ACTION_THROW = 0x2A,
+  SWFDEC_AS_ACTION_CAST = 0x2B,
+  SWFDEC_AS_ACTION_IMPLEMENTS = 0x2C,
+  SWFDEC_AS_ACTION_RANDOM = 0x30,
+  SWFDEC_AS_ACTION_MB_STRING_LENGTH = 0x31,
+  SWFDEC_AS_ACTION_CHAR_TO_ASCII = 0x32,
+  SWFDEC_AS_ACTION_ASCII_TO_CHAR = 0x33,
+  SWFDEC_AS_ACTION_GET_TIME = 0x34,
+  SWFDEC_AS_ACTION_MB_STRING_EXTRACT = 0x35,
+  SWFDEC_AS_ACTION_MB_CHAR_TO_ASCII = 0x36,
+  SWFDEC_AS_ACTION_MB_ASCII_TO_CHAR = 0x37,
+  SWFDEC_AS_ACTION_DELETE = 0x3A,
+  SWFDEC_AS_ACTION_DELETE2 = 0x3B,
+  SWFDEC_AS_ACTION_DEFINE_LOCAL = 0x3C,
+  SWFDEC_AS_ACTION_CALL_FUNCTION = 0x3D,
+  SWFDEC_AS_ACTION_RETURN = 0x3E,
+  SWFDEC_AS_ACTION_MODULO = 0x3F,
+  SWFDEC_AS_ACTION_NEW_OBJECT = 0x40,
+  SWFDEC_AS_ACTION_DEFINE_LOCAL2 = 0x41,
+  SWFDEC_AS_ACTION_INIT_ARRAY = 0x42,
+  SWFDEC_AS_ACTION_INIT_OBJECT = 0x43,
+  SWFDEC_AS_ACTION_TYPE_OF = 0x44,
+  SWFDEC_AS_ACTION_TARGET_PATH = 0x45,
+  SWFDEC_AS_ACTION_ENUMERATE = 0x46,
+  SWFDEC_AS_ACTION_ADD2 = 0x47,
+  SWFDEC_AS_ACTION_LESS2 = 0x48,
+  SWFDEC_AS_ACTION_EQUALS2 = 0x49,
+  SWFDEC_AS_ACTION_TO_NUMBER = 0x4A,
+  SWFDEC_AS_ACTION_TO_STRING = 0x4B,
+  SWFDEC_AS_ACTION_PUSH_DUPLICATE = 0x4C,
+  SWFDEC_AS_ACTION_SWAP = 0x4D,
+  SWFDEC_AS_ACTION_GET_MEMBER = 0x4E,
+  SWFDEC_AS_ACTION_SET_MEMBER = 0x4F,
+  SWFDEC_AS_ACTION_INCREMENT = 0x50,
+  SWFDEC_AS_ACTION_DECREMENT = 0x51,
+  SWFDEC_AS_ACTION_CALL_METHOD = 0x52,
+  SWFDEC_AS_ACTION_NEW_METHOD = 0x53,
+  SWFDEC_AS_ACTION_INSTANCE_OF = 0x54,
+  SWFDEC_AS_ACTION_ENUMERATE2 = 0x55,
+  SWFDEC_AS_ACTION_BIT_AND = 0x60,
+  SWFDEC_AS_ACTION_BIT_OR = 0x61,
+  SWFDEC_AS_ACTION_BIT_XOR = 0x62,
+  SWFDEC_AS_ACTION_BIT_LSHIFT = 0x63,
+  SWFDEC_AS_ACTION_BIT_RSHIFT = 0x64,
+  SWFDEC_AS_ACTION_BIT_URSHIFT = 0x65,
+  SWFDEC_AS_ACTION_STRICT_EQUALS = 0x66,
+  SWFDEC_AS_ACTION_GREATER = 0x67,
+  SWFDEC_AS_ACTION_STRING_GREATER = 0x68,
+  SWFDEC_AS_ACTION_EXTENDS = 0x69,
+  SWFDEC_AS_ACTION_GOTO_FRAME = 0x81,
+  SWFDEC_AS_ACTION_GET_URL = 0x83,
+  SWFDEC_AS_ACTION_STORE_REGISTER = 0x87,
+  SWFDEC_AS_ACTION_CONSTANT_POOL = 0x88,
+  SWFDEC_AS_ACTION_WAIT_FOR_FRAME = 0x8A,
+  SWFDEC_AS_ACTION_SET_TARGET = 0x8B,
+  SWFDEC_AS_ACTION_GOTO_LABEL = 0x8C,
+  SWFDEC_AS_ACTION_WAIT_FOR_FRAME2 = 0x8D,
+  SWFDEC_AS_ACTION_DEFINE_FUNCTION2 = 0x8E,
+  SWFDEC_AS_ACTION_TRY = 0x8F,
+  SWFDEC_AS_ACTION_WITH = 0x94,
+  SWFDEC_AS_ACTION_PUSH = 0x96,
+  SWFDEC_AS_ACTION_JUMP = 0x99,
+  SWFDEC_AS_ACTION_GET_URL2 = 0x9A,
+  SWFDEC_AS_ACTION_DEFINE_FUNCTION = 0x9B,
+  SWFDEC_AS_ACTION_IF = 0x9D,
+  SWFDEC_AS_ACTION_CALL = 0x9E,
+  SWFDEC_AS_ACTION_GOTO_FRAME2 = 0x9F
+} SwfdecAsAction;
+
 G_END_DECLS
 #endif
diff --git a/libswfdec/swfdec_as_types.h b/libswfdec/swfdec_as_types.h
index 51bc65e..dbb9394 100644
--- a/libswfdec/swfdec_as_types.h
+++ b/libswfdec/swfdec_as_types.h
@@ -106,109 +106,6 @@ struct _SwfdecAsValue {
   (__val)->value.object = o; \
 } G_STMT_END
 
-/* all existing actions */
-typedef enum {
-  SWFDEC_AS_ACTION_NEXT_FRAME = 0x04,
-  SWFDEC_AS_ACTION_PREVIOUS_FRAME = 0x05,
-  SWFDEC_AS_ACTION_PLAY = 0x06,
-  SWFDEC_AS_ACTION_STOP = 0x07,
-  SWFDEC_AS_ACTION_TOGGLE_QUALITY = 0x08,
-  SWFDEC_AS_ACTION_STOP_SOUNDS = 0x09,
-  SWFDEC_AS_ACTION_ADD = 0x0A,
-  SWFDEC_AS_ACTION_SUBTRACT = 0x0B,
-  SWFDEC_AS_ACTION_MULTIPLY = 0x0C,
-  SWFDEC_AS_ACTION_DIVIDE = 0x0D,
-  SWFDEC_AS_ACTION_EQUALS = 0x0E,
-  SWFDEC_AS_ACTION_LESS = 0x0F,
-  SWFDEC_AS_ACTION_AND = 0x10,
-  SWFDEC_AS_ACTION_OR = 0x11,
-  SWFDEC_AS_ACTION_NOT = 0x12,
-  SWFDEC_AS_ACTION_STRING_EQUALS = 0x13,
-  SWFDEC_AS_ACTION_STRING_LENGTH = 0x14,
-  SWFDEC_AS_ACTION_STRING_EXTRACT = 0x15,
-  SWFDEC_AS_ACTION_POP = 0x17,
-  SWFDEC_AS_ACTION_TO_INTEGER = 0x18,
-  SWFDEC_AS_ACTION_GET_VARIABLE = 0x1C,
-  SWFDEC_AS_ACTION_SET_VARIABLE = 0x1D,
-  SWFDEC_AS_ACTION_SET_TARGET2 = 0x20,
-  SWFDEC_AS_ACTION_STRING_ADD = 0x21,
-  SWFDEC_AS_ACTION_GET_PROPERTY = 0x22,
-  SWFDEC_AS_ACTION_SET_PROPERTY = 0x23,
-  SWFDEC_AS_ACTION_CLONE_SPRITE = 0x24,
-  SWFDEC_AS_ACTION_REMOVE_SPRITE = 0x25,
-  SWFDEC_AS_ACTION_TRACE = 0x26,
-  SWFDEC_AS_ACTION_START_DRAG = 0x27,
-  SWFDEC_AS_ACTION_END_DRAG = 0x28,
-  SWFDEC_AS_ACTION_STRING_LESS = 0x29,
-  SWFDEC_AS_ACTION_THROW = 0x2A,
-  SWFDEC_AS_ACTION_CAST = 0x2B,
-  SWFDEC_AS_ACTION_IMPLEMENTS = 0x2C,
-  SWFDEC_AS_ACTION_RANDOM = 0x30,
-  SWFDEC_AS_ACTION_MB_STRING_LENGTH = 0x31,
-  SWFDEC_AS_ACTION_CHAR_TO_ASCII = 0x32,
-  SWFDEC_AS_ACTION_ASCII_TO_CHAR = 0x33,
-  SWFDEC_AS_ACTION_GET_TIME = 0x34,
-  SWFDEC_AS_ACTION_MB_STRING_EXTRACT = 0x35,
-  SWFDEC_AS_ACTION_MB_CHAR_TO_ASCII = 0x36,
-  SWFDEC_AS_ACTION_MB_ASCII_TO_CHAR = 0x37,
-  SWFDEC_AS_ACTION_DELETE = 0x3A,
-  SWFDEC_AS_ACTION_DELETE2 = 0x3B,
-  SWFDEC_AS_ACTION_DEFINE_LOCAL = 0x3C,
-  SWFDEC_AS_ACTION_CALL_FUNCTION = 0x3D,
-  SWFDEC_AS_ACTION_RETURN = 0x3E,
-  SWFDEC_AS_ACTION_MODULO = 0x3F,
-  SWFDEC_AS_ACTION_NEW_OBJECT = 0x40,
-  SWFDEC_AS_ACTION_DEFINE_LOCAL2 = 0x41,
-  SWFDEC_AS_ACTION_INIT_ARRAY = 0x42,
-  SWFDEC_AS_ACTION_INIT_OBJECT = 0x43,
-  SWFDEC_AS_ACTION_TYPE_OF = 0x44,
-  SWFDEC_AS_ACTION_TARGET_PATH = 0x45,
-  SWFDEC_AS_ACTION_ENUMERATE = 0x46,
-  SWFDEC_AS_ACTION_ADD2 = 0x47,
-  SWFDEC_AS_ACTION_LESS2 = 0x48,
-  SWFDEC_AS_ACTION_EQUALS2 = 0x49,
-  SWFDEC_AS_ACTION_TO_NUMBER = 0x4A,
-  SWFDEC_AS_ACTION_TO_STRING = 0x4B,
-  SWFDEC_AS_ACTION_PUSH_DUPLICATE = 0x4C,
-  SWFDEC_AS_ACTION_SWAP = 0x4D,
-  SWFDEC_AS_ACTION_GET_MEMBER = 0x4E,
-  SWFDEC_AS_ACTION_SET_MEMBER = 0x4F,
-  SWFDEC_AS_ACTION_INCREMENT = 0x50,
-  SWFDEC_AS_ACTION_DECREMENT = 0x51,
-  SWFDEC_AS_ACTION_CALL_METHOD = 0x52,
-  SWFDEC_AS_ACTION_NEW_METHOD = 0x53,
-  SWFDEC_AS_ACTION_INSTANCE_OF = 0x54,
-  SWFDEC_AS_ACTION_ENUMERATE2 = 0x55,
-  SWFDEC_AS_ACTION_BIT_AND = 0x60,
-  SWFDEC_AS_ACTION_BIT_OR = 0x61,
-  SWFDEC_AS_ACTION_BIT_XOR = 0x62,
-  SWFDEC_AS_ACTION_BIT_LSHIFT = 0x63,
-  SWFDEC_AS_ACTION_BIT_RSHIFT = 0x64,
-  SWFDEC_AS_ACTION_BIT_URSHIFT = 0x65,
-  SWFDEC_AS_ACTION_STRICT_EQUALS = 0x66,
-  SWFDEC_AS_ACTION_GREATER = 0x67,
-  SWFDEC_AS_ACTION_STRING_GREATER = 0x68,
-  SWFDEC_AS_ACTION_EXTENDS = 0x69,
-  SWFDEC_AS_ACTION_GOTO_FRAME = 0x81,
-  SWFDEC_AS_ACTION_GET_URL = 0x83,
-  SWFDEC_AS_ACTION_STORE_REGISTER = 0x87,
-  SWFDEC_AS_ACTION_CONSTANT_POOL = 0x88,
-  SWFDEC_AS_ACTION_WAIT_FOR_FRAME = 0x8A,
-  SWFDEC_AS_ACTION_SET_TARGET = 0x8B,
-  SWFDEC_AS_ACTION_GOTO_LABEL = 0x8C,
-  SWFDEC_AS_ACTION_WAIT_FOR_FRAME2 = 0x8D,
-  SWFDEC_AS_ACTION_DEFINE_FUNCTION2 = 0x8E,
-  SWFDEC_AS_ACTION_TRY = 0x8F,
-  SWFDEC_AS_ACTION_WITH = 0x94,
-  SWFDEC_AS_ACTION_PUSH = 0x96,
-  SWFDEC_AS_ACTION_JUMP = 0x99,
-  SWFDEC_AS_ACTION_GET_URL2 = 0x9A,
-  SWFDEC_AS_ACTION_DEFINE_FUNCTION = 0x9B,
-  SWFDEC_AS_ACTION_IF = 0x9D,
-  SWFDEC_AS_ACTION_CALL = 0x9E,
-  SWFDEC_AS_ACTION_GOTO_FRAME2 = 0x9F
-} SwfdecAsAction;
-
 /* value conversion functions */
 gboolean	swfdec_as_value_to_boolean	(SwfdecAsContext *	context,
 						 const SwfdecAsValue *	value);
diff --git a/libswfdec/swfdec_debugger.c b/libswfdec/swfdec_debugger.c
index 141935b..9b3120b 100644
--- a/libswfdec/swfdec_debugger.c
+++ b/libswfdec/swfdec_debugger.c
@@ -25,6 +25,7 @@
 #include "swfdec_debugger.h"
 #include "swfdec_as_context.h"
 #include "swfdec_as_frame.h"
+#include "swfdec_as_interpret.h"
 #include "swfdec_debug.h"
 #include "swfdec_decoder.h"
 #include "swfdec_movie.h"
diff-tree f0e73ade09a589470364bfceff91fcc5c999a710 (from 6ae17cc3ae7f70e20e4f9dc18b2dbabc01864375)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:58:25 2007 +0200

    the stack should not be in the public API

diff --git a/doc/Makefile.am b/doc/Makefile.am
index d43bd1d..0b9b85d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -59,6 +59,7 @@ IGNORE_HFILES= \
 	swfdec_as_interpret.h \
 	swfdec_as_math.h \
 	swfdec_as_number.h \
+	swfdec_as_stack.h \
 	swfdec_as_string.h \
 	swfdec_as_strings.h \
 	swfdec_as_super.h \
diff-tree 6ae17cc3ae7f70e20e4f9dc18b2dbabc01864375 (from 33275791b6d2976f90c580d71643de1ff25b5252)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:19:21 2007 +0200

    fix up for new or forgotten symbols

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 4f9c3f9..d43bd1d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -55,6 +55,7 @@ IGNORE_HFILES= \
 	js \
 	jpeg \
 	swfdec_amf.h \
+	swfdec_as_boolean.h \
 	swfdec_as_interpret.h \
 	swfdec_as_math.h \
 	swfdec_as_number.h \
diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index db255b0..96dbcb1 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -102,6 +102,7 @@ swfdec_buffer_queue_get_type
 <SECTION>
 <FILE>Enumerations</FILE>
 <TITLE>Enumerations</TITLE>
+SwfdecAsContextState
 SwfdecLoaderDataType
 SwfdecLoaderRequest
 swfdec_loader_data_type_get_extension
@@ -205,6 +206,7 @@ SWFDEC_AS_VALUE_GET_OBJECT
 swfdec_as_value_to_object
 SWFDEC_AS_VALUE_SET_OBJECT
 swfdec_as_value_to_primitive
+swfdec_as_value_to_debug
 swfdec_as_double_to_string
 swfdec_as_str_concat
 <SUBSECTION Standard>
@@ -220,6 +222,7 @@ SWFDEC_AS_VALUE_IS_OBJECT
 <SECTION>
 <FILE>SwfdecAsContext</FILE>
 <TITLE>SwfdecAsContext</TITLE>
+SwfdecAsContext
 swfdec_as_context_startup
 swfdec_as_context_abort
 swfdec_as_context_get_string
diff-tree 33275791b6d2976f90c580d71643de1ff25b5252 (from 9a6c1ee6396b82b7bc86135f722ab509e75ec0f6)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:15:26 2007 +0200

    add comments

diff --git a/libswfdec/swfdec_as_object.h b/libswfdec/swfdec_as_object.h
index ef818fb..0236bf5 100644
--- a/libswfdec/swfdec_as_object.h
+++ b/libswfdec/swfdec_as_object.h
@@ -55,7 +55,9 @@ typedef const char *(* SwfdecAsVariableF
 struct _SwfdecAsObject {
   GObject		object;
 
-  SwfdecAsContext *	context;	/* context used */
+  /*< protected >*/
+  SwfdecAsContext *	context;	/* context the object belongs to */
+  /*< private >*/
   SwfdecAsObject *	prototype;	/* prototype object (referred to as __proto__) */
   GHashTable *		properties;	/* string->SwfdecAsVariable mapping or NULL when not in GC */
   guint8		flags;		/* GC flags */
diff-tree 9a6c1ee6396b82b7bc86135f722ab509e75ec0f6 (from f6b3af66986479230a460a4e66b4bfd2a37f8bd7)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:12:18 2007 +0200

    SwfdecLoaderRequest needs to be documented

diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index b88f06e..db255b0 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -103,6 +103,7 @@ swfdec_buffer_queue_get_type
 <FILE>Enumerations</FILE>
 <TITLE>Enumerations</TITLE>
 SwfdecLoaderDataType
+SwfdecLoaderRequest
 swfdec_loader_data_type_get_extension
 SwfdecMouseCursor
 </SECTION>
diff-tree f6b3af66986479230a460a4e66b4bfd2a37f8bd7 (from 22d96339c11f2304996215ed59f14ada39aef0e5)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:12:00 2007 +0200

    swfdec_as_string_new () is gone

diff --git a/libswfdec/swfdec_as_string.h b/libswfdec/swfdec_as_string.h
index bd01d8d..4266807 100644
--- a/libswfdec/swfdec_as_string.h
+++ b/libswfdec/swfdec_as_string.h
@@ -47,9 +47,6 @@ struct _SwfdecAsStringClass {
 
 GType		swfdec_as_string_get_type	(void);
 
-SwfdecAsObject *swfdec_as_string_new		(SwfdecAsContext *	context,
-						 const char *		string);
-
 void		swfdec_as_string_init_context	(SwfdecAsContext *	context,
 						 guint			version);
 
diff-tree 22d96339c11f2304996215ed59f14ada39aef0e5 (from cadfeb2ae498fd11e3898f44397b6e6ed07dbd04)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:09:40 2007 +0200

    use the stack iterator

diff --git a/player/swfdec_debug_stack.c b/player/swfdec_debug_stack.c
index 77a11fb..aee8f21 100644
--- a/player/swfdec_debug_stack.c
+++ b/player/swfdec_debug_stack.c
@@ -71,15 +71,11 @@ swfdec_debug_stack_set_model (SwfdecDebu
   context= SWFDEC_AS_CONTEXT (debug->manager->player);
   frame = context->frame;
   if (frame) {
-    SwfdecAsValue *val = context->cur;
-    SwfdecAsStack *stack = context->stack;
+    SwfdecAsStackIterator siter;
+    SwfdecAsValue *val;
     guint i = 0;
-    while (val != frame->stack_begin) {
-      if (val == &stack->elements[0]) {
-	stack = stack->next;
-	val = &stack->elements[stack->used_elements];
-      }
-      val--;
+    for (val = swfdec_as_stack_iterator_init (&siter, frame); val;
+	val = swfdec_as_stack_iterator_next (&siter)) {
       s = swfdec_as_value_to_debug (val);
       gtk_list_store_append (store, &iter);
       gtk_list_store_set (store, &iter, COLUMN_LINE, ++i, 
diff-tree cadfeb2ae498fd11e3898f44397b6e6ed07dbd04 (from 9fc6fa9ce9c8b9d61410f7c208d893b15bcc6a96)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 21:00:22 2007 +0200

    add SwfdecAsStackIterator
    
    This is an easy support class for letting debugging applications get access to
    the stack.

diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
index 5990d69..653adba 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -29,6 +29,99 @@
 #include "swfdec_as_super.h"
 #include "swfdec_debug.h"
 
+/*** STACK ITERATOR ***/
+
+SwfdecAsValue *
+swfdec_as_stack_iterator_init_arguments (SwfdecAsStackIterator *iter, SwfdecAsFrame *frame)
+{
+  SwfdecAsContext *context;
+
+  g_return_val_if_fail (iter != NULL, NULL);
+  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
+  /* FIXME! */
+  context = SWFDEC_AS_OBJECT (frame)->context;
+  g_return_val_if_fail (context->frame == frame, NULL);
+
+  if (frame->argv) {
+    iter->stack = NULL;
+    iter->current = (SwfdecAsValue *) frame->argv;
+  } else {
+    iter->stack = context->stack;
+    iter->current = frame->stack_begin - 1;
+  }
+  iter->i = 0;
+  iter->n = frame->argc;
+  if (frame->argc == 0)
+    iter->current = NULL;
+  return iter->current;
+}
+
+SwfdecAsValue *
+swfdec_as_stack_iterator_init (SwfdecAsStackIterator *iter, SwfdecAsFrame *frame)
+{
+  SwfdecAsContext *context;
+  SwfdecAsStack *stack;
+
+  g_return_val_if_fail (iter != NULL, NULL);
+  g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
+
+  context = SWFDEC_AS_OBJECT (frame)->context;
+  iter->i = 0;
+  stack = context->stack;
+  if (context->frame == frame) {
+    iter->current = context->cur;
+  } else {
+    SwfdecAsFrame *follow = context->frame;
+    while (follow->next != frame)
+      follow = follow->next;
+    iter->current = follow->stack_begin;
+    /* FIXME: get rid of arguments on stack */
+    while (iter->current < &stack->elements[0] || iter->current > &stack->elements[stack->n_elements]) {
+      stack = stack->next;
+      g_assert (stack);
+    }
+  }
+  iter->stack = stack;
+  /* figure out number of args */
+  iter->n = iter->current - &stack->elements[0];
+  while (frame->stack_begin < &stack->elements[0] && frame->stack_begin > &stack->elements[stack->n_elements]) {
+    iter->n += stack->used_elements;
+    stack = stack->next;
+  };
+  g_assert (iter->n >= (guint) (frame->stack_begin - &stack->elements[0]));
+  iter->n -= frame->stack_begin - &stack->elements[0];
+  if (iter->n == 0)
+    return NULL;
+  if (iter->current == &iter->stack->elements[0]) {
+    iter->stack = iter->stack->next;
+    g_assert (iter->stack);
+    iter->current = &iter->stack->elements[iter->stack->used_elements];
+  }
+  iter->current--;
+  return iter->current;
+}
+
+SwfdecAsValue *
+swfdec_as_stack_iterator_next (SwfdecAsStackIterator *iter)
+{
+  if (iter->i < iter->n)
+    iter->i++;
+  if (iter->i >= iter->n)
+    return NULL;
+  if (iter->stack) {
+    if (iter->current == &iter->stack->elements[0]) {
+      iter->stack = iter->stack->next;
+      g_assert (iter->stack);
+      iter->current = &iter->stack->elements[iter->stack->used_elements];
+    }
+    iter->current--;
+  } else {
+    iter->current++;
+  }
+  return iter->current;
+}
+
+
 G_DEFINE_TYPE (SwfdecAsFrame, swfdec_as_frame, SWFDEC_TYPE_AS_SCOPE)
 
 static void
diff --git a/libswfdec/swfdec_as_frame.h b/libswfdec/swfdec_as_frame.h
index afc9d35..6a8197a 100644
--- a/libswfdec/swfdec_as_frame.h
+++ b/libswfdec/swfdec_as_frame.h
@@ -27,6 +27,16 @@
 G_BEGIN_DECLS
 
 typedef struct _SwfdecAsFrameClass SwfdecAsFrameClass;
+typedef struct _SwfdecAsStackIterator SwfdecAsStackIterator;
+
+struct _SwfdecAsStackIterator {
+  /*< private >*/
+  SwfdecAsStack *	stack;
+  SwfdecAsValue *	current;
+  guint			i;
+  guint			n;
+};
+
 
 #define SWFDEC_TYPE_AS_FRAME                    (swfdec_as_frame_get_type())
 #define SWFDEC_IS_AS_FRAME(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_AS_FRAME))
@@ -88,6 +98,9 @@ void		swfdec_as_frame_set_target	(Swfdec
 						 SwfdecAsObject *	target);
 void		swfdec_as_frame_check_scope	(SwfdecAsFrame *	frame);
 
+SwfdecAsValue *	swfdec_as_stack_iterator_init	(SwfdecAsStackIterator *	iter,
+						 SwfdecAsFrame *	frame);
+SwfdecAsValue *	swfdec_as_stack_iterator_next	(SwfdecAsStackIterator *	iter);
 
 G_END_DECLS
 #endif
diff-tree 9fc6fa9ce9c8b9d61410f7c208d893b15bcc6a96 (from 16909175916f11bbe595d84cdec2857f2ebab09d)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 20:59:10 2007 +0200

    quote strings
    
    This makes them easier to understand when the type is not explicit

diff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c
index 6acb9c3..98d61d7 100644
--- a/libswfdec/swfdec_as_types.c
+++ b/libswfdec/swfdec_as_types.c
@@ -406,7 +406,7 @@ swfdec_as_value_to_debug (const SwfdecAs
 
   switch (value->type) {
     case SWFDEC_AS_TYPE_STRING:
-      return g_strdup (SWFDEC_AS_VALUE_GET_STRING (value));
+      return g_shell_quote (SWFDEC_AS_VALUE_GET_STRING (value));
     case SWFDEC_AS_TYPE_UNDEFINED:
       return g_strdup ("undefined");
     case SWFDEC_AS_TYPE_BOOLEAN:
diff-tree 16909175916f11bbe595d84cdec2857f2ebab09d (from 3c395d699a9d90c1205afa243eec1ae810bf7fbb)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jul 12 16:52:12 2007 +0200

    NetStream.bytesTotal should be 0 when no movie is loading

diff --git a/libswfdec/swfdec_net_stream.c b/libswfdec/swfdec_net_stream.c
index 7cdd203..7af040c 100644
--- a/libswfdec/swfdec_net_stream.c
+++ b/libswfdec/swfdec_net_stream.c
@@ -361,9 +361,14 @@ swfdec_net_stream_get_variable (SwfdecAs
     *flags = 0;
     return TRUE;
   } else if (variable == SWFDEC_AS_STR_bytesTotal) {
-    guint bytes = swfdec_loader_get_size (stream->loader);
-    if (bytes == 0)
-      bytes = swfdec_loader_get_loaded (stream->loader);
+    guint bytes;
+    if (stream->loader == NULL) {
+      bytes = 0;
+    } else { 
+      bytes = swfdec_loader_get_size (stream->loader);
+      if (bytes == 0)
+	bytes = swfdec_loader_get_loaded (stream->loader);
+    }
     SWFDEC_AS_VALUE_SET_INT (val, bytes);
     *flags = 0;
     return TRUE;


More information about the Swfdec mailing list