TPushParser::TPushParser(ALogger& l, const TDictionary& d) : APushParser(l), dictionary(d)
{
- reset();
+ init();
}
TPushParser::TPushParser(ALogger& l, AMathMLFactory& f, const TDictionary& d) : APushParser(l, f), dictionary(d)
{
- reset();
+ init();
}
TPushParser::~TPushParser()
{
}
+void
+TPushParser::init()
+{
+ cursor = doc.create("cursor");
+ cursor["visible"] = "1";
+ hiddenCursor = 0;
+ reset();
+}
+
void
TPushParser::reset()
{
- APushParser::reset();
+ cout << "passo di qui dentro pushparser " << factory << endl;
nextId = 1;
- cursor = doc.create("cursor");
- cursor["id"] = "I0";
- doc.clearDirty();
+ if (cursor.parent()) cursor.remove();
+ doc.reset();
doc.root().append(cursor);
+ if (factory) factory->documentModified(doc);
}
std::string
}
}
+bool
+TPushParser::hideCursor()
+{
+ if (hiddenCursor++ == 0)
+ {
+ cursor["visible"] = "0";
+ if (factory && doc.dirtyNode() && !frozen()) factory->documentModified(doc);
+ return true;
+ }
+ else
+ return false;
+}
+
+bool
+TPushParser::showCursor()
+{
+ if (hiddenCursor > 0 && --hiddenCursor == 0)
+ {
+ cursor["visible"] = "1";
+ if (factory && doc.dirtyNode() && !frozen()) factory->documentModified(doc);
+ return true;
+ }
+ else
+ return false;
+}
+
bool
TPushParser::thaw()
{