diff nodejs/mbfly_njs.cc @ 571:13b15b7a463b Android_Skia

Redraw all and changed in Javascript
author Thinker K.F. Li <thinker@branda.to>
date Wed, 09 Jun 2010 15:39:24 +0800
parents a12c3448afb6
children 97159102f886
line wrap: on
line diff
--- a/nodejs/mbfly_njs.cc	Wed Jun 09 15:10:29 2010 +0800
+++ b/nodejs/mbfly_njs.cc	Wed Jun 09 15:39:24 2010 +0800
@@ -61,6 +61,36 @@
 xnjsmb_handle_connection(const Arguments &args) {
 }
 
+static Handle<Value>
+xnjsmb_rt_redraw_changed(const Arguments &args) {
+    Handle<Object> self = args.This();
+    njs_runtime_t *rt;
+    redraw_man_t *rdman;
+    
+    rdman = xnjsmb_rt_rdman(self);
+    rdman_redraw_changed(rdman);
+    
+    rt = (njs_runtime_t *)UNWRAP(self);
+    X_njs_MB_flush(rt);
+    
+    return Null();
+}
+
+static Handle<Value>
+xnjsmb_rt_redraw_all(const Arguments &args) {
+    Handle<Object> self = args.This();
+    njs_runtime_t *rt;
+    redraw_man_t *rdman;
+    
+    rdman = xnjsmb_rt_rdman(self);
+    rdman_redraw_all(rdman);
+    
+    rt = (njs_runtime_t *)UNWRAP(self);
+    X_njs_MB_flush(rt);
+    
+    return Null();
+}
+
 /* @} */
 
 /*! \brief Get rdman associated with the runtime.
@@ -106,6 +136,12 @@
     func = FunctionTemplate::New(xnjsmb_coord_new);
     SET(rt_proto_temp, "coord_new", func);
 
+    func = FunctionTemplate::New(xnjsmb_rt_redraw_changed);
+    SET(rt_proto_temp, "redraw_changed", func);
+
+    func = FunctionTemplate::New(xnjsmb_rt_redraw_all);
+    SET(rt_proto_temp, "redraw_all", func);
+
     /*
      * Add properties to mb_rt templates for other modules.
      */