- 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
/// The main application class private implementation.
struct Application_pimpl
{
- ///
- BufferList buffer_list_;
/// our function handler
boost::scoped_ptr<LyXFunc> lyxfunc_;
///
}
-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;
}
-BufferList & theBufferList()
-{
- return theApp->bufferList();
-}
-
-
lyx::frontend::FontLoader & theFontLoader()
{
return theApp->fontLoader();
///
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,
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();
}
}
+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()
#include <string>
class Buffer;
+class BufferList;
class ErrorItem;
class InsetBase;
class LyXView;
/// in the case of failure
void emergencyCleanup() const;
+ ///
+ BufferList & bufferList();
+ BufferList const & bufferList() const;
+ ///
lyx::Session & session();
lyx::Session const & session() const;
/// 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_;
///