]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/menubar.hxx
Merge branch 'next' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / GUI / menubar.hxx
index 6c7217786f207719af39158f01b70af18b800813..79e0af8146d9e4802824c4fe113c96d8743a258f 100644 (file)
@@ -7,20 +7,16 @@
 # error This library requires C++
 #endif
 
-#include <simgear/compiler.h>  // for SG_USING_STD
+#include <Main/fg_props.hxx>
 
 #include <plib/pu.h>
 
 #include <map>
-SG_USING_STD(map);
-
 #include <vector>
-SG_USING_STD(vector);
-
 
 class puMenuBar;
 class puObject;
-class FGBinding;
+class SGBinding;
 
 
 /**
@@ -87,7 +83,7 @@ public:
     /**
      * create a menubar based on a PropertyList within the PropertyTree
      */
-    void make_menubar (const SGPropertyNode * props);
+    void make_menubar (SGPropertyNode * props);
 
 
     /**
@@ -96,6 +92,12 @@ public:
     void destroy_menubar ();
 
 
+    /**
+     * Disable/enable menu titles and entries
+     */
+    bool enable_item (const SGPropertyNode * item, bool state);
+
+
 private:
 
     // Make a single menu.
@@ -104,6 +106,12 @@ private:
     // Make the top-level menubar.
     void make_menubar ();
 
+    // Create a property-path -> puObject map for menu node
+    void make_object_map(SGPropertyNode * node);
+
+    // Add <enabled> listener that enables/disables menu entries.
+    void add_enabled_listener(SGPropertyNode * node);
+
     // Is the menu visible?
     bool _visible;
 
@@ -111,7 +119,7 @@ private:
     puMenuBar * _menuBar;
 
     // A map of bindings for the menubar.
-    map<string,vector<FGBinding *> > _bindings;
+    std::map<std::string,std::vector<SGBinding *> > _bindings;
 
     // These are hoops that we have to jump through because PUI doesn't
     // do memory management for lists.  We have to allocate the arrays,
@@ -119,8 +127,11 @@ private:
     // freed.
     char ** make_char_array (int size);
     puCallback * make_callback_array (int size);
-    vector<char **> _char_arrays;
-    vector<puCallback *> _callback_arrays;
+    std::vector<char **> _char_arrays;
+    std::vector<puCallback *> _callback_arrays;
+
+    // A map for {menu node path}->puObject translation.
+    std::map<std::string, puObject *> _objects;
 };
 
 #endif // __MENUBAR_HXX