Displaying 8 results from an estimated 8 matches for "swfdec_as_object_find_variable".
2007 May 17
0
Branch 'as' - 8 commits - libswfdec/.gitignore libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_object.h libswfdec/swfdec_movie.c libswfdec/swfdec_sprite_movie_as.c
...+ * @variable: name of the variable to find
+ *
+ * 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() on the result.
+ * If no such variable exist in the scope chain, %NULL is returned.
+ *
+ * Returns: the object that contains @variable or %NULL if none.
+ **/
SwfdecAsObject *
swfdec_as_frame_find_variable (SwfdecAsFrame *frame, const char *variable)
{
@@ -184,7 +197,7 @@ swfdec_as_frame_find...
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
...le (SwfdecAsFrame *frame, const SwfdecAsValue *variable)
+{
+ SwfdecAsObject *ret = NULL;
+ guint i;
+
+ g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
+ g_return_val_if_fail (SWFDEC_IS_AS_VALUE (variable), NULL);
+
+ for (i = 0; i < 256 && frame != NULL; i++) {
+ ret = swfdec_as_object_find_variable (frame->scope, variable);
+ if (ret)
+ break;
+ if (!SWFDEC_IS_AS_FRAME (frame->scope))
+ break;
+ frame = SWFDEC_AS_FRAME (frame->scope);
+ }
+ if (i == 256) {
+ swfdec_as_context_abort (SWFDEC_AS_OBJECT (frame)->context, "Scope recursion limit exceeded&quo...
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
...e(SwfdecAsObject * object,
const char * variable);
void swfdec_as_object_set_variable_flags
diff-tree f1f78721fb699bbb94bb90edb82b2bbbe203b284 (from 7311076213bb5ceb0c56b64632ea4e0b07c21d72)
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Jun 6 10: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 *
s...
2007 Apr 12
0
Branch 'as' - 15 commits - 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 libswfdec/swfdec_as_interpret.c
...bject *ret = NULL;
+ SwfdecAsObject *cur, *ret = NULL;
guint i;
g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
g_return_val_if_fail (SWFDEC_IS_AS_VALUE (variable), NULL);
+ cur = SWFDEC_AS_OBJECT (frame);
for (i = 0; i < 256 && frame != NULL; i++) {
- ret = swfdec_as_object_find_variable (frame->scope, variable);
- if (ret)
- break;
- if (!SWFDEC_IS_AS_FRAME (frame->scope))
+ if (!SWFDEC_IS_AS_FRAME (cur))
break;
- frame = SWFDEC_AS_FRAME (frame->scope);
+ ret = swfdec_as_object_find_variable (cur, variable);
+ if (ret)
+ return ret;
+...
2007 May 23
0
Branch 'as' - 7 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_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
..._value);
}
swfdec_as_context_return (context);
diff --git a/libswfdec/swfdec_as_frame.c b/libswfdec/swfdec_as_frame.c
index 75e0534..2982e3c 100644
--- a/libswfdec/swfdec_as_frame.c
+++ b/libswfdec/swfdec_as_frame.c
@@ -228,11 +228,13 @@ swfdec_as_frame_find_variable (SwfdecAsF
ret = swfdec_as_object_find_variable (frame->target, variable);
if (ret)
return frame->target;
- } else {
+ } else if (frame->thisp) {
/* The default target is the original object that called into us */
ret = swfdec_as_object_find_variable (SWFDEC_AS_FRAME (cur)->thisp, variable);
if (ret)...
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
...ive native,
guint min_args);
void swfdec_as_function_call (SwfdecAsFunction * function,
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 5cda61b..a064716 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -296,6 +296,87 @@ swfdec_as_object_find_variable (SwfdecAs
}
/**
+ * swfdec_as_object_set_variable_flags:
+ * @object: a #SwfdecAsObject
+ * @variable: the variable to modify
+ * @flags: flags to set
+ *
+ * Sets the given flags for the given variable.
+ **/
+void
+swfdec_as_object_set_variable_flags (SwfdecAsObject *object,
+ const Swfde...
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
...,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() on the result.
+ * you have to call swfdec_as_object_get_variable_and_flags() on the result.
* If no such variable exist in the scope chain, %NULL is returned.
+ * <note>The returned object might be an internal object. You probably do not
+ * want to expose it to scripts. Call swfdec_as_o...
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
...ript->n_registers;
@@ -202,7 +202,7 @@ swfdec_as_frame_find_variable (SwfdecAsF
g_return_val_if_fail (SWFDEC_IS_AS_FRAME (frame), NULL);
g_return_val_if_fail (variable != NULL, NULL);
- cur = SWFDEC_AS_SCOPE (frame);
+ cur = frame->scope;
for (i = 0; i < 256; i++) {
ret = swfdec_as_object_find_variable (SWFDEC_AS_OBJECT (cur), variable);
if (ret)
@@ -348,3 +348,31 @@ swfdec_as_frame_preload (SwfdecAsFrame *
}
}
}
+
+/**
+ * swfdec_as_frame_check_scope:
+ * @frame: a #SwfdecAsFrame
+ *
+ * Checks that the current scope of the given @frame is still correct.
+ * If it is not, the curre...