changeset 1449:ef3908d9a3d2

Revert 4be04f29fa70
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 12 Apr 2011 14:50:10 +0800
parents e18c51c1c48f
children 6644ef3d75eb
files nodejs/coord.cc nodejs/coord.m4
diffstat 2 files changed, 1 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- 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 <string.h>
 }
 
 #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<Object> self,
-				const char *txt) {
-    shape_t *sh;
-    coord_t *child;
-    Handle<Object> 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<Object> self,
-			 const char *txt) {
-    printf("text=%s\n",txt);
-    xnjsmb_coord_set_text_recursive(coord,self,txt);
-}
-
-
 #undef m
 
 #include "coord-inc.h"
--- 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,