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 * ====================================================== */
14 #include "ToolbarDefaults.h"
15 #include "LyXAction.h"
19 #include "support/lstrings.h"
23 ToolbarDefaults toolbardefaults;
37 struct keyword_item toolTags[TO_LAST - 1] = {
38 { "end", TO_ENDTOOLBAR },
40 { "layouts", TO_LAYOUTS },
41 { "newline", TO_NEWLINE },
42 { "separator", TO_SEPARATOR }
45 } // end of anon namespace
48 ToolbarDefaults::ToolbarDefaults()
54 void ToolbarDefaults::add(int action)
56 defaults.push_back(action);
60 void ToolbarDefaults::init()
64 //add(LFUN_CLOSEBUFFER);
79 add(LFUN_INSET_FOOTNOTE);
80 add(LFUN_INSET_MARGINAL);
88 add(LFUN_INSET_GRAPHICS);
89 add(LFUN_TABULAR_INSERT);
93 void ToolbarDefaults::read(LyXLex & lex)
96 if (compare_ascii_no_case(lex.getString(), "toolbar")) {
97 lyxerr << "Toolbar::read: ERROR wrong token:`"
98 << lex.getString() << '\'' << endl;
105 lex.pushTable(toolTags, TO_LAST - 1);
107 if (lyxerr.debugging(Debug::PARSER))
108 lex.printTable(lyxerr);
110 while (lex.isOK() && !quit) {
113 if (lex.next(true)) {
114 string const func = lex.getString();
115 lyxerr[Debug::PARSER]
116 << "Toolbar::read TO_ADD func: `"
117 << func << '\'' << endl;
138 lex.printError("Toolbar::read: "
139 "Unknown toolbar tag: `$$Token'");
147 void ToolbarDefaults::add(string const & func)
149 int const tf = lyxaction.LookupFunc(func);
152 lyxerr << "Toolbar::add: no LyX command called `"
153 << func << "' exists!" << endl;