]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.C
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / BufferView.C
index b422edcd572e091cd135def40e57168b8c399b84..c2bd11863f67b973b734a24598ca01bc1460cdb6 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_;
+}
+
+
+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,6 +116,13 @@ 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();
@@ -121,14 +141,7 @@ void BufferView::gotoError()
 }
 
 
-extern "C" {
-       void C_BufferView_CursorToggleCB(FL_OBJECT * ob, long buf)
-       {
-               BufferView::cursorToggleCB(ob, buf);
-       }
-}
-
-
+#if 0
 void BufferView::enterView()
 {
        pimpl_->enterView();
@@ -183,33 +196,18 @@ void BufferView::workAreaExpose()
 {
        pimpl_->workAreaExpose();
 }
-
-
-//  // Callback for cursor timer
-void BufferView::cursorToggleCB(FL_OBJECT * ob, long )
-{
-       BufferView * view = static_cast<BufferView*>(ob->u_vdata);
-       view->pimpl_->cursorToggle();
-}
-
-
-#ifndef XFORMS_CLIPBOARD
-void BufferView::workAreaSelectionNotify(Window win, XEvent * event)
-{
-       pimpl_->workAreaSelectionNotify(win, event);
-}
 #endif
 
 
-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);
 }
 
 
@@ -243,7 +241,7 @@ bool BufferView::NoSavedPositions()
 }
 
 
-void BufferView::update(signed char f)
+void BufferView::update(UpdateCodes f)
 {
        pimpl_->update(f);
 }
@@ -291,9 +289,9 @@ bool BufferView::active() const
 }
 
 
-unsigned short BufferView::paperWidth() const
+int BufferView::workWidth() const
 {
-    return text->paperWidth();
+    return pimpl_->workarea_->workWidth();
 }
 
 
@@ -333,7 +331,6 @@ void BufferView::center()
 }
 
 
-#ifdef XFORMS_CLIPBOARD
 void BufferView::pasteClipboard(bool asPara)
 {
        pimpl_->pasteClipboard(asPara);
@@ -344,4 +341,11 @@ void BufferView::stuffClipboard(string const & stuff) const
 {
        pimpl_->stuffClipboard(stuff);
 }
-#endif
+
+
+BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
+                                 BufferView::UpdateCodes uc2)
+{
+       return static_cast<BufferView::UpdateCodes>
+               (static_cast<int>(uc1) | static_cast<int>(uc2));
+}