#include "LyX.h"
-#include "LayoutFile.h"
+#include "ASpell_local.h"
#include "Buffer.h"
#include "BufferList.h"
#include "CmdDef.h"
-#include "Color.h"
+#include "ColorSet.h"
#include "ConverterCache.h"
#include "Converter.h"
#include "CutAndPaste.h"
#include "FuncStatus.h"
#include "KeyMap.h"
#include "Language.h"
+#include "LayoutFile.h"
#include "Lexer.h"
#include "LyXAction.h"
#include "LyXFunc.h"
// The language used will be derived from the environment
// variables.
messages_["GUI"] = Messages();
+
+#if defined(USE_ASPELL)
+ spell_checker_ = new ASpell();
+#else
+ spell_checker_ = 0;
+#endif
}
+
+ ~Impl()
+ {
+ delete spell_checker_;
+ }
+
/// our function handler
LyXFunc lyxfunc_;
///
///
graphics::Previews preview_;
+ ///
+ SpellChecker * spell_checker_;
};
///
Buffer * buf = *I;
if (buf != buf->masterBuffer())
continue;
- bool success = false;
vector<string>::const_iterator bcit = pimpl_->batch_commands.begin();
vector<string>::const_iterator bcend = pimpl_->batch_commands.end();
+ DispatchResult dr;
for (; bcit != bcend; bcit++) {
- buf->dispatch(*bcit, &success);
- final_success |= success;
+ LYXERR(Debug::ACTION, "Buffer::dispatch: cmd: " << *bcit);
+ buf->dispatch(*bcit, dr);
+ final_success |= !dr.error();
}
}
prepareExit();
if (!LyXSetStyle())
return false;
//...and the modules
- moduleList.load();
+ moduleList.read();
// read keymap and ui files in batch mode as well
// because InsetInfo needs to know these to produce
" where fmt is the export format of choice.\n"
" Look on Tools->Preferences->File formats->Format\n"
" to get an idea which parameters should be passed.\n"
+ " Note that the order of -e and -x switches matters."
"\t-i [--import] fmt file.xxx\n"
" where fmt is the import format of choice\n"
" and file.xxx is the file to be imported.\n"
+ "\t--batch execute commands and exit\n"
"\t-version summarize version and build info\n"
"Check the LyX man page for more details.")) << endl;
exit(0);
}
+int parse_batch(string const &, string const &, string &)
+{
+ use_gui = false;
+ return 0;
+}
+
+
} // namespace anon
cmdmap["-i"] = parse_import;
cmdmap["--import"] = parse_import;
cmdmap["-geometry"] = parse_geometry;
+ cmdmap["--batch"] = parse_batch;
for (int i = 1; i < argc; ++i) {
map<string, cmd_helper>::const_iterator it
return singleton_->pimpl_->toplevel_cmddef_;
}
+
+SpellChecker * theSpellChecker()
+{
+ return singleton_->pimpl_->spell_checker_;
+}
+
} // namespace lyx