mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
use unshared type handler for all events on window
This commit is contained in:
parent
8bccf16158
commit
ec43456e4b
@ -74,9 +74,9 @@
|
||||
|
||||
/* native proprty definition */
|
||||
#define JSAPI_PROP_GETTER(name, cx, obj, vp) \
|
||||
jsapi_property_##name##_get(cx, obj, jsval id, vp)
|
||||
jsapi_property_##name##_get(cx, obj, jsval jsapi_id, vp)
|
||||
#define JSAPI_PROP_SETTER(name, cx, obj, vp) \
|
||||
jsapi_property_##name##_set(cx, obj, jsval id, vp)
|
||||
jsapi_property_##name##_set(cx, obj, jsval jsapi_id, vp)
|
||||
|
||||
/* native property return value */
|
||||
#define JSAPI_PROP_RVAL(cx, vp) (vp)
|
||||
@ -84,6 +84,9 @@
|
||||
/* native property getter return value */
|
||||
#define JSAPI_PROP_SET_RVAL(cx, vp, v) (*(vp) = (v))
|
||||
|
||||
/* native property ID value as a jsval */
|
||||
#define JSAPI_PROP_IDVAL(cx, vp) (*(vp) = jsapi_id)
|
||||
|
||||
/* native property specifier */
|
||||
#define JSAPI_PS(name, fnname, tinyid, flags) \
|
||||
{ name , tinyid , flags , jsapi_property_##fnname##_get , jsapi_property_##fnname##_set }
|
||||
@ -183,11 +186,14 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
|
||||
/* The object instance in a native call */
|
||||
#define JSAPI_THIS_OBJECT(cx,vp) jsapi_this
|
||||
|
||||
|
||||
|
||||
|
||||
/* proprty native calls */
|
||||
#define JSAPI_PROP_GETTER(name, cx, obj, vp) \
|
||||
jsapi_property_##name##_get(cx, obj, jsval id, vp)
|
||||
jsapi_property_##name##_get(cx, obj, jsval jsapi_id, vp)
|
||||
#define JSAPI_PROP_SETTER(name, cx, obj, vp) \
|
||||
jsapi_property_##name##_set(cx, obj, jsval id, vp)
|
||||
jsapi_property_##name##_set(cx, obj, jsval jsapi_id, vp)
|
||||
|
||||
/* native property return value */
|
||||
#define JSAPI_PROP_RVAL JS_RVAL
|
||||
@ -195,6 +201,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
|
||||
/* native property return value setter */
|
||||
#define JSAPI_PROP_SET_RVAL JS_SET_RVAL
|
||||
|
||||
/* native property ID value as a jsval */
|
||||
#define JSAPI_PROP_IDVAL(cx, vp) (*(vp) = jsapi_id)
|
||||
|
||||
/* property specifier */
|
||||
#define JSAPI_PS(name, fnname, tinyid, flags) \
|
||||
{ name , tinyid , flags , jsapi_property_##fnname##_get , jsapi_property_##fnname##_set }
|
||||
@ -204,6 +213,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
|
||||
|
||||
#define JSAPI_PS_END { NULL, 0, 0, NULL, NULL }
|
||||
|
||||
|
||||
|
||||
|
||||
static inline JSObject *
|
||||
JS_NewCompartmentAndGlobalObject(JSContext *cx,
|
||||
JSClass *jsclass,
|
||||
@ -288,9 +300,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
|
||||
|
||||
/* proprty native calls */
|
||||
#define JSAPI_PROP_GETTER(name, cx, obj, vp) \
|
||||
jsapi_property_##name##_get(cx, obj, jsid id, vp)
|
||||
jsapi_property_##name##_get(cx, obj, jsid jsapi_id, vp)
|
||||
#define JSAPI_PROP_SETTER(name, cx, obj, vp) \
|
||||
jsapi_property_##name##_set(cx, obj, jsid id, JSBool strict, vp)
|
||||
jsapi_property_##name##_set(cx, obj, jsid jsapi_id, JSBool strict, vp)
|
||||
|
||||
/* native property return value */
|
||||
#define JSAPI_PROP_RVAL JS_RVAL
|
||||
@ -298,6 +310,9 @@ JS_NewCompartmentAndGlobalObject(JSContext *cx,
|
||||
/* native property getter return value */
|
||||
#define JSAPI_PROP_SET_RVAL JS_SET_RVAL
|
||||
|
||||
/* native property ID value as a jsval */
|
||||
#define JSAPI_PROP_IDVAL(cx, vp) JS_IdToValue(cx, jsapi_id, vp)
|
||||
|
||||
/* property specifier */
|
||||
#define JSAPI_PS(name, fnname, tinyid, flags) { \
|
||||
name, \
|
||||
|
@ -34,6 +34,7 @@ binding location {
|
||||
|
||||
private "struct browser_window *" bw;
|
||||
private "nsurl *" url;
|
||||
|
||||
}
|
||||
|
||||
operation reload %{
|
||||
|
@ -30,6 +30,8 @@ binding window {
|
||||
internal "JSObject *" navigator;
|
||||
internal "JSObject *" console;
|
||||
internal "JSObject *" location;
|
||||
|
||||
property unshared type EventHandler;
|
||||
}
|
||||
|
||||
api mark %{
|
||||
@ -197,3 +199,11 @@ getter window %{
|
||||
getter self %{
|
||||
jsret = obj;
|
||||
%}
|
||||
|
||||
getter EventHandler %{
|
||||
JSLOG("propname:%s %s", propname, JS_GetTypeName(cx, JS_TypeOfValue(cx, propname_jsval)));
|
||||
%}
|
||||
|
||||
setter EventHandler %{
|
||||
JSLOG("propname:%s %s", propname, JS_GetTypeName(cx, JS_TypeOfValue(cx, propname_jsval)));
|
||||
%}
|
||||
|
Loading…
Reference in New Issue
Block a user