2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * This file is Copyright 1996-2000
12 * ====================================================== */
14 #ifndef MENUBAR_PIMPL_H
15 #define MENUBAR_PIMPL_H
19 #include <boost/smart_ptr.hpp>
20 #include FORMS_H_LOCATION
27 #include "frontends/Menubar.h"
28 #include "commandtags.h"
35 /** The LyX GUI independent menubar class
36 The GUI interface is implemented in the corresponding Menubar_pimpl class.
38 struct Menubar::Pimpl {
41 Pimpl(LyXView *, MenuBackend const &);
43 void set(string const &);
44 /// Opens a top-level submenu given its name
45 void openByName(string const &);
48 static void MenuCallback(FL_OBJECT *, long);
51 void add_toc(int menu, string const & extra_label,
52 std::vector<int> & smn, Window win);
54 void add_references(int menu, string const & extra_label,
55 std::vector<int> & smn, Window win);
57 int create_submenu(Window win, LyXView * view,
58 string const & menuname,
59 std::vector<int> & smn);
61 /// update the state of the menuitems
65 void makeMenubar(Menu const &menu);
70 MenuBackend const * menubackend_;
74 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
77 : pimpl_(p), obj_(o) { item_.reset(i); }
79 Menubar::Pimpl * pimpl_;
81 boost::shared_ptr<MenuItem const> item_;
87 typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
89 ButtonList buttonlist_;
92 typedef std::map<string, FL_OBJECT *> MenubarMap;
94 MenubarMap menubarmap_;
96 string current_menu_name_;
98 FL_OBJECT * current_group_;