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 void BufferView::pushIntoUpdateList(Inset * i)
58 pimpl_->updatelist.push(i);
62 Painter & BufferView::painter()
64 return pimpl_->painter();
68 void BufferView::buffer(Buffer * b)
74 void BufferView::resize(int xpos, int ypos, int width, int height)
76 pimpl_->resize(xpos, ypos, width, height);
80 void BufferView::resize()
86 void BufferView::redraw()
92 void BufferView::fitCursor()
98 void BufferView::update()
104 void BufferView::updateScrollbar()
106 pimpl_->updateScrollbar();
110 void BufferView::scrollCB(double value)
112 pimpl_->scrollCB(value);
116 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
119 return pimpl_->checkInsetHit(text, x, y, button);
123 void BufferView::redoCurrentBuffer()
125 pimpl_->redoCurrentBuffer();
129 int BufferView::resizeCurrentBuffer()
131 return pimpl_->resizeCurrentBuffer();
135 void BufferView::cursorPrevious(LyXText * text)
137 pimpl_->cursorPrevious(text);
141 void BufferView::cursorNext(LyXText * text)
143 pimpl_->cursorNext(text);
147 bool BufferView::available() const
149 return pimpl_->available();
153 void BufferView::beforeChange(LyXText * text)
155 pimpl_->beforeChange(text);
159 void BufferView::savePosition(unsigned int i)
161 pimpl_->savePosition(i);
165 void BufferView::restorePosition(unsigned int i)
167 pimpl_->restorePosition(i);
171 bool BufferView::isSavedPosition(unsigned int i)
173 return pimpl_->isSavedPosition(i);
177 void BufferView::update(LyXText * text, UpdateCodes f)
179 pimpl_->update(text, f);
183 void BufferView::setState()
189 void BufferView::insetSleep()
191 pimpl_->insetSleep();
195 void BufferView::insetWakeup()
197 pimpl_->insetWakeup();
201 void BufferView::insetUnlock()
203 pimpl_->insetUnlock();
207 bool BufferView::focus() const
209 return pimpl_->focus();
213 void BufferView::focus(bool f)
219 bool BufferView::active() const
221 return pimpl_->active();
225 int BufferView::workWidth() const
227 return pimpl_->workarea_.workWidth();
231 bool BufferView::belowMouse() const
233 return pimpl_->belowMouse();
237 void BufferView::showCursor()
239 pimpl_->showCursor();
243 void BufferView::hideCursor()
245 pimpl_->hideCursor();
249 void BufferView::toggleSelection(bool b)
251 pimpl_->toggleSelection(b);
255 void BufferView::toggleToggle()
257 pimpl_->toggleToggle();
261 void BufferView::center()
267 void BufferView::pasteClipboard(bool asPara)
269 pimpl_->pasteClipboard(asPara);
273 string const BufferView::getClipboard() const
275 return pimpl_->workarea_.getClipboard();
279 void BufferView::stuffClipboard(string const & stuff) const
281 pimpl_->stuffClipboard(stuff);
285 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
286 BufferView::UpdateCodes uc2)
288 return static_cast<BufferView::UpdateCodes>
289 (static_cast<int>(uc1) | static_cast<int>(uc2));
292 bool BufferView::Dispatch(kb_action action, string const & argument)
294 return pimpl_->Dispatch(action, argument);