+// Read the ui file `name'
+void LyX::readUIFile(string const & name)
+{
+ enum Uitags {
+ ui_menuset = 1,
+ ui_toolbar,
+ ui_last
+ };
+
+ struct keyword_item uitags[ui_last-1] = {
+ { "menuset", ui_menuset },
+ { "toolbar", ui_toolbar }
+ };
+
+ lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
+
+ string const ui_path = LibFileSearch("ui", name, "ui");
+
+ if (ui_path.empty()) {
+ lyxerr[Debug::INIT] << "Could not find " << name << endl;
+ menubackend.defaults();
+ return;
+ }
+
+ lyxerr[Debug::INIT] << "Found " << name
+ << " in " << ui_path << endl;
+ LyXLex lex(uitags, ui_last - 1);
+ lex.setFile(ui_path);
+ if (!lex.isOK()) {
+ lyxerr << "Unable to set LyXLeX for ui file: " << ui_path
+ << endl;
+ }
+
+ if (lyxerr.debugging(Debug::PARSER))
+ lex.printTable(lyxerr);
+
+ while (lex.isOK()) {
+ switch (lex.lex()) {
+ case ui_menuset:
+ menubackend.read(lex);
+ break;
+
+ case ui_toolbar:
+ toolbardefaults.read(lex);
+ break;
+
+ default:
+ if(!strip(lex.getString()).empty())
+ lex.printError("LyX::ReadUIFile: "
+ "Unknown menu tag: `$$Token'");
+ break;
+ }
+ }
+}
+
+
+// Read the languages file `name'
+void LyX::readLanguagesFile(string const & name)
+{
+ lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
+
+ string const lang_path = LibFileSearch(string(), name);
+ if (lang_path.empty()) {
+ lyxerr[Debug::INIT] << "Could not find " << name << endl;
+ languages.setDefaults();
+ return;
+ }
+ languages.read(lang_path);
+}
+
+
+// Read the encodings file `name'
+void LyX::readEncodingsFile(string const & name)
+{
+ lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
+
+ string const enc_path = LibFileSearch(string(), name);
+ if (enc_path.empty()) {
+ lyxerr[Debug::INIT] << "Could not find " << name << endl;
+ return;
+ }
+ encodings.read(enc_path);
+}
+
+
+namespace {
+