]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/input.hxx
Moved some of the low level scene graph construction code over to simgear.
[flightgear.git] / src / Input / input.hxx
index 4a28edc961859b94226ad7a4449b81b88c48565a..2ca5568a68d72bdb8739d75e4a37a5433ec855a5 100644 (file)
 #include <simgear/compiler.h>
 
 #include <simgear/misc/commands.hxx>
-#include <simgear/misc/props.hxx>
+#include <simgear/props/condition.hxx>
+#include <simgear/props/props.hxx>
 
 #include <Main/fgfs.hxx>
+#include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
 
 #include <map>
@@ -45,6 +47,8 @@ SG_USING_STD(map);
 SG_USING_STD(vector);
 
 
+
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // General binding support.
@@ -58,7 +62,7 @@ SG_USING_STD(vector);
  * keyboard key, a joystick button or axis, or even a panel
  * instrument.</p>
  */
-class FGBinding : public FGConditional
+class FGBinding : public SGConditional
 {
 public:
 
@@ -139,11 +143,13 @@ public:
 
 
 private:
+                                // just to be safe.
+  FGBinding (const FGBinding &binding);
+
   string _command_name;
-  SGCommandMgr::command_t _command;
+  mutable SGCommandMgr::command_t _command;
   mutable SGPropertyNode * _arg;
-  mutable SGPropertyNode * _setting;
-  mutable SGCommandState * _command_state;
+  mutable SGPropertyNode_ptr _setting;
 };
 
 
@@ -189,9 +195,22 @@ public:
   // Implementation of FGSubsystem.
   //
   virtual void init ();
-  virtual void bind ();
-  virtual void unbind ();
-  virtual void update (int dt);
+  virtual void update (double dt);
+  virtual void suspend ();
+  virtual void resume ();
+  virtual bool is_suspended () const;
+
+
+  /**
+   * Control whether this is the default module to receive events.
+   *
+   * The first input module created will set itself as the default
+   * automatically.
+   *
+   * @param status true if this should be the default module for
+   * events, false otherwise.
+   */
+  virtual void makeDefault (bool status = true);
 
 
   /**
@@ -248,6 +267,8 @@ private:
     MAX_MICE = 1,
     MAX_MOUSE_BUTTONS = 8
   };
+  struct mouse;
+  friend struct mouse;
 
   typedef vector<FGBinding *> binding_list_t;
 
@@ -317,6 +338,8 @@ private:
     virtual ~mouse ();
     int x;
     int y;
+    SGPropertyNode * mode_node;
+    SGPropertyNode * mouse_button_nodes[MAX_MOUSE_BUTTONS];
     int nModes;
     int current_mode;
     mouse_mode * modes;
@@ -394,9 +417,6 @@ private:
 };
 
 
-extern FGInput current_input;
-
-
 \f
 ////////////////////////////////////////////////////////////////////////
 // GLUT callbacks.