]> git.lyx.org Git - features.git/blob - src/frontends/Toolbar.C
Really dull and boring header shit
[features.git] / src / frontends / Toolbar.C
1 /**
2  * \file Toolbar.C
3  * Read the file COPYING
4  *
5  * \author Lars Gullik Bjønnes 
6  *
7  * Full author contact details are available in file CREDITS
8  */
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation "Toolbar.h"
14 #endif
15
16 #include "Toolbar.h"
17 #include "ToolbarDefaults.h"
18 #include "Toolbar_pimpl.h"
19 #include "debug.h"
20 #include "LyXAction.h"
21
22 using std::endl;
23
24 Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarDefaults const &tbd)
25         : last_textclass_(-1)
26 {
27         pimpl_ = new Pimpl(o, x, y);
28
29         // extracts the toolbar actions from tbd
30         for (ToolbarDefaults::const_iterator cit = tbd.begin();
31              cit != tbd.end(); ++cit) {
32                 pimpl_->add((*cit));
33                 lyxerr[Debug::GUI] << "tool action: " << (*cit) << endl;
34         }
35 }
36
37
38 Toolbar::~Toolbar()
39 {
40         delete pimpl_;
41 }
42
43
44 void Toolbar::update()
45 {
46         pimpl_->update();
47 }
48
49
50
51 void Toolbar::setLayout(string const & layout)
52 {
53         pimpl_->setLayout(layout);
54 }
55
56
57 bool Toolbar::updateLayoutList(int textclass)
58 {
59         // update the layout display
60         if (last_textclass_ != textclass) {
61                 pimpl_->updateLayoutList(true);
62                 last_textclass_ = textclass;
63                 return true;
64         } else {
65                 pimpl_->updateLayoutList(false);
66                 return false;
67         }
68 }
69
70
71 void Toolbar::openLayoutList()
72 {
73         pimpl_->openLayoutList();
74 }
75
76
77 void Toolbar::clearLayoutList()
78 {
79         pimpl_->clearLayoutList();
80 }