search for: jsobj

Displaying 20 results from an estimated 38 matches for "jsobj".

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
libswfdec/Makefile.am | 4 libswfdec/js/jsapi.c | 6 - libswfdec/js/jsapi.h | 6 - libswfdec/js/jsfun.h | 2 libswfdec/js/jsinterp.c | 2 libswfdec/js/jsobj.c | 8 - libswfdec/js/jsobj.h | 6 - libswfdec/js/jspubtd.h | 4 libswfdec/js/jsscope.c | 2 libswfdec/js/jsscope.h | 2 libswfdec/swfdec_audio_stream.c | 13 +- libswfdec/swfdec_audio_stream.h | 2 libswfdec/swf...
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
...ave_fun: frame.scopeChain = NULL; /* set below for real, after cx->fp is set */ frame.pc = NULL; frame.spbase = NULL; + frame.spend = NULL; frame.sharpDepth = 0; frame.sharpArray = NULL; frame.dormantNext = NULL; @@ -1138,6 +1139,7 @@ js_Execute(JSContext *cx, JSObject *chai frame.pc = NULL; frame.sp = oldfp ? oldfp->sp : NULL; frame.spbase = NULL; + frame.spend = NULL; frame.sharpDepth = 0; frame.flags = special; frame.dormantNext = NULL; @@ -1502,6 +1504,7 @@ js_Interpret(JSContext *cx, jsval *resul } sp = newsp...
2007 Feb 22
0
3 commits - libswfdec/swfdec_js.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c
...Date: Thu Feb 22 19:26:37 2007 +0100 implement getNextHighestDepth () diff --git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c index 5b730b3..2296078 100644 --- a/libswfdec/swfdec_js_movie.c +++ b/libswfdec/swfdec_js_movie.c @@ -87,7 +87,7 @@ mc_getBytesLoaded (JSContext *cx, JSObje } static JSBool -mc_getBytesTotal(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +mc_getBytesTotal (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { SwfdecMovie *movie; SwfdecDecoder *dec; @@ -101,6 +101,23 @@ mc_getBytesTotal(JSContext *cx, JSO...
2007 Mar 01
0
7 commits - libswfdec/swfdec_connection.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h
...bswfdec/swfdec_js_net_stream.c b/libswfdec/swfdec_js_net_stream.c index 9f12dd0..ed9c81e 100644 --- a/libswfdec/swfdec_js_net_stream.c +++ b/libswfdec/swfdec_js_net_stream.c @@ -27,6 +27,23 @@ #include "swfdec_player_internal.h" static JSBool +swfdec_js_net_stream_play (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + SwfdecNetStream *stream; + const char *url; + + stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM); + if (stream == NULL) + return JS_TRUE; + url = swfdec_js_to_string (cx, argv[0]); + if (url == NULL) + return JS...
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
...uot; -#include "js/jsfun.h" -#include "js/jsinterp.h" - -G_DEFINE_ABSTRACT_TYPE (SwfdecScriptable, swfdec_scriptable, G_TYPE_OBJECT) - -static void -swfdec_scriptable_dispose (GObject *object) -{ - SwfdecScriptable *script = SWFDEC_SCRIPTABLE (object); - - g_assert (script->jsobj == NULL); - - G_OBJECT_CLASS (swfdec_scriptable_parent_class)->dispose (object); -} - -static JSObject * -swfdec_scriptable_create_js_object (SwfdecScriptable *scriptable) -{ - SwfdecScriptableClass *klass; - JSContext *cx; - JSObject *obj; - - klass = SWFDEC_SCRIPTABLE_GET_CLASS (scriptabl...
2007 Mar 13
0
4 commits - test/swfscript.c
...3efb5ffeb23363166d2a83bd723d1c40802f3d2 (from 03fccd9bc1924e4e128d1d0d6454a867991fd623) Author: Benjamin Otte <otte@gnome.org> Date: Sun Mar 11 23:08:53 2007 +0100 get rid of undefined symbols It still sucks that libjs.so needs symbols from libswfdec diff --git a/libswfdec/js/jsobj.c b/libswfdec/js/jsobj.c index 81ac409..0f825ff 100644 --- a/libswfdec/js/jsobj.c +++ b/libswfdec/js/jsobj.c @@ -905,7 +905,7 @@ js_obj_toSource(JSContext *cx, JSObject } #endif /* JS_HAS_INITIALIZERS || JS_HAS_TOSOURCE */ -extern const JSClass movieclip_class; +extern int swfdec_js_is_moviecl...
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
libswfdec/js/jsfun.c | 7 + libswfdec/js/jsobj.c | 12 +- libswfdec/swfdec_debugger.c | 5 libswfdec/swfdec_js.c | 10 + libswfdec/swfdec_js_global.c | 165 +++++++++++++++++++++++++++++++- libswfdec/swfdec_js_movie.c | 51 +++++++-- libswfdec/swfdec_movie.c...
2007 Apr 05
0
Branch 'as' - 9 commits - configure.ac libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...-674,128 +780,15 @@ fail: fp->sp[-1] = JSVAL_VOID; return JS_TRUE; } +#endif static void swfdec_action_pop (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) { - cx->fp->sp--; - return JS_TRUE; -} - -static const char * -swfdec_eval_jsval (SwfdecAsContext *cx, JSObject *obj, jsval *val) -{ - if (JSVAL_IS_STRING (*val)) { - const char *bytes = swfdec_js_to_string (cx, *val); - if (bytes == NULL) - return NULL; - *val = swfdec_js_eval (cx, obj, bytes); - return bytes; - } else { - if (obj == NULL) { - obj = OBJ_THIS_OBJECT (cx, cx->...
2007 Mar 11
0
10 commits - libswfdec/js libswfdec/swfdec_js_color.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_video.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_script.c player/.gitignore
libswfdec/js/jsobj.c | 56 +++++++++++--------------- libswfdec/swfdec_js_color.c | 14 ------ libswfdec/swfdec_js_connection.c | 14 ------ libswfdec/swfdec_js_movie.c | 22 ---------- libswfdec/swfdec_js_net_stream.c |...
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
.../* internal, to avoid extra string */ diff --git a/libswfdec/swfdec_edittext_movie.c b/libswfdec/swfdec_edittext_movie.c index 421f6bc..e3d2119 100644 --- a/libswfdec/swfdec_edittext_movie.c +++ b/libswfdec/swfdec_edittext_movie.c @@ -80,7 +80,7 @@ swfdec_edit_text_movie_iterate (SwfdecMo jsobj = swfdec_scriptable_get_object (parent); if (jsobj == NULL) return; - val = swfdec_js_eval (parent->jscx, jsobj, text->text->variable); + val = swfdec_js_eval (parent->jscx, jsobj, text->text->variable, FALSE); if (JSVAL_IS_VOID (val)) return; @@ -110,7 +110,7...
2007 Mar 01
0
11 commits - libswfdec/Makefile.am libswfdec/swfdec_connection.c libswfdec/swfdec_connection.h libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js.h libswfdec/swfdec_js_net_stream.c
...USA + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "swfdec_net_stream.h" +#include "swfdec_debug.h" +#include "swfdec_js.h" +#include "swfdec_player_internal.h" + +static JSBool +swfdec_js_net_stream_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + JSString *string; + + string = JS_InternString (cx, "[object Object]"); + if (string == NULL) + return JS_FALSE; + + *rval = STRING_TO_JSVAL (string); + return JS_TRUE; +} + +static JSFunctionSpec net_stream_methods[] = { + { &q...
2007 Mar 07
0
13 commits - libswfdec/Makefile.am libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_root_movie.c libswfdec/swfdec_root_movie.h libswfdec/swfdec_script.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie.c
...ie diff --git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c index 2a860a4..3d04d92 100644 --- a/libswfdec/swfdec_js_movie.c +++ b/libswfdec/swfdec_js_movie.c @@ -382,6 +382,57 @@ swfdec_js_copy_props (SwfdecMovie *targe } static JSBool +swfdec_js_movie_attachMovie (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + SwfdecMovie *movie, *ret; + const char *name, *export; + int depth; + SwfdecContent *content; + SwfdecGraphic *sprite; + + movie = JS_GetPrivate (cx, obj); + g_assert (movie); + + export = swfdec_js_to_string (cx, argv[0]); + name = swfde...
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
...+318,6 @@ swfdec_js_eval_get_property (JSContext * return JS_FALSE; if (!prop) return JS_FALSE; - if (pobj) - obj = pobj; return OBJ_GET_PROPERTY (cx, obj, (jsid) prop->id, ret); } } @@ -345,7 +343,7 @@ static gboolean swfdec_js_eval_internal (JSContext *cx, JSObject *obj, const char *str, jsval *val, gboolean set) { - jsval cur; + jsval cur = JSVAL_NULL; char *work = NULL; SWFDEC_LOG ("eval called with \"%s\" on %p", str, obj); @@ -361,12 +359,10 @@ swfdec_js_eval_internal (JSContext *cx, goto out; obj =...
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
...swfdec_js_video.c @@ -23,78 +23,56 @@ #include "swfdec_video.h" #include "swfdec_debug.h" -#include "swfdec_js.h" #include "swfdec_net_stream.h" #include "swfdec_player_internal.h" -static JSBool -swfdec_js_video_attach_video (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +static void +swfdec_video_attach_video (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval) { + SwfdecVideoMovie *video = SWFDEC_VIDEO_MOVIE (obj); SwfdecNetStream *stream; - SwfdecVideoMovie *video; -...
2007 Mar 22
0
7 commits - configure.ac doc/swfdec-docs.sgml libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_js_movie.c test/trace
...lddir)/libswfdec/js \ -DXP_UNIX -DDEBUG -fno-strict-aliasing libjs_la_LDFLAGS = -lm diff-tree 6c6af82416ae35dfa7312a66077977a655862051 (from 9b3d71429f674fad30b0dfa1c9ae3f7d7452e8e4) Author: Benjamin Otte <otte@gnome.org> Date: Thu Mar 22 19:50:52 2007 +0100 change all conversions JSObject->SwfdecMovie to not assert on failure but silently return diff --git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c index 2d9b1a1..3f6333c 100644 --- a/libswfdec/swfdec_js_movie.c +++ b/libswfdec/swfdec_js_movie.c @@ -116,7 +116,11 @@ mc_play (JSContext *cx, JSObject *obj, u {...
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
...ts to pass to handler + * @args: @n_args arguments that will be passed to handler + * + * Executes a callback function (like onMouseMove) on the scriptable if it is + * defined. + **/ +void +swfdec_scriptable_execute (SwfdecScriptable *script, const char *name, + guint n_args, jsval *args) +{ + JSObject *obj; + jsval fun; + + g_return_if_fail (SWFDEC_IS_SCRIPTABLE (script)); + g_return_if_fail (name != NULL); + g_return_if_fail (n_args == 0 || args != NULL); + + obj = swfdec_scriptable_get_object (script); + if (!obj) + return; + if (!JS_GetProperty (script->jscx, obj, name, &f...
2007 Apr 04
0
Branch 'as' - 17 commits - configure.ac doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt doc/swfdec.types libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_loader.h
...ec_as_context_get_string (context, s)); return TRUE; } + static gboolean -swfdec_amf_parse_properties (JSContext *cx, SwfdecBits *bits, jsval *val) +swfdec_amf_parse_properties (SwfdecAsContext *context, SwfdecBits *bits, SwfdecAsObject *object) { guint type; SwfdecAmfParseFunc func; - JSObject *object; - - g_assert (JSVAL_IS_OBJECT (*val)); - object = JSVAL_TO_OBJECT (*val); + /* need to root here due to GC */ + swfdec_as_object_root (object); while (swfdec_bits_left (bits)) { - jsval id, val; - if (!swfdec_amf_parse_string (cx, bits, &id)) + SwfdecAsValue id, va...
2007 Mar 20
0
9 commits - configure.ac libswfdec/swfdec_bits.c libswfdec/swfdec_debug.c libswfdec/swfdec_js.c libswfdec/swfdec_script.c libswfdec/swfdec_sound.c
...equal (g_getenv ("SWFDEC_JS"), "full")) - player->jscx->tracefp = stderr; - JS_SetInterrupt (swfdec_js_runtime, swfdec_js_debug_one, NULL); JS_SetErrorReporter (player->jscx, swfdec_js_error_report); JS_SetContextPrivate(player->jscx, player); player->jsobj = JS_NewObject (player->jscx, &global_class, NULL, NULL); @@ -143,23 +129,6 @@ swfdec_js_finish_player (SwfdecPlayer *p } } -static void -swfdec_disassemble (SwfdecPlayer *player, JSScript *script) -{ - guint i; - - for (i = 0; i < script->length; i ++) { - g_print ("%0...
2007 Mar 14
0
10 commits - libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_flv_decoder.h libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_loadertarget.c
...m.c b/libswfdec/swfdec_js_net_stream.c index f92634c..46cb1dc 100644 --- a/libswfdec/swfdec_js_net_stream.c +++ b/libswfdec/swfdec_js_net_stream.c @@ -43,8 +43,24 @@ swfdec_js_net_stream_play (JSContext *cx return JS_TRUE; } +static JSBool +swfdec_js_net_stream_set_buffer_time (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + SwfdecNetStream *stream; + double d; + + stream = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_NET_STREAM); + if (stream == NULL) + return JS_TRUE; + if (!JS_ValueToNumber (cx, argv[0], &d)) + return JS_FALSE; + swfdec_net_s...
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
...+; + } + return js_Invoke (cx, n_args, flags); +} + +/* FIXME: lots of overlap with swfdec_action_call_method */ +static void +swfdec_action_call_function (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) +{ + JSStackFrame *fp = cx->fp; + const char *s; + guint32 n_args; + JSObject *obj, *pobj; + JSProperty *prop; + jsval fun; + JSAtom *atom; + + if (!swfdec_script_ensure_stack (cx, 2)) + return JS_FALSE; + s = swfdec_js_to_string (cx, fp->sp[-1]); + if (s == NULL) + return JS_FALSE; + if (!JS_ValueToECMAUint32 (cx, fp->sp[-2], &n_args)) + retur...