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();
195 void BufferView::insetUnlock()
197 pimpl_->insetUnlock();
201 bool BufferView::focus() const
203 return pimpl_->focus();
207 void BufferView::focus(bool f)
213 bool BufferView::active() const
215 return pimpl_->active();
219 int BufferView::workWidth() const
221 return pimpl_->workarea_.workWidth();
225 bool BufferView::belowMouse() const
227 return pimpl_->belowMouse();
231 void BufferView::showCursor()
233 pimpl_->showCursor();
237 void BufferView::hideCursor()
239 pimpl_->hideCursor();
243 void BufferView::toggleSelection(bool b)
245 pimpl_->toggleSelection(b);
249 void BufferView::toggleToggle()
251 pimpl_->toggleToggle();
255 void BufferView::center()
261 void BufferView::pasteClipboard(bool asPara)
263 pimpl_->pasteClipboard(asPara);
267 string const BufferView::getClipboard() const
269 return pimpl_->workarea_.getClipboard();
273 void BufferView::stuffClipboard(string const & stuff) const
275 pimpl_->stuffClipboard(stuff);
279 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
280 BufferView::UpdateCodes uc2)
282 return static_cast<BufferView::UpdateCodes>
283 (static_cast<int>(uc1) | static_cast<int>(uc2));
286 bool BufferView::Dispatch(kb_action action, string const & argument)
288 return pimpl_->Dispatch(action, argument);