2 * \file ToolbarBackend.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
13 #include "ToolbarBackend.h"
14 #include "LyXAction.h"
18 #include "support/lstrings.h"
22 ToolbarBackend toolbarbackend;
36 struct keyword_item toolTags[TO_LAST - 1] = {
37 { "end", TO_ENDTOOLBAR },
39 { "layouts", TO_LAYOUTS },
40 { "newline", TO_NEWLINE },
41 { "separator", TO_SEPARATOR }
44 } // end of anon namespace
47 ToolbarBackend::ToolbarBackend()
52 void ToolbarBackend::add(int action)
54 items.push_back(action);
58 void ToolbarBackend::read(LyXLex & lex)
61 if (compare_ascii_no_case(lex.getString(), "toolbar")) {
62 lyxerr << "ToolbarBackend::read: ERROR wrong token:`"
63 << lex.getString() << '\'' << endl;
68 lex.pushTable(toolTags, TO_LAST - 1);
70 if (lyxerr.debugging(Debug::PARSER))
71 lex.printTable(lyxerr);
73 while (lex.isOK() && !quit) {
77 string const func = lex.getString();
79 << "ToolbarBackend::read TO_ADD func: `"
80 << func << '\'' << endl;
101 lex.printError("ToolbarBackend::read: "
102 "Unknown toolbar tag: `$$Token'");
110 void ToolbarBackend::add(string const & func)
112 int const tf = lyxaction.LookupFunc(func);
115 lyxerr << "ToolbarBackend::add: no LyX command called `"
116 << func << "' exists!" << endl;