Mercurial > MadButterfly
comparison nodejs/coord.cc @ 1372:0afd598a0b30
Add clone_from_subtree() for coord object of nodejs
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 07 Mar 2011 09:38:09 +0800 |
parents | 88bd0eee2b00 |
children | 8ecee58c85c6 |
comparison
equal
deleted
inserted
replaced
1371:36cbe73813a8 | 1372:0afd598a0b30 |
---|---|
230 | 230 |
231 xnjsmb_coord_invalidate_subtree(coord); | 231 xnjsmb_coord_invalidate_subtree(coord); |
232 xnjsmb_coord_free_subtree(rdman, coord); | 232 xnjsmb_coord_free_subtree(rdman, coord); |
233 } | 233 } |
234 | 234 |
235 static coord_t * | |
236 xnjsmb_coord_clone_from_subtree(coord_t *coord, Handle<Object> self, | |
237 coord_t *src, const char **err) { | |
238 Handle<Object> js_rt; | |
239 redraw_man_t *rdman; | |
240 coord_t *cloning; | |
241 | |
242 js_rt = GET(self, "mbrt")->ToObject(); | |
243 ASSERT(js_rt != NULL); | |
244 rdman = xnjsmb_rt_rdman(js_rt); | |
245 | |
246 cloning = rdman_coord_clone_from_subtree(rdman, coord, src); | |
247 if(cloning == NULL) { | |
248 *err = "can not clone a subtree (allocate memory)"; | |
249 return NULL; | |
250 } | |
251 | |
252 return cloning; | |
253 } | |
254 | |
235 static void | 255 static void |
236 xnjsmb_coord_show(coord_t *coord, Handle<Object> self) { | 256 xnjsmb_coord_show(coord_t *coord, Handle<Object> self) { |
237 Handle<Object> js_rt; | 257 Handle<Object> js_rt; |
238 redraw_man_t *rdman; | 258 redraw_man_t *rdman; |
239 | 259 |