#include "bufferlist.h"
#include "bufferparams.h"
#include "BufferView_pimpl.h"
-#include "CutAndPaste.h"
#include "coordcache.h"
#include "debug.h"
#include "funcrequest.h"
#include "frontends/Clipboard.h"
#include "frontends/Dialogs.h"
#include "frontends/LyXView.h"
-#include "frontends/Gui.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;
}
-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();
}
-void BufferView::workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state)
-{
- pimpl_->workAreaKeyPress(key, state);
-}
-
-
bool BufferView::workAreaDispatch(FuncRequest const & 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();
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;
{
return pimpl_->viewMetricsInfo();
}
+
+
+void BufferView::updateMetrics(bool singlepar)
+{
+ pimpl_->updateMetrics(singlepar);
+}