]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.hxx
Tweaks for Mips Irix compilers.
[flightgear.git] / src / Cockpit / panel.hxx
index 85b035f6bc0dbaec6ddd06062b4819c4ee5f0f5a..1adc9e811569859c14e7cdf5e909cea6bfed5f24 100644 (file)
 #include <plib/ssg.h>
 
 #include <simgear/misc/props.hxx>
+#include <simgear/timing/timestamp.hxx>
 
 #include <vector>
 #include <map>
 #include <plib/fnt.h>
 
-#include <Time/timestamp.hxx>
+#include <Main/fgfs.hxx>
+
 
 FG_USING_STD(vector);
 FG_USING_STD(map);
@@ -119,19 +121,22 @@ private:
 // the appropriate instruments for processing.
 ////////////////////////////////////////////////////////////////////////
 
-class FGPanel
+class FGPanel : public FGSubsystem
 {
 public:
 
-  FGPanel (int x, int y, int w, int h);
+  FGPanel (int window_x, int window_y, int window_w, int window_h);
   virtual ~FGPanel ();
 
+                               // Update the panel (every frame).
+  virtual void init ();
+  virtual void bind ();
+  virtual void unbind ();
+  virtual void update ();
+
                                // transfer pointer ownership!!!
   virtual void addInstrument (FGPanelInstrument * instrument);
 
-                               // Update the panel (every frame).
-  virtual void update () const;
-
                                // Background texture.
   virtual void setBackground (ssgTexture * texture);
 
@@ -139,6 +144,26 @@ public:
   virtual bool getVisibility () const;
   virtual void setVisibility (bool visibility);
 
+                               // Full width of panel.
+  virtual void setWidth (int width) { _width = width; }
+  virtual int getWidth () const { return _width; }
+
+                               // Full height of panel.
+  virtual void setHeight (int height) { _height = height; }
+  virtual int getHeight () const { return _height; }
+
+                               // X-offset
+  virtual void setXOffset (int offset);
+  virtual int getXOffset () const { return _x_offset; }
+
+                               // Y-offset.
+  virtual void setYOffset (int offset);
+  virtual int getYOffset () const { return _y_offset; }
+
+                               // View height.
+  virtual void setViewHeight (int height) { _view_height = height; }
+  virtual int getViewHeight () const { return _view_height; }
+
                                // Handle a mouse click.
   virtual bool doMouseAction (int button, int updown, int x, int y);
 
@@ -149,8 +174,13 @@ private:
   mutable int _mouseDelay;
   mutable FGPanelInstrument * _mouseInstrument;
   typedef vector<FGPanelInstrument *> instrument_list_type;
-  int _x, _y, _w, _h;
-  int _panel_h;
+  int _winx, _winy, _winw, _winh;
+  int _width;
+  int _height;
+  int _x_offset;
+  int _y_offset;
+  int _view_height;
+  
   ssgTexture * _bg;
                                // List of instruments in panel.
   instrument_list_type _instruments;
@@ -515,8 +545,8 @@ private:
   float _pointSize;
 
   mutable string _value;
-  mutable FGTimeStamp _then;
-  mutable FGTimeStamp _now;
+  mutable SGTimeStamp _then;
+  mutable SGTimeStamp _now;
 };
 
 
@@ -542,6 +572,14 @@ private:
 };
 
 
+\f
+////////////////////////////////////////////////////////////////////////
+// Functions.
+////////////////////////////////////////////////////////////////////////
+
+bool fgPanelVisible ();
+
+
 \f
 ////////////////////////////////////////////////////////////////////////
 // The current panel, if any.