]> git.lyx.org Git - lyx.git/blobdiff - src/ToolbarBackend.cpp
this we don't need anymore
[lyx.git] / src / ToolbarBackend.cpp
index b038623fcb14260b114cc71036b5863fb8f92b4a..419f0518f4008bf2e39b41078d1a4c8a2fa53fa7 100644 (file)
 #include "ToolbarBackend.h"
 #include "FuncRequest.h"
 #include "Lexer.h"
-#include "support/debug.h"
-#include "support/gettext.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;
@@ -47,6 +49,12 @@ private:
 ToolbarBackend toolbarbackend;
 
 
+/////////////////////////////////////////////////////////////////////////
+//
+// ToolbarItem
+//
+/////////////////////////////////////////////////////////////////////////
+
 ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const & label)
        : type_(type), func_(func), label_(label)
 {
@@ -72,7 +80,7 @@ void ToolbarInfo::add(ToolbarItem const & item)
 
 ToolbarInfo & ToolbarInfo::read(Lexer & lex)
 {
-       enum tooltags {
+       enum {
                TO_COMMAND = 1,
                TO_ENDTOOLBAR,
                TO_SEPARATOR,
@@ -81,10 +89,9 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
                TO_TABLEINSERT,
                TO_POPUPMENU,
                TO_ICONPALETTE,
-               TO_LAST
        };
 
-       struct keyword_item toolTags[TO_LAST - 1] = {
+       struct LexerKeyword toolTags[] = {
                { "end", TO_ENDTOOLBAR },
                { "iconpalette", TO_ICONPALETTE },
                { "item", TO_COMMAND },
@@ -116,7 +123,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
 
        bool quit = false;
 
-       lex.pushTable(toolTags, TO_LAST - 1);
+       lex.pushTable(toolTags);
 
        if (lyxerr.debugging(Debug::PARSER))
                lex.printTable(lyxerr);
@@ -139,12 +146,12 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
 
                case TO_MINIBUFFER:
                        add(ToolbarItem(ToolbarItem::MINIBUFFER,
-                               FuncRequest(kb_action(ToolbarItem::MINIBUFFER))));
+                               FuncRequest(FuncCode(ToolbarItem::MINIBUFFER))));
                        break;
 
                case TO_SEPARATOR:
                        add(ToolbarItem(ToolbarItem::SEPARATOR,
-                               FuncRequest(kb_action(ToolbarItem::SEPARATOR))));
+                               FuncRequest(FuncCode(ToolbarItem::SEPARATOR))));
                        break;
 
                case TO_POPUPMENU:
@@ -167,14 +174,14 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
 
                case TO_LAYOUTS:
                        add(ToolbarItem(ToolbarItem::LAYOUTS,
-                               FuncRequest(kb_action(ToolbarItem::LAYOUTS))));
+                               FuncRequest(FuncCode(ToolbarItem::LAYOUTS))));
                        break;
 
                case TO_TABLEINSERT:
                        if (lex.next(true)) {
                                docstring const tooltip = lex.getDocString();
                                add(ToolbarItem(ToolbarItem::TABLEINSERT,
-                                       FuncRequest(kb_action(ToolbarItem::TABLEINSERT)), tooltip));
+                                       FuncRequest(FuncCode(ToolbarItem::TABLEINSERT)), tooltip));
                        }
                        break;
 
@@ -195,21 +202,27 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
 
 
 
+/////////////////////////////////////////////////////////////////////////
+//
+// ToolbarBackend
+//
+/////////////////////////////////////////////////////////////////////////
+
 
 ToolbarBackend::ToolbarBackend()
 {
+       fullScreenWindows = 0;
 }
 
 
 void ToolbarBackend::readToolbars(Lexer & lex)
 {
-       enum tooltags {
+       enum {
                TO_TOOLBAR = 1,
                TO_ENDTOOLBARSET,
-               TO_LAST
        };
 
-       struct keyword_item toolTags[TO_LAST - 1] = {
+       struct LexerKeyword toolTags[] = {
                { "end", TO_ENDTOOLBARSET },
                { "toolbar", TO_TOOLBAR }
        };
@@ -220,7 +233,7 @@ void ToolbarBackend::readToolbars(Lexer & lex)
                       << lex.getString() << '\'');
        }
 
-       lex.pushTable(toolTags, TO_LAST - 1);
+       lex.pushTable(toolTags);
 
        if (lyxerr.debugging(Debug::PARSER))
                lex.printTable(lyxerr);
@@ -307,6 +320,8 @@ void ToolbarBackend::readToolbarSettings(Lexer & lex)
                                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:`"