1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
13 #pragma implementation
18 #include "ToolbarDefaults.h"
19 #include "LyXAction.h"
24 // only until we don't need access to the NEW_INSETS anymore
25 #include "lyxparagraph.h"
30 extern LyXAction lyxaction;
31 ToolbarDefaults toolbardefaults;
34 ToolbarDefaults::ToolbarDefaults()
40 void ToolbarDefaults::add(int action)
42 defaults.push_back(action);
46 void ToolbarDefaults::init()
50 //add(LFUN_CLOSEBUFFER);
69 add(LFUN_INSET_FOOTNOTE);
70 add(LFUN_INSET_MARGINAL);
80 add(LFUN_DIALOG_TABULAR_INSERT);
97 struct keyword_item toolTags[TO_LAST - 1] = {
98 { "end", TO_ENDTOOLBAR },
100 { "layouts", TO_LAYOUTS },
101 { "newline", TO_NEWLINE },
102 { "separator", TO_SEPARATOR }
106 void ToolbarDefaults::read(LyXLex & lex)
109 if (compare_no_case(lex.GetString(), "toolbar"))
110 lyxerr << "Toolbar::read: ERROR wrong token:`"
111 << lex.GetString() << '\'' << endl;
118 lex.pushTable(toolTags, TO_LAST - 1);
120 if (lyxerr.debugging(Debug::PARSER))
121 lex.printTable(lyxerr);
123 while (lex.IsOK() && !quit) {
128 func = lex.GetString();
130 << "Toolbar::read TO_ADD func: `"
131 << func << "'" << endl;
149 // should not set automatically
154 lex.printError("Toolbar::read: "
155 "Unknown toolbar tag: `$$Token'");
164 void ToolbarDefaults::add(string const & func)
166 int const tf = lyxaction.LookupFunc(func);
169 lyxerr << "Toolbar::add: no LyX command called`"
170 << func << "'exists!" << endl;