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)
118 return pimpl_->checkInsetHit(text, x, y);
122 void BufferView::redoCurrentBuffer()
124 pimpl_->redoCurrentBuffer();
128 int BufferView::resizeCurrentBuffer()
130 return pimpl_->resizeCurrentBuffer();
134 void BufferView::cursorPrevious(LyXText * text)
136 pimpl_->cursorPrevious(text);
140 void BufferView::cursorNext(LyXText * text)
142 pimpl_->cursorNext(text);
146 bool BufferView::available() const
148 return pimpl_->available();
152 void BufferView::beforeChange(LyXText * text)
154 pimpl_->beforeChange(text);
158 void BufferView::savePosition(unsigned int i)
160 pimpl_->savePosition(i);
164 void BufferView::restorePosition(unsigned int i)
166 pimpl_->restorePosition(i);
170 bool BufferView::isSavedPosition(unsigned int i)
172 return pimpl_->isSavedPosition(i);
176 void BufferView::update(LyXText * text, UpdateCodes f)
178 pimpl_->update(text, f);
182 void BufferView::setState()
188 void BufferView::insetSleep()
190 pimpl_->insetSleep();
194 void BufferView::insetWakeup()
196 pimpl_->insetWakeup();
200 void BufferView::insetUnlock()
202 pimpl_->insetUnlock();
206 bool BufferView::focus() const
208 return pimpl_->focus();
212 void BufferView::focus(bool f)
218 bool BufferView::active() const
220 return pimpl_->active();
224 int BufferView::workWidth() const
226 return pimpl_->workarea_.workWidth();
230 bool BufferView::belowMouse() const
232 return pimpl_->belowMouse();
236 void BufferView::showCursor()
238 pimpl_->showCursor();
242 void BufferView::hideCursor()
244 pimpl_->hideCursor();
248 void BufferView::toggleSelection(bool b)
250 pimpl_->toggleSelection(b);
254 void BufferView::toggleToggle()
256 pimpl_->toggleToggle();
260 void BufferView::center()
266 void BufferView::pasteClipboard(bool asPara)
268 pimpl_->pasteClipboard(asPara);
272 string const BufferView::getClipboard() const
274 return pimpl_->workarea_.getClipboard();
278 void BufferView::stuffClipboard(string const & stuff) const
280 pimpl_->stuffClipboard(stuff);
284 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
285 BufferView::UpdateCodes uc2)
287 return static_cast<BufferView::UpdateCodes>
288 (static_cast<int>(uc1) | static_cast<int>(uc2));
291 bool BufferView::Dispatch(kb_action action, string const & argument)
293 return pimpl_->Dispatch(action, argument);