search for: jsclass

Displaying 20 results from an estimated 25 matches for "jsclass".

Did you mean: sclass
2007 Mar 01
0
7 commits - libswfdec/swfdec_connection.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h
...turn_val_if_fail (g_type_is_a (type, SWFDEC_TYPE_SCRIPTABLE), NULL); + + if (object == NULL) + return NULL; + klass = g_type_class_peek (type); + if (klass == NULL) + return NULL; /* class doesn't exist -> no object of this type exists */ + if (!JS_InstanceOf (cx, object, klass->jsclass, NULL)) + return NULL; + return JS_GetPrivate (cx, object); +} + +/** * swfdec_scriptable_from_jsval: * @cx: a #JSContext * @val: the jsval to convert @@ -138,22 +167,14 @@ swfdec_scriptable_get_object (SwfdecScri gpointer swfdec_scriptable_from_jsval (JSContext *cx, jsval val, GType ty...
2007 Jan 16
0
9 commits - libswfdec/js libswfdec/Makefile.am libswfdec/swfdec_audio_stream.c libswfdec/swfdec_audio_stream.h libswfdec/swfdec_cache.c libswfdec/swfdec_cached.c libswfdec/swfdec_cached.h libswfdec/swfdec_edittext_movie.c libswfdec/swfdec_image.c
...vate object */ - if (movie) { - g_assert (movie->jsobj != NULL); - - SWFDEC_LOG ("destroying JSObject %p for movie %p", obj, movie); - movie->jsobj = NULL; - g_object_unref (movie); - } else { - SWFDEC_LOG ("destroying JSObject %p", obj); - } -} - -static JSClass movieclip_class = { +const JSClass movieclip_class = { "MovieClip", JSCLASS_HAS_PRIVATE, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_EnumerateStub, JS_ResolveStub, - JS_ConvertStub, movie_finalize, + JS_ConvertStub, swfdec_scripta...
2007 Jul 13
0
4 commits - configure.ac libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.h libswfdec/swfdec_scriptable.c libswfdec/swfdec_scriptable.h NEWS
...scriptable_parent_class)->dispose (object); -} - -static JSObject * -swfdec_scriptable_create_js_object (SwfdecScriptable *scriptable) -{ - SwfdecScriptableClass *klass; - JSContext *cx; - JSObject *obj; - - klass = SWFDEC_SCRIPTABLE_GET_CLASS (scriptable); - g_return_val_if_fail (klass->jsclass != NULL, NULL); - cx = scriptable->jscx; - - obj = JS_NewObject (cx, (JSClass *) klass->jsclass, NULL, NULL); - if (obj == NULL) { - SWFDEC_ERROR ("failed to create JS object for %s %p", - G_OBJECT_TYPE_NAME (scriptable), scriptable); - return NULL; - } - SWFDEC_LOG (&qu...
2007 Mar 05
0
5 commits - libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c test/trace
...a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1387,7 +1387,7 @@ static JSBool swfdec_action_new_object (JSContext *cx, guint action, const guint8 *data, guint len) { JSStackFrame *fp = cx->fp; - jsval constructor; + jsval constructor, proto; JSObject *object; const JSClass *clasp; guint n_args; @@ -1414,7 +1414,12 @@ swfdec_action_new_object (JSContext *cx, if (JS_GetClass (object) != &js_FunctionClass) goto fail; clasp = ((JSFunction *) JS_GetPrivate (cx, object))->clasp; - object = JS_NewObject (cx, clasp, NULL, NULL); + if (!JS_GetProperty (...
2007 Sep 28
1
SwfDec in Windows
...to '_imp__js_ObjectOps' C:/msys/1.0/home/Administrador/swfdec-0.4.3/libswfdec/js/jsapi.c:598: undefined reference to '_imp__js_FunctionClass' The lines are: JS_PUBLIC_API(JSType) JS_TypeOfValue(JSContext *cx, jsval v) { JSType type; JSObject *obj; JSObjectOps *ops; JSClass *clasp; CHECK_REQUEST(cx); if (JSVAL_IS_OBJECT(v)) { /* XXX JSVAL_IS_OBJECT(v) is true for null too! Can we change ECMA? */ obj = JSVAL_TO_OBJECT(v); if (obj && (ops = obj->map->ops, ops == &js_ObjectOps //***ERROR IN THIS...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
...a/libswfdec/swfdec_script.c +++ b/libswfdec/swfdec_script.c @@ -1397,9 +1397,8 @@ static JSBool swfdec_action_new_object (JSContext *cx, guint action, const guint8 *data, guint len) { JSStackFrame *fp = cx->fp; - jsval constructor, proto; + jsval constructor; JSObject *object; - const JSClass *clasp; guint n_args; const char *name; @@ -1418,20 +1417,10 @@ swfdec_action_new_object (JSContext *cx, } fp->sp[-1] = constructor; - if (!JSVAL_IS_OBJECT (constructor) || JSVAL_IS_NULL (constructor)) - goto fail; - object = JSVAL_TO_OBJECT (constructor); - if (JS_GetClass...
2007 Mar 20
0
9 commits - configure.ac libswfdec/swfdec_bits.c libswfdec/swfdec_debug.c libswfdec/swfdec_js.c libswfdec/swfdec_script.c libswfdec/swfdec_sound.c
...elated debugging stuff This was used when Swfdec compiled AS bytecode to Spidermonkey bytecode and is useless now. diff --git a/libswfdec/swfdec_js.c b/libswfdec/swfdec_js.c index 3e96503..5ec2303 100644 --- a/libswfdec/swfdec_js.c +++ b/libswfdec/swfdec_js.c @@ -68,16 +68,6 @@ static JSClass global_class = { JS_EnumerateStub,JS_ResolveStub,JS_ConvertStub,JS_FinalizeStub }; -static JSTrapStatus G_GNUC_UNUSED -swfdec_js_debug_one (JSContext *cx, JSScript *script, jsbytecode *pc, - jsval *rval, void *closure) -{ - if (g_getenv ("SWFDEC_JS") && g_str_equal (g_g...
2007 Mar 13
0
4 commits - test/swfscript.c
...s symbols from libswfdec diff --git a/libswfdec/js/jsobj.c b/libswfdec/js/jsobj.c index 81ac409..0f825ff 100644 --- a/libswfdec/js/jsobj.c +++ b/libswfdec/js/jsobj.c @@ -905,7 +905,7 @@ js_obj_toSource(JSContext *cx, JSObject } #endif /* JS_HAS_INITIALIZERS || JS_HAS_TOSOURCE */ -extern const JSClass movieclip_class; +extern int swfdec_js_is_movieclip (JSContext *cx, JSObject *obj); extern char *swfdec_movie_get_path (void *movieclip); extern void g_free (void *p); JSBool @@ -921,7 +921,7 @@ js_obj_toString(JSContext *cx, JSObject *rval = STRING_TO_JSVAL(cx->runtime->emptyString);...
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
...cAsObject *obj, guint argc, SwfdecAsValue *argv, SwfdecAsValue *rval) { - SwfdecVideo *video; - - video = JS_GetPrivate (cx, obj); - if (video) { - SWFDEC_SCRIPTABLE (video)->jsobj = NULL; - g_object_unref (video); - } -} + SwfdecVideoMovie *video = SWFDEC_VIDEO_MOVIE (obj); -const JSClass video_class = { - "Video", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, - JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, swfdec_js_video_finalize, - JSCLASS_NO_OPTIONAL_MEMBERS -}; - -static JSBool -swfdec_js_video_new (J...
2007 Mar 01
0
11 commits - libswfdec/Makefile.am libswfdec/swfdec_connection.c libswfdec/swfdec_connection.h libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js.h libswfdec/swfdec_js_net_stream.c
...string, 0, 0, 0 }, + {0,0,0,0,0} +}; + +static void +swfdec_js_net_stream_finalize (JSContext *cx, JSObject *obj) +{ + SwfdecNetStream *stream; + + stream = JS_GetPrivate (cx, obj); + if (stream) { + SWFDEC_SCRIPTABLE (stream)->jsobj = NULL; + g_object_unref (stream); + } +} + +static JSClass net_stream_class = { + "NetStream", JSCLASS_HAS_PRIVATE, + JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, swfdec_js_net_stream_finalize, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +static JSBool +swfdec_j...
2007 Mar 02
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_audio_flv.c libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_js.c libswfdec/swfdec_js.h libswfdec/swfdec_js_video.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h
...ec_js_video_to_string, 0, 0, 0 }, + {0,0,0,0,0} +}; + +static void +swfdec_js_video_finalize (JSContext *cx, JSObject *obj) +{ + SwfdecVideo *video; + + video = JS_GetPrivate (cx, obj); + if (video) { + SWFDEC_SCRIPTABLE (video)->jsobj = NULL; + g_object_unref (video); + } +} + +const JSClass video_class = { + "Video", JSCLASS_HAS_PRIVATE, + JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, swfdec_js_video_finalize, + JSCLASS_NO_OPTIONAL_MEMBERS +}; + +static JSBool +swfdec_js_video_new (J...
2007 Mar 11
0
10 commits - libswfdec/js libswfdec/swfdec_js_color.c libswfdec/swfdec_js_connection.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_js_video.c libswfdec/swfdec_js_xml.c libswfdec/swfdec_script.c player/.gitignore
...all the toString magic diff --git a/libswfdec/js/jsobj.c b/libswfdec/js/jsobj.c index 860e38c..81ac409 100644 --- a/libswfdec/js/jsobj.c +++ b/libswfdec/js/jsobj.c @@ -905,48 +905,42 @@ js_obj_toSource(JSContext *cx, JSObject } #endif /* JS_HAS_INITIALIZERS || JS_HAS_TOSOURCE */ +extern const JSClass movieclip_class; +extern char *swfdec_movie_get_path (void *movieclip); +extern void g_free (void *p); JSBool js_obj_toString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - jschar *chars; - size_t nchars; - const char *clazz, *prefix; + const...
2007 Apr 04
0
Branch 'as' - 17 commits - configure.ac doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt doc/swfdec.types libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_loader.h
...CRIPTABLE) +G_DEFINE_TYPE (SwfdecConnection, swfdec_connection, SWFDEC_TYPE_AS_OBJECT) static void swfdec_connection_dispose (GObject *object) @@ -42,16 +42,12 @@ swfdec_connection_dispose (GObject *obje G_OBJECT_CLASS (swfdec_connection_parent_class)->dispose (object); } -extern const JSClass connection_class; static void swfdec_connection_class_init (SwfdecConnectionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - SwfdecScriptableClass *scriptable_class = SWFDEC_SCRIPTABLE_CLASS (klass); object_class->dispose = swfdec_connection_dispose; - - script...
2007 Mar 14
0
10 commits - libswfdec/swfdec_flv_decoder.c libswfdec/swfdec_flv_decoder.h libswfdec/swfdec_js_global.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_js_net_stream.c libswfdec/swfdec_loader.c libswfdec/swfdec_loader.h libswfdec/swfdec_loadertarget.c
...nterval-arguments.swf.trace @@ -0,0 +1,4 @@ +Check arguments to setInterval work +1 +42 +hi diff-tree be5455d2287e0d4c7b6ee2770ce72b3022a840c6 (from 97490d426827b5adbb2205f904c83f51ab836223) Author: Benjamin Otte <otte@gnome.org> Date: Wed Mar 14 17:14:54 2007 +0100 use the movie's JSClass this makes Video::attachVideo work again diff --git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c index e0f3f54..1504e3d 100644 --- a/libswfdec/swfdec_js_movie.c +++ b/libswfdec/swfdec_js_movie.c @@ -1248,7 +1248,8 @@ swfdec_js_movie_create_jsobject (SwfdecM (fun = sw...
2007 Jun 08
0
Changes to 'refs/tags/0.4.2'
...IN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQBFy4frvMv5VCdLq8QRAtJoAJ4xxUF2QJM3uCZDJOSWzIKLimGsAwCdEqek VfJ5PxRYrDPDNSR9GYwOVcc= =pXML -----END PGP SIGNATURE----- Changes since 0.4.1: Benjamin Otte: back to cvs fix config.h include and copyright headers constify JSClass functions as far as we need them apparently we need even more const Add a SwfdecScriptable class that functions as the frontend for objects accessible from AS make SwfdecNetStream a SwfdecScriptable (nothing else changed) call unload function after adjusting size add n...
2007 Jan 29
0
Branch 'interpreter' - 18 commits - libswfdec/swfdec_image.c libswfdec/swfdec_image.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_sound.c libswfdec/swfdec_pattern.c libswfdec/swfdec_scriptable.c libswfdec/swfdec_script.c
...ref (movie); - *rval = OBJECT_TO_JSVAL (new); + *rval = OBJECT_TO_JSVAL (obj); return JS_TRUE; } diff --git a/libswfdec/swfdec_js_sound.c b/libswfdec/swfdec_js_sound.c index 67e11bd..b9f8d57 100644 --- a/libswfdec/swfdec_js_sound.c +++ b/libswfdec/swfdec_js_sound.c @@ -61,12 +61,7 @@ static JSClass sound_class = { static JSBool swfdec_js_sound_new (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - JSObject *new; - - new = JS_NewObject (cx, &sound_class, NULL, NULL); - if (new == NULL) - return JS_TRUE; - *rval = OBJECT_TO_JSVAL (new); + *rval = OBJECT_TO_J...
2007 Apr 27
0
Changes to 'refs/tags/0.4.3'
...IN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGAti+vMv5VCdLq8QRAo5TAKCU+ko+aaq9Y11c3W4uvWGvKYo1HgCfcjGk AYQ91WIDkDeClzJO/fxEO5U= =XHqm -----END PGP SIGNATURE----- Changes since 0.4.1: Benjamin Otte: back to cvs fix config.h include and copyright headers constify JSClass functions as far as we need them apparently we need even more const Add a SwfdecScriptable class that functions as the frontend for objects accessible from AS make SwfdecNetStream a SwfdecScriptable (nothing else changed) call unload function after adjusting size add n...
2007 Apr 27
0
Changes to 'refs/tags/0.4.4'
...IN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGMcWPvMv5VCdLq8QRAnEeAJ9JwxuerjUYnOyjacNSj3A4ELxYRACeJG06 heX44SOooYokBZOik7DMh3E= =rekm -----END PGP SIGNATURE----- Changes since 0.4.1: Benjamin Otte: back to cvs fix config.h include and copyright headers constify JSClass functions as far as we need them apparently we need even more const Add a SwfdecScriptable class that functions as the frontend for objects accessible from AS make SwfdecNetStream a SwfdecScriptable (nothing else changed) call unload function after adjusting size add n...
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
..._stream_time, NULL }, - { NULL } -}; - -static void -swfdec_js_net_stream_finalize (JSContext *cx, JSObject *obj) -{ - SwfdecNetStream *stream; - - stream = JS_GetPrivate (cx, obj); - if (stream) { - SWFDEC_SCRIPTABLE (stream)->jsobj = NULL; - g_object_unref (stream); - } -} - -const JSClass net_stream_class = { - "NetStream", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, - JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, swfdec_js_net_stream_finalize, - JSCLASS_NO_OPTIONAL_MEMBERS -}; - -static JSBool -swfdec_j...
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
..., 0 }, - { "setTransform", swfdec_js_color_set_transform, 1, 0, 0 }, - {0,0,0,0,0} -}; - -static void -swfdec_js_color_finalize (JSContext *cx, JSObject *obj) -{ - SwfdecMovie *movie; - - movie = JS_GetPrivate (cx, obj); - if (movie) { - g_object_unref (movie); - } -} - -static JSClass color_class = { - "Color", JSCLASS_HAS_PRIVATE, - JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, - JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, swfdec_js_color_finalize, - JSCLASS_NO_OPTIONAL_MEMBERS -}; - -static JSBool -swfdec_js_color_new (J...