]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/Menubar_pimpl.h
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / Menubar_pimpl.h
index 69ff06e8425df0214aed65445667017da4d01943..d98bddaf24738d840e4160096b18356e5862fa1e 100644 (file)
@@ -1,36 +1,38 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+/**
+ * \file xforms/Menubar_pimpl.h
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1996-2001 Lars Gullik Bjønnes
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           This file is Copyright 1996-2000
- *           Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  *
- * ====================================================== */
+ * Full author contact details are available in file CREDITS
+ */
 
 #ifndef MENUBAR_PIMPL_H
 #define MENUBAR_PIMPL_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include <vector>
 #include "LString.h"
 #include "frontends/Menubar.h"
-#include FORMS_H_LOCATION
+
+#include <boost/shared_ptr.hpp>
+
+#include "forms_fwd.h"
+#include <X11/X.h> // Window
+
+#include <vector>
+#include <map>
+
 class LyXView;
-class MenuBackend;
+class XFormsView;
+class Menu;
 class MenuItem;
-class StrPool;
-
-#include "debug.h"
 
 /** The LyX GUI independent menubar class
-  The GUI interface is implemented in the corresponding Menubar_pimpl class. 
+  The GUI interface is implemented in the corresponding Menubar_pimpl class.
   */
 struct Menubar::Pimpl {
 public:
@@ -38,55 +40,50 @@ public:
        Pimpl(LyXView *, MenuBackend const &);
        ///
        ~Pimpl();
-       ///
-       void set(string const &);
+
+       /// update the state of the menuitems
+       void update();
+
        /// Opens a top-level submenu given its name
        void openByName(string const &);
 
        ///
        static void MenuCallback(FL_OBJECT *, long);
 
-       /// Add to "menu" the list of last opened files
-       /// (add "extra_label" to the last entry)
-       void add_lastfiles(int menu, string const & extra_label,
-                          std::vector<int> & smn, StrPool & strpool);
-       /// Add to "menu" the list of opened documents
-       /// (add "extra_label" to the last entry)
-       void add_documents(int menu, string const & extra_label,
-                          std::vector<int> & smn, StrPool & strpool);
+private:
        ///
-       int create_submenu(Window win, LyXView * view, 
-                          string const & menuname, 
-                          std::vector<int> & smn, StrPool & strpool);
+       void add_toc(int menu, string const & extra_label,
+                    std::vector<int> & smn, Window win);
+       ///
+       void add_references(int menu, string const & extra_label,
+                           std::vector<int> & smn, Window win);
+       ///
+       int create_submenu(Window win, XFormsView * view,
+                          Menu const & menu, std::vector<int> & smn);
 
-        /// update the state of the menuitems
-        void update() { }
+       //
+       void makeMenubar(Menu const & menu);
 
-private:
        ///
-       FL_OBJECT * frame_;
-       /// 
-       LyXView * owner_;
+       XFormsView * owner_;
        ///
        MenuBackend const * menubackend_;
        ///
-       string current_menu;
-       ///
        struct ItemInfo {
                ///
-               ItemInfo(Menubar::Pimpl * p, MenuItem const * i, 
-                          FL_OBJECT * o) 
-                       : pimpl_(p), item_(i), obj_(o) {}
+               ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
+                        FL_OBJECT * o);
+               ~ItemInfo();
                ///
                Menubar::Pimpl * pimpl_;
                ///
-               MenuItem const * item_;
+               boost::shared_ptr<MenuItem const> item_;
                ///
                FL_OBJECT * obj_;
        };
 
        ///
-       typedef std::vector<ItemInfo *> ButtonList;
+       typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
        ///
        ButtonList buttonlist_;
 };