]> git.mxchange.org Git - flightgear.git/blob - src/GUI/new_gui.hxx
f950c0a66a14529eeaa3d4c7692639bd0bdee5b6
[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     void readDir (const char * path);
40
41     puObject * makeObject (SGPropertyNode * props,
42                            int parentWidth, int parentHeight);
43
44     void setupObject (puObject * object, SGPropertyNode * props);
45
46     void setupGroup (puGroup * group, SGPropertyNode * props,
47                      int width, int height, bool makeFrame = false);
48
49     map<string,SGPropertyNode_ptr> _objects;
50     puObject * _activeObject;
51
52     struct PropertyObject {
53         PropertyObject (puObject * object, SGPropertyNode_ptr node);
54         puObject * object;
55         SGPropertyNode_ptr node;
56     };
57
58     vector<PropertyObject> _propertyObjects;
59
60 };
61
62 #endif // __NEW_GUI_HXX