1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2002-06-12 02:54:19 +00:00
|
|
|
/**
|
|
|
|
* \file lyx_main.h
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author unknown
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#ifndef LYX_MAIN_H
|
|
|
|
#define LYX_MAIN_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#include "LString.h"
|
2001-12-18 03:30:35 +00:00
|
|
|
|
2002-05-22 01:16:37 +00:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
2000-10-02 00:55:02 +00:00
|
|
|
#include <boost/utility.hpp>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2002-05-22 01:16:37 +00:00
|
|
|
#include <csignal>
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class LyXRC;
|
|
|
|
class LastFiles;
|
|
|
|
class Buffer;
|
2000-05-10 11:50:11 +00:00
|
|
|
class kb_keymap;
|
1999-10-02 16:21:10 +00:00
|
|
|
|
2002-07-28 22:50:13 +00:00
|
|
|
|
2002-08-07 23:43:38 +00:00
|
|
|
/// e.g. $HOME/.lyx/
|
1999-10-02 16:21:10 +00:00
|
|
|
extern string user_lyxdir;
|
2002-08-07 23:43:38 +00:00
|
|
|
/// e.g. /usr/share/lyx/
|
2002-06-12 02:54:19 +00:00
|
|
|
extern string system_lyxdir;
|
2002-08-07 23:43:38 +00:00
|
|
|
/// e.g. /tmp
|
1999-10-02 16:21:10 +00:00
|
|
|
extern string system_tempdir;
|
2002-08-07 23:43:38 +00:00
|
|
|
/// last files loaded
|
2001-12-18 03:30:35 +00:00
|
|
|
extern boost::scoped_ptr<LastFiles> lastfiles;
|
2002-07-28 22:50:13 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2002-08-07 23:43:38 +00:00
|
|
|
/// initial startup
|
2001-04-17 14:00:20 +00:00
|
|
|
class LyX : boost::noncopyable {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2002-06-12 09:47:10 +00:00
|
|
|
LyX(int & argc, char * argv[]);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-10-19 15:13:49 +00:00
|
|
|
/// in the case of failure
|
|
|
|
static void emergencyCleanup();
|
2001-12-10 15:59:20 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
2002-08-07 23:43:38 +00:00
|
|
|
/// initial LyX set up
|
2001-05-17 15:11:01 +00:00
|
|
|
void init(bool);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// set up the default key bindings
|
2000-05-10 11:50:11 +00:00
|
|
|
void defaultKeyBindings(kb_keymap * kbmap);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// set up the default dead key bindings if requested
|
2000-05-10 11:50:11 +00:00
|
|
|
void deadKeyBindings(kb_keymap * kbmap);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// check, set up and configure the user dir if necessary
|
2000-05-29 15:29:50 +00:00
|
|
|
void queryUserLyXDir(bool explicit_userdir);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// return true if the given prefs file was successfully read
|
2002-03-21 17:27:08 +00:00
|
|
|
bool readRcFile(string const & name);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// read the given ui (menu/toolbar) file
|
2001-06-28 10:25:20 +00:00
|
|
|
void readUIFile(string const & name);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// read the given languages file
|
2001-06-28 10:25:20 +00:00
|
|
|
void readLanguagesFile(string const & name);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// read the given encodings file
|
2001-06-28 10:25:20 +00:00
|
|
|
void readEncodingsFile(string const & name);
|
2002-08-07 23:43:38 +00:00
|
|
|
/// parsing of non-gui LyX options. Returns true if gui
|
2002-06-12 09:47:10 +00:00
|
|
|
bool easyParse(int & argc, char * argv[]);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
2002-08-07 23:43:38 +00:00
|
|
|
/// has this user started lyx for the first time?
|
|
|
|
bool first_start;
|
|
|
|
/// the parsed command line batch command if any
|
|
|
|
string batch_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2002-08-07 23:43:38 +00:00
|
|
|
#endif // LYX_MAIN_H
|