#include "bufferlist.h"
#include "bufferparams.h"
#include "BufferView_pimpl.h"
-#include "CutAndPaste.h"
#include "coordcache.h"
#include "debug.h"
#include "funcrequest.h"
#include "texrow.h"
#include "undo.h"
#include "WordLangTuple.h"
+#include "metricsinfo.h"
#include "frontends/Alert.h"
#include "frontends/Clipboard.h"
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
-#include "frontends/Gui.h"
-#include "frontends/WorkArea.h"
#include "insets/insetcommand.h" // ChangeRefs
#include "insets/insettext.h"
using lyx::support::bformat;
-using lyx::cap::setSelectionRange;
-
using std::distance;
using std::find;
using std::string;
extern BufferList bufferlist;
-BufferView::BufferView(LyXView * owner, lyx::frontend::WorkArea * workArea)
- : pimpl_(new Pimpl(*this, owner, workArea))
+BufferView::BufferView(LyXView * owner)
+ : pimpl_(new Pimpl(*this, owner))
{}
}
-lyx::frontend::Painter & BufferView::painter() const
-{
- return pimpl_->painter();
-}
-
-
void BufferView::setBuffer(Buffer * b)
{
pimpl_->setBuffer(b);
}
-void BufferView::newFile(string const & fn, string const & tn, bool named)
+string BufferView::firstLayout()
{
- pimpl_->newFile(fn, tn, named);
+ return pimpl_->firstLayout();
}
}
-void BufferView::update(Update::flags flags)
+bool BufferView::update(Update::flags flags)
{
- pimpl_->update(flags);
+ return pimpl_->update(flags);
}
}
+void BufferView::setCursorFromScrollbar()
+{
+ pimpl_->setCursorFromScrollbar();
+}
+
+
bool BufferView::available() const
{
return pimpl_->available();
}
-string const BufferView::getClipboard() const
-{
- return pimpl_->gui().clipboard().get();
-}
-
-
-void BufferView::stuffClipboard(string const & stuff) const
-{
- pimpl_->stuffClipboard(stuff);
-}
-
-
FuncStatus BufferView::getStatus(FuncRequest const & cmd)
{
return pimpl_->getStatus(cmd);
void BufferView::selectionRequested()
{
- pimpl_->selectionRequested();
+ pimpl_->selectionRequested();
}
void BufferView::selectionLost()
{
- pimpl_->selectionLost();
+ pimpl_->selectionLost();
}
void BufferView::workAreaResize(int width, int height)
{
- pimpl_->workAreaResize(width, height);
-}
-
-
-void BufferView::workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state)
-{
- pimpl_->workAreaKeyPress(key, state);
+ pimpl_->workAreaResize(width, height);
}
bool BufferView::workAreaDispatch(FuncRequest const & ev)
{
- return pimpl_->workAreaDispatch(ev);
+ return pimpl_->workAreaDispatch(ev);
}
}
-void BufferView::showErrorList(string const & action) const
-{
- if (getErrorList().size()) {
- string const title = bformat(_("%1$s Errors (%2$s)"),
- action, buffer()->fileName());
- owner()->getDialogs().show("errorlist", title);
- pimpl_->errorlist_.clear();
- }
-}
-
-
-ErrorList const & BufferView::getErrorList() const
-{
- return pimpl_->errorlist_;
-}
-
-
void BufferView::setCursorFromRow(int row)
{
int tmpid = -1;
}
-void BufferView::hideCursor()
-{
- pimpl_->gui().guiCursor().hide();
-}
-
LyXText * BufferView::getLyXText()
{
LyXText * text = cursor().innerText();
}
-void BufferView::haveSelection(bool sel)
-{
- pimpl_->gui().clipboard().haveSelection(sel);
-}
-
-
int BufferView::workHeight() const
{
return pimpl_->height();
BOOST_ASSERT(&cur.bv() == this);
// Has the cursor just left the inset?
+ bool badcursor = false;
if (&cursor().inset() != &cur.inset())
- cursor().inset().notifyCursorLeaves(cursor());
+ badcursor = cursor().inset().notifyCursorLeaves(cursor());
// do the dEPM magic if needed
- if (cursor().inTexted())
+ // FIXME: move this to InsetText::notifyCursorLeaves?
+ if (!badcursor && cursor().inTexted())
cursor().text()->deleteEmptyParagraphMechanism(cur, cursor());
cursor() = cur;
}
-bool const BufferView::repaintAll() const
-{
- return pimpl_->repaintAll();
-}
-
-
-void const BufferView::repaintAll(bool r) const
-{
- pimpl_->repaintAll(r);
-}
-
-
LCursor & BufferView::cursor()
{
return pimpl_->cursor_;
{
return pimpl_->offset_ref_;
}
+
+
+ViewMetricsInfo const & BufferView::viewMetricsInfo()
+{
+ return pimpl_->viewMetricsInfo();
+}
+
+
+void BufferView::updateMetrics(bool singlepar)
+{
+ pimpl_->updateMetrics(singlepar);
+}