diff nodejs/X_supp_njs.c @ 869:c18058fb48ee

Export API for JS to feed X events. We need the API that JS code can feed X events to X runtime.
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 24 Sep 2010 03:22:19 +0800
parents 586e50f82c1f
children 67d0fed24120
line wrap: on
line diff
--- a/nodejs/X_supp_njs.c	Thu Sep 23 10:51:25 2010 +0800
+++ b/nodejs/X_supp_njs.c	Fri Sep 24 03:22:19 2010 +0800
@@ -141,6 +141,25 @@
     return rt;
 }
 
+/*! \brief Pass a X event to X runtime.
+ */
+void
+X_njs_MB_handle_single_event(njs_runtime_t *rt, void *evt) {
+    void *xrt = rt->xrt;
+    extern void _X_MB_handle_single_event(void *rt, void *evt);
+
+    _X_MB_handle_single_event(xrt, evt);
+}
+
+/*! \brief Called at end of an iteration of event loop.
+ */
+void
+X_njs_MB_no_more_event(njs_runtime_t *rt) {
+    void *xrt = rt->xrt;
+
+    _X_MB_no_more_event(xrt);
+}
+
 /*! \brief Get X runtime that is backend of this njs runtime.
  */
 void *