Displaying 16 results from an estimated 16 matches for "swfdec_as_frame_set_this".
2007 May 21
0
Branch 'as' - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...swfdec_as_script_function.c | 4 +--
7 files changed, 44 insertions(+), 25 deletions(-)
New commits:
diff-tree 9611954464237c3162a09458e506840adb0943e5 (from 210bee663edb435f5f15cd5e8e9649faecd982d9)
Author: Benjamin Otte <otte at gnome.org>
Date: Mon May 21 21:52:06 2007 +0200
add swfdec_as_frame_set_this to allow calling functions without a this object
diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
index 23b3c41..75e0534 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -68,7 +68,8 @@ swfdec_as_frame_mark (SwfdecAsObject *ob
if (frame->scri...
2007 May 22
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c
...er->constructor == NULL) {
+ SWFDEC_FIXME ("figure out what happens when super doesn't have a constructor");
+ return NULL;
+ }
+ klass = SWFDEC_AS_FUNCTION_GET_CLASS (super->constructor);
+ frame = klass->call (super->constructor);
+ /* FIXME: this is ugly */
+ swfdec_as_frame_set_this (frame, super->object);
+ return frame;
+}
static void
swfdec_as_super_class_init (SwfdecAsSuperClass *klass)
{
+ SwfdecAsFunctionClass *function_class = SWFDEC_AS_FUNCTION_CLASS (klass);
+
+ function_class->call = swfdec_as_super_call;
}
static void
@@ -42,15 +63,33 @@ swfdec_as_...
2007 Jul 11
0
Branch 'as' - libswfdec/swfdec_as_object.c
...BJECT (object));
g_return_if_fail (SWFDEC_AS_OBJECT_HAS_CONTEXT (object));
g_return_if_fail (script != NULL);
- frame = swfdec_as_frame_new (object->context, script);
+ context = object->context;
+ frame = swfdec_as_frame_new (context, script);
if (frame == NULL)
return;
swfdec_as_frame_set_this (frame, object);
swfdec_as_frame_preload (frame);
- swfdec_as_context_run (object->context);
+ swfdec_as_context_run (context);
+ swfdec_as_stack_pop (context);
}
/**
2007 Nov 14
0
7 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h
...if (frame == NULL)
return NULL;
if (function->priv)
swfdec_as_frame_set_security (frame, function->priv);
/* second check especially for super object */
- if (thisp != NULL && frame->thisp == NULL)
+ if (thisp != NULL && frame->thisp == NULL) {
swfdec_as_frame_set_this (frame, swfdec_as_object_resolve (thisp));
+ }
frame->is_local = TRUE;
frame->argc = n_args;
frame->argv = args;
@@ -160,7 +163,12 @@ swfdec_as_function_call (SwfdecAsFunction *function, SwfdecAsObject *thisp, guin
frame = swfdec_as_function_call_no_preload (function, thisp, n...
2007 May 24
0
Branch 'as' - 11 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c
...the real function here. 1) swfdec_as_context_run() requires it.
* And b) it makes more sense reading the constructor's name than reading "super"
* in a debugger
*/
- frame->function = super->constructor;
+ frame->function = fun;
/* FIXME: this is ugly */
swfdec_as_frame_set_this (frame, super->object);
return frame;
@@ -58,18 +67,16 @@ static gboolean
swfdec_as_super_get (SwfdecAsObject *object, const char *variable,
SwfdecAsValue *val, guint *flags)
{
- SwfdecAsValue value;
SwfdecAsSuper *super = SWFDEC_AS_SUPER (object);
- if (super->object == NULL...
2007 Sep 13
0
5 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_scope.c libswfdec/swfdec_as_scope.h libswfdec/swfdec_as_script_function.c
...ect_set_variable (obj, name, ret);
}
- swfdec_as_object_set_variable (obj, name, ret);
}
static void
diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
index 5620ac7..c11c03a 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -535,45 +535,72 @@ swfdec_as_frame_set_this (SwfdecAsFrame
}
/**
- * swfdec_as_frame_find_variable:
+ * swfdec_as_frame_get_variable_and_flags:
* @frame: a #SwfdecAsFrame
- * @variable: name of the variable to find
+ * @variable: name of the variable
+ * @value: pointer to take value of the variable or %NULL
+ * @flags: pointer to tak...
2007 Jul 13
0
3 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...frame_get_type (void);
-SwfdecAsFrame * swfdec_as_frame_new (SwfdecAsContext * context,
- SwfdecScript * script);
-SwfdecAsFrame * swfdec_as_frame_new_native (SwfdecAsContext * context);
-void swfdec_as_frame_return (SwfdecAsFrame * frame,
- SwfdecAsValue * return_value);
-
-void swfdec_as_frame_set_this (SwfdecAsFrame * frame,
- SwfdecAsObject * thisp);
-void swfdec_as_frame_preload (SwfdecAsFrame * frame);
-
-SwfdecAsObject *swfdec_as_frame_find_variable (SwfdecAsFrame * frame,
- const char * variable);
-gboolean swfdec_as_frame_delete_variable (SwfdecAsFrame * frame,
- const...
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_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -470,8 +470,6 @@ swfdec_as_object_run (SwfdecAsObject *ob
frame = swfdec_as_frame_new (object->context, script);
if (frame == NULL)
return;
- frame->next = object->context->frame;
- object->context->frame = frame;
swfdec_as_frame_set_this (frame, object);
swfdec_as_frame_preload (frame);
swfdec_as_context_run (object->context);
diff-tree 81107e1714a4e0d3ed8161587d153697f4a27398 (from d8fb7ee0521b6fa84a3a9facb960e501b69212f2)
Author: Benjamin Otte <otte at gnome.org>
Date: Sat Jun 30 19:26:52 2007 +0100
remove s...
2007 Jul 12
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_with.c libswfdec/swfdec_sprite_movie.c test/trace
...different. I'd just find a nice way of getting the with stack into functions
defined inside it.
diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
index 6115cb5..5990d69 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -264,8 +264,11 @@ swfdec_as_frame_set_this (SwfdecAsFrame
* Finds the given variable in the current scope chain. Returns the first
* object in the scope chain that contains this variable in its prototype
* chain. If you want to know the explicit object that contains the variable,
- * you have to call swfdec_as_object_find_variable(...
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
...index 41a58f2..5447bcd 100644
--- a/libswfdec/swfdec_as_super.c
+++ b/libswfdec/swfdec_as_super.c
@@ -61,6 +61,7 @@ swfdec_as_super_call (SwfdecAsFunction *
* in a debugger
*/
frame->function = fun;
+ frame->construct = frame->next->construct;
/* FIXME: this is ugly */
swfdec_as_frame_set_this (frame, super->object);
return frame;
2007 Oct 17
0
28 commits - configure.ac debian/changelog debian/control debian/copyright debian/.gitignore debian/libswfdec0.dirs debian/libswfdec0.files debian/libswfdec0.shlibs debian/libswfdec-dev.dirs debian/libswfdec-dev.files debian/rules debian/swf-player.dirs
...turn_if_fail (SWFDEC_IS_AS_OBJECT (object));
g_return_if_fail (script != NULL);
+ g_return_if_fail (SWFDEC_IS_SECURITY (sec));
context = object->context;
frame = swfdec_as_frame_new (context, script);
if (frame == NULL)
return;
+ swfdec_as_frame_set_security (frame, sec);
swfdec_as_frame_set_this (frame, object);
swfdec_as_frame_preload (frame);
swfdec_as_context_run (context);
@@ -1040,6 +1037,26 @@ swfdec_as_object_run (SwfdecAsObject *object, SwfdecScript *script)
}
/**
+ * swfdec_as_object_run:
+ * @object: a #SwfdecAsObject
+ * @script: script to execute
+ *
+ * Executes the...
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
...EC_AS_SCOPE (frame);
- if (frame->next)
- frame->var_object = frame->next->var_object;
frame->n_registers = script->n_registers;
frame->registers = g_slice_alloc0 (sizeof (SwfdecAsValue) * frame->n_registers);
if (script->constant_pool) {
@@ -176,8 +171,10 @@ swfdec_as_frame_set_this (SwfdecAsFrame
g_return_if_fail (SWFDEC_IS_AS_OBJECT (thisp));
frame->thisp = thisp;
- if (frame->var_object == NULL)
- frame->var_object = thisp;
+ if (frame->target == NULL) {
+ frame->target = thisp;
+ frame->original_target = thisp;
+ }
}
/**
@@ -285,7...
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
...8 @@ swfdec_as_function_call (SwfdecAsFunctio
/* FIXME: figure out what to do in these situations */
if (frame == NULL)
return;
- if (thisp && frame->thisp == NULL)
+ /* second check especially for super object */
+ if (thisp != NULL && frame->thisp == NULL)
swfdec_as_frame_set_this (frame, thisp);
frame->is_local = TRUE;
frame->argc = n_args;
@@ -99,6 +100,25 @@ swfdec_as_function_call (SwfdecAsFunctio
/*** AS CODE ***/
+static void
+swfdec_as_function_do_call (SwfdecAsContext *context, SwfdecAsObject *fun,
+ guint argc, SwfdecAsValue *argv, SwfdecAsValue...
2007 Nov 15
0
4 commits - libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c test/trace
...frame->callee :
- context->frame->caller);
- } else {
- caller = NULL;
- }
-
klass = SWFDEC_AS_FUNCTION_GET_CLASS (function);
g_assert (klass->call);
frame = klass->call (function);
@@ -138,8 +128,6 @@ swfdec_as_function_call_no_preload (SwfdecAsFunction *function,
swfdec_as_frame_set_this (frame, swfdec_as_object_resolve (thisp));
}
frame->is_local = TRUE;
- frame->caller = caller;
- frame->callee = function;
frame->argc = n_args;
frame->argv = args;
frame->return_value = return_value;
@@ -203,6 +191,7 @@ swfdec_as_function_do_call (SwfdecAsContext...
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
...0:00:16 2007 +0200
remove swfdec_as_object_find_variable and use swfdec_as_object_get_variable instead
diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
index de18973..de0dbd7 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -195,17 +195,16 @@ swfdec_as_frame_set_this (SwfdecAsFrame
SwfdecAsObject *
swfdec_as_frame_find_variable (SwfdecAsFrame *frame, const char *variable)
{
- SwfdecAsObject *ret = NULL;
SwfdecAsScope *cur;
guint i;
+ SwfdecAsValue val;
g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
g_return_val_if_fail (variable !=...
2008 Jan 21
0
70 commits - configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_socket.c libswfdec-gtk/swfdec_gtk_socket.h libswfdec-gtk/swfdec_playback_alsa.c
...execution */
@@ -70,8 +68,6 @@ SwfdecAsFrame * swfdec_as_frame_new_native (SwfdecAsContext * context);
void swfdec_as_frame_return (SwfdecAsFrame * frame,
SwfdecAsValue * return_value);
-void swfdec_as_frame_set_security (SwfdecAsFrame * frame,
- SwfdecSecurity * guard);
void swfdec_as_frame_set_this (SwfdecAsFrame * frame,
SwfdecAsObject * thisp);
void swfdec_as_frame_preload (SwfdecAsFrame * frame);
diff --git a/libswfdec/swfdec_as_function.c b/libswfdec/swfdec_as_function.c
index 5dce988..cc0e975 100644
--- a/libswfdec/swfdec_as_function.c
+++ b/libswfdec/swfdec_as_function.c
@@ -...