/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
*
* ====================================================== */
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include <config.h>
#include "ToolbarDefaults.h"
using std::endl;
-extern LyXAction lyxaction;
ToolbarDefaults toolbardefaults;
+namespace {
+
+enum _tooltags {
+ TO_ADD = 1,
+ TO_ENDTOOLBAR,
+ TO_SEPARATOR,
+ TO_LAYOUTS,
+ TO_NEWLINE,
+ TO_LAST
+};
+
+
+struct keyword_item toolTags[TO_LAST - 1] = {
+ { "end", TO_ENDTOOLBAR },
+ { "icon", TO_ADD },
+ { "layouts", TO_LAYOUTS },
+ { "newline", TO_NEWLINE },
+ { "separator", TO_SEPARATOR }
+};
+
+} // end of anon namespace
+
ToolbarDefaults::ToolbarDefaults()
{
}
-void ToolbarDefaults::init()
+void ToolbarDefaults::init()
{
add(LAYOUTS);
add(LFUN_FILE_OPEN);
add(LFUN_COPY);
add(LFUN_PASTE);
add(SEPARATOR);
-
+
add(LFUN_EMPH);
add(LFUN_NOUN);
add(LFUN_FREE);
add(SEPARATOR);
-
+
add(LFUN_INSET_FOOTNOTE);
add(LFUN_INSET_MARGINAL);
- add(LFUN_DEPTH);
+ add(LFUN_DEPTH_PLUS);
add(SEPARATOR);
- add(LFUN_MATH_MODE);
+ add(LFUN_MATH_MODE);
add(SEPARATOR);
- add(LFUN_FIGURE);
- add(LFUN_DIALOG_TABULAR_INSERT);
+ add(LFUN_INSET_GRAPHICS);
+ add(LFUN_TABULAR_INSERT);
}
-enum _tooltags {
- TO_ADD = 1,
- TO_ENDTOOLBAR,
- TO_SEPARATOR,
- TO_LAYOUTS,
- TO_NEWLINE,
- TO_LAST
-};
-
-
-struct keyword_item toolTags[TO_LAST - 1] = {
- { "end", TO_ENDTOOLBAR },
- { "icon", TO_ADD },
- { "layouts", TO_LAYOUTS },
- { "newline", TO_NEWLINE },
- { "separator", TO_SEPARATOR }
-};
-
-
-void ToolbarDefaults::read(LyXLex & lex)
+void ToolbarDefaults::read(LyXLex & lex)
{
//consistency check
- if (compare_no_case(lex.getString(), "toolbar")) {
+ if (compare_ascii_no_case(lex.getString(), "toolbar")) {
lyxerr << "Toolbar::read: ERROR wrong token:`"
<< lex.getString() << '\'' << endl;
}
defaults.clear();
-
+
bool quit = false;
-
+
lex.pushTable(toolTags, TO_LAST - 1);
if (lyxerr.debugging(Debug::PARSER))
string const func = lex.getString();
lyxerr[Debug::PARSER]
<< "Toolbar::read TO_ADD func: `"
- << func << "'" << endl;
+ << func << '\'' << endl;
add(func);
}
break;
-
+
case TO_SEPARATOR:
add(SEPARATOR);
break;
-
+
case TO_LAYOUTS:
add(LAYOUTS);
break;
-
+
case TO_NEWLINE:
add(NEWLINE);
break;
-
+
case TO_ENDTOOLBAR:
- // should not set automatically
- //set();
quit = true;
break;
default:
if (tf == -1) {
lyxerr << "Toolbar::add: no LyX command called `"
- << func << "' exists!" << endl;
+ << func << "' exists!" << endl;
} else {
add(tf);
}