Displaying 16 results from an estimated 16 matches for "swfdec_as_object_hash_lookup".
2007 Sep 10
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...;value;
+ args[2] = *val;
+ args[3] = watch->watch_data;
+ swfdec_as_watch_ref (watch);
+ swfdec_as_function_call (watch->watch, object, 4, args, &ret);
swfdec_as_context_run (object->context);
- var->value = ret;
- var->watch_recurse--;
+ swfdec_as_watch_unref (watch);
+ var = swfdec_as_object_hash_lookup (object, variable);
+ if (var == NULL) {
+ var = swfdec_as_object_hash_create (object, variable, flags);
+ if (var == NULL)
+ return;
+ }
}
+ var->value = ret;
} else {
var->value = *val;
}
@@ -329,12 +390,8 @@ swfdec_as_object_do_set_flags (SwfdecAsO
sta...
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
..., flags);
// if we added new value outside the current length, set a bigger length
if (indexvar) {
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 2150244..811be98 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -157,7 +157,7 @@ swfdec_as_object_hash_lookup (SwfdecAsOb
}
static inline SwfdecAsVariable *
-swfdec_as_object_hash_create (SwfdecAsObject *object, const char *variable)
+swfdec_as_object_hash_create (SwfdecAsObject *object, const char *variable, guint flags)
{
SwfdecAsVariable *var;
@@ -166,6 +166,7 @@ swfdec_as_object_hash_create (...
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
...s_context.h"
#include "swfdec_as_frame.h"
@@@ -68,10 -68,10 +70,27 @@@
}
static gboolean
++swfdec_as_object_lookup_case_insensitive (gpointer key, gpointer value, gpointer user_data)
++{
++ return strcasecmp (key, user_data) == 0;
++}
++
++static inline SwfdecAsVariable *
++swfdec_as_object_hash_lookup (SwfdecAsObject *object, const char *variable)
++{
++ SwfdecAsVariable *var = g_hash_table_lookup (object->properties, variable);
++
++ if (var || object->context->version >= 7)
++ return var;
++ var = g_hash_table_find (object->properties, swfdec_as_object_lookup_case_insensit...
2007 Aug 15
3
2 commits - libswfdec/swfdec_as_object.c test/trace
...c
+++ b/libswfdec/swfdec_as_object.c
@@ -139,6 +139,12 @@ swfdec_as_object_lookup_case_insensitive
return strcasecmp (key, user_data) == 0;
}
+static gboolean
+swfdec_as_variable_name_is_valid (const char *name)
+{
+ return name != SWFDEC_AS_STR_EMPTY;
+}
+
static inline SwfdecAsVariable *
swfdec_as_object_hash_lookup (SwfdecAsObject *object, const char *variable)
{
@@ -150,6 +156,21 @@ swfdec_as_object_hash_lookup (SwfdecAsOb
return var;
}
+static inline SwfdecAsVariable *
+swfdec_as_object_hash_create (SwfdecAsObject *object, const char *variable)
+{
+ SwfdecAsVariable *var;
+
+ if (!swfdec_as_context...
2007 Aug 16
0
Branch 'vivi' - 23 commits - 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_net_stream.c libswfdec/swfdec_sprite_movie.c test/trace vivified/core
...Ob
}
static gboolean
-swfdec_as_object_do_get (SwfdecAsObject *object, const char *variable,
- SwfdecAsValue *val, guint *flags)
+swfdec_as_object_do_get (SwfdecAsObject *object, SwfdecAsObject *orig,
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
SwfdecAsVariable *var = swfdec_as_object_hash_lookup (object, variable);
@@ -184,7 +184,7 @@ swfdec_as_object_do_get (SwfdecAsObject
return FALSE;
if (var->get) {
- swfdec_as_function_call (var->get, object, 0, NULL, val);
+ swfdec_as_function_call (var->get, orig, 0, NULL, val);
swfdec_as_context_run (object->cont...
2007 Jul 21
0
12 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/jpeg libswfdec/swfdec_as_array.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h
...*flags = var->flags;
} else {
*val = var->value;
@@ -172,6 +173,21 @@ swfdec_as_object_do_get (SwfdecAsObject
return FALSE;
}
+static SwfdecAsVariable *
+swfdec_as_object_lookup_variable (SwfdecAsObject *object, const char *variable)
+{
+ SwfdecAsVariable *var;
+
+ var = swfdec_as_object_hash_lookup (object, variable);
+ if (var == NULL) {
+ if (!swfdec_as_context_use_mem (object->context, sizeof (SwfdecAsVariable)))
+ return NULL;
+ var = g_slice_new0 (SwfdecAsVariable);
+ g_hash_table_insert (object->properties, (gpointer) variable, var);
+ }
+ return var;
+}
+
static...
2007 Nov 02
0
5 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_date.c libswfdec/swfdec_as_date.h libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_filter.c
...bswfdec/swfdec_as_object.c
@@ -354,15 +354,13 @@ swfdec_as_object_get_prototype (SwfdecAsObject *object)
return object->prototype;
}
-static void
-swfdec_as_object_do_set (SwfdecAsObject *object, const char *variable,
- const SwfdecAsValue *val, guint flags)
+static SwfdecAsVariable *
+swfdec_as_object_hash_lookup_with_prototype (SwfdecAsObject *object,
+ const char *variable)
{
SwfdecAsVariable *var;
- SwfdecAsWatch *watch;
- if (!swfdec_as_variable_name_is_valid (variable))
- return;
+ g_return_val_if_fail (swfdec_as_variable_name_is_valid (variable), NULL);
var = swfdec_as_object_hash_...
2007 Oct 25
0
12 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...RIABLE_VERSION_8_UP &&
version < 6)
return NULL;
- if (check7) {
- if (object->prototype_flags & SWFDEC_AS_VARIABLE_VERSION_8_UP && version == 7)
- return NULL;
- }
+ // check that it exists, if version < 7
+ if (version < 7 &&
+ !swfdec_as_object_hash_lookup (object, SWFDEC_AS_STR___proto__))
+ return NULL;
+
+ return object->prototype;
+}
+
+/*
+ * Get's the object->prototype, if propflags allow it for current version and
+ * if it hasn't been deleted from the object already
+ */
+SwfdecAsObject *
+swfdec_as_object_get_prototype (Swf...
2007 Sep 11
0
8 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c test/trace
...gs[1] = var->value;
+ args[2] = *val;
+ args[3] = watch->watch_data;
+ swfdec_as_watch_ref (watch);
+ swfdec_as_function_call (watch->watch, object, 4, args, &ret);
+ swfdec_as_context_run (object->context);
+ swfdec_as_watch_unref (watch);
+ var = swfdec_as_object_hash_lookup (object, variable);
+ if (var == NULL)
+ return;
+ }
+
+ var->value = ret;
+ }
if (var->get) {
if (var->set) {
SwfdecAsValue tmp;
swfdec_as_function_call (var->set, object, 1, val, &tmp);
swfdec_as_context_run (object->context);
}
-...
2007 Aug 15
0
4 commits - 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_net_stream.c libswfdec/swfdec_sprite_movie.c test/trace
...Ob
}
static gboolean
-swfdec_as_object_do_get (SwfdecAsObject *object, const char *variable,
- SwfdecAsValue *val, guint *flags)
+swfdec_as_object_do_get (SwfdecAsObject *object, SwfdecAsObject *orig,
+ const char *variable, SwfdecAsValue *val, guint *flags)
{
SwfdecAsVariable *var = swfdec_as_object_hash_lookup (object, variable);
@@ -184,7 +184,7 @@ swfdec_as_object_do_get (SwfdecAsObject
return FALSE;
if (var->get) {
- swfdec_as_function_call (var->get, object, 0, NULL, val);
+ swfdec_as_function_call (var->get, orig, 0, NULL, val);
swfdec_as_context_run (object->cont...
2007 Sep 03
0
20 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_number.c
...__proto__
Testcase will follow
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 8432c7a..6b496cf 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -234,7 +234,7 @@ swfdec_as_object_do_set (SwfdecAsObject
return;
var = swfdec_as_object_hash_lookup (object, variable);
- if (var == NULL) {
+ if (var == NULL && variable != SWFDEC_AS_STR___proto__) {
guint i;
SwfdecAsObject *proto = object->prototype;
diff-tree 2f139f8cd0d896d44cea0d9a0d7f5c6a435dd37f (from 1ed4ec72029a99387527033479df01a2527a09b5)
Author: Benjamin Otte...
2007 Jul 26
0
17 commits - doc/swfdec-sections.txt libswfdec/compiler.c libswfdec/.gitignore libswfdec/Makefile.am libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
...t_ASSetPropFlags_foreach, flags);
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 28a6f98..7a21a48 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -159,18 +159,25 @@ swfdec_as_object_do_get (SwfdecAsObject
{
SwfdecAsVariable *var = swfdec_as_object_hash_lookup (object, variable);
- if (var) {
- if (var->get) {
- swfdec_as_function_call (var->get, object, 0, NULL, val);
- swfdec_as_context_run (object->context);
- *flags = var->flags;
- } else {
- *val = var->value;
- *flags = var->flags;
- }
- ret...
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
..., flags);
// if we added new value outside the current length, set a bigger length
if (indexvar) {
diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 2150244..811be98 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -157,7 +157,7 @@ swfdec_as_object_hash_lookup (SwfdecAsOb
}
static inline SwfdecAsVariable *
-swfdec_as_object_hash_create (SwfdecAsObject *object, const char *variable)
+swfdec_as_object_hash_create (SwfdecAsObject *object, const char *variable, guint flags)
{
SwfdecAsVariable *var;
@@ -166,6 +166,7 @@ swfdec_as_object_hash_create (...
2007 Nov 26
0
14 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_file_reference.c libswfdec/swfdec_load_object.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_system_security.c test/trace
...8_UP && object->context->version < 8)
+ if (!swfdec_as_object_variable_enabled_in_version (var,
+ object->context->version))
return FALSE;
if (var->get) {
@@ -355,32 +366,40 @@ swfdec_as_object_get_prototype (SwfdecAsObject *object)
static SwfdecAsVariable *
swfdec_as_object_hash_lookup_with_prototype (SwfdecAsObject *object,
- const char *variable)
+ const char *variable, SwfdecAsObject **proto)
{
SwfdecAsVariable *var;
+ SwfdecAsObject *proto_;
g_return_val_if_fail (swfdec_as_variable_name_is_valid (variable), NULL);
+ proto_ = NULL;
+
+ // match first level...
2007 Nov 28
0
59 commits - libswfdec-gtk/swfdec_gtk_widget.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_button.c libswfdec/swfdec_button.h libswfdec/swfdec_button_movie.c libswfdec/swfdec_button_movie.h libswfdec/swfdec_event.c
...+swfdec_as_object_has_variable (SwfdecAsObject *object, const char *variable)
+{
+ guint i;
+ SwfdecAsVariable *var;
+
+ g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), FALSE);
+
+ for (i = 0; i <= SWFDEC_AS_OBJECT_PROTOTYPE_RECURSION_LIMIT && object != NULL; i++) {
+ var = swfdec_as_object_hash_lookup (object, variable);
+ if (var) {
+ /* FIXME: propflags? */
+ return TRUE;
+ }
+ object = swfdec_as_object_get_prototype_internal (object);
+ }
+ return FALSE;
+}
+
+/**
* swfdec_as_object_delete_variable:
* @object: a #SwfdecAsObject
* @variable: garbage-collected name of...
2008 Jan 01
0
4 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_sprite_movie_as.c test/trace
...le()
+ * and does not verify visibility flags.</para></warning>
+ *
+ * Returns: a pointer to the queried variable or %NULL if it doesn't exist
+ **/
+SwfdecAsValue *
+swfdec_as_object_peek_variable (SwfdecAsObject *object, const char *name)
+{
+ SwfdecAsVariable *var;
+
+ var = swfdec_as_object_hash_lookup (object, name);
+ if (var == NULL ||
+ var->get != NULL)
+ return NULL;
+
+ return &var->value;
+}
+
+/**
* swfdec_as_object_get_variable:
* @object: a #SwfdecAsObject
* @variable: a garbage-collected string containing the name of the variable
commit bec4b3bd601fbccb6c247a...