X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.C;h=12ac9b7e02d8d8a7cbce7678ec59d8c5b4aa2a47;hb=e07f7bcc50358fe9b7d68955de145b7249248c7b;hp=b45d2a77ac83efb2638f276ef685f32617ab81f0;hpb=82fa210ea8d38d51aafb131f10d843e27e056429;p=lyx.git diff --git a/src/BufferView.C b/src/BufferView.C index b45d2a77ac..12ac9b7e02 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -18,6 +18,8 @@ #include "BufferView.h" #include "BufferView_pimpl.h" #include "lyxtext.h" +#include "WorkArea.h" +#include "lyxscreen.h" BufferView::BufferView(LyXView * o, int xpos, int ypos, @@ -25,7 +27,6 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos, : pimpl_(new Pimpl(this, o, xpos, ypos, width, height)) { text = 0; - the_locking_inset = 0; inset_slept = false; } @@ -43,6 +44,18 @@ Buffer * BufferView::buffer() const } +LyXScreen * BufferView::screen() const +{ + return pimpl_->screen_; +} + + +WorkArea * BufferView::workarea() const +{ + return pimpl_->workarea_; +} + + LyXView * BufferView::owner() const { return pimpl_->owner_; @@ -85,9 +98,9 @@ void BufferView::redraw() } -void BufferView::fitCursor() +void BufferView::fitCursor(LyXText * text) { - pimpl_->fitCursor(); + pimpl_->fitCursor(text); } @@ -103,144 +116,40 @@ void BufferView::updateScrollbar() } -void BufferView::redoCurrentBuffer() -{ - pimpl_->redoCurrentBuffer(); -} - - -int BufferView::resizeCurrentBuffer() -{ - return pimpl_->resizeCurrentBuffer(); -} - - -void BufferView::gotoError() -{ - pimpl_->gotoError(); -} - - -extern "C" { - void C_BufferView_CursorToggleCB(FL_OBJECT * ob, long buf) - { - BufferView::cursorToggleCB(ob, buf); - } -} - - -#if 0 -// Callback for scrollbar up button -void BufferView::upCB(long time, int button) -{ - if (pimpl_->buffer_ == 0) return; - - switch (button) { - case 3: - pimpl_->scrollUpOnePage(); - break; - case 2: - pimpl_->scrollDownOnePage(); - break; - default: - pimpl_->scrollUp(time); - break; - } -} -#endif - - -void BufferView::enterView() -{ - pimpl_->enterView(); -} - - -void BufferView::leaveView() -{ - pimpl_->leaveView(); -} - - -// Callback for scrollbar slider void BufferView::scrollCB(double value) { pimpl_->scrollCB(value); } -#if 0 -// Callback for scrollbar down button -void BufferView::downCB(long time, int button) -{ - pimpl_->downCB(time, button); -} -#endif - - -void BufferView::workAreaMotionNotify(int x, int y, unsigned int state) -{ - pimpl_->workAreaMotionNotify(x, y, state); -} - - -extern int bibitemMaxWidth(Painter &, LyXFont const &); - - -/// Single-click on work area -void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button) -{ - pimpl_->workAreaButtonPress(xpos, ypos, button); -} - - -void BufferView::doubleClick(int x, int y, unsigned int button) -{ - pimpl_->doubleClick(x, y, button); -} - - -void BufferView::tripleClick(int x, int y, unsigned int button) -{ - pimpl_->tripleClick(x, y, button); -} - - -void BufferView::workAreaButtonRelease(int x, int y, unsigned int button) -{ - pimpl_->workAreaButtonRelease(x, y, button); -} - - -void BufferView::workAreaExpose() +Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y, + unsigned int button) { - pimpl_->workAreaExpose(); + return pimpl_->checkInsetHit(text, x, y, button); } -// // Callback for cursor timer -void BufferView::cursorToggleCB(FL_OBJECT * ob, long ) +void BufferView::redoCurrentBuffer() { - BufferView * view = static_cast(ob->u_vdata); - view->pimpl_->cursorToggle(); + pimpl_->redoCurrentBuffer(); } -void BufferView::workAreaSelectionNotify(Window win, XEvent * event) +int BufferView::resizeCurrentBuffer() { - pimpl_->workAreaSelectionNotify(win, event); + return pimpl_->resizeCurrentBuffer(); } -void BufferView::cursorPrevious() +void BufferView::cursorPrevious(LyXText * text) { - pimpl_->cursorPrevious(); + pimpl_->cursorPrevious(text); } -void BufferView::cursorNext() +void BufferView::cursorNext(LyXText * text) { - pimpl_->cursorNext(); + pimpl_->cursorNext(text); } @@ -250,36 +159,34 @@ bool BufferView::available() const } -void BufferView::beforeChange() +void BufferView::beforeChange(LyXText * text) { - pimpl_->beforeChange(); + pimpl_->beforeChange(text); } -void BufferView::savePosition() +void BufferView::savePosition(unsigned int i) { - pimpl_->savePosition(); + pimpl_->savePosition(i); } -void BufferView::restorePosition() +void BufferView::restorePosition(unsigned int i) { - pimpl_->restorePosition(); + pimpl_->restorePosition(i); } -void BufferView::update(signed char f) +bool BufferView::isSavedPosition(unsigned int i) { - pimpl_->update(f); + return pimpl_->isSavedPosition(i); } -#if 0 -void BufferView::smallUpdate(signed char f) +void BufferView::update(LyXText * text, UpdateCodes f) { - pimpl_->smallUpdate(f); + pimpl_->update(text, f); } -#endif void BufferView::setState() @@ -324,9 +231,9 @@ bool BufferView::active() const } -unsigned short BufferView::paperWidth() const +int BufferView::workWidth() const { - return text->paperWidth(); + return pimpl_->workarea_->workWidth(); } @@ -364,3 +271,28 @@ void BufferView::center() { pimpl_->center(); } + + +void BufferView::pasteClipboard(bool asPara) +{ + pimpl_->pasteClipboard(asPara); +} + + +void BufferView::stuffClipboard(string const & stuff) const +{ + pimpl_->stuffClipboard(stuff); +} + + +BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1, + BufferView::UpdateCodes uc2) +{ + return static_cast + (static_cast(uc1) | static_cast(uc2)); +} + +bool BufferView::Dispatch(kb_action action, string const & argument) +{ + return pimpl_->Dispatch(action, argument); +}