Displaying 20 results from an estimated 34 matches for "jscx".
Did you mean:
jsc
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
...);
+ g_free (s);
+ } else {
+ string = JS_NewStringCopyZ (cx, "[object Object]");
+ }
if (string == NULL)
return JS_FALSE;
*rval = STRING_TO_JSVAL (string);
@@ -1230,21 +1233,32 @@ void
swfdec_js_add_movieclip_class (SwfdecPlayer *player)
{
JS_InitClass (player->jscx, player->jsobj, NULL,
- &movieclip_class, swfdec_js_movieclip_new, 0, movieclip_props, movieclip_methods,
+ &movieclip_class, swfdec_js_movieclip_new, 0, NULL, movieclip_methods,
NULL, NULL);
}
-jsval
-swfdec_js_movie_lookup_class (SwfdecMovie *movie)
+static jsval
+s...
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
...ext->text->variable == NULL)
return;
- player = SWFDEC_ROOT_MOVIE (movie->root)->player;
- if (movie->parent->jsobj == NULL) {
- swfdec_js_add_movie (movie->parent);
- if (movie->parent->jsobj == NULL)
- return;
- }
- val = swfdec_js_eval (player->jscx, movie->parent->jsobj, text->text->variable);
+ parent = SWFDEC_SCRIPTABLE (movie->parent);
+ jsobj = swfdec_scriptable_get_object (parent);
+ if (jsobj == NULL)
+ return;
+ val = swfdec_js_eval (parent->jscx, jsobj, text->text->variable);
if (JSVAL_IS_VOID (val))...
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
...-}
-
-static JSObject *
-swfdec_scriptable_create_js_object (SwfdecScriptable *scriptable)
-{
- SwfdecScriptableClass *klass;
- JSContext *cx;
- JSObject *obj;
-
- klass = SWFDEC_SCRIPTABLE_GET_CLASS (scriptable);
- g_return_val_if_fail (klass->jsclass != NULL, NULL);
- cx = scriptable->jscx;
-
- obj = JS_NewObject (cx, (JSClass *) klass->jsclass, NULL, NULL);
- if (obj == NULL) {
- SWFDEC_ERROR ("failed to create JS object for %s %p",
- G_OBJECT_TYPE_NAME (scriptable), scriptable);
- return NULL;
- }
- SWFDEC_LOG ("created JSObject %p for %s %p", obj,...
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
...fdecPlayer
@@ -93,10 +83,6 @@ swfdec_js_init_player (SwfdecPlayer *pla
return;
}
- /* the new Flash opcodes mess up this, so this will most likely crash */
- if (g_getenv ("SWFDEC_JS") && g_str_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,2...
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
...&& !should_interrupt; i++) {
+ Breakpoint *br = &g_array_index (debugger->breakpoints, Breakpoint, i);
+
+ if (br->script) {
+ should_interrupt = TRUE;
+ break;
+ }
+ }
+ if (should_interrupt) {
+ JS_SetInterrupt (JS_GetRuntime (SWFDEC_PLAYER (debugger)->jscx),
+ swfdec_debugger_interrupt_cb, debugger);
+ } else {
+ JS_ClearInterrupt (JS_GetRuntime (SWFDEC_PLAYER (debugger)->jscx), NULL, NULL);
+ }
+}
+
guint
swfdec_debugger_set_breakpoint (SwfdecDebugger *debugger,
SwfdecDebuggerScript *script, guint line)
@@ -242,10 +291,6 @@ swfdec_d...
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
...connection_dispose;
-
- scriptable_class->jsclass = &connection_class;
}
static void
@@ -63,46 +59,37 @@ static void
swfdec_connection_onstatus (SwfdecConnection *conn, const char *code,
const char *level, const char *description)
{
- JSContext *cx = SWFDEC_SCRIPTABLE (conn)->jscx;
- JSObject *obj = SWFDEC_SCRIPTABLE (conn)->jsobj;
- JSObject *info;
- jsval val, fun;
- JSString *string;
+ SwfdecAsValue value;
+ SwfdecAsObject *info;
- if (!JS_GetProperty (cx, obj, "onStatus", &fun))
- return;
- if (fun == JSVAL_VOID)
- return;
- info = JS_Ne...
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
...c_js_video_new (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
-{
- return JS_TRUE;
+ swfdec_video_movie_clear (video);
}
void
-swfdec_js_add_video (SwfdecPlayer *player)
+swfdec_video_movie_init_context (SwfdecPlayer *player, guint version)
{
- JS_InitClass (player->jscx, player->jsobj, NULL,
- &video_class, swfdec_js_video_new, 0, NULL, video_methods,
- NULL, NULL);
+ SwfdecAsContext *context;
+ SwfdecAsObject *video, *proto;
+ SwfdecAsValue val;
+
+ g_return_if_fail (SWFDEC_IS_PLAYER (player));
+
+ context = SWFDEC_AS_CONTEXT (player);
+ vi...
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
...+ stream = swfdec_net_stream_new (JS_GetContextPrivate (cx), conn);
+
+ JS_SetPrivate (cx, obj, stream);
+ SWFDEC_SCRIPTABLE (stream)->jsobj = obj;
+
+ *rval = OBJECT_TO_JSVAL (obj);
+ return JS_TRUE;
+}
+
+void
+swfdec_js_add_net_stream (SwfdecPlayer *player)
+{
+ JS_InitClass (player->jscx, player->jsobj, NULL,
+ &net_stream_class, swfdec_js_net_stream_new, 0, NULL, net_stream_methods,
+ NULL, NULL);
+}
+
diff-tree 9ea16e8cfcae227f0742865e8f47be32392036c5 (from b388b559727066550385b938933b85e443fde2c9)
Author: Benjamin Otte <otte@gnome.org>
Date: Thu Mar 1 11...
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
...gt;state = SWFDEC_STATE_EOF;
+}
+
SwfdecMovie *
swfdec_flv_decoder_add_movie (SwfdecFlvDecoder *flv, SwfdecMovie *parent)
{
@@ -511,10 +550,8 @@ swfdec_flv_decoder_add_movie (SwfdecFlvD
/* set up the playback stream */
conn = swfdec_connection_new (SWFDEC_ROOT_MOVIE (parent)->player->jscx);
stream = swfdec_net_stream_new (SWFDEC_ROOT_MOVIE (parent)->player, conn);
+ stream->flvdecoder = flv;
swfdec_net_stream_set_loader (stream, SWFDEC_ROOT_MOVIE (parent)->loader);
- if (!swfdec_loader_target_set_decoder (SWFDEC_LOADER_TARGET (stream), SWFDEC_DECODER (flv))) {
-...
2007 Feb 22
0
6 commits - libswfdec/Makefile.am libswfdec/swfdec_js.c libswfdec/swfdec_js_mouse.c libswfdec/swfdec_listener.c libswfdec/swfdec_listener.h libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...fdec_js_interval_free (Swf
void
swfdec_js_finish_player (SwfdecPlayer *player)
{
+ swfdec_listener_free (player->mouse_listener);
+ swfdec_listener_free (player->key_listener);
while (player->intervals)
swfdec_js_interval_free (player->intervals->data);
if (player->jscx) {
diff --git a/libswfdec/swfdec_listener.c b/libswfdec/swfdec_listener.c
new file mode 100644
index 0000000..85ea67d
--- /dev/null
+++ b/libswfdec/swfdec_listener.c
@@ -0,0 +1,184 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte@gnome.org>
+ *
+ * This library is free software; you c...
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
..._js_global.c b/libswfdec/swfdec_js_global.c
index 06e83e1..0a3b6f3 100644
--- a/libswfdec/swfdec_js_global.c
+++ b/libswfdec/swfdec_js_global.c
@@ -245,8 +245,15 @@ static JSFunctionSpec global_methods[] =
void
swfdec_js_add_globals (SwfdecPlayer *player)
{
- if (!JS_DefineFunctions (player->jscx, player->jsobj, global_methods)) {
- SWFDEC_ERROR ("failed to initialize global methods");
+ JSBool found = JS_FALSE;
+ jsval val = OBJECT_TO_JSVAL (player->jsobj);
+
+ if (!JS_DefineFunctions (player->jscx, player->jsobj, global_methods) ||
+ !JS_SetProperty (playe...
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
...set_model (SwfdecDebugStack *debug)
{
JSStackFrame *frame = NULL;
guint i, min, max;
GtkListStore *store = gtk_list_store_new (N_COLUMNS, G_TYPE_UINT,
- G_TYPE_STRING);
+ G_TYPE_STRING, G_TYPE_STRING);
GtkTreeIter iter;
JS_FrameIterator (debug->manager->player->jscx, &frame);
@@ -49,7 +69,9 @@ swfdec_debug_stack_set_model (SwfdecDebu
for (i = min; i <= max; i++) {
const char *s = swfdec_js_to_string (debug->manager->player->jscx, frame->sp[-i]);
gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,...
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
...rval);
/**
* swfdec_js_finish_player:
* @player: a #SwfdecPlayer
@@ -122,6 +124,8 @@ swfdec_js_init_player (SwfdecPlayer *pla
void
swfdec_js_finish_player (SwfdecPlayer *player)
{
+ while (player->intervals)
+ swfdec_js_interval_free (player->intervals->data);
if (player->jscx) {
JS_DestroyContext(player->jscx);
player->jsobj = NULL;
diff --git a/libswfdec/swfdec_js_global.c b/libswfdec/swfdec_js_global.c
index 328d74d..06e83e1 100644
--- a/libswfdec/swfdec_js_global.c
+++ b/libswfdec/swfdec_js_global.c
@@ -1,5 +1,5 @@
/* Swfdec
- * Copyright (C) 2006 Be...
2007 Jul 04
0
Branch 'as' - 25 commits - libswfdec/Makefile.am libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h 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
...anager, "Invalid command");
- return;
- }
- if (!JSVAL_IS_OBJECT (rval)) {
- swfdec_player_manager_error (manager, "Given expression is not an object");
+ if (arg == NULL)
return;
- }
- obj = JSVAL_TO_OBJECT (rval);
- array = JS_Enumerate (manager->player->jscx, obj);
- if (array == NULL) {
- swfdec_player_manager_error (manager, "Error enumerating");
+
+ swfdec_as_context_eval (SWFDEC_AS_CONTEXT (manager->player), NULL, arg, &val);
+ s = swfdec_as_value_to_debug (&val);
+ swfdec_player_manager_output (manager, "%s",...
2007 Mar 15
0
11 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_debugger.h libswfdec/swfdec_event.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c
...ex 48dd120..8840d78 100644
--- a/libswfdec/swfdec_net_stream.c
+++ b/libswfdec/swfdec_net_stream.c
@@ -36,6 +36,7 @@ swfdec_net_stream_onstatus (SwfdecNetStr
JSObject *object;
JSContext *cx;
+ SWFDEC_INFO ("emitting onStatus for %s %s", level, code);
cx = stream->player->jscx;
object = JS_NewObject (cx, NULL, NULL, NULL);
if (!object)
diff-tree 78a3f9774427296b4382492369dec48c6a427c20 (from 165ab93606a6387834d2cc513085f02d8df3ac8e)
Author: Benjamin Otte <otte@gnome.org>
Date: Thu Mar 15 19:06:35 2007 +0100
add swfdec_debugger_run and replace swfdebug&...
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
...ariables != '&' && *variables != '\0') {
+ SWFDEC_WARNING ("variables not delimited with & at \"%s\"", variables);
+ g_free (name);
+ g_free (value);
+ break;
+ }
+ variables++;
+ string = JS_NewStringCopyZ (script->jscx, value);
+ if (string == NULL) {
+ g_free (name);
+ g_free (value);
+ SWFDEC_ERROR ("could not create string");
+ break;
+ }
+ val = STRING_TO_JSVAL (string);
+ if (!JS_SetProperty (script->jscx, object, name, &val)) {
+ g_free (name);
+ g_...
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
...sval *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, &fun))
+ return;
+ if (!JSVAL_IS_OBJECT (fun) || fun == JSVAL_NULL ||
+ JS_GetClass (JSVAL_TO_OBJECT (fun)) != &js_FunctionClass) {
+ SWFDEC_LOG ("scriptable has no handler for %s event", name);
+ return;
+ }
+ js_InternalCall (script->jscx, obj, fu...
2007 Jun 01
0
Branch 'as' - 2 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_interval.c libswfdec/swfdec_interval.h libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c
.../* interval in milliseconds */
- guint n_args; /* number of arguments to call function with */
- SwfdecAsValue vals[0]; /* values: 0 is function, 1 is object, 2-n are arguments */
-};
-
-void
-swfdec_js_interval_free (SwfdecAsInterval *interval)
-{
- JSContext *cx = interval->player->jscx;
- guint i;
-
- swfdec_player_remove_timeout (interval->player, &interval->timeout);
- interval->player->intervals =
- g_list_remove (interval->player->intervals, interval);
- for (i = 0; i < interval->n_args + 2; i++) {
- JS_RemoveRoot (cx, &interval->...
2007 Feb 02
0
Branch 'interpreter' - 6 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_compiler.c libswfdec/swfdec_sprite.c test/swfdec-extract.c
...uot;Push: Could not get string");
+ return;
+ }
compile_state_debug_add (state, "Push \"%s\"", s);
push_string (state, s);
break;
@@ -1300,7 +1304,7 @@ swfdec_compile (SwfdecPlayer *player, Sw
name = "Unnamed script";
compile_state_init (player->jscx, bits, version, &state);
SWFDEC_INFO ("Creating new script in frame");
- while ((action = swfdec_bits_get_u8 (bits))) {
+ while (swfdec_bits_left (bits) && (action = swfdec_bits_get_u8 (bits))) {
if (action & 0x80) {
len = swfdec_bits_get_u16 (bits);...
2007 Mar 02
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_audio_flv.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_js_video.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h
...(movie), (GWeakNotify) g_object_unref, video);
+ g_signal_connect (SWFDEC_ROOT_MOVIE (parent)->player, "notify::initialized",
+ G_CALLBACK (notify_initialized), movie);
/* set up the playback stream */
conn = swfdec_connection_new (SWFDEC_ROOT_MOVIE (parent)->player->jscx);
stream = swfdec_net_stream_new (SWFDEC_ROOT_MOVIE (parent)->player, conn);
swfdec_net_stream_set_loader (stream, SWFDEC_ROOT_MOVIE (parent)->loader);
- g_object_ref (SWFDEC_ROOT_MOVIE (parent)->decoder);
- if (!swfdec_loader_target_set_decoder (SWFDEC_LOADER_TARGET (stream), SWFD...