# HG changeset patch # User Thinker K.F. Li # Date 1302591010 -28800 # Node ID ef3908d9a3d2480a5715fd3cc84ef1c06f396442 # Parent e18c51c1c48f2d67896f1b4b2b053f57679a791b Revert 4be04f29fa70 diff -r e18c51c1c48f -r ef3908d9a3d2 nodejs/coord.cc --- a/nodejs/coord.cc Mon Apr 11 20:26:18 2011 +0800 +++ b/nodejs/coord.cc Tue Apr 12 14:50:10 2011 +0800 @@ -8,7 +8,6 @@ #include "mb_X_supp.h" #include "mb_tools.h" #include "njs_mb_supp.h" -#include } #include "mbfly_njs.h" @@ -16,6 +15,7 @@ #ifndef ASSERT #define ASSERT(x) #endif + #define OK 0 /*! \page jsgc How to Manage Life-cycle of Objects for Javascript. @@ -407,50 +407,6 @@ x = cc(0)*xx+cc(1)*yy+cc(2); return Number::New(x); } - -static int -xnjsmb_coord_set_text_recursive(coord_t *coord, Handle self, - const char *txt) { - shape_t *sh; - coord_t *child; - Handle rt; - redraw_man_t *rdman; - - FOR_COORD_SHAPES(coord, sh) { - printf("shape type %d\n",sh->obj.obj_type); - if (sh->obj.obj_type == MBO_STEXT) { - sh_stext_set_text(sh, txt); - /* - * Mark changed. - */ - rt = GET(self, "mbrt")->ToObject(); - ASSERT(rt != NULL); - rdman = xnjsmb_rt_rdman(rt); - - if(sh_get_coord(sh)) - rdman_shape_changed(rdman, sh); - return 1; - } - } - for((child) = STAILQ_HEAD((coord)->children); - (child) != NULL; - (child) = STAILQ_NEXT(coord_t, sibling, (child))) { - /* Invalidate members of a coord */ - if ( xnjsmb_coord_set_text_recursive(child, self, txt)) - return 1; - } - return 0; - -} - -static void -xnjsmb_coord_set_text(coord_t *coord, Handle self, - const char *txt) { - printf("text=%s\n",txt); - xnjsmb_coord_set_text_recursive(coord,self,txt); -} - - #undef m #include "coord-inc.h" diff -r e18c51c1c48f -r ef3908d9a3d2 nodejs/coord.m4 --- a/nodejs/coord.m4 Mon Apr 11 20:26:18 2011 +0800 +++ b/nodejs/coord.m4 Tue Apr 12 14:50:10 2011 +0800 @@ -7,9 +7,6 @@ ], [METHOD([add_shape], [xnjsmb_coord_add_shape], (SELF, OBJ([shape], [shape], [shape_t]), ERR), 1, []), - - METHOD([set_text], [xnjsmb_coord_set_text], - (SELF, STR([txt])), 1, []), METHOD([remove], [xnjsmb_coord_remove], (SELF), 0, []), METHOD([clone_from_subtree], [xnjsmb_coord_clone_from_subtree], (SELF, OBJ([src], [coord], [coord_t]), ERR), 1,