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);
95 struct keyword_item toolTags[TO_LAST - 1] = {
96 { "end", TO_ENDTOOLBAR },
98 { "layouts", TO_LAYOUTS },
99 { "newline", TO_NEWLINE },
100 { "separator", TO_SEPARATOR }
104 void ToolbarDefaults::read(LyXLex & lex)
107 if (compare_no_case(lex.GetString(), "toolbar"))
108 lyxerr << "Toolbar::read: ERROR wrong token:`"
109 << lex.GetString() << '\'' << endl;
116 lex.pushTable(toolTags, TO_LAST - 1);
118 if (lyxerr.debugging(Debug::PARSER))
119 lex.printTable(lyxerr);
121 while (lex.IsOK() && !quit) {
126 func = lex.GetString();
128 << "Toolbar::read TO_ADD func: `"
129 << func << "'" << endl;
147 // should not set automatically
152 lex.printError("Toolbar::read: "
153 "Unknown toolbar tag: `$$Token'");
162 void ToolbarDefaults::add(string const & func)
164 int const tf = lyxaction.LookupFunc(func);
167 lyxerr << "Toolbar::add: no LyX command called`"
168 << func << "'exists!" << endl;