]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/DEVEL/mathml_editor/ocaml/c_mathml_editor.cc
* added show/hide cursro methods
[helm.git] / helm / DEVEL / mathml_editor / ocaml / c_mathml_editor.cc
index 284f1ed508f4904c5abe5e21fd9fae75b6d9dd7b..88acf9b190d0072dd08852103bb99dc1c3badf44 100644 (file)
@@ -119,13 +119,29 @@ c_mathml_editor_drop(Editor* editor, int alt)
   editor->lexer->drop(alt != 0);
 }
 
+extern "C" int
+c_mathml_editor_cursor_hide(Editor* editor)
+{
+  assert(editor);
+  return editor->parser->hideCursor();
+}
+
+extern "C" int
+c_mathml_editor_cursor_show(Editor* editor)
+{
+  assert(editor);
+  return editor->parser->showCursor();
+}
+
 extern "C" char*
 c_mathml_editor_get_tex(const Editor* editor)
 {
   assert(editor);
   DOM::Document res = editor->tml_tex->apply(editor->parser->document());
-  DOM::Element root = res.get_documentElement();
-  return strdup(std::string(root.get_nodeValue()).c_str());
+  assert(res);
+  res.normalize();
+  assert(res.get_firstChild() && res.get_firstChild().get_nodeName() == "#text");
+  return strdup(std::string(res.get_firstChild().get_nodeValue()).c_str());
 }
 
 extern "C" void