]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scripting/NasalSys.hxx
- Added ultra-light traffic is now a separate traffic class that can have its
[flightgear.git] / src / Scripting / NasalSys.hxx
index 700b23011c902fde83270ae8be09112f64511f22..a68317570842fd9fcae58f6b78488c5e701491ce 100644 (file)
@@ -5,6 +5,7 @@
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/nasal/nasal.h>
 #include <simgear/scene/model/model.hxx>
+#include <simgear/xml/easyxml.hxx>
 
 #include <map>
 SG_USING_STD(map);
@@ -40,7 +41,7 @@ public:
     FGNasalScript* parseScript(const char* src, const char* name=0);
 
     // Implementation of the settimer extension function
-    void setTimer(int argc, naRef* args);
+    void setTimer(naContext c, int argc, naRef* args);
 
     // Implementation of the setlistener extension function
     naRef setListener(naContext c, int argc, naRef* args);
@@ -160,4 +161,23 @@ private:
     SGConstPropertyNode_ptr _unload;
 };
 
+
+class NasalXMLVisitor : public XMLVisitor {
+public:
+    NasalXMLVisitor(naContext c, int argc, naRef* args);
+    virtual ~NasalXMLVisitor() { naFreeContext(_c); }
+
+    virtual void startElement(const char* tag, const XMLAttributes& a);
+    virtual void endElement(const char* tag);
+    virtual void data(const char* str, int len);
+    virtual void pi(const char* target, const char* data);
+
+private:
+    void call(naRef func, int num, naRef a = naNil(), naRef b = naNil());
+    naRef make_string(const char* s, int n = -1);
+
+    naContext _c;
+    naRef _start_element, _end_element, _data, _pi;
+};
+
 #endif // __NASALSYS_HXX