]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_props.hxx
Fixed AIplane vertical speed.
[flightgear.git] / src / Main / fg_props.hxx
index 703636a96a5b67453207a73dd5085023f12d7b52..41772ff358345d94f66eeab7b8f9563e9f26d7ae 100644 (file)
@@ -6,36 +6,28 @@
 #ifndef __FG_PROPS_HXX
 #define __FG_PROPS_HXX 1
 
-#include <simgear/debug/logstream.hxx>
-#include <simgear/props/props.hxx>
-#include <simgear/props/props_io.hxx>
+#include <iosfwd>
 
-#include "globals.hxx"
+#include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/math/SGMath.hxx>
+
+#include <Main/globals.hxx>
 
-\f
 ////////////////////////////////////////////////////////////////////////
 // Property management.
 ////////////////////////////////////////////////////////////////////////
 
+class FGProperties : public SGSubsystem
+{
+public:
+    FGProperties ();
+    virtual ~FGProperties ();
 
-/**
- * Initialize the default FlightGear properties.
- *
- * These are mostly properties that haven't been claimed by a
- * specific module yet.  This function should be invoked once,
- * while the program is starting (and after the global property
- * tree has been created).
- */
-extern void fgInitProps ();    // fixme: how are they untied?
-
-
-/**
- * Update the default FlightGear properties.
- *
- * This function should be invoked once in each loop to update all
- * of the default properties.
- */
-extern void fgUpdateProps ();
+    void init ();
+    void bind ();
+    void unbind ();
+    void update (double dt);
+};
 
 
 /**
@@ -49,7 +41,7 @@ extern void fgUpdateProps ();
  *        just the ones flagged as archivable.
  * @return true if the flight was saved successfully.
  */
-extern bool fgSaveFlight (ostream &output, bool write_all = false);
+extern bool fgSaveFlight (std::ostream &output, bool write_all = false);
 
 
 /**
@@ -61,7 +53,7 @@ extern bool fgSaveFlight (ostream &output, bool write_all = false);
  * @param input The input stream to read the XML from.
  * @return true if the flight was restored successfully.
  */
-extern bool fgLoadFlight (istream &input);
+extern bool fgLoadFlight (std::istream &input);
 
 
 /**
@@ -76,7 +68,7 @@ extern bool fgLoadFlight (istream &input);
  *         otherwise.
  */
 extern bool fgLoadProps (const char * path, SGPropertyNode * props,
-                         bool in_fg_root = true);
+                         bool in_fg_root = true, int default_mode = 0);
 
 
 \f
@@ -539,5 +531,18 @@ fgTie (const char * name, T * obj, int index,
 }
 
 
+class FGMakeUpperCase : public SGPropertyChangeListener {
+public:
+    void valueChanged(SGPropertyNode *node) {
+        if (node->getType() != simgear::props::STRING)
+            return;
+
+        char *s = const_cast<char *>(node->getStringValue());
+        for (; *s; s++)
+            *s = toupper(*s);
+    }
+};
+
+
 #endif // __FG_PROPS_HXX