* LyX class (lyx_main.[Ch]):

- new buffer_list_ member and accessors
  - implementation of theBufferList() extern function

* Application: remove everything related to BufferList

* lyx_cb.C: test for lyx::use_gui before using theApp.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15303 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-10-11 22:30:31 +00:00
parent 1b5f5e58ed
commit 3b21b04e9c
5 changed files with 31 additions and 25 deletions

View File

@ -41,8 +41,6 @@ namespace frontend {
/// The main application class private implementation.
struct Application_pimpl
{
///
BufferList buffer_list_;
/// our function handler
boost::scoped_ptr<LyXFunc> lyxfunc_;
///
@ -94,18 +92,6 @@ LyXServerSocket const & Application::socket() const
}
BufferList & Application::bufferList()
{
return pimpl_->buffer_list_;
}
BufferList const & Application::bufferList() const
{
return pimpl_->buffer_list_;
}
void Application::setBufferView(BufferView * buffer_view)
{
buffer_view_ = buffer_view;
@ -177,12 +163,6 @@ LyXFunc & theLyXFunc()
}
BufferList & theBufferList()
{
return theApp->bufferList();
}
lyx::frontend::FontLoader & theFontLoader()
{
return theApp->fontLoader();

View File

@ -87,9 +87,6 @@ public:
///
LyXServerSocket & socket();
LyXServerSocket const & socket() const;
///
BufferList & bufferList();
BufferList const & bufferList() const;
/// Create the main window with given geometry settings.
LyXView & createView(unsigned int width, unsigned int height,

View File

@ -216,7 +216,9 @@ void quitLyX(bool noask)
Alert::warning(_("Unable to remove temporary directory"), msg);
}
theApp->exit(0);
if (lyx_gui::use_gui)
theApp->exit(0);
// Restore original font resources after Application is destroyed.
lyx::support::restoreFontResources();
}

View File

@ -169,9 +169,29 @@ LyX const & LyX::cref()
}
BufferList & theBufferList()
{
return LyX::ref().bufferList();
}
LyX::LyX()
: first_start(false), geometryOption_(false)
{}
{
buffer_list_.reset(new BufferList);
}
BufferList & LyX::bufferList()
{
return *buffer_list_.get();
}
BufferList const & LyX::bufferList() const
{
return *buffer_list_.get();
}
lyx::Session & LyX::session()

View File

@ -22,6 +22,7 @@
#include <string>
class Buffer;
class BufferList;
class ErrorItem;
class InsetBase;
class LyXView;
@ -55,6 +56,10 @@ public:
/// in the case of failure
void emergencyCleanup() const;
///
BufferList & bufferList();
BufferList const & bufferList() const;
///
lyx::Session & session();
lyx::Session const & session() const;
@ -102,6 +107,8 @@ private:
/// the parsed command line batch command if any
std::string batch_command;
///
boost::scoped_ptr<BufferList> buffer_list_;
/// lyx session, containing lastfiles, lastfilepos, and lastopened
boost::scoped_ptr<lyx::Session> session_;
///