]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
redraw fix 1.
[lyx.git] / src / BufferView.C
index 2425f7ce1593d5e0f0c65b47095641241cdf482a..d9d6e37774f8d42d76914d441c697f46f911a643 100644 (file)
@@ -1,13 +1,11 @@
-// -*- C++ -*-
-/* This file is part of
- * ====================================================== 
- * 
- *           LyX, The Document Processor
- *        
- *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-2000 The LyX Team.
+/**
+ * \file BufferView.C
+ * Copyright 1995-2002 the LyX Team
+ * Read the file COPYING
  *
- * ====================================================== */
+ * \author unknown
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
 
 #include <config.h>
 
@@ -18,6 +16,8 @@
 #include "BufferView.h"
 #include "BufferView_pimpl.h"
 #include "lyxtext.h"
+#include "frontends/screen.h"
+#include "frontends/WorkArea.h"
 
 
 BufferView::BufferView(LyXView * o, int xpos, int ypos,
@@ -25,8 +25,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,19 +41,19 @@ Buffer * BufferView::buffer() const
 }
 
 
-LyXView * BufferView::owner() const
+LyXScreen & BufferView::screen() const
 {
-       return pimpl_->owner_;
+       return pimpl_->screen();
 }
 
 
-void BufferView::pushIntoUpdateList(Inset * i)
+LyXView * BufferView::owner() const
 {
-       pimpl_->updatelist.push(i);
+       return pimpl_->owner_;
 }
 
 
-Painter & BufferView::painter() 
+Painter & BufferView::painter() const
 {
        return pimpl_->painter();
 }
@@ -67,27 +65,21 @@ void BufferView::buffer(Buffer * b)
 }
 
 
-void BufferView::resize(int xpos, int ypos, int width, int height)
-{
-       pimpl_->resize(xpos, ypos, width, height);
-}
-
-
 void BufferView::resize()
 {
-       pimpl_->resize();
+       pimpl_->resizeCurrentBuffer();
 }
 
 
-void BufferView::redraw()
+void BufferView::repaint()
 {
-       pimpl_->redraw();
+       pimpl_->repaint();
 }
 
 
-void BufferView::fitCursor()
+bool BufferView::fitCursor()
 {
-       pimpl_->fitCursor();
+       return pimpl_->fitCursor();
 }
 
 
@@ -103,141 +95,69 @@ 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)
+void BufferView::scrollDocView(int value)
 {
-       pimpl_->tripleClick(x, y, button);
+       pimpl_->scrollDocView(value);
 }
 
 
-void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
+Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
 {
-       pimpl_->workAreaButtonRelease(x, y, button);
+       return pimpl_->checkInsetHit(text, x, y);
 }
 
 
-void BufferView::workAreaExpose()
-{
-       pimpl_->workAreaExpose();
-}
-
-
-//  // Callback for cursor timer
-void BufferView::cursorToggleCB(FL_OBJECT * ob, long )
+void BufferView::redoCurrentBuffer()
 {
-       BufferView * view = static_cast<BufferView*>(ob->u_vdata);
-       view->pimpl_->cursorToggle();
+       pimpl_->redoCurrentBuffer();
 }
 
 
-void BufferView::workAreaSelectionNotify(Window win, XEvent * event)
+void BufferView::cursorPrevious(LyXText * text)
 {
-       pimpl_->workAreaSelectionNotify(win, event);
+       pimpl_->cursorPrevious(text);
 }
 
 
-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);
 }
 
 
@@ -247,79 +167,74 @@ void BufferView::setState()
 }
 
 
-void BufferView::insetSleep()
+void BufferView::insetUnlock()
 {
-       pimpl_->insetSleep();
+       pimpl_->insetUnlock();
 }
 
 
-void BufferView::insetWakeup()
+int BufferView::workWidth() const
 {
-       pimpl_->insetWakeup();
+       return pimpl_->workarea().workWidth();
 }
 
 
-void BufferView::insetUnlock()
-{
-       pimpl_->insetUnlock();
-}
-
-
-bool BufferView::focus() const
+void BufferView::showCursor()
 {
-       return pimpl_->focus();
+       pimpl_->showCursor();
 }
 
 
-void BufferView::focus(bool f)
+void BufferView::hideCursor()
 {
-       pimpl_->focus(f);
+       pimpl_->hideCursor();
 }
 
 
-bool BufferView::active() const
+void BufferView::toggleSelection(bool b)
 {
-       return pimpl_->active();
+       pimpl_->toggleSelection(b);
 }
 
 
-unsigned short BufferView::paperWidth() const
+void BufferView::toggleToggle()
 {
-    return text->paperWidth();
+       pimpl_->toggleToggle();
 }
 
 
-bool BufferView::belowMouse() const 
+void BufferView::center()
 {
-       return pimpl_->belowMouse();
+       pimpl_->center();
 }
 
 
-void BufferView::showCursor()
+void BufferView::pasteClipboard(bool asPara)
 {
-       pimpl_->showCursor();
+       pimpl_->pasteClipboard(asPara);
 }
 
 
-void BufferView::hideCursor()
+string const BufferView::getClipboard() const
 {
-       pimpl_->hideCursor();
+       return pimpl_->workarea().getClipboard();
 }
 
 
-void BufferView::toggleSelection(bool b)
+void BufferView::stuffClipboard(string const & stuff) const
 {
-       pimpl_->toggleSelection(b);
+       pimpl_->stuffClipboard(stuff);
 }
 
 
-void BufferView::toggleToggle()
+BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
+                                 BufferView::UpdateCodes uc2)
 {
-       pimpl_->toggleToggle();
+       return static_cast<BufferView::UpdateCodes>
+               (static_cast<int>(uc1) | static_cast<int>(uc2));
 }
 
-
-void BufferView::center() 
+bool BufferView::Dispatch(kb_action action, string const & argument)
 {
-       pimpl_->center();
+       return pimpl_->Dispatch(action, argument);
 }