Displaying 20 results from an estimated 77 matches for "swfdec_as_object_get_variable".
2008 Jan 07
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_types.c libswfdec/swfdec_xml.c
...10,7 +410,7 @@ swfdec_as_array_get_value (SwfdecAsArray *array, gint32 idx,
g_assert (idx >= 0);
g_assert (value != NULL);
- var = swfdec_as_double_to_string (SWFDEC_AS_OBJECT (array)->context, idx);
+ var = swfdec_as_integer_to_string (SWFDEC_AS_OBJECT (array)->context, idx);
swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (array), var, value);
}
@@ -433,7 +433,7 @@ swfdec_as_array_set_value (SwfdecAsArray *array, gint32 idx,
g_assert (idx >= 0);
g_assert (SWFDEC_IS_AS_VALUE (value));
- var = swfdec_as_double_to_string (SWFDEC_AS_OBJECT (array)->context, idx);
+ var = swfdec_as_in...
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
...Author: Benjamin Otte <otte at gnome.org>
Date: Thu May 24 17:11:28 2007 +0200
cosmetic fix
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 1cd8c89..bee692a 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -353,8 +353,7 @@ swfdec_as_object_get_variable (SwfdecAsO
}
void
-swfdec_as_object_delete_variable (SwfdecAsObject *object,
- const char *variable)
+swfdec_as_object_delete_variable (SwfdecAsObject *object, const char *variable)
{
SwfdecAsObjectClass *klass;
guint i, flags;
diff-tree 12a24b52a62b851c41bc2393312ff5a5f18dc2df (from...
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
...dec_as_super.c b/libswfdec/swfdec_as_super.c
index e5b9728..ffbc0b5 100644
--- a/libswfdec/swfdec_as_super.c
+++ b/libswfdec/swfdec_as_super.c
@@ -79,10 +79,10 @@ swfdec_as_super_new (SwfdecAsFrame *fram
if (frame->thisp) {
SwfdecAsValue val;
super->object = frame->thisp;
- swfdec_as_object_get_variable (frame->thisp, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_get_variable (frame->thisp, SWFDEC_AS_STR___proto__, &val);
if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
- SwfdecAsObject *constructor = SWFDEC_AS_VALUE_GET_OBJECT (&val);
- swfdec_as_object_get_v...
2007 Dec 03
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_pattern.c
...swfdec_pattern_new_color (color));
swfdec_path_move_to (&draw->path, movie->draw_x, movie->draw_y);
swfdec_sprite_movie_end_fill (movie, draw);
}
+static inline guint
+swfdec_sprite_movie_gradient_fill_get_length (SwfdecAsObject *o)
+{
+ int length;
+ SwfdecAsValue val;
+
+ swfdec_as_object_get_variable (o, SWFDEC_AS_STR_length, &val);
+ length = swfdec_as_value_to_integer (o->context, &val);
+ return MAX (length, 0);
+}
+
+static int
+swfdec_sprite_movie_gradient_fill_check_length (SwfdecAsObject *colors, SwfdecAsObject *alphas, SwfdecAsObject *ratios)
+{
+ guint c, a, r;
+
+ c = s...
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
...seemed
clever to make them 2 different functions
diff --git a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c
index 035e1fd..733192d 100644
--- a/libswfdec/swfdec_as_context.c
+++ b/libswfdec/swfdec_as_context.c
@@ -963,16 +963,11 @@ swfdec_as_context_eval_get_property (Swf
swfdec_as_object_get_variable (obj, name, ret);
} else {
if (cx->frame) {
- obj = swfdec_as_frame_find_variable (cx->frame, name);
- if (obj) {
- swfdec_as_object_get_variable (obj, name, ret);
- return;
- }
+ swfdec_as_frame_get_variable (cx->frame, name, ret);
} else {
SWFDEC_W...
2007 Sep 08
0
9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_video_movie_as.c
...kup_magic (SwfdecMovie *movie, const char *name)
+{
+ SwfdecAsValue val;
- SwfdecAsObject *ret;
++ SwfdecMovie *ret;
+
- ret = SWFDEC_AS_OBJECT (swfdec_movie_get_by_name (SWFDEC_MOVIE (movie), name));
++ ret = swfdec_movie_get_by_name (movie, name);
+ if (ret)
+ return ret;
- if (!swfdec_as_object_get_variable (movie, name, &val))
++ if (!swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (movie), name, &val))
+ return NULL;
+ if (!SWFDEC_AS_VALUE_IS_OBJECT (&val))
+ return NULL;
- ret = SWFDEC_AS_VALUE_GET_OBJECT (&val);
++ ret = (SwfdecMovie *) SWFDEC_AS_VALUE_GET_OBJECT (&am...
2007 Jul 27
0
libswfdec/swfdec_asbroadcaster.c
...r.c
@@ -21,7 +21,6 @@
#include "config.h"
#endif
-#include "swfdec_as_array.h"
#include "swfdec_as_object.h"
#include "swfdec_as_strings.h"
#include "swfdec_debug.h"
@@ -47,10 +46,10 @@ broadcastMessage (SwfdecAsContext *cx, S
argc--;
swfdec_as_object_get_variable (object, SWFDEC_AS_STR__listeners, &val);
- if (!SWFDEC_AS_VALUE_IS_OBJECT (&val) ||
- !SWFDEC_IS_AS_ARRAY (listeners = SWFDEC_AS_VALUE_GET_OBJECT (&val)))
+ if (!SWFDEC_AS_VALUE_IS_OBJECT (&val))
return;
+ listeners = SWFDEC_AS_VALUE_GET_OBJECT (&val);
swfdec_...
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
...SwfdecAsObjectClass *klass;
- SwfdecAsValue tmp_val;
- guint tmp_flags;
-
- if (value == NULL)
- value = &tmp_val;
- if (flags == NULL)
- flags = &tmp_flags;
-
- klass = SWFDEC_AS_OBJECT_GET_CLASS (object);
- return klass->get (object, variable, value, flags);
-}
-
gboolean
swfdec_as_object_get_variable_and_flags (SwfdecAsObject *object,
const char *variable, SwfdecAsValue *value, guint *flags)
{
+ SwfdecAsObjectClass *klass;
guint i;
+ SwfdecAsValue tmp_val;
+ guint tmp_flags;
g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
g_return_val_if_fail (variable != NULL,...
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
...c_as_stack_peek (frame->stack, 1));
+ thisp = swfdec_as_stack_peek (frame->stack, 2);
+ fun = swfdec_as_stack_peek (frame->stack, 1);
obj = swfdec_as_frame_find_variable (frame, name);
if (obj) {
- SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_peek (frame->stack, 2), obj);
- swfdec_as_object_get_variable (obj, name, swfdec_as_stack_peek (frame->stack, 1));
+ SWFDEC_AS_VALUE_SET_OBJECT (thisp, obj);
+ swfdec_as_object_get_variable (obj, name, fun);
} else {
- SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_peek (frame->stack, 2));
- SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek...
2007 Oct 14
0
3 commits - doc/Makefile.am libswfdec/swfdec_text_field_movie_as.c
...SWFDEC_FIXME ("Using embed fonts in TextField not supported");
+
+ text->text->embed_fonts = value;
}
static void
@@ -619,8 +619,7 @@ swfdec_text_field_movie_get_textColor (SwfdecAsContext *cx,
SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, "");
- swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (text->format_new),
- SWFDEC_AS_STR_color, ret);
+ SWFDEC_AS_VALUE_SET_NUMBER (ret, text->format_new->color);
}
// This doesn't work the same way as TextFormat's color setting
@@ -631,18 +630,16 @@ swfdec_text_field_movie_set_textColor (SwfdecAsContext *...
2007 Sep 02
0
3 commits - libswfdec/swfdec_as_number.c libswfdec/swfdec_internal.h libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c test/trace
...dd_function (context->global, SWFDEC_AS_STR_ASnative,
- 0, swfdec_player_ASnative, 2);
- swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_ASconstructor,
- 0, swfdec_player_ASconstructor, 2);
-
- // remove __proto__ and constructor from ASnative and ASconstructor
-
- swfdec_as_object_get_variable (context->global, SWFDEC_AS_STR_ASnative, &val);
- g_assert (SWFDEC_AS_VALUE_IS_OBJECT (&val));
- object = SWFDEC_AS_VALUE_GET_OBJECT (&val);
- swfdec_as_object_unset_variable_flags (object, SWFDEC_AS_STR___proto__,
- SWFDEC_AS_VARIABLE_PERMANENT);
- swfdec_as_object_delete_...
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c test/trace
...*constructor)
+{
+ SwfdecAsValue val;
+ SwfdecAsObject *class, *prototype;
+
+ g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
+ g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (constructor), FALSE);
+
+ // FIXME: propflag tests are wrong, and we shouldn't get __proto__.prototype
+ swfdec_as_object_get_variable (constructor, SWFDEC_AS_STR_prototype, &val);
+ if (!SWFDEC_AS_VALUE_IS_OBJECT (&val))
+ return FALSE;
+ prototype = SWFDEC_AS_VALUE_GET_OBJECT (&val);
+
+ class = object;
+ while ((class = swfdec_as_object_get_prototype (class)) != NULL) {
+ if (class == prototype)
+ ret...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
...-73,7 +74,7 @@ swfdec_as_array_to_index (const char *st
}
static gint32
-swfdec_as_array_get_length (SwfdecAsObject *object)
+swfdec_as_array_get_length_as_integer (SwfdecAsObject *object)
{
SwfdecAsValue val;
gint32 length;
@@ -83,6 +84,16 @@ swfdec_as_array_get_length (SwfdecAsObje
swfdec_as_object_get_variable (object, SWFDEC_AS_STR_length, &val);
length = swfdec_as_value_to_integer (object->context, &val);
+ return length;
+}
+
+static gint32
+swfdec_as_array_get_length (SwfdecAsObject *object)
+{
+ gint32 length;
+
+ length = swfdec_as_array_get_length_as_integer (object);
+
if (l...
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
...ariable 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_object_resolve () on the
+ * returned value to be sure of not having...
2007 Oct 26
0
2 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h test/trace
...onst guint8 *data, guint len)
+{
+ SwfdecAsValue *val, *argv;
+ SwfdecAsObject *object, *proto, *interface;
+ int argc, i;
+
+ swfdec_as_stack_ensure_size (cx, 2);
+
+ val = swfdec_as_stack_pop (cx);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
+ object = SWFDEC_AS_VALUE_GET_OBJECT (val);
+ swfdec_as_object_get_variable (object, SWFDEC_AS_STR_prototype, val);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (val)) {
+ proto = SWFDEC_AS_VALUE_GET_OBJECT (val);
+ } else {
+ proto = NULL;
+ }
+ } else {
+ object = NULL;
+ proto = NULL;
+ }
+
+ val = swfdec_as_stack_pop (cx);
+ argc = swfdec_as_value_to_in...
2007 Oct 14
0
4 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_sound.c test/trace
...n-SwfdecPlayer context");
+ goto error;
} else {
- SWFDEC_WARNING ("not an object, can't GetProperty");
- goto out;
+ movie = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx),
+ swfdec_as_stack_peek (cx, 2));
+ if (movie == NULL)
+ goto error;
}
- swfdec_as_object_get_variable (obj, swfdec_movieclip_props[id].name,
- swfdec_as_stack_peek (cx, 1));
+ if (id > (cx->version > 4 ? 21 : 18)) {
+ SWFDEC_WARNING ("trying to SetProperty %u, doesn't exist", id);
+ goto error;
+ }
+ swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (movie), swfde...
2007 Sep 06
0
3 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_sprite_movie.c
...ot;.:/"))) {
+ const char *var;
+
+ if (s == path) {
+ if (*s == '/')
+ return FALSE;
+ was_slash = FALSE;
+ path++;
+ continue;
+ }
+ was_slash = *s == '/';
+ var = swfdec_as_context_give_string (cx, g_strndup (path, s - path));
+ if (!swfdec_as_object_get_variable (movie, var, &val) ||
+ !SWFDEC_AS_VALUE_IS_OBJECT (&val) ||
+ !SWFDEC_IS_MOVIE ((movie = SWFDEC_AS_VALUE_GET_OBJECT (&val))))
+ return FALSE;
+ path = s + 1;
+ }
+ if (was_slash) {
+ if (*path) {
+ const char *var = swfdec_as_context_get_string (cx, path);
+ movi...
2007 Aug 31
0
4 commits - libswfdec/swfdec_as_number.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player_as.c test/trace
...272,5 +274,28 @@ swfdec_player_init_global (SwfdecPlayer
0, swfdec_player_ASnative, 2);
swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_ASconstructor,
0, swfdec_player_ASconstructor, 2);
+
+ // remove __proto__ and constructor from ASnative and ASconstructor
+
+ swfdec_as_object_get_variable (context->global, SWFDEC_AS_STR_ASnative, &val);
+ g_assert (SWFDEC_AS_VALUE_IS_OBJECT (&val));
+ object = SWFDEC_AS_VALUE_GET_OBJECT (&val);
+ swfdec_as_object_unset_variable_flags (object, SWFDEC_AS_STR___proto__,
+ SWFDEC_AS_VARIABLE_PERMANENT);
+ swfdec_as_object_delete_...
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
...AS_OBJECT (frame)->context;
if (!swfdec_as_context_use_mem (context, sizeof (SwfdecAsSuper)))
return NULL;
ret = g_object_new (SWFDEC_TYPE_AS_SUPER, NULL);
+ super = SWFDEC_AS_SUPER (ret);
+ if (frame->thisp) {
+ SwfdecAsValue val;
+ super->object = frame->thisp;
+ swfdec_as_object_get_variable (frame->thisp, SWFDEC_AS_STR_constructor, &val);
+ if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
+ SwfdecAsObject *constructor = SWFDEC_AS_VALUE_GET_OBJECT (&val);
+ swfdec_as_object_get_variable (constructor, SWFDEC_AS_STR___constructor__, &val);
+ if (SWFDEC_AS_VALU...
2007 Jun 27
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_interpret.c libswfdec/swfdec_js_video.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_video_movie_as.c libswfdec/swfdec_video_movie.c
...nstructor) ||
- !SWFDEC_IS_AS_FUNCTION (fun = (SwfdecAsFunction *) SWFDEC_AS_VALUE_GET_OBJECT (constructor))) {
- SWFDEC_WARNING ("%s is not a constructor", name);
- goto fail;
- }
if (name != SWFDEC_AS_STR_EMPTY) {
- if (SWFDEC_AS_VALUE_IS_OBJECT (constructor)) {
- swfdec_as_object_get_variable (SWFDEC_AS_VALUE_GET_OBJECT (constructor),
- name, constructor);
+ if (!SWFDEC_AS_VALUE_IS_OBJECT (constructor)) {
+ SWFDEC_WARNING ("NewMethod called without an object to get variable %s from", name);
+ goto fail;
}
+ swfdec_as_object_get_variable (SWFDEC_AS_VALUE_...