2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
15 #pragma implementation
18 #include "BufferView.h"
19 #include "BufferView_pimpl.h"
22 #include "lyxscreen.h"
25 BufferView::BufferView(LyXView * o, int xpos, int ypos,
26 int width, int height)
27 : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
33 BufferView::~BufferView()
40 Buffer * BufferView::buffer() const
42 return pimpl_->buffer_;
46 LyXScreen * BufferView::screen() const
48 return pimpl_->screen_.get();
52 LyXView * BufferView::owner() const
54 return pimpl_->owner_;
58 void BufferView::pushIntoUpdateList(Inset * i)
60 pimpl_->updatelist.push(i);
64 Painter & BufferView::painter()
66 return pimpl_->painter();
70 void BufferView::buffer(Buffer * b)
76 void BufferView::resize(int xpos, int ypos, int width, int height)
78 pimpl_->resize(xpos, ypos, width, height);
82 void BufferView::resize()
88 void BufferView::redraw()
94 void BufferView::fitCursor(LyXText * text)
96 pimpl_->fitCursor(text);
100 void BufferView::update()
106 void BufferView::updateScrollbar()
108 pimpl_->updateScrollbar();
112 void BufferView::scrollCB(double value)
114 pimpl_->scrollCB(value);
118 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
121 return pimpl_->checkInsetHit(text, x, y, button);
125 void BufferView::redoCurrentBuffer()
127 pimpl_->redoCurrentBuffer();
131 int BufferView::resizeCurrentBuffer()
133 return pimpl_->resizeCurrentBuffer();
137 void BufferView::cursorPrevious(LyXText * text)
139 pimpl_->cursorPrevious(text);
143 void BufferView::cursorNext(LyXText * text)
145 pimpl_->cursorNext(text);
149 bool BufferView::available() const
151 return pimpl_->available();
155 void BufferView::beforeChange(LyXText * text)
157 pimpl_->beforeChange(text);
161 void BufferView::savePosition(unsigned int i)
163 pimpl_->savePosition(i);
167 void BufferView::restorePosition(unsigned int i)
169 pimpl_->restorePosition(i);
173 bool BufferView::isSavedPosition(unsigned int i)
175 return pimpl_->isSavedPosition(i);
179 void BufferView::update(LyXText * text, UpdateCodes f)
181 pimpl_->update(text, f);
185 void BufferView::setState()
191 void BufferView::insetSleep()
193 pimpl_->insetSleep();
197 void BufferView::insetWakeup()
199 pimpl_->insetWakeup();
203 void BufferView::insetUnlock()
205 pimpl_->insetUnlock();
209 bool BufferView::focus() const
211 return pimpl_->focus();
215 void BufferView::focus(bool f)
221 bool BufferView::active() const
223 return pimpl_->active();
227 int BufferView::workWidth() const
229 return pimpl_->workarea_.workWidth();
233 bool BufferView::belowMouse() const
235 return pimpl_->belowMouse();
239 void BufferView::showCursor()
241 pimpl_->showCursor();
245 void BufferView::hideCursor()
247 pimpl_->hideCursor();
251 void BufferView::toggleSelection(bool b)
253 pimpl_->toggleSelection(b);
257 void BufferView::toggleToggle()
259 pimpl_->toggleToggle();
263 void BufferView::center()
269 void BufferView::pasteClipboard(bool asPara)
271 pimpl_->pasteClipboard(asPara);
275 string const BufferView::getClipboard() const
277 return pimpl_->workarea_.getClipboard();
281 void BufferView::stuffClipboard(string const & stuff) const
283 pimpl_->stuffClipboard(stuff);
287 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
288 BufferView::UpdateCodes uc2)
290 return static_cast<BufferView::UpdateCodes>
291 (static_cast<int>(uc1) | static_cast<int>(uc2));
294 bool BufferView::Dispatch(kb_action action, string const & argument)
296 return pimpl_->Dispatch(action, argument);