X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyX.h;h=3d98e42b8edb5100c719d27152f7e0c6e6018969;hb=d8ab0622c5354ae2d181e9eae56764211285706c;hp=e7b18f40e393d652110ab93569ceb35e85ed037f;hpb=1a77c867a23f6f904f24b4968bdeb41e4244ccec;p=lyx.git diff --git a/src/LyX.h b/src/LyX.h index e7b18f40e3..3d98e42b8e 100644 --- a/src/LyX.h +++ b/src/LyX.h @@ -14,31 +14,22 @@ #ifndef LYX_H #define LYX_H -#include -#include - -#include +#include "support/strfwd.h" namespace lyx { -namespace support { -class FileName; -} - -class Buffer; class BufferList; +class CmdDef; class Converters; class ErrorItem; -class Inset; +class KeyMap; class LyXFunc; -class Server; -class ServerSocket; class Messages; class Mover; class Movers; +class Server; +class ServerSocket; class Session; -class KeyMap; -class CmdDef; extern bool use_gui; @@ -48,7 +39,7 @@ class LyXView; } /// initial startup -class LyX : boost::noncopyable { +class LyX { public: LyX(); @@ -57,6 +48,11 @@ public: /// Execute LyX. int exec(int & argc, char * argv[]); + /// Try to exit LyX properly. + /// \p exit_code is 0 by default, if a non zero value is passed, + /// emergencyCleanup() will be called before exiting. + void exit(int exit_code = 0) const; + static LyX & ref(); static LyX const & cref(); @@ -83,10 +79,6 @@ public: frontend::Application & application(); frontend::Application const & application() const; - /// - KeyMap & topLevelKeymap(); - KeyMap const & topLevelKeymap() const; - /// CmdDef & topLevelCmdDef(); @@ -104,20 +96,17 @@ public: /// frontend::LyXView * newLyXView(); - /** redraw \c inset in all the BufferViews in which it is currently - * visible. If successful return a pointer to the owning Buffer. - */ - Buffer const * updateInset(Inset const *) const; - - void hideDialogs(std::string const & name, Inset * inset) const; - /// Execute batch commands if available. void execBatchCommands(); /// - void addFileToLoad(support::FileName const &); + void addFileToLoad(std::string const &); private: + /// noncopyable + LyX(LyX const &); + void operator=(LyX const &); + /// Do some cleanup in preparation of an exit. void prepareExit(); @@ -136,18 +125,8 @@ private: */ void loadFiles(); - /// Create a View, load files and restore GUI Session. - void restoreGuiSession(); - - /// Initialize RC font for the GUI. - void initGuiFont(); - /// initial LyX set up bool init(); - /// set up the default key bindings - void defaultKeyBindings(KeyMap * kbmap); - /// set up the default dead key bindings if requested - void deadKeyBindings(KeyMap * kbmap); /** Check for the existence of the user's support directory and, * if not present, create it. Exits the program if the directory * cannot be created. @@ -171,20 +150,20 @@ private: /// shows up a parsing error on screen void printError(ErrorItem const &); + /// Use the Pimpl idiom to hide the internals. + // Mostly used for singletons. + struct Impl; + Impl * pimpl_; + /// has this user started lyx for the first time? bool first_start; - /// the parsed command line batch command if any - std::string batch_command; - - /// Use the Pimpl idiom to hide the internals. - struct Singletons; - boost::scoped_ptr pimpl_; friend Movers & theMovers(); friend Mover const & getMover(std::string const & fmt); friend void setMover(std::string const & fmt, std::string const & command); friend Movers & theSystemMovers(); friend frontend::Application * theApp(); + friend KeyMap & theTopLevelKeymap(); }; } // namespace lyx