Displaying 20 results from an estimated 87 matches for "swfdec_as_object_set_variable".
2007 Aug 21
0
4 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c test/trace
...dex 495bff1..81ef701 100644
--- a/libswfdec/swfdec_as_array.c
+++ b/libswfdec/swfdec_as_array.c
@@ -1107,7 +1107,8 @@ swfdec_as_array_init_context (SwfdecAsCo
/* set the right properties on the Array.prototype object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
- swfdec_as_object_set_variable (proto, SWFDEC_AS_STR___proto__, &val);
+ swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR___proto__, &val,
+ SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
SWFDEC_AS_VALUE_SET_OBJECT (&val, array);
swfdec_as_object_set_variable (proto, SWFDEC_AS_STR...
2007 Jul 03
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_math.c libswfdec/swfdec_as_object.c libswfdec/swfdec_movie.c libswfdec/swfdec_sprite_movie.c test/trace
...break;
}
- asname = swfdec_as_context_get_string (as->context, name);
- g_free (name);
+ asname = swfdec_as_context_give_string (as->context, name);
SWFDEC_AS_VALUE_SET_STRING (&val, swfdec_as_context_get_string (as->context, value));
g_free (value);
swfdec_as_object_set_variable (as, asname, &val);
diff-tree a6549a64a50be437716e8ec3dbdc33671ee15f0a (from a031f4b7e379e364e82101dd02924cc1b1137b56)
Author: Benjamin Otte <otte at gnome.org>
Date: Tue Jul 3 00:00:16 2007 +0100
unset sound stream here, since we're not recreating it in any case
diff --git a/...
2007 Aug 22
0
5 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_script_function.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h
...ec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c
index 28888ae..273b083 100644
--- a/libswfdec/swfdec_as_array.c
+++ b/libswfdec/swfdec_as_array.c
@@ -108,7 +108,8 @@ swfdec_as_array_set_length (SwfdecAsObje
g_return_if_fail (object != NULL);
SWFDEC_AS_VALUE_SET_INT (&val, length);
- swfdec_as_object_set_variable (object, SWFDEC_AS_STR_length, &val);
+ swfdec_as_object_set_variable_and_flags (object, SWFDEC_AS_STR_length, &val,
+ SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
}
typedef struct {
diff --git a/libswfdec/swfdec_as_boolean.c b/libswfdec/swfdec_as_boolean.c
index b88...
2007 Nov 01
0
libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie_html.c
...->tags_open = g_slist_prepend (data->tags_open, tag);
// set format based on tag
- object = SWFDEC_AS_OBJECT (tag->format);
- SWFDEC_AS_VALUE_SET_BOOLEAN (&val, TRUE);
-
- if (tag->name_length == 2 && !g_strncasecmp (tag->name, "li", 2)) {
- swfdec_as_object_set_variable (object, SWFDEC_AS_STR_bullet, &val);
- } else if (tag->name_length == 1 && !g_strncasecmp (tag->name, "b", 1)) {
- swfdec_as_object_set_variable (object, SWFDEC_AS_STR_bold, &val);
- } else if (tag->name_length == 1 && !g_strncasecmp (tag->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
...rn;
+ if (version < 6) {
+ /* deleting it later on is easier than duplicating swfdec_as_object_add_function() */
+ swfdec_as_object_delete_variable (context->global, SWFDEC_AS_STR_Function);
+ }
context->Function = function;
SWFDEC_AS_VALUE_SET_OBJECT (&val, function);
swfdec_as_object_set_variable (function, SWFDEC_AS_STR_constructor, &val);
diff-tree cb168347a7ab95b8918e3d4d737e37bd693fda10 (from 12a24b52a62b851c41bc2393312ff5a5f18dc2df)
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/l...
2007 Aug 17
1
libswfdec/swfdec_as_object.c
...RIABLE_PERMANENT: Do not all swfdec_as_object_delete_variable()
* to delete this variable.
- * @SWFDEC_AS_VARIABLE_READONLY: Do not allow changing the value with
+ * @SWFDEC_AS_VARIABLE_CONSTANT: Do not allow changing the value with
* swfdec_as_object_set_variable().
*
* These flags are used to describe various properties of a variable inside
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
...as_array_set_range_with_flags (SwfdecAsObject *object,
g_return_if_fail (num == 0 || value != NULL);
for (i = 0; i < num; i++) {
- var = swfdec_as_double_to_string (object->context, start_index + i);
+ var = swfdec_as_integer_to_string (object->context, start_index + i);
swfdec_as_object_set_variable_and_flags (object, var, &value[i], flags);
}
}
@@ -410,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_integ...
2007 Aug 19
0
2 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_with.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_sprite_movie.c
...set the variable to
*
* Sets a variable on @object. It is not guaranteed that getting the variable
- * after setting it results in the same value, as some variables can be
- * read-only or require a specific type.
+ * after setting it results in the same value. This is a mcaro that calls
+ * swfdec_as_object_set_variable_and_flags()
+ **/
+/**
+ * swfdec_as_object_set_variable:
+ * @object: a #SwfdecAsObject
+ * @variable: garbage-collected name of the variable to set
+ * @value: value to set the variable to
+ * @default_flags: flags to use if creating the variable anew - the flags will
+ * be ignor...
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
..._AS_STR_Video, 0, NULL, 0));
if (video == NULL)
return;
+ player->Video = video;
proto = swfdec_as_object_new (context);
- /* set the right properties on the NetStream object */
+ /* set the right properties on the Video object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
swfdec_as_object_set_variable (video, SWFDEC_AS_STR_prototype, &val);
- /* set the right properties on the NetStream.prototype object */
+ /* set the right properties on the Video.prototype object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, video);
swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &v...
2007 Aug 17
0
4 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h test/trace
...DEC_AS_OBJECT (construct),
+ SWFDEC_AS_STR_prototype, &val);
if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) {
proto = SWFDEC_AS_VALUE_GET_OBJECT (&val);
} else {
@@ -959,8 +961,15 @@ swfdec_as_object_set_constructor (Swfdec
}
SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
swfdec_as_object_set_variable (object, SWFDEC_AS_STR___proto__, &val);
+ swfdec_as_object_set_variable_flags (object, SWFDEC_AS_STR___proto__,
+ SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
SWFDEC_AS_VALUE_SET_OBJECT (&val, construct);
- swfdec_as_object_set_variable (object, scripted ? SWFDEC_AS...
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_AS_OBJECT (swfdec_as_object_add_function (context->global,
+ SWFDEC_AS_STR_Video, 0, NULL, 0));
+ if (video == NULL)
+ return;
+ proto = swfdec_as_object_new (context);
+ /* set the right properties on the NetStream object */
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, proto);
+ swfdec_as_object_set_variable (video, SWFDEC_AS_STR_prototype, &val);
+ /* set the right properties on the NetStream.prototype object */
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, video);
+ swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_add_function (proto, SWFDEC_AS_STR_atta...
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
...;
+ }
+
+ /* set the default variables (unless suppressed */
+ if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_THIS)) {
if (frame->thisp) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, frame->thisp);
} else {
@@ -580,34 +593,59 @@ swfdec_as_frame_preload (SwfdecAsFrame *
swfdec_as_object_set_variable (object, SWFDEC_AS_STR_this, &val);
}
if (!(script->flags & SWFDEC_SCRIPT_SUPPRESS_ARGS)) {
- SwfdecAsObject *args = swfdec_as_array_new (context);
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, args);
+ swfdec_as_object_set_variable (object, SWFDEC_AS_STR_arguments, &val);
+...
2007 Aug 22
0
3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c test/trace
...gv);
+ } else {
+ swfdec_as_array_set_length (object, 0);
}
SWFDEC_AS_VALUE_SET_OBJECT (ret, object);
@@ -1090,7 +1084,8 @@ swfdec_as_array_init_context (SwfdecAsCo
/* set the right properties on the Array object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
- swfdec_as_object_set_variable (array, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_set_variable_and_flags (array, SWFDEC_AS_STR_constructor,
+ &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
SWFDEC_AS_VALUE_SET_NUMBER (&val, ARRAY_SORT_OPTION_CASEINSENSITIVE);
swfdec_as_object_se...
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
...UPER) {
- SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], super);
+ SWFDEC_AS_VALUE_SET_OBJECT (&frame->registers[current_reg++], frame->super);
} else {
- SWFDEC_AS_VALUE_SET_OBJECT (&val, super);
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, frame->super);
swfdec_as_object_set_variable (object, SWFDEC_AS_STR_super, &val);
}
}
diff --git a/libswfdec/swfdec_as_frame.h b/libswfdec/swfdec_as_frame.h
index 36756fb..78e90cc 100644
--- a/libswfdec/swfdec_as_frame.h
+++ b/libswfdec/swfdec_as_frame.h
@@ -41,6 +41,7 @@ struct _SwfdecAsFrame {
SwfdecAsFrame * next; /* ne...
2007 Aug 18
0
8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_load_object_as.c libswfdec/swfdec_load_object_as.h libswfdec/swfdec_load_object.c libswfdec/swfdec_load_object.h libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h
...ith 0 params to return FALSE
diff --git a/libswfdec/swfdec_xml_as.c b/libswfdec/swfdec_xml_as.c
index 10f9d13..db31bc0 100644
--- a/libswfdec/swfdec_xml_as.c
+++ b/libswfdec/swfdec_xml_as.c
@@ -65,6 +65,6 @@ swfdec_xml_init_context (SwfdecPlayer *p
SWFDEC_AS_VALUE_SET_OBJECT (&val, xml);
swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_load, SWFDEC_TYPE_XML,
- swfdec_load_object_load, 1);
+ swfdec_load_object_load, 0);
}
diff-tree 1e15b5e20599d5193ba0745cf1e11fac076e66f6 (from d0bd628cea984172d9dfb185b9fbeba64348ed81)...
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
...pe, NULL);
- swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, size);
+ g_return_if_fail (SWFDEC_IS_AS_FUNCTION (fun));
+
+ object = SWFDEC_AS_OBJECT (fun);
+ context = object->context;
if (context->Function) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
- swfdec_as_object_set_variable (fun, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_set_variable (object, SWFDEC_AS_STR_constructor, &val);
}
if (context->Function_prototype) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function_prototype);
- swfdec_as_object_set_variable (fun, SWFDEC_AS_...
2007 May 18
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_as_context.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_native_function.h
...dd (SWFDEC_AS_OBJECT (fun), context, sizeof (SwfdecAsFunction));
- swfdec_as_object_root (fun);
+ fun = g_object_new (type, NULL);
+ swfdec_as_object_add (SWFDEC_AS_OBJECT (fun), context, size);
if (context->Function) {
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function);
swfdec_as_object_set_variable (fun, SWFDEC_AS_STR_constructor, &val);
@@ -92,60 +61,17 @@ swfdec_as_function_do_create (SwfdecAsCo
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Function_prototype);
swfdec_as_object_set_variable (fun, SWFDEC_AS_STR___proto__, &val);
}
- swfdec_as_object_unroot (fun);...
2007 Aug 20
0
Branch 'vivi' - 60 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c
...decAsContext *cx, Swfdec
function = swfdec_get_asnative (cx, x, y);
if (function == NULL) {
SWFDEC_FIXME ("no ASnative function for %u, %u, what now?", x, y);
- return;
+ break;
}
SWFDEC_AS_VALUE_SET_OBJECT (&val, SWFDEC_AS_OBJECT (function));
swfdec_as_object_set_variable (target, swfdec_as_context_get_string (cx, s), &val);
y++;
}
- g_free (names);
+ g_strfreev (names);
}
SWFDEC_AS_NATIVE (4, 1, ASSetNativeAccessor)
@@ -202,12 +202,12 @@ ASSetNativeAccessor (SwfdecAsContext *cx
set = swfdec_get_asnative (cx, x, y++);
if (get == NULL) {...
2008 Jan 19
0
11 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h libswfdec/swfdec_xml_node.c libswfdec/swfdec_xml_node.h test/image test/swfdec_test.c test/swfdec_test_image.c test/trace
...te if not ./default.sts", "FILENAME" },
{ NULL }
};
@@ -110,6 +112,11 @@ main (int argc, char **argv)
context = g_object_new (SWFDEC_TYPE_AS_CONTEXT, NULL);
swfdec_as_context_startup (context, SWFDEC_TEST_VERSION);
+
+ SWFDEC_AS_VALUE_SET_BOOLEAN (&val, dump);
+ swfdec_as_object_set_variable (context->global,
+ swfdec_as_context_get_string (context, "dump"), &val);
+
swfdec_test_function_init_context (context);
swfdec_as_context_run_init_script (context, swfdec_test_initialize,
sizeof (swfdec_test_initialize), SWFDEC_TEST_VERSION);
diff --git a/test/...
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
...- const char *s = swfdec_js_to_string (cx, fp->sp[-3 - 2 * i]);
- if (s == NULL)
- return JS_FALSE;
- if (!JS_SetProperty (cx, object, s, &fp->sp[-2 - 2 * i]))
- return JS_FALSE;
+ const char *s = swfdec_as_value_to_string (cx, swfdec_as_stack_peek (stack, 2));
+ swfdec_as_object_set_variable (object, s, swfdec_as_stack_peek (stack, 1));
+ swfdec_as_stack_pop_n (stack, 2);
}
- fp->sp -= 2 * n_args;
- fp->sp[-1] = OBJECT_TO_JSVAL (object);
- return JS_TRUE;
+ SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (stack), object);
}
-#endif
static void
swfdec_action_init_a...