]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
Yet another tweak from J�rgen.
[lyx.git] / src / BufferView.C
index ef2fdf83dc2a1e26012d80f4e5d47942a47fb4b0..1e8a987d60337628d1e5f5823fc678dc5bdf32ff 100644 (file)
@@ -1,11 +1,10 @@
-// -*- C++ -*-
 /* This file is part of
  * ====================================================== 
  * 
  *           LyX, The Document Processor
  *        
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+ *           Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
@@ -18,7 +17,6 @@
 #include "BufferView.h"
 #include "BufferView_pimpl.h"
 #include "lyxtext.h"
-#include "WorkArea.h"
 #include "lyxscreen.h"
 
 
@@ -27,7 +25,6 @@ BufferView::BufferView(LyXView * o, int xpos, int ypos,
        : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
 {
        text = 0;
-       inset_slept = false;
 }
 
 
@@ -46,13 +43,7 @@ Buffer * BufferView::buffer() const
 
 LyXScreen * BufferView::screen() const
 {
-       return pimpl_->screen_;
-}
-
-
-WorkArea * BufferView::workarea() const
-{
-       return pimpl_->workarea_;
+       return pimpl_->screen_.get();
 }
 
 
@@ -98,9 +89,9 @@ void BufferView::redraw()
 }
 
 
-void BufferView::fitCursor(LyXText * text)
+void BufferView::fitCursor()
 {
-       pimpl_->fitCursor(text);
+       pimpl_->fitCursor();
 }
 
 
@@ -116,81 +107,28 @@ void BufferView::updateScrollbar()
 }
 
 
-Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
-                                 unsigned int button)
-{
-       return pimpl_->checkInsetHit(text, x, y, button);
-}
-
-
-void BufferView::redoCurrentBuffer()
-{
-       pimpl_->redoCurrentBuffer();
-}
-
-
-int BufferView::resizeCurrentBuffer()
-{
-       return pimpl_->resizeCurrentBuffer();
-}
-
-
-#if 0
-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)
 {
-       pimpl_->tripleClick(x, y, button);
+       return pimpl_->checkInsetHit(text, x, y);
 }
 
 
-void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
+void BufferView::redoCurrentBuffer()
 {
-       pimpl_->workAreaButtonRelease(x, y, button);
+       pimpl_->redoCurrentBuffer();
 }
 
 
-void BufferView::workAreaExpose()
+int BufferView::resizeCurrentBuffer()
 {
-       pimpl_->workAreaExpose();
+       return pimpl_->resizeCurrentBuffer();
 }
-#endif
 
 
 void BufferView::cursorPrevious(LyXText * text)
@@ -211,9 +149,9 @@ bool BufferView::available() const
 }
 
 
-void BufferView::beforeChange()
+void BufferView::beforeChange(LyXText * text)
 {
-       pimpl_->beforeChange();
+       pimpl_->beforeChange(text);
 }
 
 
@@ -285,7 +223,7 @@ bool BufferView::active() const
 
 int BufferView::workWidth() const
 {
-    return pimpl_->workarea_->workWidth();
+    return pimpl_->workarea_.workWidth();
 }
 
 
@@ -331,6 +269,12 @@ void BufferView::pasteClipboard(bool asPara)
 }
 
 
+string const BufferView::getClipboard() const
+{
+       return pimpl_->workarea_.getClipboard();
+}
+
+
 void BufferView::stuffClipboard(string const & stuff) const
 {
        pimpl_->stuffClipboard(stuff);
@@ -343,3 +287,8 @@ BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
        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);
+}