annotate nodejs/shapes.cc @ 565:c0bc60448913 Android_Skia

Constructor for path objects in Javascript domain
author Thinker K.F. Li <thinker@branda.to>
date Mon, 07 Jun 2010 22:37:51 +0800
parents 0cd1511272d2
children f87a368e847a
rev   line source
564
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 #include <v8.h>
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 #include "mbfly_njs.h"
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
3
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4 extern "C" {
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5 #include <mb.h>
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
6 }
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 using namespace v8;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9
565
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
10 /*! \defgroup shape_temp Templates for shape and derivations.
564
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 *
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 * @{
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 */
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 static Persistent<FunctionTemplate> xnjsmb_shape_temp;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 static Handle<Value>
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 xnjsmb_shape_show(const Arguments &args) {
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18 shape_t *sh;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 Handle<Object> self;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 self = args.This();
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 sh = (shape_t *)UNWRAP(self);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 sh_show(sh);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
25 return Null();
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26 }
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
27
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28 static Handle<Value>
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
29 xnjsmb_shape_hide(const Arguments &args) {
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
30 shape_t *sh;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31 Handle<Object> self;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 self = args.This();
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
34 sh = (shape_t *)UNWRAP(self);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
35 sh_hide(sh);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
36
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
37 return Null();
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
38 }
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
39
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
40 static void
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
41 xnjsmb_init_shape_temp(void) {
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
42 Handle<FunctionTemplate> temp;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
43 Handle<ObjectTemplate> proto_temp;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
44 Handle<FunctionTemplate> method_temp;
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
45
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
46 temp = FunctionTemplate::New();
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
47 temp->SetClassName(String::New("shape"));
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
48 xnjsmb_shape_temp = Persistent<FunctionTemplate>::New(temp);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
49 proto_temp = temp->PrototypeTemplate();
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
50
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
51 method_temp = FunctionTemplate::New(xnjsmb_shape_show);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
52 SET(proto_temp, "show", method_temp);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
53 method_temp = FunctionTemplate::New(xnjsmb_shape_hide);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
54 SET(proto_temp, "hide", method_temp);
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
55 }
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
56
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
57 /* @} */
0cd1511272d2 Make base type for shapes.
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
58
565
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
59 /*! \defgroup path_temp Templates for path objects.
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
60 *
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
61 * @{
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
62 */
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
63 static Persistent<FunctionTemplate> xnjsmb_path_temp;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
64
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
65 /*! \brief Callback of constructor of path objects for Javascript.
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
66 */
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
67 static Handle<Value>
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
68 xnjsmb_shape_path(const Arguments &args) {
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
69 shape_t *sh;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
70 redraw_man_t *rdman;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
71 Handle<Object> self = args.This(); // path object
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
72 Handle<Object> rt;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
73 char *dstr;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
74 int argc;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
75
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
76 argc = args.Length();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
77 if(argc != 2)
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
78 THROW("Invalid number of arugments (!= 1)");
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
79 if(!args[0]->IsString())
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
80 THROW("Invalid argument type (should be a string)");
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
81 if(!args[1]->IsObject())
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
82 THROW("Invalid argument type (should be an object)");
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
83
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
84 String::Utf8Value dutf8(args[0]->ToString());
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
85 dstr = *dutf8;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
86
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
87 rt = args[1]->ToObject();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
88 rdman = xnjsmb_rt_rdman(rt);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
89 sh = rdman_shape_path_new(rdman, dstr);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
90
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
91 WRAP(self, sh);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
92
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
93 return Null();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
94 }
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
95
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
96 /*! \brief Initial function template for constructor of path objects.
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
97 */
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
98 static void
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
99 xnjsmb_init_path_temp(void) {
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
100 Handle<FunctionTemplate> temp;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
101 Handle<ObjectTemplate> inst_temp;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
102
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
103 temp = FunctionTemplate::New(xnjsmb_shape_path);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
104 temp->Inherit(xnjsmb_shape_temp);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
105 temp->SetClassName(String::New("path"));
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
106
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
107 inst_temp = temp->InstanceTemplate();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
108 inst_temp->SetInternalFieldCount(1);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
109
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
110 xnjsmb_path_temp = Persistent<FunctionTemplate>::New(temp);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
111 }
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
112
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
113 /*! \brief Callback function of mb_rt.path_new().
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
114 */
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
115 static Handle<Value>
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
116 xnjsmb_shape_path_new(const Arguments &args) {
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
117 HandleScope scope;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
118 Handle<Object> self = args.This(); // runtime object
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
119 Handle<Object> path_obj;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
120 Handle<Value> path_args[2];
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
121 int argc;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
122
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
123 argc = args.Length();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
124 if(argc != 1)
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
125 THROW("Invalid number of arugments (!= 1)");
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
126 if(!args[0]->IsString())
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
127 THROW("Invalid argument type (shoud be a string)");
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
128
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
129 path_args[0] = args[0];
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
130 path_args[1] = self;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
131
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
132 path_obj = xnjsmb_path_temp->GetFunction()->NewInstance(2, path_args);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
133
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
134 scope.Close(path_obj);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
135 return path_obj;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
136 }
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
137
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
138 /* @} */
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
139
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
140 /*! \brief Set properties of template of mb_rt.
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
141 */
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
142 void
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
143 xnjsmb_shapes_init_mb_rt_temp(Handle<FunctionTemplate> rt_temp) {
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
144 Handle<FunctionTemplate> path_new_temp;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
145 Handle<ObjectTemplate> rt_proto_temp;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
146 static int temp_init_flag = 0;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
147
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
148 if(temp_init_flag == 0) {
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
149 xnjsmb_init_shape_temp();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
150 xnjsmb_init_path_temp();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
151 temp_init_flag = 1;
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
152 }
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
153
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
154 rt_proto_temp = rt_temp->PrototypeTemplate();
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
155
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
156 path_new_temp = FunctionTemplate::New(xnjsmb_shape_path_new);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
157 SET(rt_proto_temp, "path_new", path_new_temp);
c0bc60448913 Constructor for path objects in Javascript domain
Thinker K.F. Li <thinker@branda.to>
parents: 564
diff changeset
158 }