]> git.lyx.org Git - features.git/commitdiff
a bunch of toolbar related renaming.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 25 May 2008 08:30:06 +0000 (08:30 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 25 May 2008 08:30:06 +0000 (08:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24931 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
development/scons/scons_manifest.py
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiApplication.h
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiToolbar.h
src/frontends/qt4/GuiToolbars.cpp
src/frontends/qt4/GuiToolbars.h
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h
src/frontends/qt4/Makefile.am
src/frontends/qt4/Menus.cpp
src/frontends/qt4/ToolbarBackend.cpp [deleted file]
src/frontends/qt4/ToolbarBackend.h [deleted file]
src/frontends/qt4/Toolbars.cpp [new file with mode: 0644]
src/frontends/qt4/Toolbars.h [new file with mode: 0644]

index 20183e349148cc605adb13ade8754472d9daa750..e17bcc25ce023df8b2fe3a3abc63cc0216e6d51d 100644 (file)
@@ -761,7 +761,7 @@ src_frontends_qt4_header_files = Split('''
     PanelStack.h
     TocModel.h
     TocWidget.h
-    ToolbarBackend.h
+    Toolbars.h
     Validator.h
     qt_helpers.h
     qt_i18n.h
@@ -852,7 +852,7 @@ src_frontends_qt4_files = Split('''
     PanelStack.cpp
     TocModel.cpp
     TocWidget.cpp
-    ToolbarBackend.cpp
+    Toolbars.cpp
     Validator.cpp
     qt_helpers.cpp
 ''')
index 8ef56090ad73d93487ccc938b0368a7d2530ecac..7b8556da2d67392f74f683c7774bc4d9677ddff5 100644 (file)
@@ -22,7 +22,7 @@
 #include "GuiView.h"
 #include "Menus.h"
 #include "qt_helpers.h"
-#include "ToolbarBackend.h"
+#include "Toolbars.h"
 
 #include "frontends/alert.h"
 #include "frontends/Application.h"
@@ -356,6 +356,10 @@ struct GuiApplication::Private
        QHash<int, SocketNotifier *> socket_notifiers_;
        ///
        Menus menus_;
+       ///
+       /// The global instance
+       Toolbars toolbars_;
+
        /// this timer is used for any regular events one wants to
        /// perform. at present it is used to check if forked processes
        /// are done.
@@ -706,6 +710,18 @@ FontLoader & GuiApplication::fontLoader()
 }
 
 
+Toolbars const & GuiApplication::toolbars() const 
+{
+       return d->toolbars_;
+}
+
+
+Toolbars & GuiApplication::toolbars()
+{
+       return d->toolbars_; 
+}
+
+
 Menus const & GuiApplication::menus() const 
 {
        return d->menus_;
@@ -1107,11 +1123,11 @@ bool GuiApplication::readUIFile(QString const & name, bool include)
                        break;
 
                case ui_toolbarset:
-                       toolbarbackend.readToolbars(lex);
+                       d->toolbars_.readToolbars(lex);
                        break;
 
                case ui_toolbars:
-                       toolbarbackend.readToolbarSettings(lex);
+                       d->toolbars_.readToolbarSettings(lex);
                        break;
 
                default:
index e0e3517a4233d9ee0ee2b764c02b1c4c8c5c65f3..4387aa570289b55b713bb74ef703569388ff6ed2 100644 (file)
@@ -36,6 +36,7 @@ class GlobalMenuBar;
 class GuiWorkArea;
 class Menus;
 class SocketNotifier;
+class Toolbars;
 
 /// The Qt main application class
 /**
@@ -71,6 +72,8 @@ public:
        Buffer const * updateInset(Inset const * inset) const;
        //@}
 
+       Toolbars const & toolbars() const;
+       Toolbars & toolbars();
        Menus const & menus() const;
        Menus & menus();
        /// Methods inherited from \c QApplication class
index 22225003cb5f9550b49411e42110c6b8f234385f..f83d2ec46c21c8da0bad8efeaf39fd1d32f0f43e 100644 (file)
 
 #include <config.h>
 
-#include "GuiView.h"
-#include "GuiCommandBuffer.h"
 #include "GuiToolbar.h"
-#include "LyXAction.h"
+
 #include "Action.h"
-#include "qt_helpers.h"
+#include "GuiApplication.h"
+#include "GuiCommandBuffer.h"
+#include "GuiView.h"
+#include "IconPalette.h"
 #include "InsertTableWidget.h"
+#include "qt_helpers.h"
+#include "Toolbars.h"
 
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Cursor.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "IconPalette.h"
 #include "Layout.h"
+#include "LyXAction.h"
 #include "LyXFunc.h"
 #include "LyXRC.h"
 #include "Paragraph.h"
 #include "TextClass.h"
-#include "ToolbarBackend.h"
 
 #include "support/debug.h"
 #include "support/filetools.h"
@@ -881,7 +883,7 @@ public:
                        this, SLOT(setIconSize(QSize)));
                setCheckable(true);
                ToolbarInfo const * tbinfo = 
-                       toolbarbackend.getDefinedToolbarInfo(tbitem_.name_);
+                       guiApp->toolbars().getDefinedToolbarInfo(tbitem_.name_);
                if (tbinfo)
                        // use the icon of first action for the toolbar button
                        setIcon(getIcon(tbinfo->items.begin()->func_, true));
@@ -897,7 +899,7 @@ public:
                initialized_ = true;
 
                ToolbarInfo const * tbinfo = 
-                       toolbarbackend.getDefinedToolbarInfo(tbitem_.name_);
+                       guiApp->toolbars().getDefinedToolbarInfo(tbitem_.name_);
                if (!tbinfo) {
                        lyxerr << "Unknown toolbar " << tbitem_.name_ << endl;
                        return;
@@ -952,7 +954,7 @@ public:
                m->setTearOffEnabled(true);
                connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
                ToolbarInfo const * tbinfo = 
-                       toolbarbackend.getDefinedToolbarInfo(tbitem_.name_);
+                       guiApp->toolbars().getDefinedToolbarInfo(tbitem_.name_);
                if (!tbinfo) {
                        lyxerr << "Unknown toolbar " << tbitem_.name_ << endl;
                        return;
index 57650ac8eff18664b23ac36badc77dc40350e60f..382440bf90c076301c6844525879318ed96d9d7c 100644 (file)
@@ -30,15 +30,17 @@ namespace lyx {
 
 class DocumentClass;
 class Inset;
-class ToolbarItem;
 
 namespace frontend {
 
 class Action;
 class GuiCommandBuffer;
 class GuiLayoutFilterModel;
+class GuiToolbar;
 class GuiView;
 class LayoutItemDelegate;
+class ToolbarInfo;
+class ToolbarItem;
 
 class GuiLayoutBox : public QComboBox
 {
index c1e573370735a057032a184aeb5688cf583bd8f9..de07ffea49fd8688d5147d6dad8fc3a7ef6e4e98 100644 (file)
 
 #include "GuiToolbars.h"
 
+#include "GuiApplication.h"
 #include "GuiCommandBuffer.h"
 #include "GuiToolbar.h"
 #include "GuiView.h"
+#include "Toolbars.h"
 
 #include "Buffer.h"
 #include "BufferParams.h"
@@ -26,7 +28,6 @@
 #include "LyX.h"
 #include "LyXFunc.h"
 #include "TextClass.h"
-#include "ToolbarBackend.h"
 
 #include "support/debug.h"
 #include "support/gettext.h"
@@ -95,33 +96,33 @@ void GuiToolbars::initFlags(ToolbarInfo & tbinfo)
        }
        /*
        cout << "State " << info.state << " FLAGS: " << flags
-               << " ON:" << (flags & ToolbarBackend::ON)
-               << " OFF:" << (flags & ToolbarBackend::OFF)
-               << " L:" << (flags & ToolbarBackend::LEFT)
-               << " R:" << (flags & ToolbarBackend::RIGHT)
-               << " T:" << (flags & ToolbarBackend::TOP)
-               << " B:" << (flags & ToolbarBackend::BOTTOM)
-               << " MA:" << (flags & ToolbarBackend::MATH)
-               << " RE:" << (flags & ToolbarBackend::REVIEW)
-               << " TB:" << (flags & ToolbarBackend::TABLE)
-               << " AU:" << (flags & ToolbarBackend::AUTO)
+               << " ON:" << (flags & Toolbars::ON)
+               << " OFF:" << (flags & Toolbars::OFF)
+               << " L:" << (flags & Toolbars::LEFT)
+               << " R:" << (flags & Toolbars::RIGHT)
+               << " T:" << (flags & Toolbars::TOP)
+               << " B:" << (flags & Toolbars::BOTTOM)
+               << " MA:" << (flags & Toolbars::MATH)
+               << " RE:" << (flags & Toolbars::REVIEW)
+               << " TB:" << (flags & Toolbars::TABLE)
+               << " AU:" << (flags & Toolbars::AUTO)
                << endl;
        */
        // now set the flags
-       tbinfo.flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
+       tbinfo.flags = static_cast<ToolbarInfo::Flags>(flags);
 }
 
 
 void GuiToolbars::init()
 {
-       ToolbarsMap::const_iterator it = toolbars_.begin();
+       ToolbarsMap::iterator it = toolbars_.begin();
        for (; it != toolbars_.end(); ++it)
                delete it->second;
        toolbars_.clear();
 
        // extracts the toolbars from the backend
-       ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
-       ToolbarBackend::Toolbars::iterator end = toolbarbackend.end();
+       Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
+       Toolbars::Infos::iterator end = guiApp->toolbars().end();
 
        // init flags will also add these toolbars to session if they
        // are not already there (e.g. first run of lyx).
@@ -149,7 +150,7 @@ void GuiToolbars::init()
                        (last_loc == ToolbarSection::ToolbarInfo::LEFT && tb->info.posx != last_posx) ||
                        (last_loc == ToolbarSection::ToolbarInfo::RIGHT && tb->info.posx != last_posx) );
                // find the backend item and add
-               for (cit = toolbarbackend.begin(); cit != end; ++cit)
+               for (cit = guiApp->toolbars().begin(); cit != end; ++cit)
                        if (cit->name == tb->key) {
                                add(*cit, newline);
                                last_loc = tb->info.location;
@@ -163,8 +164,8 @@ void GuiToolbars::init()
 
 void GuiToolbars::display(string const & name, bool show)
 {
-       ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
-       ToolbarBackend::Toolbars::iterator end = toolbarbackend.end();
+       Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
+       Toolbars::Infos::iterator end = guiApp->toolbars().end();
 
        for (; cit != end; ++cit) {
                if (cit->name == name) {
@@ -176,7 +177,7 @@ void GuiToolbars::display(string const & name, bool show)
                                TurnOnFlag(ON);
                        else
                                TurnOnFlag(OFF);
-                       cit->flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
+                       cit->flags = static_cast<ToolbarInfo::Flags>(flags);
                        displayToolbar(*cit, show);
                }
        }
@@ -187,13 +188,13 @@ void GuiToolbars::display(string const & name, bool show)
 
 ToolbarInfo * GuiToolbars::getToolbarInfo(string const & name)
 {
-       return toolbarbackend.getUsedToolbarInfo(name);
+       return guiApp->toolbars().getUsedToolbarInfo(name);
 }
 
 
 void GuiToolbars::toggleToolbarState(string const & name, bool allowauto)
 {
-       ToolbarInfo * tbi = toolbarbackend.getUsedToolbarInfo(name);
+       ToolbarInfo * tbi = guiApp->toolbars().getUsedToolbarInfo(name);
 
        if (!tbi) {
                LYXERR(Debug::GUI, "Toolbar::display: no toolbar named " << name);
@@ -230,17 +231,17 @@ void GuiToolbars::toggleFullScreen(bool start_full_screen)
 {
        // we need to know number of fullscreens until every
        // LyXView has its own toolbar configuration
-       toolbarbackend.fullScreenWindows += start_full_screen ? 1 : -1;
+       guiApp->toolbars().fullScreenWindows += start_full_screen ? 1 : -1;
 
        // extracts the toolbars from the backend
-       ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
-       ToolbarBackend::Toolbars::iterator end = toolbarbackend.end();
+       Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
+       Toolbars::Infos::iterator end = guiApp->toolbars().end();
        int flags = 0;
 
        for (; cit != end; ++cit) {
 
                if (start_full_screen) {
-                       if (toolbarbackend.fullScreenWindows == 1)
+                       if (guiApp->toolbars().fullScreenWindows == 1)
                                flags = cit->before_fullscreen = cit->flags;
                        TurnOffFlag(ON);
                        TurnOffFlag(AUTO);
@@ -261,8 +262,8 @@ void GuiToolbars::update(bool in_math, bool in_table, bool review,
        updateIcons();
 
        // extracts the toolbars from the backend
-       ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
-       ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
+       Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin();
+       Toolbars::Infos::const_iterator end = guiApp->toolbars().end();
 
        for (; cit != end; ++cit) {
                if (cit->flags & ToolbarInfo::ON)
@@ -295,8 +296,8 @@ void GuiToolbars::saveToolbarInfo()
 {
        ToolbarSection & tb = LyX::ref().session().toolbars();
 
-       for (ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
-               cit != toolbarbackend.end(); ++cit) {
+       for (Toolbars::Infos::iterator cit = guiApp->toolbars().begin();
+               cit != guiApp->toolbars().end(); ++cit) {
                ToolbarsMap::iterator it = toolbars_.find(cit->name);
                LASSERT(it != toolbars_.end(), /**/);
                // get toolbar info from session.
@@ -317,7 +318,7 @@ void GuiToolbars::saveToolbarInfo()
                        flags &= ~(info.state == ToolbarSection::ToolbarInfo::ON ? ToolbarInfo::OFF : ToolbarInfo::ON);
                        flags |= (info.state == ToolbarSection::ToolbarInfo::ON ? ToolbarInfo::ON : ToolbarInfo::OFF);
                        if (info.state == ToolbarSection::ToolbarInfo::ON)
-                       cit->flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
+                       cit->flags = static_cast<ToolbarInfo::Flags>(flags);
                }
                */
        }
index 49ac3a5af3b9099cd942a3fc7700473448322e32..1afad34ee380dff70a8d644a8b2608e03719c0f1 100644 (file)
 namespace lyx {
 
 class DocumentClass;
-class ToolbarInfo;
 
 namespace frontend {
 
 class GuiToolbar;
 class GuiView;
+class ToolbarInfo;
 
 class GuiToolbars
 {
index feba1f57dc727bdaeff0516be4698d3c7327e9f7..323f61646adcdf4ca4e38f88bdb07427bd9113f9 100644 (file)
@@ -52,7 +52,7 @@
 #include "Paragraph.h"
 #include "TextClass.h"
 #include "Text.h"
-#include "ToolbarBackend.h"
+#include "Toolbars.h"
 #include "version.h"
 
 #include "support/lassert.h"
@@ -1749,7 +1749,7 @@ bool GuiView::dispatch(FuncRequest const & cmd)
                        string const name = cmd.getArg(0);
                        bool const allowauto = cmd.getArg(1) == "allowauto";
                        // it is possible to get current toolbar status like this,...
-                       // but I decide to obey the order of ToolbarBackend::flags
+                       // but I decide to obey the order of Toolbars::flags
                        // and disregard real toolbar status.
                        // toolbars_->saveToolbarInfo();
                        //
index 7f5b14b93ed4a63695e98aeb26d1c2417d9ce79c..dee533fec70642aeb6fc21eb0dbcd3b872f83f38 100644 (file)
@@ -32,7 +32,6 @@ class QShowEvent;
 namespace lyx {
 
 class Cursor;
-class ToolbarInfo;
 
 namespace frontend {
 
@@ -42,6 +41,7 @@ class GuiToolbar;
 class GuiWorkArea;
 class TabWorkArea;
 class TocModels;
+class ToolbarInfo;
 
 /**
  * GuiView - Qt4 implementation of LyXView
index 997c071088b9266331baba177f6c2cda6aacff34..cb7bf6770c15d2d341f155a24ced5f2146e81f13 100644 (file)
@@ -132,7 +132,7 @@ SOURCEFILES = \
        qt_helpers.cpp \
        TocModel.cpp \
        TocWidget.cpp \
-       ToolbarBackend.cpp \
+       Toolbars.cpp \
        Validator.cpp 
 
 NOMOCHEADER = \
@@ -153,7 +153,7 @@ NOMOCHEADER = \
        LaTeXHighlighter.h \
        qt_i18n.h \
        qt_helpers.h \
-       ToolbarBackend.h
+       Toolbars.h
 
 MOCHEADER = \
        Action.h \
index cebd8975eb35400f5be78ddee30fbd26d6546cbb..c8ee95464d6c2645394a144923fe6e4dce2c7810 100644 (file)
@@ -46,7 +46,7 @@
 #include "Session.h"
 #include "TextClass.h"
 #include "TocBackend.h"
-#include "ToolbarBackend.h"
+#include "Toolbars.h"
 
 #include "insets/Inset.h"
 #include "insets/InsetCitation.h"
@@ -1012,13 +1012,13 @@ void MenuDefinition::expandToolbars()
 {
        //
        // extracts the toolbars from the backend
-       ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
-       ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
+       Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin();
+       Toolbars::Infos::const_iterator end = guiApp->toolbars().end();
 
        for (; cit != end; ++cit) {
                QString label = qt_(cit->gui_name);
                // frontends are not supposed to turn on/off toolbars,
-               // if they cannot update ToolbarBackend::flags. That
+               // if they cannot update Toolbars::flags. That
                // is to say, ToolbarsBackend::flags should reflect
                // the true state of toolbars.
                //
diff --git a/src/frontends/qt4/ToolbarBackend.cpp b/src/frontends/qt4/ToolbarBackend.cpp
deleted file mode 100644 (file)
index 419f051..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-/**
- * \file ToolbarBackend.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Jean-Marc Lasgouttes
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "ToolbarBackend.h"
-#include "FuncRequest.h"
-#include "Lexer.h"
-#include "LyXAction.h"
-#include "support/lstrings.h"
-
-#include "support/debug.h"
-#include "support/gettext.h"
-
-#include <boost/bind.hpp>
-
-#include <algorithm>
-
-using namespace std;
-using namespace lyx::support;
-
-namespace lyx {
-
-namespace {
-
-class ToolbarNamesEqual
-{
-public:
-       ToolbarNamesEqual(string const & name) : name_(name) {}
-       bool operator()(ToolbarInfo const & tbinfo) const
-       {
-               return tbinfo.name == name_;
-       }
-private:
-       string name_;
-};
-
-} // namespace anon
-
-
-ToolbarBackend toolbarbackend;
-
-
-/////////////////////////////////////////////////////////////////////////
-//
-// ToolbarItem
-//
-/////////////////////////////////////////////////////////////////////////
-
-ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const & label)
-       : type_(type), func_(func), label_(label)
-{
-}
-
-
-ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label)
-       : type_(type), label_(label), name_(name)
-{
-}
-
-
-ToolbarItem::~ToolbarItem()
-{}
-
-
-void ToolbarInfo::add(ToolbarItem const & item)
-{
-       items.push_back(item);
-       items.back().func_.origin = FuncRequest::TOOLBAR;
-}
-
-
-ToolbarInfo & ToolbarInfo::read(Lexer & lex)
-{
-       enum {
-               TO_COMMAND = 1,
-               TO_ENDTOOLBAR,
-               TO_SEPARATOR,
-               TO_LAYOUTS,
-               TO_MINIBUFFER,
-               TO_TABLEINSERT,
-               TO_POPUPMENU,
-               TO_ICONPALETTE,
-       };
-
-       struct LexerKeyword toolTags[] = {
-               { "end", TO_ENDTOOLBAR },
-               { "iconpalette", TO_ICONPALETTE },
-               { "item", TO_COMMAND },
-               { "layouts", TO_LAYOUTS },
-               { "minibuffer", TO_MINIBUFFER },
-               { "popupmenu", TO_POPUPMENU },
-               { "separator", TO_SEPARATOR },
-               { "tableinsert", TO_TABLEINSERT }
-       };
-
-       //consistency check
-       if (compare_ascii_no_case(lex.getString(), "toolbar")) {
-               LYXERR0("ToolbarInfo::read: ERROR wrong token:`"
-                      << lex.getString() << '\'');
-       }
-
-       lex.next(true);
-       name = lex.getString();
-
-       lex.next(true);
-       gui_name = lex.getString();
-
-       // FIXME what to do here?
-       if (!lex) {
-               LYXERR0("ToolbarInfo::read: Malformed toolbar "
-                       "description " <<  lex.getString());
-               return *this;
-       }
-
-       bool quit = false;
-
-       lex.pushTable(toolTags);
-
-       if (lyxerr.debugging(Debug::PARSER))
-               lex.printTable(lyxerr);
-
-       while (lex.isOK() && !quit) {
-               switch (lex.lex()) {
-               case TO_COMMAND:
-                       if (lex.next(true)) {
-                               docstring const tooltip = translateIfPossible(lex.getDocString());
-                               lex.next(true);
-                               string const func_arg = lex.getString();
-                               LYXERR(Debug::PARSER, "ToolbarInfo::read TO_COMMAND func: `"
-                                       << func_arg << '\'');
-
-                               FuncRequest func =
-                                       lyxaction.lookupFunc(func_arg);
-                               add(ToolbarItem(ToolbarItem::COMMAND, func, tooltip));
-                       }
-                       break;
-
-               case TO_MINIBUFFER:
-                       add(ToolbarItem(ToolbarItem::MINIBUFFER,
-                               FuncRequest(FuncCode(ToolbarItem::MINIBUFFER))));
-                       break;
-
-               case TO_SEPARATOR:
-                       add(ToolbarItem(ToolbarItem::SEPARATOR,
-                               FuncRequest(FuncCode(ToolbarItem::SEPARATOR))));
-                       break;
-
-               case TO_POPUPMENU:
-                       if (lex.next(true)) {
-                               string const name = lex.getString();
-                               lex.next(true);
-                               docstring const label = lex.getDocString();
-                               add(ToolbarItem(ToolbarItem::POPUPMENU, name, label));
-                       }
-                       break;
-
-               case TO_ICONPALETTE:
-                       if (lex.next(true)) {
-                               string const name = lex.getString();
-                               lex.next(true);
-                               docstring const label = lex.getDocString();
-                               add(ToolbarItem(ToolbarItem::ICONPALETTE, name, label));
-                       }
-                       break;
-
-               case TO_LAYOUTS:
-                       add(ToolbarItem(ToolbarItem::LAYOUTS,
-                               FuncRequest(FuncCode(ToolbarItem::LAYOUTS))));
-                       break;
-
-               case TO_TABLEINSERT:
-                       if (lex.next(true)) {
-                               docstring const tooltip = lex.getDocString();
-                               add(ToolbarItem(ToolbarItem::TABLEINSERT,
-                                       FuncRequest(FuncCode(ToolbarItem::TABLEINSERT)), tooltip));
-                       }
-                       break;
-
-               case TO_ENDTOOLBAR:
-                       quit = true;
-                       break;
-
-               default:
-                       lex.printError("ToolbarInfo::read: "
-                                      "Unknown toolbar tag: `$$Token'");
-                       break;
-               }
-       }
-
-       lex.popTable();
-       return *this;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////
-//
-// ToolbarBackend
-//
-/////////////////////////////////////////////////////////////////////////
-
-
-ToolbarBackend::ToolbarBackend()
-{
-       fullScreenWindows = 0;
-}
-
-
-void ToolbarBackend::readToolbars(Lexer & lex)
-{
-       enum {
-               TO_TOOLBAR = 1,
-               TO_ENDTOOLBARSET,
-       };
-
-       struct LexerKeyword toolTags[] = {
-               { "end", TO_ENDTOOLBARSET },
-               { "toolbar", TO_TOOLBAR }
-       };
-
-       //consistency check
-       if (compare_ascii_no_case(lex.getString(), "toolbarset")) {
-               LYXERR0("ToolbarBackend::readToolbars: ERROR wrong token:`"
-                      << lex.getString() << '\'');
-       }
-
-       lex.pushTable(toolTags);
-
-       if (lyxerr.debugging(Debug::PARSER))
-               lex.printTable(lyxerr);
-
-       bool quit = false;
-       while (lex.isOK() && !quit) {
-               switch (lex.lex()) {
-               case TO_TOOLBAR: {
-                       ToolbarInfo tbinfo;
-                       tbinfo.read(lex);
-                       toolbars.push_back(tbinfo);
-                       break;
-                       }
-               case TO_ENDTOOLBARSET:
-                       quit = true;
-                       break;
-               default:
-                       lex.printError("ToolbarBackend::readToolbars: "
-                                      "Unknown toolbar tag: `$$Token'");
-                       break;
-               }
-       }
-
-       lex.popTable();
-}
-
-
-void ToolbarBackend::readToolbarSettings(Lexer & lex)
-{
-       //consistency check
-       if (compare_ascii_no_case(lex.getString(), "toolbars")) {
-               LYXERR0("ToolbarBackend::readToolbarSettings: ERROR wrong token:`"
-                      << lex.getString() << '\'');
-       }
-
-       lex.next(true);
-
-       while (lex.isOK()) {
-               string name = lex.getString();
-               lex.next(true);
-
-               if (!compare_ascii_no_case(name, "end"))
-                       return;
-
-               Toolbars::iterator tcit = toolbars.begin();
-               Toolbars::iterator tend = toolbars.end();
-               for (; tcit != tend; ++tcit) {
-                       if (tcit->name == name)
-                               break;
-               }
-
-               if (tcit == tend) {
-                       LYXERR0("ToolbarBackend: undefined toolbar " << name);
-                       return;
-               }
-
-               tcit->flags = static_cast<ToolbarInfo::Flags>(0);
-               string flagstr = lex.getString();
-               lex.next(true);
-               vector<string> flags = getVectorFromString(flagstr);
-
-               vector<string>::const_iterator cit = flags.begin();
-               vector<string>::const_iterator end = flags.end();
-
-               for (; cit != end; ++cit) {
-                       int flag = 0;
-                       if (!compare_ascii_no_case(*cit, "off"))
-                               flag = ToolbarInfo::OFF;
-                       else if (!compare_ascii_no_case(*cit, "on"))
-                               flag = ToolbarInfo::ON;
-                       else if (!compare_ascii_no_case(*cit, "math"))
-                               flag = ToolbarInfo::MATH;
-                       else if (!compare_ascii_no_case(*cit, "table"))
-                               flag = ToolbarInfo::TABLE;
-                       else if (!compare_ascii_no_case(*cit, "mathmacrotemplate"))
-                               flag = ToolbarInfo::MATHMACROTEMPLATE;
-                       else if (!compare_ascii_no_case(*cit, "review"))
-                               flag = ToolbarInfo::REVIEW;
-                       else if (!compare_ascii_no_case(*cit, "top"))
-                               flag = ToolbarInfo::TOP;
-                       else if (!compare_ascii_no_case(*cit, "bottom"))
-                               flag = ToolbarInfo::BOTTOM;
-                       else if (!compare_ascii_no_case(*cit, "left"))
-                               flag = ToolbarInfo::LEFT;
-                       else if (!compare_ascii_no_case(*cit, "right"))
-                               flag = ToolbarInfo::RIGHT;
-                       else if (!compare_ascii_no_case(*cit, "auto"))
-                               flag = ToolbarInfo::AUTO;
-                       else {
-                               LYXERR(Debug::ANY,
-                                       "ToolbarBackend::readToolbarSettings: unrecognised token:`"
-                                       << *cit << '\'');
-                       }
-                       tcit->flags = static_cast<ToolbarInfo::Flags>(tcit->flags | flag);
-               }
-
-               usedtoolbars.push_back(*tcit);
-       }
-}
-
-
-ToolbarInfo const * ToolbarBackend::getDefinedToolbarInfo(string const & name) const
-{
-       Toolbars::const_iterator it = find_if(toolbars.begin(), toolbars.end(), ToolbarNamesEqual(name));
-       if (it == toolbars.end())
-               return 0;
-       return &(*it);
-}
-
-
-ToolbarInfo * ToolbarBackend::getUsedToolbarInfo(string const &name)
-{
-       Toolbars::iterator it = find_if(usedtoolbars.begin(), usedtoolbars.end(), ToolbarNamesEqual(name));
-       if (it == usedtoolbars.end())
-               return 0;
-       return &(*it);
-}
-
-} // namespace lyx
diff --git a/src/frontends/qt4/ToolbarBackend.h b/src/frontends/qt4/ToolbarBackend.h
deleted file mode 100644 (file)
index 8845b5d..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-// -*- C++ -*-
-/**
- * \file ToolbarBackend.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Jean-Marc Lasgouttes
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef TOOLBAR_BACKEND_H
-#define TOOLBAR_BACKEND_H
-
-#include "FuncRequest.h"
-
-#include <vector>
-
-
-namespace lyx {
-
-
-class Lexer;
-
-class ToolbarItem {
-public:
-       enum Type {
-               /// command/action
-               COMMAND,
-               /// the command buffer
-               MINIBUFFER,
-               /// adds space between buttons in the toolbar
-               SEPARATOR,
-               /// a special combox insead of a button
-               LAYOUTS,
-               /// a special widget to insert tabulars
-               TABLEINSERT,
-               ///
-               POPUPMENU,
-               ///
-               ICONPALETTE
-       };
-
-       ToolbarItem(Type type,
-                FuncRequest const & func,
-                docstring const & label = docstring());
-
-       ToolbarItem(Type type,
-                std::string const & name = std::string(),
-                docstring const & label = docstring());
-
-       ~ToolbarItem();
-
-       /// item type
-       Type type_;
-       /// action
-       FuncRequest func_;
-       /// label/tooltip
-       docstring label_;
-       /// name
-       std::string name_;
-};
-
-
-///
-class ToolbarInfo {
-public:
-       /// toolbar flags
-       enum Flags {
-               ON = 1, //< show
-               OFF = 2, //< do not show
-               MATH = 4, //< show when in math
-               TABLE = 8, //< show when in table
-               TOP = 16, //< show at top
-               BOTTOM = 32, //< show at bottom
-               LEFT = 64, //< show at left
-               RIGHT = 128, //< show at right
-               REVIEW = 256, //< show when change tracking is enabled
-               AUTO = 512,  //< only if AUTO is set, when MATH, TABLE and REVIEW is used
-               MATHMACROTEMPLATE = 1024 //< show in math macro template
-       };
-       /// the toolbar items
-       typedef std::vector<ToolbarItem> Items;
-
-       typedef Items::const_iterator item_iterator;
-
-       explicit ToolbarInfo(std::string const & name = std::string())
-               : name(name) {}
-
-       /// toolbar name
-       std::string name;
-       /// toolbar GUI name
-       std::string gui_name;
-       /// toolbar contents
-       Items items;
-       /// flags
-       Flags flags;
-       /// store flags when coming to fullscreen mode
-       Flags before_fullscreen;
-
-       /// read a toolbar from the file
-       ToolbarInfo & read(Lexer &);
-
-private:
-       /// add toolbar item
-       void add(ToolbarItem const &);
-};
-
-
-///
-class ToolbarBackend {
-public:
-       typedef std::vector<ToolbarInfo> Toolbars;
-
-       ToolbarBackend();
-
-       /// iterator for all toolbars
-       Toolbars::const_iterator begin() const { return usedtoolbars.begin(); }
-
-       Toolbars::const_iterator end() const { return usedtoolbars.end(); }
-
-       Toolbars::iterator begin() { return usedtoolbars.begin(); }
-
-       Toolbars::iterator end() { return usedtoolbars.end(); }
-
-       /// read toolbars from the file
-       void readToolbars(Lexer &);
-
-       /// read ui toolbar settings
-       void readToolbarSettings(Lexer &);
-
-       ///
-       ToolbarInfo const * getDefinedToolbarInfo(std::string const & name) const;
-       ///
-       ToolbarInfo * getUsedToolbarInfo(std::string const & name);
-
-       // FIXME should be deleted when every window has its own toolbar config.
-       /// number of toggleFullScreen calls, i.e. number of FullScreen windows.
-       int fullScreenWindows;
-
-private:
-       /// all the defined toolbars
-       Toolbars toolbars;
-
-       /// toolbars listed
-       Toolbars usedtoolbars;
-};
-
-/// The global instance
-extern ToolbarBackend toolbarbackend;
-
-
-
-} // namespace lyx
-
-#endif // TOOLBAR_BACKEND_H
diff --git a/src/frontends/qt4/Toolbars.cpp b/src/frontends/qt4/Toolbars.cpp
new file mode 100644 (file)
index 0000000..99ece2f
--- /dev/null
@@ -0,0 +1,354 @@
+/**
+ * \file Toolbars.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Jean-Marc Lasgouttes
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "Toolbars.h"
+#include "FuncRequest.h"
+#include "Lexer.h"
+#include "LyXAction.h"
+#include "support/lstrings.h"
+
+#include "support/debug.h"
+#include "support/gettext.h"
+
+#include <boost/bind.hpp>
+
+#include <algorithm>
+
+using namespace std;
+using namespace lyx::support;
+
+namespace lyx {
+namespace frontend {
+
+namespace {
+
+class ToolbarNamesEqual
+{
+public:
+       ToolbarNamesEqual(string const & name) : name_(name) {}
+       bool operator()(ToolbarInfo const & tbinfo) const
+       {
+               return tbinfo.name == name_;
+       }
+private:
+       string name_;
+};
+
+} // namespace anon
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// ToolbarItem
+//
+/////////////////////////////////////////////////////////////////////////
+
+ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const & label)
+       : type_(type), func_(func), label_(label)
+{
+}
+
+
+ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label)
+       : type_(type), label_(label), name_(name)
+{
+}
+
+
+ToolbarItem::~ToolbarItem()
+{}
+
+
+void ToolbarInfo::add(ToolbarItem const & item)
+{
+       items.push_back(item);
+       items.back().func_.origin = FuncRequest::TOOLBAR;
+}
+
+
+ToolbarInfo & ToolbarInfo::read(Lexer & lex)
+{
+       enum {
+               TO_COMMAND = 1,
+               TO_ENDTOOLBAR,
+               TO_SEPARATOR,
+               TO_LAYOUTS,
+               TO_MINIBUFFER,
+               TO_TABLEINSERT,
+               TO_POPUPMENU,
+               TO_ICONPALETTE,
+       };
+
+       struct LexerKeyword toolTags[] = {
+               { "end", TO_ENDTOOLBAR },
+               { "iconpalette", TO_ICONPALETTE },
+               { "item", TO_COMMAND },
+               { "layouts", TO_LAYOUTS },
+               { "minibuffer", TO_MINIBUFFER },
+               { "popupmenu", TO_POPUPMENU },
+               { "separator", TO_SEPARATOR },
+               { "tableinsert", TO_TABLEINSERT }
+       };
+
+       //consistency check
+       if (compare_ascii_no_case(lex.getString(), "toolbar")) {
+               LYXERR0("ToolbarInfo::read: ERROR wrong token:`"
+                      << lex.getString() << '\'');
+       }
+
+       lex.next(true);
+       name = lex.getString();
+
+       lex.next(true);
+       gui_name = lex.getString();
+
+       // FIXME what to do here?
+       if (!lex) {
+               LYXERR0("ToolbarInfo::read: Malformed toolbar "
+                       "description " <<  lex.getString());
+               return *this;
+       }
+
+       bool quit = false;
+
+       lex.pushTable(toolTags);
+
+       if (lyxerr.debugging(Debug::PARSER))
+               lex.printTable(lyxerr);
+
+       while (lex.isOK() && !quit) {
+               switch (lex.lex()) {
+               case TO_COMMAND:
+                       if (lex.next(true)) {
+                               docstring const tooltip = translateIfPossible(lex.getDocString());
+                               lex.next(true);
+                               string const func_arg = lex.getString();
+                               LYXERR(Debug::PARSER, "ToolbarInfo::read TO_COMMAND func: `"
+                                       << func_arg << '\'');
+
+                               FuncRequest func =
+                                       lyxaction.lookupFunc(func_arg);
+                               add(ToolbarItem(ToolbarItem::COMMAND, func, tooltip));
+                       }
+                       break;
+
+               case TO_MINIBUFFER:
+                       add(ToolbarItem(ToolbarItem::MINIBUFFER,
+                               FuncRequest(FuncCode(ToolbarItem::MINIBUFFER))));
+                       break;
+
+               case TO_SEPARATOR:
+                       add(ToolbarItem(ToolbarItem::SEPARATOR,
+                               FuncRequest(FuncCode(ToolbarItem::SEPARATOR))));
+                       break;
+
+               case TO_POPUPMENU:
+                       if (lex.next(true)) {
+                               string const name = lex.getString();
+                               lex.next(true);
+                               docstring const label = lex.getDocString();
+                               add(ToolbarItem(ToolbarItem::POPUPMENU, name, label));
+                       }
+                       break;
+
+               case TO_ICONPALETTE:
+                       if (lex.next(true)) {
+                               string const name = lex.getString();
+                               lex.next(true);
+                               docstring const label = lex.getDocString();
+                               add(ToolbarItem(ToolbarItem::ICONPALETTE, name, label));
+                       }
+                       break;
+
+               case TO_LAYOUTS:
+                       add(ToolbarItem(ToolbarItem::LAYOUTS,
+                               FuncRequest(FuncCode(ToolbarItem::LAYOUTS))));
+                       break;
+
+               case TO_TABLEINSERT:
+                       if (lex.next(true)) {
+                               docstring const tooltip = lex.getDocString();
+                               add(ToolbarItem(ToolbarItem::TABLEINSERT,
+                                       FuncRequest(FuncCode(ToolbarItem::TABLEINSERT)), tooltip));
+                       }
+                       break;
+
+               case TO_ENDTOOLBAR:
+                       quit = true;
+                       break;
+
+               default:
+                       lex.printError("ToolbarInfo::read: "
+                                      "Unknown toolbar tag: `$$Token'");
+                       break;
+               }
+       }
+
+       lex.popTable();
+       return *this;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////
+//
+// Toolbars
+//
+/////////////////////////////////////////////////////////////////////////
+
+
+Toolbars::Toolbars()
+{
+       fullScreenWindows = 0;
+}
+
+
+void Toolbars::readToolbars(Lexer & lex)
+{
+       enum {
+               TO_TOOLBAR = 1,
+               TO_ENDTOOLBARSET,
+       };
+
+       struct LexerKeyword toolTags[] = {
+               { "end", TO_ENDTOOLBARSET },
+               { "toolbar", TO_TOOLBAR }
+       };
+
+       //consistency check
+       if (compare_ascii_no_case(lex.getString(), "toolbarset")) {
+               LYXERR0("Toolbars::readToolbars: ERROR wrong token:`"
+                      << lex.getString() << '\'');
+       }
+
+       lex.pushTable(toolTags);
+
+       if (lyxerr.debugging(Debug::PARSER))
+               lex.printTable(lyxerr);
+
+       bool quit = false;
+       while (lex.isOK() && !quit) {
+               switch (lex.lex()) {
+               case TO_TOOLBAR: {
+                       ToolbarInfo tbinfo;
+                       tbinfo.read(lex);
+                       toolbars.push_back(tbinfo);
+                       break;
+                       }
+               case TO_ENDTOOLBARSET:
+                       quit = true;
+                       break;
+               default:
+                       lex.printError("Toolbars::readToolbars: "
+                                      "Unknown toolbar tag: `$$Token'");
+                       break;
+               }
+       }
+
+       lex.popTable();
+}
+
+
+void Toolbars::readToolbarSettings(Lexer & lex)
+{
+       //consistency check
+       if (compare_ascii_no_case(lex.getString(), "toolbars")) {
+               LYXERR0("Toolbars::readToolbarSettings: ERROR wrong token:`"
+                      << lex.getString() << '\'');
+       }
+
+       lex.next(true);
+
+       while (lex.isOK()) {
+               string name = lex.getString();
+               lex.next(true);
+
+               if (!compare_ascii_no_case(name, "end"))
+                       return;
+
+               Infos::iterator tcit = toolbars.begin();
+               Infos::iterator tend = toolbars.end();
+               for (; tcit != tend; ++tcit) {
+                       if (tcit->name == name)
+                               break;
+               }
+
+               if (tcit == tend) {
+                       LYXERR0("Toolbars: undefined toolbar " << name);
+                       return;
+               }
+
+               tcit->flags = static_cast<ToolbarInfo::Flags>(0);
+               string flagstr = lex.getString();
+               lex.next(true);
+               vector<string> flags = getVectorFromString(flagstr);
+
+               vector<string>::const_iterator cit = flags.begin();
+               vector<string>::const_iterator end = flags.end();
+
+               for (; cit != end; ++cit) {
+                       int flag = 0;
+                       if (!compare_ascii_no_case(*cit, "off"))
+                               flag = ToolbarInfo::OFF;
+                       else if (!compare_ascii_no_case(*cit, "on"))
+                               flag = ToolbarInfo::ON;
+                       else if (!compare_ascii_no_case(*cit, "math"))
+                               flag = ToolbarInfo::MATH;
+                       else if (!compare_ascii_no_case(*cit, "table"))
+                               flag = ToolbarInfo::TABLE;
+                       else if (!compare_ascii_no_case(*cit, "mathmacrotemplate"))
+                               flag = ToolbarInfo::MATHMACROTEMPLATE;
+                       else if (!compare_ascii_no_case(*cit, "review"))
+                               flag = ToolbarInfo::REVIEW;
+                       else if (!compare_ascii_no_case(*cit, "top"))
+                               flag = ToolbarInfo::TOP;
+                       else if (!compare_ascii_no_case(*cit, "bottom"))
+                               flag = ToolbarInfo::BOTTOM;
+                       else if (!compare_ascii_no_case(*cit, "left"))
+                               flag = ToolbarInfo::LEFT;
+                       else if (!compare_ascii_no_case(*cit, "right"))
+                               flag = ToolbarInfo::RIGHT;
+                       else if (!compare_ascii_no_case(*cit, "auto"))
+                               flag = ToolbarInfo::AUTO;
+                       else {
+                               LYXERR(Debug::ANY,
+                                       "Toolbars::readToolbarSettings: unrecognised token:`"
+                                       << *cit << '\'');
+                       }
+                       tcit->flags = static_cast<ToolbarInfo::Flags>(tcit->flags | flag);
+               }
+
+               usedtoolbars.push_back(*tcit);
+       }
+}
+
+
+ToolbarInfo const * Toolbars::getDefinedToolbarInfo(string const & name) const
+{
+       Infos::const_iterator it = find_if(toolbars.begin(), toolbars.end(), ToolbarNamesEqual(name));
+       if (it == toolbars.end())
+               return 0;
+       return &(*it);
+}
+
+
+ToolbarInfo * Toolbars::getUsedToolbarInfo(string const &name)
+{
+       Infos::iterator it = find_if(usedtoolbars.begin(), usedtoolbars.end(), ToolbarNamesEqual(name));
+       if (it == usedtoolbars.end())
+               return 0;
+       return &(*it);
+}
+
+} // namespace frontend
+} // namespace lyx
diff --git a/src/frontends/qt4/Toolbars.h b/src/frontends/qt4/Toolbars.h
new file mode 100644 (file)
index 0000000..b4a9182
--- /dev/null
@@ -0,0 +1,154 @@
+// -*- C++ -*-
+/**
+ * \file Toolbars.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Jean-Marc Lasgouttes
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef TOOLBAR_BACKEND_H
+#define TOOLBAR_BACKEND_H
+
+#include "FuncRequest.h"
+
+#include <vector>
+
+
+namespace lyx {
+
+class Lexer;
+
+namespace frontend {
+
+class ToolbarItem {
+public:
+       enum Type {
+               /// command/action
+               COMMAND,
+               /// the command buffer
+               MINIBUFFER,
+               /// adds space between buttons in the toolbar
+               SEPARATOR,
+               /// a special combox insead of a button
+               LAYOUTS,
+               /// a special widget to insert tabulars
+               TABLEINSERT,
+               ///
+               POPUPMENU,
+               ///
+               ICONPALETTE
+       };
+
+       ToolbarItem(Type type,
+                FuncRequest const & func,
+                docstring const & label = docstring());
+
+       ToolbarItem(Type type,
+                std::string const & name = std::string(),
+                docstring const & label = docstring());
+
+       ~ToolbarItem();
+
+       /// item type
+       Type type_;
+       /// action
+       FuncRequest func_;
+       /// label/tooltip
+       docstring label_;
+       /// name
+       std::string name_;
+};
+
+
+///
+class ToolbarInfo {
+public:
+       /// toolbar flags
+       enum Flags {
+               ON = 1, //< show
+               OFF = 2, //< do not show
+               MATH = 4, //< show when in math
+               TABLE = 8, //< show when in table
+               TOP = 16, //< show at top
+               BOTTOM = 32, //< show at bottom
+               LEFT = 64, //< show at left
+               RIGHT = 128, //< show at right
+               REVIEW = 256, //< show when change tracking is enabled
+               AUTO = 512,  //< only if AUTO is set, when MATH, TABLE and REVIEW is used
+               MATHMACROTEMPLATE = 1024 //< show in math macro template
+       };
+       /// the toolbar items
+       typedef std::vector<ToolbarItem> Items;
+
+       typedef Items::const_iterator item_iterator;
+
+       explicit ToolbarInfo(std::string const & name = std::string())
+               : name(name) {}
+
+       /// toolbar name
+       std::string name;
+       /// toolbar GUI name
+       std::string gui_name;
+       /// toolbar contents
+       Items items;
+       /// flags
+       Flags flags;
+       /// store flags when coming to fullscreen mode
+       Flags before_fullscreen;
+
+       /// read a toolbar from the file
+       ToolbarInfo & read(Lexer &);
+
+private:
+       /// add toolbar item
+       void add(ToolbarItem const &);
+};
+
+
+///
+class Toolbars {
+public:
+       typedef std::vector<ToolbarInfo> Infos;
+
+       Toolbars();
+
+       /// iterator for all toolbars
+       Infos::const_iterator begin() const { return usedtoolbars.begin(); }
+
+       Infos::const_iterator end() const { return usedtoolbars.end(); }
+
+       Infos::iterator begin() { return usedtoolbars.begin(); }
+
+       Infos::iterator end() { return usedtoolbars.end(); }
+
+       /// read toolbars from the file
+       void readToolbars(Lexer &);
+
+       /// read ui toolbar settings
+       void readToolbarSettings(Lexer &);
+
+       ///
+       ToolbarInfo const * getDefinedToolbarInfo(std::string const & name) const;
+       ///
+       ToolbarInfo * getUsedToolbarInfo(std::string const & name);
+
+       // FIXME should be deleted when every window has its own toolbar config.
+       /// number of toggleFullScreen calls, i.e. number of FullScreen windows.
+       int fullScreenWindows;
+
+private:
+       /// all the defined toolbars
+       Infos toolbars;
+
+       /// toolbars listed
+       Infos usedtoolbars;
+};
+
+} // namespace frontend
+} // namespace lyx
+
+#endif // TOOLBAR_BACKEND_H