X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyX.h;h=0d8616eff9b98eef606cb2631ec62e76ae1f4049;hb=6c977615633e5e132494b9a7fa778588210f9c95;hp=76f9d59fe3e1399e5c970c021004a92d733e05d9;hpb=7fb4a57ab9c049a7b7b197b1b8e86d497714988a;p=lyx.git diff --git a/src/LyX.h b/src/LyX.h index 76f9d59fe3..0d8616eff9 100644 --- a/src/LyX.h +++ b/src/LyX.h @@ -14,10 +14,7 @@ #ifndef LYX_H #define LYX_H -#include -#include - -#include +#include "support/strfwd.h" namespace lyx { @@ -48,7 +45,7 @@ class LyXView; } /// initial startup -class LyX : boost::noncopyable { +class LyX { public: LyX(); @@ -57,6 +54,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(); @@ -104,20 +106,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,12 +135,6 @@ 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 dead key bindings if requested @@ -169,14 +162,13 @@ 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);