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