3 #include "ToolbarDefaults.h"
11 extern LyXAction lyxaction;
14 ToolbarDefaults::ToolbarDefaults()
20 void ToolbarDefaults::add(int action)
22 defaults.push_back(action);
26 void ToolbarDefaults::init()
28 add(Toolbar::TOOL_LAYOUTS);
30 //add(LFUN_CLOSEBUFFER);
33 add(Toolbar::TOOL_SEPARATOR);
38 add(Toolbar::TOOL_SEPARATOR);
43 add(Toolbar::TOOL_SEPARATOR);
48 add(Toolbar::TOOL_SEPARATOR);
52 add(Toolbar::TOOL_SEPARATOR);
70 struct keyword_item toolTags[TO_LAST - 1] = {
72 { "\\end_toolbar", TO_ENDTOOLBAR },
73 { "\\layouts", TO_LAYOUTS },
74 { "\\newline", TO_NEWLINE },
75 { "\\separator", TO_SEPARATOR }
79 void ToolbarDefaults::read(LyXLex & lex)
82 if (lex.GetString() != "\\begin_toolbar")
83 lyxerr << "Toolbar::read: ERROR wrong token:`"
84 << lex.GetString() << '\'' << endl;
91 lex.pushTable(toolTags, TO_LAST - 1);
93 if (lyxerr.debugging(Debug::PARSER))
94 lex.printTable(lyxerr);
96 while (lex.IsOK() && !quit) {
98 lyxerr[Debug::TOOLBAR] << "Toolbar::read: current lex text: `"
99 << lex.GetString() << '\'' << endl;
104 func = lex.GetString();
105 lyxerr[Debug::TOOLBAR]
106 << "Toolbar::read TO_ADD func: `"
107 << func << "'" << endl;
113 add(Toolbar::TOOL_SEPARATOR);
117 add(Toolbar::TOOL_LAYOUTS);
121 add(Toolbar::TOOL_NEWLINE);
125 // should not set automatically
130 lex.printError("Toolbar::read: "
131 "Unknown toolbar tag: `$$Token'");
139 void ToolbarDefaults::add(string const & func)
141 int tf = lyxaction.LookupFunc(func);
144 lyxerr << "Toolbar::add: no LyX command called`"
145 << func << "'exists!" << endl;