]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Menubar_pimpl.h
move a few things out-of-line
[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
22 #include <boost/shared_ptr.hpp>
23
24 #include "forms_fwd.h"
25 #include <X11/X.h> // Window
26
27 #include <vector>
28 #include <map>
29
30 class LyXView;
31 class XFormsView;
32 class Menu;
33 class MenuItem;
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         ~Pimpl();
44
45         /// update the state of the menuitems
46         void update();
47
48         /// Opens a top-level submenu given its name
49         void openByName(string const &);
50
51         ///
52         static void MenuCallback(FL_OBJECT *, long);
53
54 private:
55         ///
56         void add_toc(int menu, string const & extra_label,
57                      std::vector<int> & smn, Window win);
58         ///
59         void add_references(int menu, string const & extra_label,
60                             std::vector<int> & smn, Window win);
61         ///
62         int create_submenu(Window win, XFormsView * view,
63                            Menu const & menu,
64                            std::vector<int> & smn, bool & all_disabled);
65
66         //
67         void makeMenubar(Menu const & menu);
68
69         ///
70         XFormsView * owner_;
71         ///
72         MenuBackend const * menubackend_;
73         ///
74         struct ItemInfo {
75                 ///
76                 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
77                          FL_OBJECT * o);
78                 ~ItemInfo();
79                 ///
80                 Menubar::Pimpl * pimpl_;
81                 ///
82                 boost::shared_ptr<MenuItem const> item_;
83                 ///
84                 FL_OBJECT * obj_;
85         };
86
87         ///
88         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
89         ///
90         ButtonList buttonlist_;
91 };
92 #endif