1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
13 #pragma implementation
18 #include "ToolbarDefaults.h"
19 #include "LyXAction.h"
23 #include "support/lstrings.h"
27 ToolbarDefaults toolbardefaults;
41 struct keyword_item toolTags[TO_LAST - 1] = {
42 { "end", TO_ENDTOOLBAR },
44 { "layouts", TO_LAYOUTS },
45 { "newline", TO_NEWLINE },
46 { "separator", TO_SEPARATOR }
49 } // end of anon namespace
52 ToolbarDefaults::ToolbarDefaults()
58 void ToolbarDefaults::add(int action)
60 defaults.push_back(action);
64 void ToolbarDefaults::init()
68 //add(LFUN_CLOSEBUFFER);
83 add(LFUN_INSET_FOOTNOTE);
84 add(LFUN_INSET_MARGINAL);
92 add(LFUN_INSET_GRAPHICS);
93 add(LFUN_TABULAR_INSERT);
97 void ToolbarDefaults::read(LyXLex & lex)
100 if (compare_ascii_no_case(lex.getString(), "toolbar")) {
101 lyxerr << "Toolbar::read: ERROR wrong token:`"
102 << lex.getString() << '\'' << endl;
109 lex.pushTable(toolTags, TO_LAST - 1);
111 if (lyxerr.debugging(Debug::PARSER))
112 lex.printTable(lyxerr);
114 while (lex.isOK() && !quit) {
117 if (lex.next(true)) {
118 string const func = lex.getString();
119 lyxerr[Debug::PARSER]
120 << "Toolbar::read TO_ADD func: `"
121 << func << "'" << endl;
142 lex.printError("Toolbar::read: "
143 "Unknown toolbar tag: `$$Token'");
151 void ToolbarDefaults::add(string const & func)
153 int const tf = lyxaction.LookupFunc(func);
156 lyxerr << "Toolbar::add: no LyX command called `"
157 << func << "' exists!" << endl;