Displaying 20 results from an estimated 61 matches for "swfdec_as_object_add_funct".
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
...to__, &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_constructor, &val);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_toString, 0,
diff --git a/libswfdec/swfdec_as_boolean.c b/libswfdec/swfdec_as_boolean.c
index 907960a..18872cb 100644
--- a/libswfdec/swfdec_as_boolean.c
+++ b/libswfdec/swfdec_as_boolean.c
@@ -103,7 +103,8 @@ swfdec_as_boolean_init_context (SwfdecAs
swfdec_as_object_set...
2007 Aug 24
0
7 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_string.c test/trace
...g (cx, s));
g_free (s);
}
@@ -748,21 +771,17 @@ swfdec_as_string_init_context (SwfdecAsC
SWFDEC_AS_VALUE_SET_OBJECT (&val, string);
swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
&val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1);
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1);
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_lastIndexOf, SWFDEC_TYPE_AS_STRING, swfdec...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
...ject,
+ SWFDEC_AS_VALUE_GET_OBJECT (&val), FALSE);
} else {
SWFDEC_INFO ("\"Array\" is not an object");
}
@@ -994,10 +1078,10 @@ swfdec_as_array_init_context (SwfdecAsCo
g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
- array = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
+ array = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
SWFDEC_AS_STR_Array, 0, swfdec_as_array_construct, 0));
- swfdec_as_native_function_set_construct_type (SWFDEC_AS_NATIVE_FUNCTION (array),
- SWFDEC_TYPE_AS_ARRAY);
+ swfdec_as_nati...
2007 Jun 10
0
Branch 'as' - 5 commits - libswfdec/swfdec_mouse_as.c libswfdec/swfdec_movie_asprops.c test/trace
...b6c9d 100644
--- a/libswfdec/swfdec_mouse_as.c
+++ b/libswfdec/swfdec_mouse_as.c
@@ -76,8 +76,10 @@ swfdec_mouse_init_context (SwfdecPlayer
SWFDEC_AS_VALUE_SET_OBJECT (&val, mouse);
swfdec_as_object_set_variable (SWFDEC_AS_CONTEXT (player)->global, SWFDEC_AS_STR_Mouse, &val);
- swfdec_as_object_add_function (mouse, SWFDEC_AS_STR_addListener, 0, swfdec_mouse_addListener, 1);
- swfdec_as_object_add_function (mouse, SWFDEC_AS_STR_removeListener, 0, swfdec_mouse_removeListener, 1);
+ if (version > 5) {
+ swfdec_as_object_add_function (mouse, SWFDEC_AS_STR_addListener, 0, swfdec_mouse_addListene...
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
...is ran before swfdec_as_context_startup
+void
+swfdec_player_preinit_global (SwfdecPlayer *player, guint version)
+{
+ SwfdecAsContext *context = SWFDEC_AS_CONTEXT (player);
+
+ // init these two before swfdec_as_context_startup, so they won't get
+ // __proto__ and constructor properties
+ swfdec_as_object_add_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);
+}
+
void
swfdec_player_init_global (SwfdecPlayer *player, guint version)
{
- Swfd...
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
...ject,
+ SWFDEC_AS_VALUE_GET_OBJECT (&val), FALSE);
} else {
SWFDEC_INFO ("\"Array\" is not an object");
}
@@ -994,10 +1078,10 @@ swfdec_as_array_init_context (SwfdecAsCo
g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
- array = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
+ array = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
SWFDEC_AS_STR_Array, 0, swfdec_as_array_construct, 0));
- swfdec_as_native_function_set_construct_type (SWFDEC_AS_NATIVE_FUNCTION (array),
- SWFDEC_TYPE_AS_ARRAY);
+ swfdec_as_nati...
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
...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, &val);
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_attachMovie, SWFDEC_TYPE_VIDEO_MOVIE,
+ swfdec_as_object_add_function (proto, SWFDEC_AS_STR_attachVideo, SWFDEC_TYPE_VIDEO_MOVIE,
swfdec_video_attach_video, 1);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_clear, SWFDEC_TYPE_VIDEO_MOVIE,
swfdec_vide...
2007 Jun 28
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_as_strings.c test/trace
...(SwfdecAsContext *cx, SwfdecAsObject *object,
guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret)
{
@@ -671,6 +695,7 @@ swfdec_as_string_init_context (SwfdecAsC
SWFDEC_AS_VALUE_SET_OBJECT (&val, string);
swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charAt, SWFDEC_TYPE_AS_STRING, swfdec_as_string_charAt, 1);
+ swfdec_as_object_add_function (proto, SWFDEC_AS_STR_indexOf, SWFDEC_TYPE_AS_STRING, swfdec_as_string_indexOf, 1);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_charCodeAt, SWFDEC_TYPE_AS_STRING, swfdec_...
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
...pe object */
SWFDEC_AS_VALUE_SET_OBJECT (&val, boolean);
- swfdec_as_object_set_variable (proto, SWFDEC_AS_STR_constructor, &val);
+ swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
+ &val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_toString, SWFDEC_TYPE_AS_BOOLEAN, swfdec_as_boolean_toString, 0);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_valueOf, SWFDEC_TYPE_AS_BOOLEAN, swfdec_as_boolean_valueOf, 0);
SWFDEC_AS_VALUE_SET_OBJECT (&val, context->Object_prototype);
diff --git a/libs...
2007 Jun 15
0
Branch 'as' - 2 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_sprite_movie_as.c test/trace
...e);
+ SWFDEC_AS_VALUE_SET_OBJECT (rval, SWFDEC_AS_OBJECT (movie));
+}
+
+static void
swfdec_sprite_movie_copy_props (SwfdecMovie *target, SwfdecMovie *src)
{
target->matrix = src->matrix;
@@ -421,6 +439,10 @@ swfdec_sprite_movie_init_context (Swfdec
/* now add all the functions */
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_attachMovie, SWFDEC_TYPE_SPRITE_MOVIE,
swfdec_sprite_movie_attachMovie, 3);
+ if (version >= 6) {
+ swfdec_as_object_add_function (proto, SWFDEC_AS_STR_createEmptyMovieClip, SWFDEC_TYPE_SPRITE_MOVIE,
+ swfdec_sprite_movie_createEmptyMovieClip, 2);
+ }
swfd...
2007 Aug 08
0
6 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_loader_internal.h libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_net_stream.c
...E);
+}
+
+static void
swfdec_net_stream_play (SwfdecAsContext *cx, SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
{
SwfdecNetStream *stream = SWFDEC_NET_STREAM (obj);
@@ -119,6 +128,8 @@ swfdec_net_stream_init_context (SwfdecPl
swfdec_net_stream_pause, 0);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_play, SWFDEC_TYPE_NET_STREAM,
swfdec_net_stream_play, 1);
+ swfdec_as_object_add_function (proto, SWFDEC_AS_STR_close, SWFDEC_TYPE_NET_STREAM,
+ swfdec_net_stream_close, 0);
swfdec_as_object_add_function (proto, SWFDEC_AS_STR_seek, SWFDEC_TYPE_NET_STREAM,...
2007 Aug 31
0
4 commits - libswfdec/swfdec_as_number.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player_as.c test/trace
...wfdec_player_as.c
+++ b/libswfdec/swfdec_player_as.c
@@ -260,6 +260,8 @@ swfdec_player_object_registerClass (Swfd
void
swfdec_player_init_global (SwfdecPlayer *player, guint version)
{
+ SwfdecAsValue val;
+ SwfdecAsObject *object;
SwfdecAsContext *context = SWFDEC_AS_CONTEXT (player);
swfdec_as_object_add_function (context->Object, SWFDEC_AS_STR_registerClass,
@@ -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 __pr...
2007 Jun 21
0
Branch 'as' - 5 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_movie.c libswfdec/swfdec_net_connection.c libswfdec/swfdec_net_stream_as.c libswfdec/swfdec_net_stream.c
...swfdec_net_connection.c b/libswfdec/swfdec_net_connection.c
index 47c9d0d..d6df7d1 100644
--- a/libswfdec/swfdec_net_connection.c
+++ b/libswfdec/swfdec_net_connection.c
@@ -139,9 +139,9 @@ swfdec_net_connection_init_context (Swfd
context = SWFDEC_AS_CONTEXT (player);
conn = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
SWFDEC_AS_STR_NetConnection, SWFDEC_TYPE_NET_CONNECTION, NULL, 0));
- swfdec_as_native_function_set_construct_type (SWFDEC_AS_NATIVE_FUNCTION (conn), SWFDEC_TYPE_NET_CONNECTION);
if (!conn)
return;
+ swfdec_as_native_function_set_construct_type (SWFDEC_AS_N...
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
...,
- &video_class, swfdec_js_video_new, 0, NULL, video_methods,
- NULL, NULL);
+ SwfdecAsContext *context;
+ SwfdecAsObject *video, *proto;
+ SwfdecAsValue val;
+
+ g_return_if_fail (SWFDEC_IS_PLAYER (player));
+
+ context = SWFDEC_AS_CONTEXT (player);
+ video = 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...
2007 May 29
0
Branch 'as' - 8 commits - libswfdec/Makefile.am libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_math.h libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c
...SWFDEC_IS_AS_CONTEXT (context));
+
+ math = swfdec_as_object_new (context);
+ if (math == NULL)
+ return;
+ SWFDEC_AS_VALUE_SET_OBJECT (&val, math);
+ swfdec_as_object_set_variable (context->global, SWFDEC_AS_STR_Math, &val);
+ /* set the right properties on the Math object */
+ swfdec_as_object_add_function (math, SWFDEC_AS_STR_ceil, 0, swfdec_as_math_ceil, 1);
+}
+
diff --git a/libswfdec/swfdec_as_math.h b/libswfdec/swfdec_as_math.h
new file mode 100644
index 0000000..80b1452
--- /dev/null
+++ b/libswfdec/swfdec_as_math.h
@@ -0,0 +1,33 @@
+/* Swfdec
+ * Copyright (C) 2007 Benjamin Otte <otte at...
2007 Sep 12
0
9 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 libswfdec/swfdec_player_as.c test/trace
...-250,11 +252,6 @@ swfdec_as_function_init_context (SwfdecA
SWFDEC_AS_VALUE_SET_OBJECT (&val, function);
swfdec_as_object_set_variable_and_flags (proto, SWFDEC_AS_STR_constructor,
&val, SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
- /* prototype functions */
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_call,
- SWFDEC_TYPE_AS_FUNCTION, swfdec_as_function_do_call, 0);
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_apply,
- SWFDEC_TYPE_AS_FUNCTION, swfdec_as_function_apply, 0);
}
}
diff --git a/libswfdec/swfdec_as_initialize.as b/libswfdec/swfdec_as_initializ...
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
...12 15:29:47 2007 +0200
make native functions take the context as first argument
This is necessary, because passing NULL as this is possible, think
parseInt.call (null, "123");
If you need a this object, make sure to define the required type of
the this object in swfdec_as_object_add_function () or via
swfdec_as_native_function_set_object_type ().
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
/***...
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_MOVIE (object);
+ }
+ SWFDEC_AS_VALUE_SET_OBJECT (rval, obj);
+}
+
+void
+swfdec_movie_color_init_context (SwfdecAsContext *context, guint version)
+{
+ SwfdecAsObject *color, *proto;
+ SwfdecAsValue val;
+
+ g_return_if_fail (SWFDEC_IS_AS_CONTEXT (context));
+
+ color = SWFDEC_AS_OBJECT (swfdec_as_object_add_function (context->global,
+ SWFDEC_AS_STR_Color, SWFDEC_TYPE_MOVIE_COLOR, swfdec_movie_color_construct, 0));
+ if (!color)
+ return;
+ if (!swfdec_as_context_use_mem (context, sizeof (SwfdecMovieColor)))
+ return;
+ proto = g_object_new (SWFDEC_TYPE_MOVIE_COLOR, NULL);
+ swfdec_as_obj...
2007 Sep 04
0
4 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_video_movie_as.c test/trace
...ec_video_movie_as.c
@@ -74,10 +74,12 @@ swfdec_video_movie_init_context (SwfdecP
swfdec_as_object_set_variable_and_flags (video, SWFDEC_AS_STR_prototype, &val,
SWFDEC_AS_VARIABLE_HIDDEN | SWFDEC_AS_VARIABLE_PERMANENT);
/* set the right properties on the Video.prototype object */
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_attachVideo, SWFDEC_TYPE_VIDEO_MOVIE,
- swfdec_video_attach_video, 1);
- swfdec_as_object_add_function (proto, SWFDEC_AS_STR_clear, SWFDEC_TYPE_VIDEO_MOVIE,
- swfdec_video_clear, 0);
+ if (context->version >= 6) {
+ swfdec_as_object_add_function (proto,...
2007 Jun 01
0
Branch 'as' - 2 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_interval.c libswfdec/swfdec_interval.h libswfdec/swfdec_player_as.c libswfdec/swfdec_player.c
...SwfdecAsObject *obj, uintN argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
+swfdec_js_stopAllSounds (SwfdecAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval)
{
SwfdecPlayer *player = JS_GetContextPrivate (cx);
@@ -263,5 +175,9 @@ swfdec_player_init_global (SwfdecPlayer
swfdec_as_object_add_function (context->Object, SWFDEC_AS_STR_registerClass,
0, swfdec_player_object_registerClass, 2);
+ swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_setInterval,
+ 0, swfdec_player_setInterval, 2);
+ swfdec_as_object_add_function (context->global, SWFDEC_AS_STR_clea...