]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Menubar_pimpl.h
Yet more dialog tweaking from Rob.
[lyx.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  * This file is part of LyX, the document processor.
7  * Licence details can be found in the file COPYING.
8  *
9  * \author Lars Gullik Bjønnes
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef MENUBAR_PIMPL_H
15 #define MENUBAR_PIMPL_H
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include "LString.h"
22 #include "frontends/Menubar.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 class Menu;
35 class MenuItem;
36
37 /** The LyX GUI independent menubar class
38   The GUI interface is implemented in the corresponding Menubar_pimpl class.
39   */
40 struct Menubar::Pimpl {
41 public:
42         ///
43         Pimpl(LyXView *, MenuBackend const &);
44         ///
45         ~Pimpl();
46
47         /// update the state of the menuitems
48         void update();
49
50         /// Opens a top-level submenu given its name
51         void openByName(string const &);
52
53         ///
54         static void MenuCallback(FL_OBJECT *, long);
55
56 private:
57         ///
58         void add_toc(int menu, string const & extra_label,
59                      std::vector<int> & smn, Window win);
60         ///
61         void add_references(int menu, string const & extra_label,
62                             std::vector<int> & smn, Window win);
63         ///
64         int create_submenu(Window win, XFormsView * view,
65                            Menu const & menu,
66                            std::vector<int> & smn, bool & all_disabled);
67
68         //
69         void makeMenubar(Menu const & menu);
70
71         ///
72         XFormsView * owner_;
73         ///
74         MenuBackend const * menubackend_;
75         ///
76         struct ItemInfo {
77                 ///
78                 ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
79                          FL_OBJECT * o);
80                 ~ItemInfo();
81                 ///
82                 Menubar::Pimpl * pimpl_;
83                 ///
84                 boost::shared_ptr<MenuItem const> item_;
85                 ///
86                 FL_OBJECT * obj_;
87         };
88
89         ///
90         typedef std::vector<boost::shared_ptr<ItemInfo> > ButtonList;
91         ///
92         ButtonList buttonlist_;
93 };
94 #endif