]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Menubar_pimpl.h
remove the multiple menubar stuff
[lyx.git] / src / frontends / xforms / Menubar_pimpl.h
1 // -*- C++ -*-
2 /**
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
8  *
9  * \author Lars Gullik Bjønnes, larsbj@lyx.org
10  */
11
12 #ifndef MENUBAR_PIMPL_H
13 #define MENUBAR_PIMPL_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "LString.h"
20 #include "frontends/Menubar.h"
21 #include "commandtags.h"
22 #include "MenuBackend.h"
23
24 #include <boost/shared_ptr.hpp>
25
26 #include "forms_fwd.h"
27 #include <X11/X.h> // Window
28
29 #include <vector>
30 #include <map>
31
32 class LyXView;
33 class XFormsView;
34
35 /** The LyX GUI independent menubar class
36   The GUI interface is implemented in the corresponding Menubar_pimpl class.
37   */
38 struct Menubar::Pimpl {
39 public:
40         ///
41         Pimpl(LyXView *, MenuBackend const &);
42
43         /// update the state of the menuitems
44         void update();
45
46         /// Opens a top-level submenu given its name
47         void openByName(string const &);
48
49         ///
50         static void MenuCallback(FL_OBJECT *, long);
51
52 private:
53         ///
54         void add_toc(int menu, string const & extra_label,
55                      std::vector<int> & smn, Window win);
56         ///
57         void add_references(int menu, string const & extra_label,
58                             std::vector<int> & smn, Window win);
59         ///
60         int create_submenu(Window win, XFormsView * view,
61                            string const & menuname,
62                            std::vector<int> & smn);
63
64         //
65         void makeMenubar(Menu const &menu);
66
67         ///
68         XFormsView * owner_;
69         ///
70         MenuBackend const * menubackend_;
71         ///
72         struct ItemInfo {
73                 ///
74                 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
75                          FL_OBJECT * o)
76
77                         : pimpl_(p), obj_(o) { item_.reset(i); }
78                 ///
79                 Menubar::Pimpl * pimpl_;
80                 ///
81                 boost::shared_ptr<MenuItem const> item_;
82                 ///
83                 FL_OBJECT * obj_;
84         };
85
86         ///
87         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
88         ///
89         ButtonList buttonlist_;
90 };
91 #endif