void timestep_view_set_filterColor(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo &info) { //LOG("in timestep_view set filterColor"); v8::Local<v8::Object> thiz = info.Holder(); timestep_view *obj = (timestep_view*) v8::Local<v8::External>::Cast(thiz->GetInternalField(0))->Value(); if (value->IsString()) { String::Utf8Value s(value); const char *str = ToCString(s); rgba color; rgba_parse(&color, str); obj->filter_color = color; } //LOG("done in 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; }