static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) { HandleScope scope; Local<ObjectTemplate> obj = temp->PrototypeTemplate(); EXPOSE_METHOD(obj, bindToUnit, ReadOnly | DontDelete); return scope.Close(temp->GetFunction()); }
static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) { HandleScope scope; Local<ObjectTemplate> obj = temp->PrototypeTemplate(); obj->SetAccessor(String::New("byteLength"), byteLength); EXPOSE_METHOD(obj, slice, ReadOnly | DontDelete); EXPOSE_METHOD(obj, isView, ReadOnly | DontDelete); obj->Set(String::New("clone"), FunctionTemplate::New(ClassWrap<NodeBuffer>::clone)); return scope.Close(temp->GetFunction()); }
static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) { HandleScope scope; Local<ObjectTemplate> obj = temp->PrototypeTemplate(); EXPOSE_METHOD(obj, get, ReadOnly | DontDelete); EXPOSE_METHOD(obj, isNearDeath, ReadOnly | DontDelete); EXPOSE_METHOD(obj, isDead, ReadOnly | DontDelete); EXPOSE_METHOD(obj, callbacks, ReadOnly | DontDelete); EXPOSE_METHOD(obj, addCallback, ReadOnly | DontDelete); return scope.Close(temp->GetFunction()); }
static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) { HandleScope scope; Local<ObjectTemplate> obj = temp->PrototypeTemplate(); EXPOSE_METHOD(obj, values, ReadOnly | DontDelete); // EXPOSE_METHOD(obj, measure, ReadOnly | DontDelete); // EXPOSE_METHOD(obj, glyphs, ReadOnly | DontDelete); // EXPOSE_METHOD(obj, outline_type, ReadOnly | DontDelete); // EXPOSE_METHOD(obj, outline_thickness, ReadOnly | DontDelete); return scope.Close(temp->GetFunction()); }
void V8Proxy::bindJsObjectToWindow(Frame* frame, const char* name, int type, v8::Handle<v8::FunctionTemplate> descriptor, void* impl) { // Get environment. v8::Handle<v8::Context> v8Context = V8Proxy::mainWorldContext(frame); if (v8Context.IsEmpty()) return; // JS not enabled. v8::Context::Scope scope(v8Context); v8::Handle<v8::Object> instance = descriptor->GetFunction(); V8DOMWrapper::setDOMWrapper(instance, type, impl); v8::Handle<v8::Object> global = v8Context->Global(); global->Set(v8::String::New(name), instance); }
static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) { HandleScope scope; Local<ObjectTemplate> obj = temp->PrototypeTemplate(); EXPOSE_METHOD(obj, dotVec2, ReadOnly | DontDelete); EXPOSE_METHOD(obj, dotVec3, ReadOnly | DontDelete); EXPOSE_METHOD(obj, dotVec4, ReadOnly | DontDelete); EXPOSE_METHOD(obj, mulVec2, ReadOnly | DontDelete); EXPOSE_METHOD(obj, mulVec3, ReadOnly | DontDelete); EXPOSE_METHOD(obj, mulVec4, ReadOnly | DontDelete); EXPOSE_METHOD(obj, crossVec3, ReadOnly | DontDelete); EXPOSE_METHOD(obj, addVec2, ReadOnly | DontDelete); EXPOSE_METHOD(obj, addVec3, ReadOnly | DontDelete); EXPOSE_METHOD(obj, addVec4, ReadOnly | DontDelete); EXPOSE_METHOD(obj, subVec2, ReadOnly | DontDelete); EXPOSE_METHOD(obj, subVec3, ReadOnly | DontDelete); EXPOSE_METHOD(obj, subVec4, ReadOnly | DontDelete); EXPOSE_METHOD(obj, scaleVec2f, ReadOnly | DontDelete); EXPOSE_METHOD(obj, scaleVec3f, ReadOnly | DontDelete); EXPOSE_METHOD(obj, scaleVec4f, ReadOnly | DontDelete); EXPOSE_METHOD(obj, mulMV4, ReadOnly | DontDelete); EXPOSE_METHOD(obj, mulMV3, ReadOnly | DontDelete); EXPOSE_METHOD(obj, inverse, ReadOnly | DontDelete); EXPOSE_METHOD(obj, mulMM, ReadOnly | DontDelete); EXPOSE_METHOD(obj, setTranslation, ReadOnly | DontDelete); EXPOSE_METHOD(obj, identity, ReadOnly | DontDelete); EXPOSE_METHOD(obj, perspective, ReadOnly | DontDelete); EXPOSE_METHOD(obj, ortho, ReadOnly | DontDelete); EXPOSE_METHOD(obj, frustum, ReadOnly | DontDelete); EXPOSE_METHOD(obj, lookAt, ReadOnly | DontDelete); EXPOSE_METHOD(obj, translate, ReadOnly | DontDelete); EXPOSE_METHOD(obj, rotateX, ReadOnly | DontDelete); EXPOSE_METHOD(obj, rotateY, ReadOnly | DontDelete); EXPOSE_METHOD(obj, rotateZ, ReadOnly | DontDelete); EXPOSE_METHOD(obj, rotate, ReadOnly | DontDelete); EXPOSE_METHOD(obj, scale, ReadOnly | DontDelete); EXPOSE_METHOD(obj, transpose, ReadOnly | DontDelete); EXPOSE_METHOD(obj, translation, ReadOnly | DontDelete); EXPOSE_METHOD(obj, scaling, ReadOnly | DontDelete); EXPOSE_METHOD(obj, nodeMatrix, ReadOnly | DontDelete); return scope.Close(temp->GetFunction()); }
static v8::Local<v8::Function> initClass(v8::Handle<v8::FunctionTemplate>& temp) { HandleScope scope; Local<ObjectTemplate> obj = temp->PrototypeTemplate(); obj->SetAccessor(String::New("height"), height); obj->SetAccessor(String::New("ascender"), ascender); obj->SetAccessor(String::New("descender"), descender); EXPOSE_METHOD(obj, load, ReadOnly | DontDelete); EXPOSE_METHOD(obj, measure, ReadOnly | DontDelete); EXPOSE_METHOD(obj, glyphs, ReadOnly | DontDelete); EXPOSE_METHOD(obj, outline_type, ReadOnly | DontDelete); EXPOSE_METHOD(obj, outline_thickness, ReadOnly | DontDelete); return scope.Close(temp->GetFunction()); }