]> git.lyx.org Git - lyx.git/blobdiff - src/MenuBackend.h
Fix bug 2195: Slowness in rendering inside insets, especially on the Mac
[lyx.git] / src / MenuBackend.h
index 6234d3a874a316988ee6a24d516da826a6520b89..20e34f0fde06aa0a828ad01d721ce0dfab8897a1 100644 (file)
@@ -55,6 +55,9 @@ public:
                /** This is a list of importable formats
                    typically for the File->Export menu. */
                ImportFormats,
+               /** This is the list of elements available
+                * for insertion into document. */
+               CharStyles,
                /** This is the list of floats that we can
                    insert a list for. */
                FloatListInsert,
@@ -153,7 +156,9 @@ public:
        ///
        ItemList::size_type size() const { return items_.size(); }
        ///
-       bool hasSubmenu(std::string const &) const;
+       MenuItem const & operator[](size_type) const;
+       ///
+       bool hasFunc(FuncRequest const &) const;
        ///
        const_iterator begin() const {
                return items_.begin();
@@ -183,6 +188,10 @@ public:
        ///
        typedef MenuList::const_iterator const_iterator;
        ///
+       typedef MenuList::iterator iterator;
+       ///
+       MenuBackend() : specialmenu_(0) {}
+       ///
        void read(LyXLex &);
        ///
        void add(Menu const &);
@@ -196,6 +205,11 @@ public:
        Menu const & getMenubar() const;
        ///
        bool empty() const { return menulist_.empty(); }
+       /** This defines a menu whose entries list the FuncRequests
+           will be removed by expand() in other menus. This is used by
+           the Qt/Mac code
+       */
+       void specialMenu(std::string const &);
        /// Expands some special entries of the menu
        /** The entries with the following kind are expanded to a
            sequence of Command MenuItems: Lastfiles, Documents,
@@ -208,14 +222,24 @@ public:
                return menulist_.begin();
        }
        ///
+       iterator begin() {
+               return menulist_.begin();
+       }
+       ///
        const_iterator end() const {
                return menulist_.end();
        }
+       ///
+       iterator end() {
+               return menulist_.end();
+       }
 private:
        ///
        MenuList menulist_;
        ///
        Menu menubar_;
+       ///
+       Menu * specialmenu_;
 };
 
 ///