annotate nodejs/mbfly_njs.cc @ 679:799c852b9065

Extract event info from C object to JS object
author Thinker K.F. Li <thinker@branda.to>
date Fri, 06 Aug 2010 19:31:37 +0800
parents f264b50c469c
children a588eefd3f04
rev   line source
546
249bcbf07eb0 Reuse and adapt X_supp.c by implmeneting X_supp_njs.c
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 #include <stdio.h>
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
2 #include <string.h>
547
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
3 #include <v8.h>
546
249bcbf07eb0 Reuse and adapt X_supp.c by implmeneting X_supp_njs.c
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
4
556
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
5 extern "C" {
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
6 #include "X_supp_njs.h"
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
7 }
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
8
559
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
9 #include "mbfly_njs.h"
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
10
547
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
11 using namespace v8;
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
12
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
13 static coord_t *
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
14 xnjsmb_coord_new(njs_runtime_t *rt, coord_t *parent, const char **err) {
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
15 coord_t *coord;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
16 redraw_man_t *rdman;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
17
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
18 rdman = X_njs_MB_rdman(rt);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
19 coord = rdman_coord_new(rdman, parent);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
20 if(coord == NULL) {
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
21 *err = "Can not allocate a redraw_man_t";
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
22 return NULL;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
23 }
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
24
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
25 return coord;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
26 }
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
27
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
28 static void
676
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
29 xnjsmb_coord_new_mod(Handle<Object> mbrt, Handle<Value> ret) {
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
30 Handle<Object> ret_obj = ret->ToObject();
675
c643af2095c5 Keep and retrieve respective js object to/from property store
Thinker K.F. Li <thinker@branda.to>
parents: 671
diff changeset
31 Persistent<Object> *ret_obj_hdl;
671
fc29a343ce7c Track JS object with property store of objects
Thinker K.F. Li <thinker@branda.to>
parents: 666
diff changeset
32 coord_t *coord;
676
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
33 subject_t *subject;
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
34 Handle<Value> subject_o;
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
35
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
36 SET(ret_obj, "mbrt", mbrt);
671
fc29a343ce7c Track JS object with property store of objects
Thinker K.F. Li <thinker@branda.to>
parents: 666
diff changeset
37 coord = (coord_t *)UNWRAP(ret_obj);
675
c643af2095c5 Keep and retrieve respective js object to/from property store
Thinker K.F. Li <thinker@branda.to>
parents: 671
diff changeset
38 /* Keep associated js object in property store for retrieving,
c643af2095c5 Keep and retrieve respective js object to/from property store
Thinker K.F. Li <thinker@branda.to>
parents: 671
diff changeset
39 * later, without create new js object.
c643af2095c5 Keep and retrieve respective js object to/from property store
Thinker K.F. Li <thinker@branda.to>
parents: 671
diff changeset
40 */
c643af2095c5 Keep and retrieve respective js object to/from property store
Thinker K.F. Li <thinker@branda.to>
parents: 671
diff changeset
41 ret_obj_hdl = new Persistent<Object>(ret_obj);
c643af2095c5 Keep and retrieve respective js object to/from property store
Thinker K.F. Li <thinker@branda.to>
parents: 671
diff changeset
42 mb_prop_set(&coord->obj.props, PROP_JSOBJ, ret_obj_hdl);
676
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
43
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
44 subject = coord->mouse_event;
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
45 subject_o = export_xnjsmb_auto_subject_new(subject);
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
46 SET(ret_obj, "subject", subject_o);
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
47 }
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
48
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
49 #define xnjsmb_auto_coord_new export_xnjsmb_auto_coord_new
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
50
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
51 static void
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
52 xnjsmb_redraw_changed(njs_runtime_t *rt) {
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
53 redraw_man_t *rdman;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
54
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
55 rdman = X_njs_MB_rdman(rt);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
56 rdman_redraw_changed(rdman);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
57 }
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
58
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
59 static void
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
60 xnjsmb_redraw_all(njs_runtime_t *rt) {
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
61 redraw_man_t *rdman;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
62
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
63 rdman = X_njs_MB_rdman(rt);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
64 rdman_redraw_all(rdman);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
65 }
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
66
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
67 static njs_runtime_t *
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
68 _X_njs_MB_new(Handle<Object> self, char *display_name,
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
69 int width, int height) {
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
70 njs_runtime_t *obj;
676
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
71 coord_t *root;
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
72 subject_t *subject;
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
73 Handle<Object> root_o;
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
74 Handle<Value> subject_o;
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
75
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
76 obj = X_njs_MB_new(display_name, width, height);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
77 WRAP(self, obj); /* mkroot need a wrapped object, but
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
78 * it is wrapped after returning of
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
79 * this function. So, we wrap it
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
80 * here. */
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
81 X_njs_MB_init_handle_connection(obj);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
82 xnjsmb_coord_mkroot(self);
676
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
83
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
84 root_o = GET(self, "root")->ToObject();
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
85 root = (coord_t *)UNWRAP(root_o);
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
86 subject = root->mouse_event;
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
87 subject_o = export_xnjsmb_auto_subject_new(subject);
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
88 SET(root_o, "subject", subject_o);
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
89
679
799c852b9065 Extract event info from C object to JS object
Thinker K.F. Li <thinker@branda.to>
parents: 676
diff changeset
90 subject = X_MB_kbevents(obj->xrt);
799c852b9065 Extract event info from C object to JS object
Thinker K.F. Li <thinker@branda.to>
parents: 676
diff changeset
91 subject_o = export_xnjsmb_auto_subject_new(subject);
799c852b9065 Extract event info from C object to JS object
Thinker K.F. Li <thinker@branda.to>
parents: 676
diff changeset
92 SET(self, "kbevent", subject_o);
799c852b9065 Extract event info from C object to JS object
Thinker K.F. Li <thinker@branda.to>
parents: 676
diff changeset
93
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
94 return obj;
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
95 }
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
96
556
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
97 /*! \defgroup njs_template_cb Callback functions for v8 engine and nodejs.
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
98 *
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
99 * @{
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
100 */
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
101
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
102 #include "mbfly_njs-inc.h"
571
13b15b7a463b Redraw all and changed in Javascript
Thinker K.F. Li <thinker@branda.to>
parents: 567
diff changeset
103
556
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
104 /* @} */
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
105
562
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
106 /*! \brief Get rdman associated with the runtime.
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
107 */
559
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
108 redraw_man_t *
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
109 xnjsmb_rt_rdman(Handle<Object> mbrt) {
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
110 HandleScope scope;
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
111 njs_runtime_t *rt;
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
112 redraw_man_t *rdman;
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
113
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
114 rt = (njs_runtime_t *)UNWRAP(mbrt);
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
115 rdman = X_njs_MB_rdman(rt);
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
116
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
117 return rdman;
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
118 }
ef078d7c57b4 Use internal field to store njs_runtime_t object.
Thinker K.F. Li <thinker@branda.to>
parents: 558
diff changeset
119
548
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
120 Handle<Value>
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
121 hello_func(const Arguments &args) {
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
122 HandleScope scope;
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
123
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
124 return String::Concat(String::New("World"), args[0]->ToString());
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
125 }
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
126
547
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
127 extern "C" void
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
128 init(Handle<Object> target) {
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
129 HandleScope scope;
562
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
130 Handle<FunctionTemplate> func, mb_rt_func;
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
131 Handle<ObjectTemplate> rt_instance_temp, rt_proto_temp;
547
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
132
548
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
133 func = FunctionTemplate::New(hello_func);
f69b0814ef3c Test FunctionTemplate
Thinker K.F. Li <thinker@branda.to>
parents: 547
diff changeset
134 target->Set(String::New("Hello"), func->GetFunction());
556
c9d23f7279a4 The first testcase that nodejs code can show a MadButterfly window.
Thinker K.F. Li <thinker@branda.to>
parents: 548
diff changeset
135
562
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
136 /*
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
137 * Initialize template for MadButterfly runtime objects.
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
138 */
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
139 xnjsmb_auto_mb_rt_init();
571
13b15b7a463b Redraw all and changed in Javascript
Thinker K.F. Li <thinker@branda.to>
parents: 567
diff changeset
140
567
a12c3448afb6 Add dummy paint_color templates
Thinker K.F. Li <thinker@branda.to>
parents: 565
diff changeset
141 /*
a12c3448afb6 Add dummy paint_color templates
Thinker K.F. Li <thinker@branda.to>
parents: 565
diff changeset
142 * Add properties to mb_rt templates for other modules.
a12c3448afb6 Add dummy paint_color templates
Thinker K.F. Li <thinker@branda.to>
parents: 565
diff changeset
143 */
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
144 xnjsmb_shapes_init_mb_rt_temp(xnjsmb_auto_mb_rt_temp);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
145 xnjsmb_paints_init_mb_rt_temp(xnjsmb_auto_mb_rt_temp);
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
146 xnjsmb_font_init_mb_rt_temp(xnjsmb_auto_mb_rt_temp);
639
dc32c1c140ae First compilable image loader binding for Javascript
Thinker K.F. Li <thinker@branda.to>
parents: 638
diff changeset
147 xnjsmb_img_ldr_init_mb_rt_temp(target);
676
f264b50c469c Bind subject of mouse_event to JS object of coord
Thinker K.F. Li <thinker@branda.to>
parents: 675
diff changeset
148 xnjsmb_observer_init();
562
1b6402f07cd4 Make root coord availabe for Javascript code
Thinker K.F. Li <thinker@branda.to>
parents: 561
diff changeset
149
666
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
150 target->Set(String::New("mb_rt"),
b6fb543d69ee Use binding generator to implement mb_rt
Thinker K.F. Li <thinker@branda.to>
parents: 639
diff changeset
151 xnjsmb_auto_mb_rt_temp->GetFunction());
547
371690a166df Remove hello.c and initial plugin at mbfly_njs.cc
Thinker K.F. Li <thinker@branda.to>
parents: 546
diff changeset
152 }