diff nodejs/coord.cc @ 749:ed59e659a202

Implement binding for hide/show for shapes and coords
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 25 Aug 2010 19:37:52 +0800
parents 56a5e08cd8af
children be0e02948c1d
line wrap: on
line diff
--- a/nodejs/coord.cc	Wed Aug 25 18:46:47 2010 +0800
+++ b/nodejs/coord.cc	Wed Aug 25 19:37:52 2010 +0800
@@ -227,6 +227,32 @@
     xnjsmb_coord_free_subtree(rdman, coord);
 }
 
+static void
+xnjsmb_coord_show(coord_t *coord, Handle<Object> self) {
+    Handle<Object> js_rt;
+    redraw_man_t *rdman;
+    
+    js_rt = GET(self, "mbrt")->ToObject();
+    ASSERT(js_rt != NULL);
+    rdman = xnjsmb_rt_rdman(js_rt);
+    
+    coord_show(coord);
+    rdman_coord_changed(rdman, coord);
+}
+
+static void
+xnjsmb_coord_hide(coord_t *coord, Handle<Object> self) {
+    Handle<Object> js_rt;
+    redraw_man_t *rdman;
+    
+    js_rt = GET(self, "mbrt")->ToObject();
+    ASSERT(js_rt != NULL);
+    rdman = xnjsmb_rt_rdman(js_rt);
+    
+    coord_hide(coord);
+    rdman_coord_changed(rdman, coord);
+}
+
 #include "coord-inc.h"
 
 /*! \brief This function used by \ref xnjsmb_mb_rt to wrap coord object.