search for: swfdecasvari

Displaying 20 results from an estimated 26 matches for "swfdecasvari".

Did you mean: swfdecasval
2007 Sep 10
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...t;otte at gnome.org> Date: Mon Sep 10 22:00:48 2007 +0200 rewrite (un)watch functions diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index 1fbf1d0..a331030 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -113,11 +113,14 @@ struct _SwfdecAsVariable { SwfdecAsValue value; /* value of property */ SwfdecAsFunction * get; /* getter set with swfdec_as_object_add_property */ SwfdecAsFunction * set; /* setter or %NULL */ - SwfdecAsFunction * watch; /* watcher or %NULL */ - SwfdecAsValue * watch_data; /* user data to watcher *...
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
...ength, 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 (SwfdecAsOb if (!swfdec_as_variable_name_is...
2007 Aug 15
3
2 commits - libswfdec/swfdec_as_object.c test/trace
...ec/swfdec_as_object.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) +{ + SwfdecAsVariab...
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
...nclude "swfdec_as_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,...
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
...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; @@ -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 NU...
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
.... The property is native, so + * the value is not managed by the script engine, but the @set and @get + * function are used to access the value. The variable will not be enumerated + * and cannot be deleted. + **/ +void +swfdec_as_object_add_variable (SwfdecAsObject *object, const char *name, + SwfdecAsVariableSetter set, SwfdecAsVariableGetter get) +{ + SwfdecAsVariable *var; + SwfdecAsValue variable; + + g_return_if_fail (SWFDEC_IS_AS_OBJECT (object)); + g_return_if_fail (name != NULL); + g_return_if_fail (get != NULL); + + name = swfdec_as_context_get_string (object->context, name); + SWF...
2007 Jul 26
0
5 commits - doc/Makefile.am doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_player_as.c
...per.h \ swfdec_as_with.h \ + swfdec_asnative.h \ swfdec_audio_internal.h \ swfdec_audio_event.h \ swfdec_audio_flv.h \ diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt index 9c9eb75..3048a95 100644 --- a/doc/swfdec-sections.txt +++ b/doc/swfdec-sections.txt @@ -266,6 +266,7 @@ SwfdecAsVariableFlag swfdec_as_object_get_variable swfdec_as_object_get_variable_and_flags swfdec_as_object_set_variable +swfdec_as_object_add_variable swfdec_as_object_set_variable_flags swfdec_as_object_unset_variable_flags swfdec_as_object_delete_variable diff-tree 79a46534730bb6e1d19ce2ba5f54a43acdb8a...
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
...ct_hash_create (SwfdecAsOb } 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);...
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
...as_object.c +++ b/libswfdec/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...
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
...Apr 12 19:15:17 2007 +0200 That return_if_fail was wrong diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index a064716..ff9abbd 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -310,7 +310,7 @@ swfdec_as_object_set_variable_flags (Swf SwfdecAsVariable *var; g_return_if_fail (SWFDEC_IS_AS_OBJECT (object)); - g_return_if_fail ((flags & SWFDEC_AS_VARIABLE_NATIVE) != 0); + g_return_if_fail ((flags & SWFDEC_AS_VARIABLE_NATIVE) == 0); var = swfdec_as_object_lookup (object, variable, FALSE); g_return_if_fail (var != NULL); @@...
2007 Nov 14
0
2 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c libswfdec/swfdec_initialize.as
..._isPropertyEnumerable (SwfdecAsContext *cx, SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE); + if (object == NULL) + return; + // return false even if no params if (argc < 1) return; @@ -1546,6 +1552,9 @@ swfdec_as_object_unwatch (SwfdecAsContext *cx, SwfdecAsObject *object, SwfdecAsVariable *var; const char *name; + if (object == NULL) + return; + SWFDEC_AS_VALUE_SET_BOOLEAN (retval, FALSE); if (argc < 1) @@ -1574,7 +1583,8 @@ void swfdec_as_object_valueOf (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval...
2007 Jul 13
0
12 commits - AUTHORS doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_array.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h
...ct; }; diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index 4193fdf..1284bea 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -76,6 +76,19 @@ * Swfdec. You can manually set them with swfdec_as_object_set_variable_flags(). */ +/** + * SwfdecAsVariableForeach: + * @object: The object this function is run on + * @variable: garbage-collected name of the current variables + * @value: value of the current variable + * @flags: Flags associated with the current variable + * @data: User dta passed to swfdec_as_object_foreach() + * + * Function proto...
2007 Aug 20
0
15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_with.c
...le was deleted. + * @SWFDEC_AS_DELETE_NOT_DELETED: The variable was found but could not be + * deleted. + * + * This is the return value used by swfdec_as_object_delete_variable(). It + * describes the various outcomes of trying to delete a variable. + */ + +/** * SwfdecAsVariableForeach: * @object: The object this function is run on * @variable: garbage-collected name of the current variables @@ -266,22 +278,22 @@ swfdec_as_object_free_property (gpointer g_slice_free (SwfdecAsVariable, value); } -static gboolean +static SwfdecAsDeleteReturn swfdec_as_object_d...
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
...h (obj, swfdec_as_context_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; -...
2008 Jun 02
4
[Bug 16206] New: Charts in Yahoo Finance crash swfdec
http://bugs.freedesktop.org/show_bug.cgi?id=16206 Summary: Charts in Yahoo Finance crash swfdec Product: swfdec Version: git Platform: Other URL: http://finance.yahoo.com/echarts?s=%5EDJI#symbol=%5EDJI; range=1d OS/Version: All Status: NEW Severity: critical Priority: medium
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
...ct_hash_create (SwfdecAsOb } 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);...
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
...le was deleted. + * @SWFDEC_AS_DELETE_NOT_DELETED: The variable was found but could not be + * deleted. + * + * This is the return value used by swfdec_as_object_delete_variable(). It + * describes the various outcomes of trying to delete a variable. + */ + +/** * SwfdecAsVariableForeach: * @object: The object this function is run on * @variable: garbage-collected name of the current variables @@ -266,22 +278,22 @@ swfdec_as_object_free_property (gpointer g_slice_free (SwfdecAsVariable, value); } -static gboolean +static SwfdecAsDeleteReturn swfdec_as_object_d...
2007 Jul 18
0
12 commits - configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_playback_alsa.c libswfdec/jpeg libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c
...;bits, buffer); if (*function_name) { diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index 7e049d1..989c30b 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -180,7 +180,8 @@ swfdec_as_object_do_set (SwfdecAsObject var = g_slice_new0 (SwfdecAsVariable); g_hash_table_insert (object->properties, (gpointer) variable, var); } - var->value = *val; + if (!(var->flags & SWFDEC_AS_VARIABLE_READONLY)) + var->value = *val; } static void @@ -959,17 +960,6 @@ swfdec_as_object_init_context (SwfdecAsC SWFDEC_TYPE_AS...
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
...riable (cx->frame, name); } static void diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index 567ff16..ce48065 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -142,17 +142,22 @@ swfdec_as_object_free_property (gpointer g_slice_free (SwfdecAsVariable, value); } -static void +static gboolean swfdec_as_object_do_delete (SwfdecAsObject *object, const char *variable) { SwfdecAsVariable *var; var = g_hash_table_lookup (object->properties, variable); - g_assert (var); + if (var == NULL) + return FALSE; + if (var->flags &a...
2007 Jul 12
0
15 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt INSTALL libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.h
...e <otte at gnome.org> Date: Thu Jul 12 21:15:26 2007 +0200 add comments diff --git a/libswfdec/swfdec_as_object.h b/libswfdec/swfdec_as_object.h index ef818fb..0236bf5 100644 --- a/libswfdec/swfdec_as_object.h +++ b/libswfdec/swfdec_as_object.h @@ -55,7 +55,9 @@ typedef const char *(* SwfdecAsVariableF struct _SwfdecAsObject { GObject object; - SwfdecAsContext * context; /* context used */ + /*< protected >*/ + SwfdecAsContext * context; /* context the object belongs to */ + /*< private >*/ SwfdecAsObject * prototype; /* prototype object (referred to as __proto__) *...