]> git.mxchange.org Git - flightgear.git/blob - src/GUI/new_gui.hxx
1c2f455af3ffefb530e3a622a52a51b19778b2cd
[flightgear.git] / src / GUI / new_gui.hxx
1 #ifndef __NEW_GUI_HXX
2 #define __NEW_GUI_HXX 1
3
4 #ifndef __cplusplus
5 # error This library requires C++
6 #endif
7
8 #include <plib/pu.h>
9
10 #include <simgear/compiler.h>   // for SG_USING_STD
11 #include <simgear/misc/props.hxx>
12
13 #include <vector>
14 SG_USING_STD(vector);
15
16 #include <map>
17 SG_USING_STD(map);
18
19 #include <Main/fgfs.hxx>
20
21
22 class NewGUI : public FGSubsystem
23 {
24 public:
25
26     NewGUI ();
27     virtual ~NewGUI ();
28     virtual void init ();
29     virtual void update (double delta_time_sec);
30
31     virtual void display (const string &name);
32
33     virtual void updateProperties ();
34     virtual void applyProperties ();
35     virtual void closeActiveObject ();
36
37 private:
38
39     puObject * makeObject (SGPropertyNode * props,
40                            int parentWidth, int parentHeight);
41
42     void setupObject (puObject * object, SGPropertyNode * props);
43
44     void setupGroup (puGroup * group, SGPropertyNode * props,
45                      int width, int height, bool makeFrame = false);
46
47     map<string,SGPropertyNode_ptr> _objects;
48     puObject * _activeObject;
49
50     struct PropertyObject {
51         PropertyObject (puObject * object, SGPropertyNode_ptr node);
52         puObject * object;
53         SGPropertyNode_ptr node;
54     };
55
56     vector<PropertyObject> _propertyObjects;
57
58 };
59
60 #endif // __NEW_GUI_HXX