]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Toolbar.C
Martin's changes to the Note inset.
[lyx.git] / src / frontends / Toolbar.C
index c19f215149186604532fb15cebe6f54aaf96554a..e9045711c853c801a9a0bc810943b72eff1044d4 100644 (file)
 
 #include "Toolbar.h"
 #include "ToolbarBackend.h"
-#include "Toolbar_pimpl.h"
 #include "debug.h"
 #include "LyXAction.h"
 
 using std::endl;
 
-Toolbar::Toolbar(LyXView * o, int x, int y, ToolbarBackend const & backend)
+Toolbar::Toolbar()
        : last_textclass_(-1)
 {
-       pimpl_ = new Pimpl(o, x, y);
-
-       // extracts the toolbar actions from  the backend
-       for (ToolbarBackend::const_iterator cit = backend.begin();
-            cit != backend.end(); ++cit) {
-               pimpl_->add(cit->first, cit->second);
-       }
 }
 
 
 Toolbar::~Toolbar()
 {
-       delete pimpl_;
 }
 
 
-void Toolbar::update()
+void Toolbar::init() 
 {
-       pimpl_->update();
-}
+       // extracts the toolbars from the backend
+       ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
+       ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
 
+       for (; cit != end; ++cit)
+               add(*cit);
+}
 
 
-void Toolbar::setLayout(string const & layout)
+void Toolbar::update(bool in_math, bool in_table)
 {
-       pimpl_->setLayout(layout);
+       update();
+
+       // extracts the toolbars from the backend
+       ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
+       ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
+
+       for (; cit != end; ++cit) {
+               if (cit->flags & ToolbarBackend::MATH)
+                       displayToolbar(*cit, in_math);
+               else if (cit->flags & ToolbarBackend::TABLE)
+                       displayToolbar(*cit, in_table);
+       }
 }
 
 
@@ -55,23 +61,9 @@ bool Toolbar::updateLayoutList(int textclass)
 {
        // update the layout display
        if (last_textclass_ != textclass) {
-               pimpl_->updateLayoutList(true);
+               updateLayoutList();
                last_textclass_ = textclass;
                return true;
-       } else {
-               pimpl_->updateLayoutList(false);
+       } else
                return false;
-       }
-}
-
-
-void Toolbar::openLayoutList()
-{
-       pimpl_->openLayoutList();
-}
-
-
-void Toolbar::clearLayoutList()
-{
-       pimpl_->clearLayoutList();
 }