Mercurial > MadButterfly
comparison nodejs/paints.cc @ 699:0b98bdc53215
Add binding for color changing of paint_color_t in JS
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 11 Aug 2010 17:38:44 +0800 |
parents | da12923a789a |
children | 163f0d9e6382 |
comparison
equal
deleted
inserted
replaced
698:32e1b8005403 | 699:0b98bdc53215 |
---|---|
46 | 46 |
47 rdman_paint_stroke(rdman, paint, sh); | 47 rdman_paint_stroke(rdman, paint, sh); |
48 | 48 |
49 if(sh_get_coord(sh)) | 49 if(sh_get_coord(sh)) |
50 rdman_shape_changed(rdman, sh); | 50 rdman_shape_changed(rdman, sh); |
51 } | |
52 | |
53 static void | |
54 xnjsmb_paint_color_set_color(paint_t *paint, Handle<Object> self, | |
55 float r, float g, float b, float a) { | |
56 Handle<Value> rt_v; | |
57 Handle<Object> rt_o; | |
58 redraw_man_t *rdman; | |
59 | |
60 rt_v = GET(self, "mbrt"); | |
61 rt_o = rt_v->ToObject(); | |
62 rdman = xnjsmb_rt_rdman(rt_o); | |
63 | |
64 paint_color_set(paint, r, g, b, a); | |
65 | |
66 rdman_paint_changed(rdman, paint); | |
51 } | 67 } |
52 | 68 |
53 #include "paints-inc.h" | 69 #include "paints-inc.h" |
54 | 70 |
55 /*! \defgroup xnjsmb_paints_cons Constructor of paints | 71 /*! \defgroup xnjsmb_paints_cons Constructor of paints |
129 if(!init_flag) { | 145 if(!init_flag) { |
130 xnjsmb_auto_paint_init(); | 146 xnjsmb_auto_paint_init(); |
131 xnjsmb_auto_paint_color_init(); | 147 xnjsmb_auto_paint_color_init(); |
132 xnjsmb_auto_paint_image_init(); | 148 xnjsmb_auto_paint_image_init(); |
133 | 149 |
134 /* xnjsmb_init_paints(); */ | |
135 init_flag = 1; | 150 init_flag = 1; |
136 } | 151 } |
137 /* | |
138 rt_proto_temp = rt_temp->PrototypeTemplate(); | |
139 SET(rt_proto_temp, "paint_color_new", xnjsmb_paint_color_new_temp); | |
140 SET(rt_proto_temp, "paint_image_new", xnjsmb_paint_image_new_temp); | |
141 */ | |
142 } | 152 } |
143 | 153 |
144 /* @} */ | 154 /* @} */ |