* ====================================================== */
#include <config.h>
-
-#include <cstdlib>
-#include <csignal>
+#include <version.h>
#ifdef __GNUG__
#pragma implementation
#endif
-#include <version.h>
#include "lyx_main.h"
#include "lyx_gui.h"
#include "LyXView.h"
#include "lyxfunc.h"
-#include "frontends/Alert.h"
-#include "frontends/GUIRunTime.h"
#include "lyxrc.h"
-#include "support/path.h"
-#include "support/filetools.h"
#include "buffer.h"
#include "bufferlist.h"
#include "debug.h"
-#include "support/FileInfo.h"
#include "lastfiles.h"
#include "intl.h"
#include "lyxserver.h"
-#include "layout.h"
+//#include "layout.h"
+#include "lyxtextclasslist.h"
#include "gettext.h"
#include "kbmap.h"
#include "MenuBackend.h"
#include "encoding.h"
#include "converter.h"
#include "language.h"
+
+#include "frontends/Alert.h"
+#include "frontends/GUIRunTime.h"
+
+#include "support/path.h"
+#include "support/filetools.h"
+#include "support/FileInfo.h"
#include "support/os.h"
+#include <cstdlib>
+#include <csignal>
+
using std::endl;
#ifndef CXX_GLOBAL_CSTD
// Should this be kept global? Asger says Yes.
DebugStream lyxerr;
-LastFiles * lastfiles;
+boost::scoped_ptr<LastFiles> lastfiles;
// This is the global bufferlist object
BufferList bufferlist;
LyX::LyX(int * argc, char * argv[])
{
- // Prevent crash with --help
- lyxGUI = 0;
- lastfiles = 0;
-
// Here we need to parse the command line. At least
// we need to parse for "-dbg" and "-help"
bool gui = easyParse(argc, argv);
// Make the GUI object, and let it take care of the
// command line arguments that concerns it.
lyxerr[Debug::INIT] << "Initializing LyXGUI..." << endl;
- lyxGUI = new LyXGUI(this, argc, argv, gui);
+ lyxGUI.reset(new LyXGUI(this, argc, argv, gui));
lyxerr[Debug::INIT] << "Initializing LyXGUI...done" << endl;
// Now the GUI and LyX have taken care of their arguments, so
// A destructor is always necessary (asierra-970604)
LyX::~LyX()
{
- delete lastfiles;
- delete lyxGUI;
}
// Determine path of binary
//
- string fullbinpath;
string binpath = os::binpath();
string binname = os::binname();
- fullbinpath = binpath;
+ string fullbinpath = binpath;
if (binpath.empty()) {
lyxerr << _("Warning: could not determine path of binary.")
//
// Default template path: system_dir/templates
- if (lyxrc.template_path.empty()){
+ if (lyxrc.template_path.empty()) {
lyxrc.template_path = AddPath(system_lyxdir, "templates");
}
// Default lastfiles file: $HOME/.lyx/lastfiles
- if (lyxrc.lastfiles.empty()){
+ if (lyxrc.lastfiles.empty()) {
lyxrc.lastfiles = AddName(user_lyxdir, "lastfiles");
}
// load the lastfiles mini-database
lyxerr[Debug::INIT] << "Reading lastfiles `"
<< lyxrc.lastfiles << "'..." << endl;
- lastfiles = new LastFiles(lyxrc.lastfiles,
- lyxrc.check_lastfiles,
- lyxrc.num_lastfiles);
+ lastfiles.reset(new LastFiles(lyxrc.lastfiles,
+ lyxrc.check_lastfiles,
+ lyxrc.num_lastfiles));
// start up the lyxserver. (is this a bit early?) (Lgb)
// 0.12 this will be way to early, we need the GUI to be initialized
kbmap->bind("Delete", LFUN_DELETE);
kbmap->bind("BackSpace", LFUN_BACKSPACE);
+
+ // sub- and superscript -MV
+ kbmap->bind("~S-underscore", LFUN_SUBSCRIPT);
+ kbmap->bind("~S-asciicircum", LFUN_SUPERSCRIPT);
// kbmap->bindings to enable the use of the numeric keypad
// e.g. Num Lock set
}
else if (arg == "-i" || arg == "--import") {
if (i + 1 < *argc) {
- string type(argv[i+1]);
- string file(argv[i+2]);
+ string const type(argv[i+1]);
+ string const file(argv[i+2]);
removeargs = 3;
batch_command = "buffer-import " + type + " " + file;