-// -*- 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>
#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,
: pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
{
text = 0;
- the_locking_inset = 0;
- inset_slept = false;
}
}
-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();
}
}
-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();
}
}
-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)
-{
- pimpl_->tripleClick(x, y, button);
-}
-
-
-void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
-{
- pimpl_->workAreaButtonRelease(x, y, button);
-}
-
-
-void BufferView::workAreaExpose()
+void BufferView::scrollDocView(int value)
{
- pimpl_->workAreaExpose();
+ pimpl_->scrollDocView(value);
}
-// // Callback for cursor timer
-void BufferView::cursorToggleCB(FL_OBJECT * ob, long )
+Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
{
- BufferView * view = static_cast<BufferView*>(ob->u_vdata);
- view->pimpl_->cursorToggle();
+ return pimpl_->checkInsetHit(text, x, y);
}
-#ifndef XFORMS_CLIPBOARD
-void BufferView::workAreaSelectionNotify(Window win, XEvent * event)
+void BufferView::redoCurrentBuffer()
{
- pimpl_->workAreaSelectionNotify(win, event);
+ pimpl_->redoCurrentBuffer();
}
-#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);
}
}
-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);
}
-void BufferView::setState()
-{
- pimpl_->setState();
-}
-
-
-void BufferView::insetSleep()
+void BufferView::update(LyXText * text, UpdateCodes f)
{
- pimpl_->insetSleep();
+ pimpl_->update(text, f);
}
-void BufferView::insetWakeup()
+void BufferView::setState()
{
- pimpl_->insetWakeup();
+ pimpl_->setState();
}
}
-bool BufferView::focus() const
-{
- return pimpl_->focus();
-}
-
-
-void BufferView::focus(bool f)
+int BufferView::workWidth() const
{
- pimpl_->focus(f);
-}
-
-
-bool BufferView::active() const
-{
- return pimpl_->active();
-}
-
-
-unsigned short BufferView::paperWidth() const
-{
- return text->paperWidth();
-}
-
-
-bool BufferView::belowMouse() const
-{
- return pimpl_->belowMouse();
+ return pimpl_->workarea().workWidth();
}
}
-void BufferView::center()
+void BufferView::center()
{
pimpl_->center();
}
-#ifdef XFORMS_CLIPBOARD
void BufferView::pasteClipboard(bool asPara)
{
pimpl_->pasteClipboard(asPara);
}
+string const BufferView::getClipboard() const
+{
+ return pimpl_->workarea().getClipboard();
+}
+
+
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));
+}
+
+bool BufferView::Dispatch(kb_action action, string const & argument)
+{
+ return pimpl_->Dispatch(action, argument);
+}