]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
no log...
[lyx.git] / src / BufferView.C
index bfe5dc237b9f02d9af0200f66733648179031b72..1e7db9e20b2b39d0dc69d57a2001c3ae1c6820ac 100644 (file)
@@ -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_.get();
+}
+
+
+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,143 +116,76 @@ 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);
-       }
-}
-
-
-void BufferView::enterView()
-{
-       pimpl_->enterView();
-}
-
-
-void BufferView::leaveView()
-{
-       pimpl_->leaveView();
-}
-
-
-// Callback for scrollbar slider
 void BufferView::scrollCB(double value)
 {
        pimpl_->scrollCB(value);
 }
 
 
-void BufferView::workAreaMotionNotify(int x, int y, unsigned int state)
-{
-       pimpl_->workAreaMotionNotify(x, y, state);
-}
-
-
-///  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)
+Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
+                                 unsigned int button)
 {
-       pimpl_->tripleClick(x, y, button);
+       return pimpl_->checkInsetHit(text, x, y, button);
 }
 
 
-void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
-{
-       pimpl_->workAreaButtonRelease(x, y, button);
-}
-
-
-void BufferView::workAreaExpose()
+void BufferView::redoCurrentBuffer()
 {
-       pimpl_->workAreaExpose();
+       pimpl_->redoCurrentBuffer();
 }
 
 
-//  // Callback for cursor timer
-void BufferView::cursorToggleCB(FL_OBJECT * ob, long )
+int BufferView::resizeCurrentBuffer()
 {
-       BufferView * view = static_cast<BufferView*>(ob->u_vdata);
-       view->pimpl_->cursorToggle();
+       return pimpl_->resizeCurrentBuffer();
 }
 
 
-#ifndef XFORMS_CLIPBOARD
-void BufferView::workAreaSelectionNotify(Window win, XEvent * event)
+void BufferView::cursorPrevious(LyXText * text)
 {
-       pimpl_->workAreaSelectionNotify(win, event);
+       pimpl_->cursorPrevious(text);
 }
-#endif
 
 
-void BufferView::cursorPrevious()
+void BufferView::cursorNext(LyXText * text)
 {
-       pimpl_->cursorPrevious();
+       pimpl_->cursorNext(text);
 }
 
 
-void BufferView::cursorNext()
+bool BufferView::available() const
 {
-       pimpl_->cursorNext();
+       return pimpl_->available();
 }
 
 
-bool BufferView::available() const
+void BufferView::beforeChange(LyXText * text)
 {
-       return pimpl_->available();
+       pimpl_->beforeChange(text);
 }
 
 
-void BufferView::beforeChange()
+void BufferView::savePosition(unsigned int i)
 {
-       pimpl_->beforeChange();
+       pimpl_->savePosition(i);
 }
 
 
-void BufferView::savePosition()
+void BufferView::restorePosition(unsigned int i)
 {
-       pimpl_->savePosition();
+       pimpl_->restorePosition(i);
 }
 
 
-void BufferView::restorePosition()
+bool BufferView::isSavedPosition(unsigned int i)
 {
-       pimpl_->restorePosition();
+       return pimpl_->isSavedPosition(i);
 }
 
 
-void BufferView::update(signed char f)
+void BufferView::update(LyXText * text, UpdateCodes f)
 {
-       pimpl_->update(f);
+       pimpl_->update(text, f);
 }
 
 
@@ -285,9 +231,9 @@ bool BufferView::active() const
 }
 
 
-unsigned short BufferView::paperWidth() const
+int BufferView::workWidth() const
 {
-    return text->paperWidth();
+    return pimpl_->workarea_.workWidth();
 }
 
 
@@ -327,9 +273,26 @@ void BufferView::center()
 }
 
 
-#ifdef XFORMS_CLIPBOARD
-void BufferView::pasteSelection(bool asPara)
+void BufferView::pasteClipboard(bool asPara)
 {
-       pimpl_->pasteSelection(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<BufferView::UpdateCodes>
+               (static_cast<int>(uc1) | static_cast<int>(uc2));
+}
+
+bool BufferView::Dispatch(kb_action action, string const & argument)
+{
+    return pimpl_->Dispatch(action, argument);
 }
-#endif