1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2001 The LyX Team.
9 * ====================================================== */
14 #pragma implementation
17 #include "BufferView.h"
18 #include "BufferView_pimpl.h"
20 #include "lyxscreen.h"
23 BufferView::BufferView(LyXView * o, int xpos, int ypos,
24 int width, int height)
25 : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
31 BufferView::~BufferView()
38 Buffer * BufferView::buffer() const
40 return pimpl_->buffer_;
44 LyXScreen * BufferView::screen() const
46 return pimpl_->screen_.get();
50 LyXView * BufferView::owner() const
52 return pimpl_->owner_;
56 Painter & BufferView::painter()
58 return pimpl_->painter();
62 void BufferView::buffer(Buffer * b)
68 void BufferView::resize(int xpos, int ypos, int width, int height)
70 pimpl_->resize(xpos, ypos, width, height);
74 void BufferView::resize()
80 void BufferView::redraw()
86 bool BufferView::fitCursor()
88 return pimpl_->fitCursor();
92 void BufferView::update()
98 void BufferView::updateScrollbar()
100 pimpl_->updateScrollbar();
104 void BufferView::scrollCB(double value)
106 pimpl_->scrollCB(value);
110 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
112 return pimpl_->checkInsetHit(text, x, y);
116 void BufferView::redoCurrentBuffer()
118 pimpl_->redoCurrentBuffer();
122 int BufferView::resizeCurrentBuffer()
124 return pimpl_->resizeCurrentBuffer();
128 void BufferView::cursorPrevious(LyXText * text)
130 pimpl_->cursorPrevious(text);
134 void BufferView::cursorNext(LyXText * text)
136 pimpl_->cursorNext(text);
140 bool BufferView::available() const
142 return pimpl_->available();
146 void BufferView::beforeChange(LyXText * text)
148 pimpl_->beforeChange(text);
152 void BufferView::savePosition(unsigned int i)
154 pimpl_->savePosition(i);
158 void BufferView::restorePosition(unsigned int i)
160 pimpl_->restorePosition(i);
164 bool BufferView::isSavedPosition(unsigned int i)
166 return pimpl_->isSavedPosition(i);
170 void BufferView::update(LyXText * text, UpdateCodes f)
172 pimpl_->update(text, f);
176 void BufferView::setState()
182 void BufferView::insetSleep()
184 pimpl_->insetSleep();
188 void BufferView::insetWakeup()
190 pimpl_->insetWakeup();
194 void BufferView::insetUnlock()
196 pimpl_->insetUnlock();
200 bool BufferView::focus() const
202 return pimpl_->focus();
206 void BufferView::focus(bool f)
212 bool BufferView::active() const
214 return pimpl_->active();
218 int BufferView::workWidth() const
220 return pimpl_->workarea_.workWidth();
224 bool BufferView::belowMouse() const
226 return pimpl_->belowMouse();
230 void BufferView::showCursor()
232 pimpl_->showCursor();
236 void BufferView::hideCursor()
238 pimpl_->hideCursor();
242 void BufferView::toggleSelection(bool b)
244 pimpl_->toggleSelection(b);
248 void BufferView::toggleToggle()
250 pimpl_->toggleToggle();
254 void BufferView::center()
260 void BufferView::pasteClipboard(bool asPara)
262 pimpl_->pasteClipboard(asPara);
266 string const BufferView::getClipboard() const
268 return pimpl_->workarea_.getClipboard();
272 void BufferView::stuffClipboard(string const & stuff) const
274 pimpl_->stuffClipboard(stuff);
278 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
279 BufferView::UpdateCodes uc2)
281 return static_cast<BufferView::UpdateCodes>
282 (static_cast<int>(uc1) | static_cast<int>(uc2));
285 bool BufferView::Dispatch(kb_action action, string const & argument)
287 return pimpl_->Dispatch(action, argument);