3 #include "ToolbarDefaults.h"
10 extern LyXAction lyxaction;
13 ToolbarDefaults::ToolbarDefaults()
19 void ToolbarDefaults::add(int action)
21 defaults.push_back(action);
25 void ToolbarDefaults::init()
27 add(Toolbar::TOOL_LAYOUTS);
29 //add(LFUN_CLOSEBUFFER);
32 add(Toolbar::TOOL_SEPARATOR);
37 add(Toolbar::TOOL_SEPARATOR);
42 add(Toolbar::TOOL_SEPARATOR);
47 add(Toolbar::TOOL_SEPARATOR);
51 add(Toolbar::TOOL_SEPARATOR);
69 struct keyword_item toolTags[TO_LAST - 1] = {
71 { "\\end_toolbar", TO_ENDTOOLBAR },
72 { "\\layouts", TO_LAYOUTS },
73 { "\\newline", TO_NEWLINE },
74 { "\\separator", TO_SEPARATOR }
78 void ToolbarDefaults::read(LyXLex & lex)
81 if (lex.GetString() != "\\begin_toolbar")
82 lyxerr << "Toolbar::read: ERROR wrong token:`"
83 << lex.GetString() << '\'' << endl;
90 lex.pushTable(toolTags, TO_LAST - 1);
92 if (lyxerr.debugging(Debug::PARSER))
93 lex.printTable(lyxerr);
95 while (lex.IsOK() && !quit) {
97 lyxerr[Debug::TOOLBAR] << "Toolbar::read: current lex text: `"
98 << lex.GetString() << '\'' << endl;
103 func = lex.GetString();
104 lyxerr[Debug::TOOLBAR]
105 << "Toolbar::read TO_ADD func: `"
106 << func << "'" << endl;
112 add(Toolbar::TOOL_SEPARATOR);
116 add(Toolbar::TOOL_LAYOUTS);
120 add(Toolbar::TOOL_NEWLINE);
124 // should not set automatically
129 lex.printError("Toolbar::read: "
130 "Unknown toolbar tag: `$$Token'");
138 void ToolbarDefaults::add(string const & func)
140 int tf = lyxaction.LookupFunc(func);
143 lyxerr << "Toolbar::add: no LyX command called`"
144 << func << "'exists!" << endl;