search for: swfdecaso

Displaying 20 results from an estimated 23 matches for "swfdecaso".

Did you mean: swfdecasc
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...: Sun Apr 15 17:12:49 2007 +0200 add support for native properties diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index 9a90393..afd0a18 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -240,8 +240,12 @@ swfdec_as_object_set_variable (SwfdecAsO if (var == NULL || var->flags & SWFDEC_AS_VARIABLE_READONLY) return; - g_assert ((var->flags & SWFDEC_AS_VARIABLE_NATIVE) == 0); - var->value.value = *value; + if ((var->flags & SWFDEC_AS_VARIABLE_NATIVE)) { + g_return_if_fail (var->value.funcs.set !=...
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
...c_as_string.h \ swfdec_as_strings.h \ diff --git a/doc/swfdec-docs.sgml b/doc/swfdec-docs.sgml index 2c7787f..553dfb1 100644 --- a/doc/swfdec-docs.sgml +++ b/doc/swfdec-docs.sgml @@ -27,5 +27,6 @@ <xi:include href="xml/SwfdecAsContext.xml"/> <xi:include href="xml/SwfdecAsObject.xml"/> <xi:include href="xml/SwfdecAsArray.xml"/> + <xi:include href="xml/SwfdecAsFunction.xml"/> </chapter> </book> diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt index fd2f296..7773b37 100644 --- a/doc/swfdec-sec...
2007 Jun 12
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c
...ype (). diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c index e2071b6..b72e43b 100644 --- a/libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -160,9 +160,9 @@ swfdec_as_array_append (SwfdecAsArray *a /*** AS CODE ***/ static void -swfdec_as_array_toString (SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +swfdec_as_array_toString (SwfdecAsContext *cx, SwfdecAsObject *object, + guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { - SwfdecAsContext *cx = object->context; int i, length; const char *s, *str; SwfdecAs...
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
....org> Date: Thu May 24 19:05:05 2007 +0200 really delete a variable diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index bee692a..451d5bc 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -150,6 +150,9 @@ swfdec_as_object_do_delete (SwfdecAsObje var = g_hash_table_lookup (object->properties, variable); g_assert (var); swfdec_as_object_free_property (NULL, var, object); + if (!g_hash_table_remove (object->properties, variable)) { + g_assert_not_reached (); + } } typedef struct { diff-tree 8e153b97a76a8fa425210bf62...
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
...libswfdec/swfdec_video_movie.c | 2 - 9 files changed, 50 insertions(+), 51 deletions(-) New commits: diff-tree 4e35fceb28469c2bc9ee49c9ec71573d6df8861e (from cb77cc43c823c4f3260d6341cf5ed04b65783deb) Author: Benjamin Otte <otte at gnome.org> Date: Sun Aug 19 20:16:59 2007 +0200 SwfdecAsObject->set() now takes a default_flags parameter This parameter is used to set the default set of flags, when a variable is newly created. Now we don't have the need to call set_flags() after every init function diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_...
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
...c_as_object.c b/libswfdec/swfdec_as_object.c index 46c590d..a5e4b08 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -942,7 +942,8 @@ swfdec_as_object_create (SwfdecAsFunctio * object.__proto__ = construct.prototype; ]| **/ void -swfdec_as_object_set_constructor (SwfdecAsObject *object, SwfdecAsObject *construct, gboolean scripted) +swfdec_as_object_set_constructor (SwfdecAsObject *object, + SwfdecAsObject *construct, gboolean scripted) { SwfdecAsValue val; SwfdecAsObject *proto; @@ -950,7 +951,8 @@ swfdec_as_object_set_constructor (Swfdec g_return_if_fa...
2007 Aug 17
1
libswfdec/swfdec_as_object.c
libswfdec/swfdec_as_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: diff-tree af55385468269795f5f4d14cb8746dfd3d7be245 (from 616cfc32ab9acfa67d4d3c9c963ae76d29ac5835) Author: Benjamin Otte <otte at gnome.org> Date: Fri Aug 17 23:38:48 2007 +0200 fix docs diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index a5e4b08..8d4df41
2007 Jul 11
0
Branch 'as' - libswfdec/swfdec_as_object.c
...include "swfdec_as_frame.h" #include "swfdec_as_native_function.h" +#include "swfdec_as_stack.h" #include "swfdec_as_strings.h" #include "swfdec_as_super.h" #include "swfdec_debug.h" @@ -557,18 +558,21 @@ swfdec_as_object_add_function (SwfdecAsO void swfdec_as_object_run (SwfdecAsObject *object, SwfdecScript *script) { + SwfdecAsContext *context; SwfdecAsFrame *frame; g_return_if_fail (SWFDEC_IS_AS_OBJECT (object)); g_return_if_fail (SWFDEC_AS_OBJECT_HAS_CONTEXT (object)); g_return_if_fail (script != NULL); - frame = s...
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
...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_variable (constructor, SWFDEC_AS_STR___constructor__, &val); + SwfdecAsObject *proto = SWFDEC_AS_VALUE_GET_OBJECT (&val); + swfdec_as_object_get_variable (proto, SWFDEC_AS_STR___constructor__, &...
2007 Mar 28
0
Branch 'as' - 3 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...+ SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object); + + g_slice_free1 (sizeof (SwfdecAsValue) * frame->n_registers, frame->registers); + swfdec_script_unref (frame->script); + + G_OBJECT_CLASS (swfdec_as_frame_parent_class)->dispose (object); +} + +static void +swfdec_as_frame_mark (SwfdecAsObject *object) +{ + SwfdecAsFrame *frame = SWFDEC_AS_FRAME (object); + guint i; + + swfdec_as_object_mark (SWFDEC_AS_OBJECT (frame->next)); + swfdec_as_object_mark (frame->scope); + swfdec_as_object_mark (frame->var_object); + for (i = 0; i < frame->n_registers; i++) { + swfd...
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
...; - - if (function->script) { - swfdec_script_unref (function->script); - function->script = NULL; - } - g_free (function->name); - function->name = NULL; - - G_OBJECT_CLASS (swfdec_as_function_parent_class)->dispose (object); -} - -static void -swfdec_as_function_mark (SwfdecAsObject *object) -{ - SwfdecAsFunction *function = SWFDEC_AS_FUNCTION (object); - - if (function->scope) - swfdec_as_object_mark (SWFDEC_AS_OBJECT (function->scope)); - - SWFDEC_AS_OBJECT_CLASS (swfdec_as_function_parent_class)->mark (object); -} +G_DEFINE_ABSTRACT_TYPE (SwfdecAsFunctio...
2007 Sep 10
0
3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...mes the watch function has been called without returning */ }; +typedef struct { + SwfdecAsFunction * watch; /* watcher or %NULL */ + SwfdecAsValue watch_data; /* user data to watcher */ + guint refcount; /* refcount - misused for recursion detection */ +} SwfdecAsWatch; + G_DEFINE_TYPE (SwfdecAsObject, swfdec_as_object, G_TYPE_OBJECT) static void @@ -141,22 +144,28 @@ swfdec_as_object_mark_property (gpointer if (var->set) swfdec_as_object_mark (SWFDEC_AS_OBJECT (var->set)); } else { - if (var->watch) { - swfdec_as_object_mark (SWFDEC_AS_OBJECT (var->wat...
2007 Aug 17
0
Branch 'vivi' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_debugger.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_script_function.c test/trace vivified/core vivified/ui
...8..15cfc26 100644 --- a/vivified/core/vivi_breakpoint.c +++ b/vivified/core/vivi_breakpoint.c @@ -63,6 +63,21 @@ vivi_breakpoint_finish_frame (ViviDebugg return swfdec_as_value_to_boolean (obj->context, &retval); } +static gboolean +vivi_breakpoint_set_variable (ViviDebugger *debugger, SwfdecAsObject *object, + const char *variable, const SwfdecAsValue *value, ViviBreakpoint *breakpoint) +{ + SwfdecAsObject *obj = SWFDEC_AS_OBJECT (breakpoint); + SwfdecAsValue vals[3]; + SwfdecAsValue retval; + + SWFDEC_AS_VALUE_SET_OBJECT (&vals[0], vivi_wrap_object (VIVI_APPLICATION (obj->...
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
.../swfdec_as_string.c @@ -57,6 +57,62 @@ swfdec_as_string_init (SwfdecAsString *s /*** AS CODE ***/ +static inline const char * +swfdec_as_str_nth_char (const char *s, guint n) +{ + while (*s && n--) + s = g_utf8_next_char (s); + return s; +} + +static void +swfdec_as_string_charAt (SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) +{ + SwfdecAsString *string = SWFDEC_AS_STRING (object); + int i; + const char *s, *t; + + i = swfdec_as_value_to_integer (object->context, &argv[0]); + if (i < 0) { + SWFDEC_AS_VALUE_SET_STRING (ret, SWFDEC_AS_STR...
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
...31 2007 +0200 porperties added with addProperty aren't permanent. diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index 8999597..b5dcd25 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -991,7 +991,7 @@ swfdec_as_object_add_variable (SwfdecAsO return; var->get = get; var->set = set; - var->flags = SWFDEC_AS_VARIABLE_PERMANENT; + var->flags = 0; if (set == NULL) var->flags |= SWFDEC_AS_VARIABLE_READONLY; } diff-tree b9d80cd0852b204c03e5828bfb4210e3ed98a2a4 (from c94ea432d4a4a30c76cd89d701d8cb9395347647...
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
...t; +#include "vivi_application.h" +#include "vivi_function.h" +#include "vivi_wrap.h" + +G_DEFINE_TYPE (ViviBreakpoint, vivi_breakpoint, SWFDEC_TYPE_AS_OBJECT) + +static gboolean +vivi_breakpoint_step (ViviDebugger *debugger, ViviBreakpoint *breakpoint) +{ + SwfdecAsObject *obj = SWFDEC_AS_OBJECT (breakpoint); + SwfdecAsValue retval; + + swfdec_as_object_call (obj, swfdec_as_context_get_string (obj->context, "onCommand"), 0, NULL, &retval); + return swfdec_as_value_to_boolean (obj->context, &retval); +} + +static gboolean +vivi...
2007 Aug 15
3
2 commits - libswfdec/swfdec_as_object.c test/trace
...ject.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_use_mem (o...
2007 Jul 07
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h libswfdec/swfdec_as_with.c test/trace
...ext *cx /* stack looks like this: [ function, this, arg1, arg2, ... ] */ /* stack must be at least 2 elements big */ static gboolean -swfdec_action_call (SwfdecAsContext *cx, guint n_args, gboolean use_super) +swfdec_action_call (SwfdecAsContext *cx, guint n_args) { SwfdecAsFunction *fun; SwfdecAsObject *thisp; @@ -592,11 +592,9 @@ swfdec_action_call (SwfdecAsContext *cx, swfdec_as_stack_pop_n (frame->stack, n_args); swfdec_as_function_call (fun, thisp, n_args, swfdec_as_stack_peek (frame->stack, 0), swfdec_as_stack_peek (frame->stack, 1)); - if (use_super) { - if...
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
...f --git a/libswfdec/swfdec_as_frame.h b/libswfdec/swfdec_as_frame.h index c0c2d71..c2423e3 100644 --- a/libswfdec/swfdec_as_frame.h +++ b/libswfdec/swfdec_as_frame.h @@ -42,11 +42,11 @@ struct _SwfdecAsFrame { SwfdecAsFunction * function; /* function we're executing or NULL if toplevel */ SwfdecAsObject * thisp; /* this object in current frame or NULL if none */ gboolean construct; /* TRUE if this is the constructor for thisp */ - /* debugging */ - char * function_name; /* name of function */ SwfdecAsValue * return_value; /* pointer to where to store the return value */ guint...
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
...+0200 walk the inheritance chain to find an objects type diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index b5dcd25..803d82f 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -883,6 +883,7 @@ swfdec_as_object_create (SwfdecAsFunctio SwfdecAsObject *new; SwfdecAsContext *context; SwfdecAsFunction *cur; + SwfdecAsValue val; guint size; GType type = 0; @@ -890,29 +891,30 @@ swfdec_as_object_create (SwfdecAsFunctio context = SWFDEC_AS_OBJECT (fun)->context; cur = fun; - while (type == 0 && cur != NULL) { +...