: bv_(b), owner_(o), cursor_timeout(400)
{
buffer_ = 0;
+#if 0
workarea_ = new WorkArea(bv_, xpos, ypos, width, height);
+#else
+ workarea_ = new WorkArea(xpos, ypos, width, height);
+#endif
// Setup the signals
+ workarea_->scrollCB.connect(slot(this, &BufferView::Pimpl::scrollCB));
workarea_->workAreaExpose
.connect(slot(this, &BufferView::Pimpl::workAreaExpose));
workarea_->workAreaEnter
{
Assert(screen_); // it is a programming error to call fitCursor
// without a valid screen.
- bool ret = screen_->FitCursor(text);
+ bool ret = screen_->FitCursor(text, bv_);
if (ret)
updateScrollbar();
return ret;
if (!screen_)
return;
- screen_->Draw(bv_->text, current_scrollbar_value);
+ screen_->Draw(bv_->text, bv_, current_scrollbar_value);
if (lyxrc.cursor_follows_scrollbar) {
LyXText * vbt = bv_->text;
workarea_->setScrollbarValue(value);
- bv_->scrollCB(value);
+ scrollCB(value);
return 0;
}
workarea_->setScrollbarValue(value);
- bv_->scrollCB(value);
+ scrollCB(value);
return 0;
}
update(BufferView::UPDATE); // Maybe an empty line was deleted
bv_->text->SetSelection();
- screen_->ToggleToggle(bv_->text);
+ screen_->ToggleToggle(bv_->text, bv_);
fitCursor(bv_->text);
- screen_->ShowCursor(bv_->text);
+ screen_->ShowCursor(bv_->text, bv_);
}
return;
}
}
// Clear the selection
- screen_->ToggleSelection(bv_->text);
+ screen_->ToggleSelection(bv_->text, bv_);
bv_->text->ClearSelection();
bv_->text->FullRebreak(bv_);
- screen_->Update(bv_->text);
+ screen_->Update(bv_->text, bv_);
updateScrollbar();
// Single left click in math inset?
if (buffer_ && !bv_->theLockingInset()) {
if (screen_ && button == 1) {
screen_->HideCursor();
- screen_->ToggleSelection(bv_->text);
+ screen_->ToggleSelection(bv_->text, bv_);
bv_->text->SelectWord(bv_);
- screen_->ToggleSelection(bv_->text, false);
+ screen_->ToggleSelection(bv_->text, bv_, false);
/* This will fit the cursor on the screen
* if necessary */
update(BufferView::SELECT|BufferView::FITCUR);
// select a line
if (buffer_ && screen_ && !bv_->theLockingInset() && (button == 1)) {
screen_->HideCursor();
- screen_->ToggleSelection(bv_->text);
+ screen_->ToggleSelection(bv_->text, bv_);
bv_->text->CursorHome(bv_);
bv_->text->sel_cursor = bv_->text->cursor;
bv_->text->CursorEnd(bv_);
bv_->text->SetSelection();
- screen_->ToggleSelection(bv_->text, false);
+ screen_->ToggleSelection(bv_->text, bv_, false);
/* This will fit the cursor on the screen
* if necessary */
update(BufferView::SELECT|BufferView::FITCUR);
// ...including the minibuffer
owner_->getMiniBuffer()->Init();
- } else if (screen_) screen_->Redraw(bv_->text);
+ } else if (screen_)
+ screen_->Redraw(bv_->text, bv_);
} else {
// Grey box when we don't have a buffer
workarea_->greyOut();
void BufferView::Pimpl::update()
{
- if (screen_) screen_->Update(bv_->text);
+ if (screen_) screen_->Update(bv_->text, bv_);
}
// Values used when calling update:
}
if (!bv_->theLockingInset()) {
- screen_->CursorToggle(bv_->text);
+ screen_->CursorToggle(bv_->text, bv_);
} else {
bv_->theLockingInset()->ToggleInsetCursor(bv_);
}
if (text->inset_owner ||
text->cursor.row()->height() < workarea_->height())
- screen_->Draw(bv_->text,
+ screen_->Draw(bv_->text, bv_,
text->cursor.y()
- text->cursor.row()->baseline()
+ text->cursor.row()->height()
if (text->inset_owner ||
text->cursor.row()->height() < workarea_->height())
- screen_->Draw(bv_->text, text->cursor.y() -
+ screen_->Draw(bv_->text, bv_, text->cursor.y() -
text->cursor.row()->baseline());
updateScrollbar();
}
void BufferView::Pimpl::showCursor()
{
if (screen_)
- screen_->ShowCursor(bv_->text);
+ screen_->ShowCursor(bv_->text, bv_);
}
void BufferView::Pimpl::toggleSelection(bool b)
{
if (screen_)
- screen_->ToggleSelection(bv_->text, b);
+ screen_->ToggleSelection(bv_->text, bv_, b);
}
void BufferView::Pimpl::toggleToggle()
{
if (screen_)
- screen_->ToggleToggle(bv_->text);
+ screen_->ToggleToggle(bv_->text, bv_);
}
{
beforeChange();
if (bv_->text->cursor.y() > static_cast<int>((workarea_->height() / 2))) {
- screen_->Draw(bv_->text, bv_->text->cursor.y() - workarea_->height() / 2);
+ screen_->Draw(bv_->text, bv_, bv_->text->cursor.y() - workarea_->height() / 2);
} else {
- screen_->Draw(bv_->text, 0);
+ screen_->Draw(bv_->text, bv_, 0);
}
update(BufferView::SELECT|BufferView::FITCUR);
redraw();
screen_->HideCursor();
bv_->beforeChange();
- string clip(workarea_->getClipboard());
+ string const clip(workarea_->getClipboard());
if (clip.empty()) return;