本文整理汇总了C++中JSMutableHandleValue类的典型用法代码示例。如果您正苦于以下问题:C++ JSMutableHandleValue类的具体用法?C++ JSMutableHandleValue怎么用?C++ JSMutableHandleValue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JSMutableHandleValue类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPropertyWrapper
JSBool JavaObject::getPropertyWrapper(JSContext* ctx, JSHandleObject obj,
JSHandleId id, JSMutableHandleValue vp) {
jsval rval;
JSBool result = JavaObject::getProperty(ctx, obj.get(), id.get(), &rval);
vp.set(rval);
return result;
}
示例2: def_timestep_view_set_filterColor
CEXPORT JSBool def_timestep_view_set_filterColor(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_view *thiz = (timestep_view*)JS_GetPrivate(obj.get());
if (thiz) {
if (vp.isString()) {
JSString *jstr = vp.toString();
JSTR_TO_CSTR(cx, jstr, cstr);
rgba color;
rgba_parse(&color, cstr);
thiz->filter_color = color;
}
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例3: def_timestep_image_map_set_width
CEXPORT JSBool def_timestep_image_map_set_width(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_image_map *thiz = (timestep_image_map*)JS_GetPrivate(obj.get());
if (thiz) {
thiz->width = vp.toInt32();
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例4: def_timestep_view_get_offsetX
CEXPORT JSBool def_timestep_view_get_offsetX(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_view *thiz = (timestep_view*)JS_GetPrivate(obj.get());
if (thiz) {
vp.setNumber(thiz->offset_x);
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例5: def_timestep_image_map_get_marginLeft
CEXPORT JSBool def_timestep_image_map_get_marginLeft(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_image_map *thiz = (timestep_image_map*)JS_GetPrivate(obj.get());
if (thiz) {
vp.setInt32(thiz->margin_left);
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例6: def_timestep_view_get_filterType
CEXPORT JSBool def_timestep_view_get_filterType(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_view *thiz = (timestep_view*)JS_GetPrivate(obj.get());
if (thiz) {
vp.setInt32(thiz->filter_type);
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例7: def_timestep_view_set_y
CEXPORT JSBool def_timestep_view_set_y(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_view *thiz = (timestep_view*)JS_GetPrivate(obj.get());
if (thiz) {
thiz->y = vp.toNumber();
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例8: def_timestep_image_map_get_url
CEXPORT JSBool def_timestep_image_map_get_url(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_image_map *thiz = (timestep_image_map*)JS_GetPrivate(obj.get());
if (thiz) {
vp.setString(JS_NewStringCopyZ(cx, thiz->url));
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例9: def_timestep_view_get___firstRender
CEXPORT JSBool def_timestep_view_get___firstRender(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_view *thiz = (timestep_view*)JS_GetPrivate(obj.get());
if (thiz) {
vp.setBoolean(thiz->__first_render);
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例10: def_timestep_image_map_set_url
CEXPORT JSBool def_timestep_image_map_set_url(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_image_map *thiz = (timestep_image_map*)JS_GetPrivate(obj.get());
if (thiz) {
if (vp.isString()) {
JSString *jstr = vp.toString();
JSTR_TO_CSTR_PERSIST(cx, jstr, cstr);
if (thiz->url) {
free(thiz->url);
}
thiz->url = cstr;
}
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例11: js_cocos2dx_extension_WebSocket_get_readyState
static JSBool js_cocos2dx_extension_WebSocket_get_readyState(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
{
JSObject* jsobj = obj.get();
js_proxy_t *proxy = jsb_get_js_proxy(jsobj);
WebSocket* cobj = (WebSocket *)(proxy ? proxy->ptr : NULL);
JSB_PRECONDITION2( cobj, cx, JS_FALSE, "Invalid Native Object");
if (cobj) {
vp.set(INT_TO_JSVAL((int)cobj->getReadyState()));
return JS_TRUE;
} else {
JS_ReportError(cx, "Error: WebSocket instance is invalid.");
return JS_FALSE;
}
}
示例12: def_timestep_view_get_filterColor
CEXPORT JSBool def_timestep_view_get_filterColor(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp) {
JS_BeginRequest(cx);
timestep_view *thiz = (timestep_view*)JS_GetPrivate(obj.get());
if (thiz) {
rgba prop = thiz->filter_color;
char buf[64];
int len = rgba_to_string(&prop, buf);
vp.setString(JS_NewStringCopyN(cx, buf, len));
}
JS_EndRequest(cx);
return JS_TRUE;
}
示例13: setPropertyWrapper
JSBool JavaObject::setPropertyWrapper(JSContext* ctx, JSHandleObject obj,
JSHandleId id, JSBool strict, JSMutableHandleValue vp) {
jsval rval = vp.get();
return JavaObject::setProperty(ctx, obj, id, strict, &rval);
}
示例14: setProperty
JSBool
setProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp)
{
printf("in setProperty %ld=%s\n",JSID_BITS(id.get()),JS_EncodeString(cx,JS_ValueToString(cx,vp.get())));
return true;
}