Displaying 2 results from an estimated 2 matches for "swfdec_js_getdepth".
2007 Mar 21
0
4 commits - libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c player/swfdec_slow_loader.c
...ieClip.getDepth (untested)
diff --git a/libswfdec/swfdec_js_movie.c b/libswfdec/swfdec_js_movie.c
index 5137746..2d9b1a1 100644
--- a/libswfdec/swfdec_js_movie.c
+++ b/libswfdec/swfdec_js_movie.c
@@ -610,12 +610,26 @@ swfdec_js_getURL (JSContext *cx, JSObjec
return JS_TRUE;
}
+static JSBool
+swfdec_js_getDepth (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
+{
+ SwfdecMovie *movie;
+
+ movie = JS_GetPrivate (cx, obj);
+ if (!movie)
+ return JS_TRUE;
+
+ *rval = INT_TO_JSVAL (movie->depth);
+ return JS_TRUE;
+}
+
static JSFunctionSpec movieclip_methods[] = {
{ "att...
2007 Mar 22
0
7 commits - configure.ac doc/swfdec-docs.sgml libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_js_movie.c test/trace
...(cx, obj);
- g_assert (movie);
+ movie = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_MOVIE);
+ if (movie == NULL) {
+ SWFDEC_WARNING ("not a movie");
+ return JS_TRUE;
+ }
+
url = swfdec_js_to_string (cx, argv[0]);
if (!url)
return FALSE;
@@ -615,9 +670,11 @@ swfdec_js_getDepth (JSContext *cx, JSObj
{
SwfdecMovie *movie;
- movie = JS_GetPrivate (cx, obj);
- if (!movie)
+ movie = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_MOVIE);
+ if (movie == NULL) {
+ SWFDEC_WARNING ("not a movie");
return JS_TRUE;
+ }
*rval = INT_TO_JSVAL (mov...