3 #include "ToolbarDefaults.h"
9 extern LyXAction lyxaction;
12 ToolbarDefaults::ToolbarDefaults()
18 void ToolbarDefaults::add(int action)
20 defaults.push_back(action);
24 void ToolbarDefaults::init()
26 add(Toolbar::TOOL_LAYOUTS);
28 //add(LFUN_CLOSEBUFFER);
31 add(Toolbar::TOOL_SEPARATOR);
36 add(Toolbar::TOOL_SEPARATOR);
41 add(Toolbar::TOOL_SEPARATOR);
46 add(Toolbar::TOOL_SEPARATOR);
50 add(Toolbar::TOOL_SEPARATOR);
68 struct keyword_item toolTags[TO_LAST - 1] = {
70 { "\\end_toolbar", TO_ENDTOOLBAR },
71 { "\\layouts", TO_LAYOUTS },
72 { "\\newline", TO_NEWLINE },
73 { "\\separator", TO_SEPARATOR }
77 void ToolbarDefaults::read(LyXLex & lex)
80 if (lex.GetString() != "\\begin_toolbar")
81 lyxerr << "Toolbar::read: ERROR wrong token:`"
82 << lex.GetString() << '\'' << endl;
89 lex.pushTable(toolTags, TO_LAST - 1);
91 if (lyxerr.debugging(Debug::PARSER))
92 lex.printTable(lyxerr);
94 while (lex.IsOK() && !quit) {
96 lyxerr[Debug::TOOLBAR] << "Toolbar::read: current lex text: `"
97 << lex.GetString() << '\'' << endl;
102 func = lex.GetString();
103 lyxerr[Debug::TOOLBAR]
104 << "Toolbar::read TO_ADD func: `"
105 << func << "'" << endl;
111 add(Toolbar::TOOL_SEPARATOR);
115 add(Toolbar::TOOL_LAYOUTS);
119 add(Toolbar::TOOL_NEWLINE);
123 // should not set automatically
128 lex.printError("Toolbar::read: "
129 "Unknown toolbar tag: `$$Token'");
137 void ToolbarDefaults::add(string const & func)
139 int tf = lyxaction.LookupFunc(func);
142 lyxerr << "Toolbar::add: no LyX command called`"
143 << func << "'exists!" << endl;