Displaying 20 results from an estimated 21 matches for "swfdec_action_push".
2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...ate: Wed Apr 4 16:51:17 2007 +0200
implement ActionGetVariable and ActionSetVariable
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 60c4046..aab5f44 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -512,22 +512,18 @@ swfdec_action_push (SwfdecAsContext *cx,
}
}
-#if 0
static void
swfdec_action_get_variable (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
const char *s;
- s = swfdec_js_to_string (cx, cx->fp->sp[-1]);
- if (s == NULL)
- return JS_FALSE;
- cx->fp->sp[-1] = swfdec_j...
2007 Jan 18
0
Branch 'interpreter' - 4 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c
...9ad92f 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -29,6 +29,7 @@
#include <string.h>
#include "swfdec_decoder.h"
+#include "swfdec_js.h"
#include "swfdec_movie.h"
#include "swfdec_root_movie.h"
@@ -305,6 +306,18 @@ swfdec_action_push (JSContext *cx, guint
return swfdec_bits_left (&bits) ? JS_TRUE : JS_FALSE;
}
+static JSBool
+swfdec_action_get_variable (JSContext *cx, guint action, const guint8 *data, guint len)
+{
+ const char *s;
+
+ s = swfdec_js_to_string (cx, cx->fp->sp[-1]);
+ if (s == NULL)
+ return...
2007 Feb 17
0
8 commits - configure.ac doc/swfdec-sections.txt libswfdec/swfdec_loader.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h
...les" : "");
+}
+
+static char *
swfdec_action_print_get_url (guint action, const guint8 *data, guint len)
{
SwfdecBits bits;
@@ -2134,7 +2155,7 @@ static const SwfdecActionSpec actions[25
/* version 4 */
[0x96] = { "Push", swfdec_action_print_push, 0, -1, { NULL, swfdec_action_push, swfdec_action_push, swfdec_action_push, swfdec_action_push } },
[0x99] = { "Jump", swfdec_action_print_jump, 0, 0, { NULL, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump } },
- [0x9a] = { "GetURL2", NULL, 2, 0, { NULL, swfdec_action_get_url2,...
2007 Jun 05
0
Branch 'as' - 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_scope.h
...] = { "With", NULL },
+ [SWFDEC_AS_ACTION_WITH] = { "With", swfdec_action_print_with, 1, 0, { NULL, NULL, swfdec_action_with, swfdec_action_with, swfdec_action_with } },
/* version 4 */
[SWFDEC_AS_ACTION_PUSH] = { "Push", swfdec_action_print_push, 0, -1, { NULL, swfdec_action_push, swfdec_action_push, swfdec_action_push, swfdec_action_push } },
[SWFDEC_AS_ACTION_JUMP] = { "Jump", swfdec_action_print_jump, 0, 0, { NULL, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump } },
diff --git a/libswfdec/swfdec_as_scope.h b/libswfdec/swfdec_a...
2007 Nov 07
0
14 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field_movie.c
...ction_equals2, 5 },
[SWFDEC_AS_ACTION_TO_NUMBER] = { "ToNumber", NULL, 1, 1, swfdec_action_to_number, 5 },
[SWFDEC_AS_ACTION_TO_STRING] = { "ToString", NULL, 1, 1, swfdec_action_to_string, 5 },
[SWFDEC_AS_ACTION_PUSH_DUPLICATE] = { "PushDuplicate", NULL, 1, 2, swfdec_action_push_duplicate, 5 },
@@ -3205,7 +3195,7 @@ const SwfdecActionSpec swfdec_as_actions[256] = {
[SWFDEC_AS_ACTION_GREATER] = { "Greater", NULL, 2, 1, swfdec_action_new_comparison, 6 },
[SWFDEC_AS_ACTION_STRING_GREATER] = { "StringGreater", NULL },
/* version 7 */
- [SWFDEC_AS_...
2007 Apr 12
0
Branch 'as' - 14 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
...ersion 5 */
- [0x94] = { "With", NULL },
#endif
+ [SWFDEC_AS_ACTION_TRY] = { "Try", NULL },
+ /* version 5 */
+ [SWFDEC_AS_ACTION_WITH] = { "With", NULL },
/* version 4 */
[SWFDEC_AS_ACTION_PUSH] = { "Push", swfdec_action_print_push, 0, -1, { NULL, swfdec_action_push, swfdec_action_push, swfdec_action_push, swfdec_action_push } },
[SWFDEC_AS_ACTION_JUMP] = { "Jump", swfdec_action_print_jump, 0, 0, { NULL, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump } },
diff --git a/libswfdec/swfdec_as_types.h b/libswfdec/swfdec_a...
2007 Jan 25
0
Branch 'interpreter' - 28 commits - configure.ac libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_player.c
...ULL },
[0x14] = { "StringLength", NULL },
[0x15] = { "StringExtract", NULL },
@@ -938,12 +1007,12 @@ static const SwfdecActionSpec actions[25
[0x94] = { "With", NULL },
/* version 4 */
[0x96] = { "Push", swfdec_action_print_push, 0, -1, { NULL, swfdec_action_push, swfdec_action_push, swfdec_action_push, swfdec_action_push } },
- [0x99] = { "Jump", NULL },
+ [0x99] = { "Jump", swfdec_action_print_jump, 0, 0, { NULL, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump } },
[0x9a] = { "GetURL2", NUL...
2007 Feb 16
0
11 commits - libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h test/.gitignore test/trace
...PORT FUNCTIONS ***/
+static gboolean
+swfdec_action_has_register (JSContext *cx, guint i)
+{
+ if (cx->fp->fun == NULL)
+ return i < 4;
+ else
+ return i < cx->fp->fun->nvars;
+}
+
static SwfdecMovie *
swfdec_action_get_target (JSContext *cx)
{
@@ -461,6 +470,16 @@ swfdec_action_push (JSContext *cx, guint
case 3: /* undefined */
*cx->fp->sp++ = JSVAL_VOID;
break;
+ case 4: /* register */
+ {
+ guint regnum = swfdec_bits_get_u8 (&bits);
+ if (!swfdec_action_has_register (cx, regnum)) {
+ SWFDEC_ERROR ("cannot Push register %u: not enough re...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...tic SwfdecMovie *
+swfdec_action_get_target (SwfdecAsContext *context)
+{
+ SwfdecAsObject *object = context->frame->scope;
+
+ if (!SWFDEC_IS_MOVIE (object)) {
+ SWFDEC_ERROR ("no valid target");
+ return NULL;
+ }
+ return SWFDEC_MOVIE (object);
+}
+
+#if 0
+static void
+swfdec_action_push_string (SwfdecAsContext *cx, const char *s)
+{
+ JSString *string = JS_NewStringCopyZ (cx, s);
+ if (string == NULL)
+ return JS_FALSE;
+ *cx->fp->sp++ = STRING_TO_JSVAL (string);
+ return JS_TRUE;
+}
+
+static void
+swfdec_value_to_boolean_5 (SwfdecAsContext *cx, jsval val)
+{
+ if (...
2007 Sep 06
0
3 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c
...his is the second try to make FLash 4-style variables work. Tests will follow
tomorrow
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index fcbd035..a94d3ca 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -409,18 +409,156 @@ swfdec_action_push (SwfdecAsContext *cx,
}
}
+/**
+ * swfdec_action_get_movie_by_path:
+ * @cx: a #SwfdecAsContext
+ * @path: the path to look up
+ * @variable: pointer that takes variable part of the path or %NULL if not
+ * allowed
+ *
+ * Looks up a Flash4-compatible path using "/", &qu...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...JS_TRUE;
+}
+
+static JSBool
swfdec_action_string_add (JSContext *cx, guint action, const guint8 *data, guint len)
{
JSString *lval, *rval;
@@ -1940,7 +1978,7 @@ static const SwfdecActionSpec actions[25
/* version 4 */
[0x96] = { "Push", swfdec_action_print_push, 0, -1, { NULL, swfdec_action_push, swfdec_action_push, swfdec_action_push, swfdec_action_push } },
[0x99] = { "Jump", swfdec_action_print_jump, 0, 0, { NULL, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump, swfdec_action_jump } },
- [0x9a] = { "GetURL2", NULL },
+ [0x9a] = { "GetURL2",...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...* sizeof (jsval));
+ }
+ while (n_elements) {
+ n_elements--;
+ fp->spbase[n_elements] = JSVAL_VOID;
+ }
+ return JS_TRUE;
+}
+
static gboolean
swfdec_action_has_register (JSContext *cx, guint i)
{
@@ -452,10 +488,11 @@ swfdec_action_constant_pool (JSContext *
}
static JSBool
-swfdec_action_push (JSContext *cx, guint stackspace, const guint8 *data, guint len)
+swfdec_action_push (JSContext *cx, guint action, const guint8 *data, guint len)
{
/* FIXME: supply API for this */
SwfdecBits bits;
+ guint stackspace = cx->fp->spend - cx->fp->sp;
swfdec_bits_init_data (&...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...0
remove swfdec_bits_get_string() and rename swfdec_bits_get_String_with_version() to it
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index b703847..130d920 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -326,7 +326,7 @@ swfdec_action_push (SwfdecAsContext *cx, guint action, const guint8 *data, guint
switch (type) {
case 0: /* string */
{
- char *s = swfdec_bits_get_string_with_version (&bits, cx->version);
+ char *s = swfdec_bits_get_string (&bits, cx->version);
if (s == NULL)
return;
SW...
2007 Sep 08
0
9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_video_movie_as.c
...gnome.org>
Date: Thu Sep 6 14:32:00 2007 +0200
add special magic for movie lookups
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index a94d3ca..2660c97 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -409,6 +409,25 @@ swfdec_action_push (SwfdecAsContext *cx,
}
}
+static SwfdecAsObject *
+super_special_movie_lookup_magic (SwfdecAsObject *movie, const char *name)
+{
+ SwfdecAsValue val;
+ SwfdecAsObject *ret;
+
+ ret = SWFDEC_AS_OBJECT (swfdec_movie_get_by_name (SWFDEC_MOVIE (movie), name));
+ if (ret)
+ return ret;
+...
2007 Jul 30
0
10 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_super.c libswfdec/swfdec_video_movie_as.c test/trace
...Mon Jul 30 14:53:36 2007 +0200
if not enoguh registers are available, push undefined
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 4802133..ecc828a 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -349,9 +349,10 @@ swfdec_action_push (SwfdecAsContext *cx,
guint regnum = swfdec_bits_get_u8 (&bits);
if (!swfdec_action_has_register (cx, regnum)) {
SWFDEC_ERROR ("cannot Push register %u: not enough registers", regnum);
- return;
+ SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (cx));
+ } e...
2007 Aug 20
0
15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_with.c
...e at gnome.org>
Date: Mon Aug 20 13:43:50 2007 +0200
fix valgrind reported memleaks
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 23e4116..4a712c2 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -331,7 +331,7 @@ swfdec_action_push (SwfdecAsContext *cx,
if (s == NULL)
return;
SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx),
- swfdec_as_context_get_string (cx, s));
+ swfdec_as_context_give_string (cx, s));
break;
}
case 1: /* float */
diff-tree c13484c2bf562b37799aa5cce70beb04fe430...
2007 Feb 06
0
109 commits - configure.ac libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_button_movie.c libswfdec/swfdec_codec_screen.c libswfdec/swfdec_color.c libswfdec/swfdec_color.h
...#include "swfdec_movie.h"
#include "swfdec_player_internal.h"
#include "swfdec_root_movie.h"
+#include "swfdec_sprite.h"
+#include "swfdec_sprite_movie.h"
#include "js/jsfun.h"
#include "js/jsscope.h"
@@ -115,6 +117,25 @@ swfdec_action_push_string (JSContext *cx
return JS_TRUE;
}
+static double
+swfdec_action_to_number (JSContext *cx, jsval val)
+{
+ if (JSVAL_IS_INT (val)) {
+ return JSVAL_TO_INT (val);
+ } else if (JSVAL_IS_DOUBLE (val)) {
+ return *JSVAL_TO_DOUBLE (val);
+ } else if (JSVAL_IS_BOOLEAN (val)) {
+ re...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...;, NULL },
+ [0x49] = { "Equals2", NULL, 2, 1, { NULL, NULL, swfdec_action_equals2, swfdec_action_equals2, swfdec_action_equals2 } },
[0x4a] = { "ToNumber", NULL },
[0x4b] = { "ToString", NULL },
[0x4c] = { "PushDuplicate", NULL, 1, 2, { NULL, NULL, swfdec_action_push_duplicate, swfdec_action_push_duplicate, swfdec_action_push_duplicate } },
diff-tree 2c8b93b57d2d93c187ac1e0c45667884047fc48d (from 0a490e81dada959efc3ed155a98b8de577ff4dd2)
Author: Benjamin Otte <otte@gnome.org>
Date: Sun Jan 28 20:52:23 2007 +0100
another fix for swfdec_js_internal...
2007 Jun 06
0
Branch 'as' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...Con
SwfdecAsFrame *frame;
frame = cx->frame;
- pool = swfdec_constant_pool_new_from_action (data, len);
+ pool = swfdec_constant_pool_new_from_action (data, len, cx->version);
if (pool == NULL)
return;
swfdec_constant_pool_attach_to_context (pool, cx);
@@ -346,7 +346,7 @@ swfdec_action_push (SwfdecAsContext *cx,
switch (type) {
case 0: /* string */
{
- const char *s = swfdec_bits_skip_string (&bits);
+ char *s = swfdec_bits_get_string_with_version (&bits, cx->version);
if (s == NULL)
return;
SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (s...
2007 Jul 02
0
Branch 'as' - 24 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...c->add);
}
if (context->state != SWFDEC_AS_CONTEXT_RUNNING)
goto error;
diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c
index 3195a8c..649ec36 100644
--- a/libswfdec/swfdec_as_interpret.c
+++ b/libswfdec/swfdec_as_interpret.c
@@ -321,7 +321,7 @@ swfdec_action_push (SwfdecAsContext *cx,
while (swfdec_bits_left (&bits)) {
guint type = swfdec_bits_get_u8 (&bits);
SWFDEC_LOG ("push type %u", type);
- swfdec_as_stack_ensure_left (stack, 1);
+ swfdec_as_stack_ensure_free (stack, 1);
switch (type) {
case 0: /* string...