search for: swfdecscript

Displaying 20 results from an estimated 102 matches for "swfdecscript".

Did you mean: swfdec_script
2007 Jul 13
0
4 commits - configure.ac libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.h libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h NEWS
...This is strictly a bugfix release. Have fun. diff-tree 7b8a7526b5fec8d7129f461bb318baa85eb3d257 (from d617bb496e5aa49a138dd34a62dc20b240aed089) Author: Benjamin Otte <otte at gnome.org> Date: Fri Jul 13 21:14:16 2007 +0200 remove swfdec_as_object_run() from exported headers SwfdecScript is not exported, so it cannot be public diff --git a/libswfdec/swfdec_as_internal.h b/libswfdec/swfdec_as_internal.h index 00d56db..ca6ab2d 100644 --- a/libswfdec/swfdec_as_internal.h +++ b/libswfdec/swfdec_as_internal.h @@ -41,6 +41,7 @@ void swfdec_as_function_init_context (S typedef SwfdecAsV...
2007 Aug 09
0
Branch 'vivi' - 12 commits - libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec/Makefile.am libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_debugger.c
...t;libswfdec-gtk/swfdec-gtk.h> +#include "vivi_application.h" +#include "vivi_ming.h" enum { PROP_0, @@ -143,3 +144,20 @@ vivi_application_get_player (ViviApplica return app->player; } +void +vivi_application_run (ViviApplication *app, const char *command) +{ + SwfdecScript *script; + char *error = NULL; + + g_return_if_fail (VIVI_IS_APPLICATION (app)); + g_return_if_fail (command != NULL); + + script = vivi_ming_compile (command, &error); + if (script == NULL) { + g_free (error); + } + swfdec_as_object_run (SWFDEC_AS_CONTEXT (app)->global, script); +...
2007 Jan 26
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_event.c libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c
...ption = swfdec_script_print_action (action, data, len); + g_array_append_val (arrayp, command); + return TRUE; +} + static SwfdecDebuggerScript * -swfdec_debugger_script_new (JSScript *script, const char *name, - SwfdecDebuggerCommand *commands, guint n_commands) +swfdec_debugger_script_new (SwfdecScript *script) { + GArray *array; SwfdecDebuggerScript *ret; ret = g_new0 (SwfdecDebuggerScript, 1); ret->script = script; - ret->name = g_strdup (name); - ret->commands = commands; - ret->n_commands = n_commands; + swfdec_script_ref (script); + array = g_array_new (TRUE, FA...
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
...ot; #include "swfdec_as_context.h" #include "swfdec_as_frame.h" +#include "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...
2007 Apr 17
0
Branch 'as' - 2 commits -
...on of the script */ ++ guint version; /* version of the script */ ++ guint n_registers; /* number of registers */ gpointer debugger; /* debugger owning us or NULL */ /* needed by functions */ SwfdecBuffer * constant_pool; /* constant pool action */ @@@ -78,8 -77,8 +78,8 @@@ SwfdecScript * swfdec_script_new_for_player (SwfdecPlayer * player, SwfdecBits * bits, const char * name, - unsigned int version); - guint version); -void swfdec_script_ref (SwfdecScript * script); ++ guint version); +SwfdecScript * swfdec_sc...
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
...LL; diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c index b9f605b..e6c25a5 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -3008,9 +3008,12 @@ internal_error: * * Returns: the return value of @script **/ -jsval +#endif +void swfdec_script_execute (SwfdecScript *script, SwfdecScriptable *scriptable) { +} +#if 0 JSContext *cx; JSStackFrame *oldfp, frame; JSObject *obj; diff-tree 7fbbe64db09817aaed4d28fa5bb1ac4869c835f5 (from parents) Merge: 97a34e2bdc46d12e66fa103489e8f630fbf0d495 f516f0186bef8f00810f200034d63776bfab9271 Author: Benjamin Otte &lt...
2007 Jan 18
0
Branch 'interpreter' - 2 commits - libswfdec/js libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...+++++++++++++++++++++++++++++++++++-- 4 files changed, 100 insertions(+), 7 deletions(-) New commits: diff-tree c3f0eaf5706a0d972132a0ea4fcaff5aa79ec122 (from 3e6fcd37cb3157514beaf45cb90e2c68d2138b86) Author: Benjamin Otte <otte@gnome.org> Date: Wed Jan 17 22:51:45 2007 +0100 add the SwfdecSCript to the stack frame also, some more functions are implemented (like WaitForFrame, it needs this) diff --git a/libswfdec/js/jsinterp.c b/libswfdec/js/jsinterp.c index 1a45a77..1d15966 100644 --- a/libswfdec/js/jsinterp.c +++ b/libswfdec/js/jsinterp.c @@ -832,6 +832,7 @@ have_fun: frame...
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
...== 0x88) { + /* constant pool */ + if (parser->constant_pool) + swfdec_constant_pool_free (parser->constant_pool); + parser->constant_pool = swfdec_constant_pool_new_from_action (data, len); + } return TRUE; } static SwfdecDebuggerScript * swfdec_debugger_script_new (SwfdecScript *script) { - GArray *array; + ScriptParser parser; SwfdecDebuggerScript *ret; ret = g_new0 (SwfdecDebuggerScript, 1); ret->script = script; swfdec_script_ref (script); - array = g_array_new (TRUE, FALSE, sizeof (SwfdecDebuggerCommand)); - swfdec_script_foreach (script, swfdec_...
2007 Feb 01
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/swfdec_script.c libswfdec/swfdec_script.h player/swfdec_debug_stack.c test/trace
...c index d79a3d1..ad08eef 100644 --- a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -151,6 +151,8 @@ swfdec_action_to_number (JSContext *cx, if (!JS_ValueToNumber (cx, val, &d)) return 0; return isnan (d) ? 0 : d; + } else if (JSVAL_IS_OBJECT(val) && (((SwfdecScript *) cx->fp->swf)->version >= 6)) { + return JSVAL_IS_NULL (val) ? 0 : *cx->runtime->jsNaN; } else { return 0; } @@ -727,6 +729,8 @@ swfdec_action_binary (JSContext *cx, gui l = l * r; break; case 0x0d: + if (isnan (r)) + r = 0; if (r ==...
2007 Feb 22
0
3 commits - libswfdec/swfdec_js.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
..._from_jsval (cx, val, SWFDEC_TYPE_MOVIE); - val = JSVAL_VOID; - if (movie == NULL) { - SWFDEC_WARNING ("specified target does not reference a movie clip"); - goto out; - } if (!JS_ValueToECMAUint32 (cx, cx->fp->sp[-1], &id)) return JS_FALSE; - - if (id > (((SwfdecScript *) cx->fp->swf)->version > 4 ? 21 : 18)) + val = cx->fp->sp[-2]; + bytes = swfdec_eval_jsval (cx, NULL, &val); + if (id > (((SwfdecScript *) cx->fp->swf)->version > 4 ? 21 : 18)) { + SWFDEC_WARNING ("trying to SetProperty %u, not allowed", id);...
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
...sp[-1]); if (name == NULL) return JS_FALSE; - if (!JS_SetProperty (cx, cx->fp->callobj, name, &val)) + if (!JS_SetProperty (cx, cx->fp->scopeChain, name, &val)) return JS_FALSE; cx->fp->sp--; return JS_TRUE; @@ -2593,9 +2593,9 @@ swfdec_script_execute (SwfdecScript *scr return JSVAL_VOID; oldfp = cx->fp; - frame.callobj = frame.argsobj = NULL; + frame.callobj = NULL; frame.script = NULL; - frame.varobj = NULL; + frame.varobj = frame.argsobj = NULL; frame.fun = swfdec_script_ensure_function (script, scriptable); frame.swf = script;...
2007 Mar 07
0
11 commits - libswfdec/swfdec_event.c libswfdec/swfdec_event.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h libswfdec/swfdec_script.c libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h
...RUCT: + return event_names[18]; + default: + g_assert_not_reached (); + return NULL; + } +} SwfdecEventList * swfdec_event_list_new (SwfdecPlayer *player) @@ -154,36 +223,45 @@ swfdec_event_list_parse (SwfdecEventList void swfdec_event_list_execute (SwfdecEventList *list, SwfdecScriptable *scriptable, - unsigned int conditions, guint8 key) + unsigned int condition, guint8 key) { unsigned int i; + const char *name; g_return_if_fail (list != NULL); for (i = 0; i < list->events->len; i++) { SwfdecEvent *event = &g_array_index (list->events...
2007 Jan 16
0
9 commits - libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_audio_stream.c libswfdec/swfdec_audio_stream.h libswfdec/swfdec_cache.c libswfdec/swfdec_cached.c libswfdec/swfdec_cached.h libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_image.c
...u)", cache, handle, + cache->usage + handle->size, cache->usage); } } diff-tree 56c277e18cee8bf64152e1ad3e5f7e2af5b1ec5f (from 097b676f528d2d0e5c0a972823cdffdf4e9b0134) Author: Benjamin Otte <otte@gnome.org> Date: Tue Jan 16 11:57:12 2007 +0100 make SwfdecNetStream a SwfdecScriptable (nothing else changed) diff --git a/libswfdec/swfdec_net_stream.c b/libswfdec/swfdec_net_stream.c index 21458d5..eee3f72 100644 --- a/libswfdec/swfdec_net_stream.c +++ b/libswfdec/swfdec_net_stream.c @@ -200,7 +200,7 @@ swfdec_net_stream_input_finalize (Swfdec /*** SWFDEC_NET_STREAM ***/...
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
...nt action, const guint8 *data, guint len) +swfdec_action_do_define_function (JSContext *cx, guint action, + const guint8 *data, guint len, gboolean v2) { const char *function_name; guint i, n_args, size; @@ -1426,7 +1427,8 @@ swfdec_action_define_function (JSContext JSFunction *fun; SwfdecScript *script; gboolean has_preloads = FALSE; - gboolean v2 = (action == 0x8e); + guint flags = 0; + guint8 *preloads = NULL; swfdec_bits_init_data (&bits, data, len); function_name = swfdec_bits_get_string (&bits); @@ -1446,8 +1448,8 @@ swfdec_action_define_function (JSContext...
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
...c_action_print_push, 0, -1, { NULL, swfdec_action_push, swfdec_action_push, swfdec_action_push, swfdec_action_push } }, [0x99] = { "Jump", NULL }, [0x9a] = { "GetURL2", NULL }, /* version 5 */ @@ -320,7 +574,7 @@ static gboolean swfdec_script_foreach (SwfdecBits *bits, SwfdecScriptForeachFunc func, gpointer user_data) { guint action, len; - guint8 *data; + const guint8 *data; while ((action = swfdec_bits_get_u8 (bits))) { if (action & 0x80) { @@ -343,10 +597,19 @@ swfdec_script_foreach (SwfdecBits *bits, /*** PUBLIC API ***/ static gboolean -validate_a...
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
...;DefineFunction2", swfdec_action_print_define_function, 0, -1, { NULL, NULL, NULL, swfdec_action_define_function, swfdec_action_define_function } }, [0x8f] = { "Try", NULL }, /* version 5 */ [0x94] = { "With", NULL }, @@ -2560,7 +2581,10 @@ swfdec_script_interpret (SwfdecScript *s guint8 *startpc, *pc, *endpc, *nextpc; JSBool ok = JS_TRUE; void *mark; - jsval *startsp, *endsp, *checksp; + jsval *startsp; +#ifndef G_DISABLE_ASSERT + jsval *checksp; +#endif int stack_check; guint action, len; guint8 *data; @@ -2636,8 +2660,8 @@ swfdec_script_interpret (...
2007 Mar 29
0
Branch 'as' - 9 commits - configure.ac doc/swfdec-sections.txt 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_stack.c
...ect.h" +#include "swfdec_as_stack.h" #include "swfdec_as_types.h" #include "swfdec_debug.h" #include "swfdec_script.h" @@ -300,20 +301,26 @@ void swfdec_as_context_run (SwfdecAsContext *context) { SwfdecAsFrame *frame; + SwfdecAsStack *stack; SwfdecScript *script; const SwfdecActionSpec *spec; guint8 *startpc, *pc, *endpc, *nextpc; +#ifndef G_DISABLE_ASSERT + SwfdecAsValue *check; +#endif guint action, len; guint8 *data; int version; g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context)); +start: /* setup data */ frame = cont...
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
...bias; frame = CLAMP (frame, 0, (int) movie->n_frames - 1); swfdec_movie_goto (movie, frame); movie->stopped = !play; @@ -315,6 +324,63 @@ swfdec_action_goto_frame2 (JSContext *cx return JS_TRUE; } +static void +swfdec_script_skip_actions (JSContext *cx, guint jump) +{ + SwfdecScript *script = cx->fp->swf; + guint8 *pc = cx->fp->pc; + guint8 *endpc = script->buffer->data + script->buffer->length; + + /* jump instructions */ + g_assert (script); + do { + if (pc >= endpc) + break; + if (*pc & 0x80) { + if (pc + 2 >= endpc) +...
2007 Mar 29
0
libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_audio_event.h libswfdec/swfdec_audio_flv.h libswfdec/swfdec_audio_stream.h libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_cache.c
...t a/libswfdec/swfdec_event.c b/libswfdec/swfdec_event.c index 66d6aa7..af41b9e 100644 --- a/libswfdec/swfdec_event.c +++ b/libswfdec/swfdec_event.c @@ -30,7 +30,7 @@ typedef struct _SwfdecEvent SwfdecEvent; struct _SwfdecEvent { - unsigned int conditions; + guint conditions; guint8 key; SwfdecScript *script; }; @@ -140,7 +140,7 @@ swfdec_event_list_copy (SwfdecEventList void swfdec_event_list_free (SwfdecEventList *list) { - unsigned int i; + guint i; g_return_if_fail (list != NULL); @@ -157,7 +157,7 @@ swfdec_event_list_free (SwfdecEventList } static const char * -swfdec_ev...
2007 Mar 05
0
11 commits - configure.ac libswfdec/swfdec_js_movie.c libswfdec/swfdec_root_movie.c libswfdec/swfdec_root_movie.h libswfdec/swfdec_script.c libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_swf_decoder.c
...t;, NULL, -1, 1, { NULL, NULL, swfdec_action_call_function, swfdec_action_call_function, swfdec_action_call_function } }, [0x3e] = { "Return", NULL, 1, 0, { NULL, NULL, swfdec_action_return, swfdec_action_return, swfdec_action_return } }, @@ -2470,7 +2490,10 @@ swfdec_script_interpret (SwfdecScript *s if (script->flags & SWFDEC_SCRIPT_PRELOAD_SUPER || script->flags & SWFDEC_SCRIPT_PRELOAD_ROOT || script->flags & SWFDEC_SCRIPT_PRELOAD_PARENT) { - g_assert_not_reached (); + SWFDEC_ERROR ("The following preload flags aren't implemented:%s%s%s&quot...