3 #include "ToolbarDefaults.h"
7 extern LyXAction lyxaction;
10 ToolbarDefaults::ToolbarDefaults()
16 void ToolbarDefaults::add(int action)
18 defaults.push_back(action);
22 void ToolbarDefaults::init()
24 add(Toolbar::TOOL_LAYOUTS);
26 //add(LFUN_CLOSEBUFFER);
29 add(Toolbar::TOOL_SEPARATOR);
34 add(Toolbar::TOOL_SEPARATOR);
39 add(Toolbar::TOOL_SEPARATOR);
44 add(Toolbar::TOOL_SEPARATOR);
48 add(Toolbar::TOOL_SEPARATOR);
66 struct keyword_item toolTags[TO_LAST - 1] = {
68 { "\\end_toolbar", TO_ENDTOOLBAR },
69 { "\\layouts", TO_LAYOUTS },
70 { "\\newline", TO_NEWLINE },
71 { "\\separator", TO_SEPARATOR }
75 void ToolbarDefaults::read(LyXLex & lex)
78 if (lex.GetString() != "\\begin_toolbar")
79 lyxerr << "Toolbar::read: ERROR wrong token:`"
80 << lex.GetString() << '\'' << endl;
87 lex.pushTable(toolTags, TO_LAST - 1);
89 if (lyxerr.debugging(Debug::PARSER))
90 lex.printTable(lyxerr);
92 while (lex.IsOK() && !quit) {
94 lyxerr[Debug::TOOLBAR] << "Toolbar::read: current lex text: `"
95 << lex.GetString() << '\'' << endl;
100 func = lex.GetString();
101 lyxerr[Debug::TOOLBAR]
102 << "Toolbar::read TO_ADD func: `"
103 << func << "'" << endl;
109 add(Toolbar::TOOL_SEPARATOR);
113 add(Toolbar::TOOL_LAYOUTS);
117 add(Toolbar::TOOL_NEWLINE);
121 // should not set automatically
126 lex.printError("Toolbar::read: "
127 "Unknown toolbar tag: `$$Token'");
135 void ToolbarDefaults::add(string const & func)
137 int tf = lyxaction.LookupFunc(func);
140 lyxerr << "Toolbar::add: no LyX command called`"
141 << func << "'exists!" << endl;