search for: swfdec_action_get_target

Displaying 19 results from an estimated 19 matches for "swfdec_action_get_target".

2007 Jun 27
0
Branch 'as' - 6 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie_asprops.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie_as.c
.../libswfdec/swfdec_as_interpret.c index 7fc4ae6..e09b09f 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -50,7 +50,7 @@ #define swfdec_action_has_register(cx, i) \ ((i) < (cx)->frame->n_registers) -static SwfdecMovie * +static SwfdecSpriteMovie * swfdec_action_get_target (SwfdecAsContext *context) { SwfdecAsObject *target = context->frame->target; @@ -62,11 +62,11 @@ swfdec_action_get_target (SwfdecAsContex g_assert (SWFDEC_IS_AS_FRAME (scope)); target = SWFDEC_AS_FRAME (scope)->thisp; } - if (!SWFDEC_IS_MOVIE (target)) { + if (!SWFDEC_I...
2007 Jan 18
0
Branch 'interpreter' - 2 commits - libswfdec/js libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...ec_script.c index 3d39a72..5b01510 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -29,7 +29,9 @@ /*** SUPPORT FUNCTIONS ***/ +#include "swfdec_decoder.h" #include "swfdec_movie.h" +#include "swfdec_root_movie.h" static SwfdecMovie * swfdec_action_get_target (JSContext *cx) @@ -45,9 +47,91 @@ swfdec_action_stop (JSContext *cx, guint SwfdecMovie *movie = swfdec_action_get_target (cx); if (movie) movie->stopped = TRUE; + else + SWFDEC_ERROR ("no movie to stop"); return JS_TRUE; } +static JSBool +swfdec_action_play (JSCon...
2007 Jun 27
0
Branch 'as' - 16 commits - configure.ac libswfdec/Makefile.am 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_script_function.c
...47d,e09b09f..4f84189 @@@ -55,8 -74,9 +55,8 @@@ static void swfdec_action_stop (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) { - if (SWFDEC_IS_MOVIE (cx->frame->target)) - SWFDEC_MOVIE (cx->frame->target)->stopped = TRUE; - SwfdecSpriteMovie *movie = swfdec_action_get_target (cx); - if (movie) - movie->playing = FALSE; ++ if (SWFDEC_IS_SPRITE_MOVIE (cx->frame->target)) ++ SWFDEC_SPRITE_MOVIE (cx->frame->target)->playing = FALSE; else SWFDEC_ERROR ("no movie to stop"); } @@@ -64,8 -84,9 +64,8 @@@ static void swfdec_a...
2007 Feb 01
0
Branch 'interpreter' - libswfdec/swfdec_script.c
...- } - frame = swfdec_sprite_get_frame (SWFDEC_SPRITE_MOVIE (movie)->sprite, name); - if (frame == -1) - return JS_TRUE; - } else { - /* FIXME: how do we treat undefined etc? */ - frame = swfdec_action_to_number (cx, val); - } - frame += bias; - /* now set it */ movie = swfdec_action_get_target (cx); + /* now set it */ if (movie) { + int frame = swfdec_value_to_frame (cx, movie, val); + if (frame < 0) + return JS_TRUE; + frame += bias; frame = CLAMP (frame, 0, (int) movie->n_frames - 1); swfdec_movie_goto (movie, frame); movie->stopped = !play; @@...
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
...about unimplemented native properties, + * but usually just causes a lot of spam. */ +//#define SWFDEC_WARN_MISSING_PROPERTIES + +/*** SUPPORT FUNCTIONS ***/ + +#define swfdec_action_has_register(cx, i) \ + ((i) < ((SwfdecScript *) (cx)->fp->swf)->n_registers) + +static 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...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...an (d) ? 0 : d; + } else { + return 0; + } +} + /*** ALL THE ACTION IS HERE ***/ static JSBool @@ -140,6 +161,38 @@ swfdec_action_play (JSContext *cx, guint } static JSBool +swfdec_action_next_frame (JSContext *cx, guint action, const guint8 *data, guint len) +{ + SwfdecMovie *movie = swfdec_action_get_target (cx); + if (movie) { + if (movie->frame + 1 < movie->n_frames) { + swfdec_movie_goto (movie, movie->frame + 1); + } else { + SWFDEC_INFO ("can't execute nextFrame, already at last frame"); + } + } else { + SWFDEC_ERROR ("no movie to nextFrame o...
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
...; #include "swfdec_debug.h" #include <errno.h> @@ -44,7 +45,7 @@ /*** SUPPORT FUNCTIONS ***/ #define swfdec_action_has_register(cx, i) \ - ((i) < ((SwfdecScript *) (cx)->fp->swf)->n_registers) + ((i) < (cx)->frame->n_registers) static SwfdecMovie * swfdec_action_get_target (SwfdecAsContext *context) @@ -60,16 +61,6 @@ swfdec_action_get_target (SwfdecAsContex #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++ = STRI...
2007 Feb 22
0
3 commits - libswfdec/swfdec_js.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...e current target, so that it works with scope chains diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index f8a9623..83dde3a 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -137,7 +137,10 @@ swfdec_action_has_register (JSContext *c static SwfdecMovie * swfdec_action_get_target (JSContext *cx) { - JSObject *object = cx->fp->thisp; + JSObject *object = cx->fp->scopeChain; + /* this whole function needs a big FIXME */ + if (JS_GetClass (object) == &js_WithClass) + object = JS_GetPrototype (cx, object); return swfdec_scriptable_from_jsval (cx, OBJE...
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
...- } - frame = swfdec_sprite_get_frame (SWFDEC_SPRITE_MOVIE (movie)->sprite, name); - if (frame == -1) - return JS_TRUE; - } else { - /* FIXME: how do we treat undefined etc? */ - frame = swfdec_action_to_number (cx, val); - } - frame += bias; - /* now set it */ movie = swfdec_action_get_target (cx); + /* now set it */ if (movie) { + int frame = swfdec_value_to_frame (cx, movie, val); + if (frame < 0) + return JS_TRUE; + frame += bias; frame = CLAMP (frame, 0, (int) movie->n_frames - 1); swfdec_movie_goto (movie, frame); movie->stopped = !play; @@...
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
...tval); /* IMPORTANT: a SwfdecAsValue memset to 0 is a valid undefined value */ struct _SwfdecAsValue { diff-tree 3f9d1cf43340a13945d5eb825292b811171d074f (from 5804d93d45647d46e34f9916ea797e4156fa1572) Author: Benjamin Otte <otte@gnome.org> Date: Thu Apr 12 15:49:53 2007 +0200 make swfdec_action_get_target really get the target diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 23ab663..5ba5fb2 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -50,13 +50,18 @@ static SwfdecMovie * swfdec_action_get_target (SwfdecAsContext *conte...
2007 Jan 24
0
Branch 'interpreter' - 8 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_script.c test/swfdec_out.c test/swfdec_out.h test/swfedit_tag.c test/swfedit_token.c test/swfedit_token.h
...s; + const char *url, *target; + + swfdec_bits_init_data (&bits, data, len); + url = swfdec_bits_skip_string (&bits); + target = swfdec_bits_skip_string (&bits); + if (swfdec_bits_left (&bits)) { + SWFDEC_WARNING ("leftover bytes in GetURL action"); + } + movie = swfdec_action_get_target (cx); + if (movie) + swfdec_root_movie_load (SWFDEC_ROOT_MOVIE (movie->root), url, target); + else + SWFDEC_WARNING ("no movie to load"); + return JS_TRUE; +} + +static JSBool +swfdec_action_string_add (JSContext *cx, guint action, const guint8 *data, guint len) +{ + JSString...
2007 Mar 28
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...tion_has_register (JSContext *cx, guint i) -{ - if (cx->fp->fun == NULL) - return i < 4; - else - return i < cx->fp->fun->nvars; -} +#define swfdec_action_has_register(cx, i) \ + ((i) < ((SwfdecScript *) (cx)->fp->swf)->n_registers) static SwfdecMovie * swfdec_action_get_target (JSContext *cx) @@ -1707,20 +1716,21 @@ swfdec_action_define_function (JSContext if (fun == NULL) return JS_FALSE; if (v2) { - fun->nvars = swfdec_bits_get_u8 (&bits) + 1; + script->n_registers = swfdec_bits_get_u8 (&bits) + 1; flags = swfdec_bits_get_u16 (&b...
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
...6 +124,15 @@ swfdec_constant_pool_get_area (SwfdecScr /*** SUPPORT 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)) { +...
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
..._constant_pool_get (SwfdecConstantPool *pool, guint i) +{ + g_assert (i < pool->len); + return g_ptr_array_index (pool, i); +} + +static void +swfdec_constant_pool_free (SwfdecConstantPool *pool) +{ + g_ptr_array_free (pool, TRUE); +} + +/*** SUPPORT FUNCTIONS ***/ + static SwfdecMovie * swfdec_action_get_target (JSContext *cx) { return swfdec_scriptable_from_jsval (cx, OBJECT_TO_JSVAL (cx->fp->scopeChain), SWFDEC_TYPE_MOVIE); } +static JSBool +swfdec_action_push_string (JSContext *cx, const char *s) +{ + JSString *string = JS_NewStringCopyZ (cx, s); + if (string == NULL) + return JS_FALS...
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
..._OBJECT (cx, cx->fp->scopeChain)); } finish: diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index dca72e0..537fced 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -98,7 +98,9 @@ swfdec_constant_pool_free (SwfdecConstan static SwfdecMovie * swfdec_action_get_target (JSContext *cx) { - return swfdec_scriptable_from_jsval (cx, OBJECT_TO_JSVAL (cx->fp->scopeChain), SWFDEC_TYPE_MOVIE); + JSObject *object = cx->fp->scopeChain; + object = OBJ_THIS_OBJECT (cx, object); + return swfdec_scriptable_from_jsval (cx, OBJECT_TO_JSVAL (object), SWFDEC_TYPE_...
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
...fdec/swfdec_as_interpret.c @@ -27,6 +27,7 @@ #include "swfdec_as_function.h" #include "swfdec_as_script_function.h" #include "swfdec_as_stack.h" +#include "swfdec_as_with.h" #include "swfdec_debug.h" #include <errno.h> @@ -55,8 +56,7 @@ swfdec_action_get_target (SwfdecAsContex SwfdecAsObject *target = context->frame->target; if (target == NULL) { - SwfdecAsScope *scope = context->frame->scope ? - context->frame->scope : SWFDEC_AS_SCOPE (context->frame); + SwfdecAsScope *scope = context->frame->scope; while (s...
2007 Feb 19
0
22 commits - libswfdec/js libswfdec/swfdec_debugger.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_script.c
...JSPROP_READONLY, mc_root, NULL }, {NULL} }; diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index 1439882..6972c81 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -137,8 +137,7 @@ swfdec_action_has_register (JSContext *c static SwfdecMovie * swfdec_action_get_target (JSContext *cx) { - JSObject *object = cx->fp->scopeChain; - object = OBJ_THIS_OBJECT (cx, object); + JSObject *object = cx->fp->thisp; return swfdec_scriptable_from_jsval (cx, OBJECT_TO_JSVAL (object), SWFDEC_TYPE_MOVIE); } @@ -1638,10 +1637,7 @@ swfdec_action_define_local (J...
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
...implement encoding variables using %s", method == 1 ? "GET" : "POST"); + } + if (data[0] & 2) { + SWFDEC_ERROR ("FIXME: implement LoadTarget"); + } + if (data[0] & 1) { + SWFDEC_ERROR ("FIXME: implement LoadVariables"); + } + movie = swfdec_action_get_target (cx); + if (movie) + swfdec_root_movie_load (SWFDEC_ROOT_MOVIE (movie->root), url, target); + else + SWFDEC_WARNING ("no movie to load"); + cx->fp->sp -= 2; + return JS_TRUE; +} + +static JSBool swfdec_action_string_add (JSContext *cx, guint action, const guint8 *data,...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am 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
...); - } - fp->sp += n_elements; - while (n_elements) { - n_elements--; - fp->spbase[n_elements] = JSVAL_VOID; - } - return JS_TRUE; -} - #define swfdec_action_has_register(cx, i) \ ((i) < ((SwfdecScript *) (cx)->fp->swf)->n_registers) +#if 0 static SwfdecMovie * swfdec_action_get_target (JSContext *cx) { @@ -2481,6 +2443,7 @@ swfdec_action_print_wait_for_frame (guin jump = data[2]; return g_strdup_printf ("WaitForFrame %u %u", frame, jump); } +#endif /*** BIG FUNCTION TABLE ***/ @@ -2489,7 +2452,7 @@ swfdec_action_print_wait_for_frame (guin #define MAXSCRIP...