changeset 561:a3c13c2a4792 Android_Skia

Function template on runtime object for xnjsmb_coord_new()
author Thinker K.F. Li <thinker@branda.to>
date Mon, 07 Jun 2010 12:12:03 +0800
parents ce7a35abcb0d
children 1b6402f07cd4
files nodejs/mbfly_njs.cc nodejs/mbfly_njs.h
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/mbfly_njs.cc	Mon Jun 07 11:47:34 2010 +0800
+++ b/nodejs/mbfly_njs.cc	Mon Jun 07 12:12:03 2010 +0800
@@ -85,11 +85,16 @@
 init(Handle<Object> target) {
     HandleScope scope;
     Handle<FunctionTemplate> func;
+    Handle<ObjectTemplate> rt_obj_temp;
 
     func = FunctionTemplate::New(hello_func);
     target->Set(String::New("Hello"), func->GetFunction());
 
     func = FunctionTemplate::New(xnjsmb_new);
     target->Set(String::New("mb_rt"), func->GetFunction());
-    func->PrototypeTemplate()->SetInternalFieldCount(1);
+    rt_obj_temp = func->PrototypeTemplate();
+    rt_obj_temp->SetInternalFieldCount(1);
+    
+    func = FunctionTemplate::New(xnjsmb_coord_new);
+    SET(rt_obj_temp, "coord_new", func);
 }
--- a/nodejs/mbfly_njs.h	Mon Jun 07 11:47:34 2010 +0800
+++ b/nodejs/mbfly_njs.h	Mon Jun 07 12:12:03 2010 +0800
@@ -18,5 +18,6 @@
 #define GET(o, n) (o)->Get(v8::String::New(n))
 
 redraw_man_t *xnjsmb_rt_rdman(v8::Handle<v8::Object> mbrt);
+v8::Handle<v8::Value> xnjsmb_coord_new(const v8::Arguments &args);
 
 #endif /* __MBFLY_NJS_H_ */