#include "Timeout.h"
#include "Toolbars.h"
#include "Menubar.h"
+#include "WorkArea.h"
#include "buffer.h"
#include "bufferparams.h"
#endif
using lyx::frontend::Gui;
+using lyx::frontend::WorkArea;
using lyx::support::makeDisplayPath;
using lyx::support::onlyFilename;
return owner_;
}
+
LyXView::LyXView(Gui & owner)
- : owner_(owner),
+ : work_area_(0),
+ owner_(owner),
toolbars_(new Toolbars(*this)),
intl_(new Intl),
autosave_timeout_(new Timeout(5000)),
lyxfunc_(new LyXFunc(this)),
dialogs_(new Dialogs(*this)),
- controlcommand_(new ControlCommandBuffer(*this)),
- bufferview_(0)
+ controlcommand_(new ControlCommandBuffer(*this))
{
lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
}
-void LyXView::setBufferView(BufferView * buffer_view)
+
+LyXView::~LyXView()
{
- bufferview_ = buffer_view;
}
-LyXView::~LyXView()
+void LyXView::setWorkArea(WorkArea * work_area)
+{
+ work_area_ = work_area;
+}
+
+
+void LyXView::redrawWorkArea()
{
+ work_area_->redraw();
}
Buffer * LyXView::buffer() const
{
- return bufferview_->buffer();
+ return work_area_->bufferView().buffer();
}
BufferView * LyXView::view() const
{
- return bufferview_;
+ return &work_area_->bufferView();
}
void LyXView::updateToolbars()
{
- bool const math = bufferview_->cursor().inMathed();
+ bool const math = work_area_->bufferView().cursor().inMathed();
bool const table =
getLyXFunc().getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
toolbars_->update(math, table);
current_layout = buffer()->params().getLyXTextClass().defaultLayoutName();
}
- if (bufferview_->cursor().inMathed())
+ if (work_area_->bufferView().cursor().inMathed())
return;
string const & layout =
- bufferview_->cursor().paragraph().layout()->name();
+ work_area_->bufferView().cursor().paragraph().layout()->name();
if (layout != current_layout) {
toolbars_->setLayout(layout);
{
Buffer const * buffer_ptr = 0;
if (inset) {
- buffer_ptr = bufferview_->buffer();
+ buffer_ptr = work_area_->bufferView().buffer();
// No FitCursor:
- bufferview_->update(Update::Force);
+ work_area_->bufferView().update(Update::Force);
}
return buffer_ptr;
}