diff options
author | Vincent Sanders <vince@kyllikki.org> | 2012-07-02 22:51:06 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2012-07-02 22:51:06 +0100 |
commit | e205f0f99e0cb6ffa0044c6c1322f5da8f795183 (patch) | |
tree | 71da1109b3cb5b41c77d221d67cd5183558bff80 /javascript/jsapi.h | |
parent | 20e99e4f20a982de43f6aec8b5f962369d5e8d22 (diff) | |
parent | 67648c621d67de0921417884e0efb33a4e86a0f3 (diff) | |
download | netsurf-e205f0f99e0cb6ffa0044c6c1322f5da8f795183.tar.gz netsurf-e205f0f99e0cb6ffa0044c6c1322f5da8f795183.tar.bz2 |
Merge branch 'vince/jsnavigator'
Merge javascript navigator object implementation
Diffstat (limited to 'javascript/jsapi.h')
-rw-r--r-- | javascript/jsapi.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/javascript/jsapi.h b/javascript/jsapi.h index 4024d267b..ac5ada79c 100644 --- a/javascript/jsapi.h +++ b/javascript/jsapi.h @@ -92,7 +92,7 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx, #else /* #if JS_VERSION <= 180 */ /* three parameter jsapi native call */ -#define JSAPI_NATIVE(name, cx, argc, vp) jsnative_##name(cx, argc, vp) +#define JSAPI_NATIVE(name, cx, argc, vp) jsapi_native_##name(cx, argc, vp) /* three parameter function descriptor */ #define JSAPI_FS(name, nargs, flags) \ @@ -137,9 +137,38 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx, #endif - +/** Create a new javascript window object + * + * @param cx The javascript context. + * @param parent The parent object or NULL for new global + * @param win_priv The private context to set on the object + * @return new javascript object or NULL on error + */ JSObject *jsapi_new_window(JSContext *cx, JSObject *parent, void *win_priv); + +/** Create a new javascript document object + * + * @param cx The javascript context. + * @param parent The parent object, usually a global window object + * @param doc_priv The private context to set on the object + * @return new javascript object or NULL on error + */ JSObject *jsapi_new_document(JSContext *cx, JSObject *parent, void *doc_priv); + +/** Create a new javascript console object + * + * @param cx The javascript context. + * @param parent The parent object, usually a global window object + * @return new javascript object or NULL on error + */ JSObject *jsapi_new_console(JSContext *cx, JSObject *parent); +/** Create a new javascript navigator object + * + * @param cx The javascript context. + * @param parent The parent object, usually a global window object + * @return new javascript object or NULL on error + */ +JSObject *jsapi_new_navigator(JSContext *cx, JSObject *parent); + #endif |