3 * \file Menubar_pimpl.h
4 * Copyright 1995 Matthias Ettrich
5 * Copyright 1995-2002 the LyX Team
6 * Copyright 1996-2001 Lars Gullik Bjønnes
7 * Read the file COPYING
9 * \author Lars Gullik Bjønnes, larsbj@lyx.org
12 #ifndef MENUBAR_PIMPL_H
13 #define MENUBAR_PIMPL_H
20 #include "frontends/Menubar.h"
22 #include <boost/shared_ptr.hpp>
24 #include "forms_fwd.h"
25 #include <X11/X.h> // Window
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 /// update the state of the menuitems
46 /// Opens a top-level submenu given its name
47 void openByName(string const &);
50 static void MenuCallback(FL_OBJECT *, long);
54 void add_toc(int menu, string const & extra_label,
55 std::vector<int> & smn, Window win);
57 void add_references(int menu, string const & extra_label,
58 std::vector<int> & smn, Window win);
60 int create_submenu(Window win, XFormsView * view,
61 Menu const & menu, std::vector<int> & smn);
64 void makeMenubar(Menu const &menu);
69 MenuBackend const * menubackend_;
73 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
76 : pimpl_(p), obj_(o) { item_.reset(i); }
78 Menubar::Pimpl * pimpl_;
80 boost::shared_ptr<MenuItem const> item_;
86 typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
88 ButtonList buttonlist_;