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 "frontends/screen.h"
21 #include "frontends/WorkArea.h"
24 BufferView::BufferView(LyXView * o, int xpos, int ypos,
25 int width, int height)
26 : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
32 BufferView::~BufferView()
39 Buffer * BufferView::buffer() const
41 return pimpl_->buffer_;
45 LyXScreen * BufferView::screen() const
47 return pimpl_->screen_.get();
51 LyXView * BufferView::owner() const
53 return pimpl_->owner_;
57 Painter & BufferView::painter()
59 return pimpl_->painter();
63 void BufferView::buffer(Buffer * b)
69 void BufferView::resize(int xpos, int ypos, int width, int height)
71 pimpl_->resize(xpos, ypos, width, height);
75 void BufferView::resize()
81 void BufferView::redraw()
87 bool BufferView::fitCursor()
89 return pimpl_->fitCursor();
93 void BufferView::update()
99 void BufferView::updateScrollbar()
101 pimpl_->updateScrollbar();
105 void BufferView::scrollCB(double value)
107 pimpl_->scrollCB(value);
111 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
113 return pimpl_->checkInsetHit(text, x, y);
117 void BufferView::redoCurrentBuffer()
119 pimpl_->redoCurrentBuffer();
123 int BufferView::resizeCurrentBuffer()
125 return pimpl_->resizeCurrentBuffer();
129 void BufferView::cursorPrevious(LyXText * text)
131 pimpl_->cursorPrevious(text);
135 void BufferView::cursorNext(LyXText * text)
137 pimpl_->cursorNext(text);
141 bool BufferView::available() const
143 return pimpl_->available();
147 void BufferView::beforeChange(LyXText * text)
149 pimpl_->beforeChange(text);
153 void BufferView::savePosition(unsigned int i)
155 pimpl_->savePosition(i);
159 void BufferView::restorePosition(unsigned int i)
161 pimpl_->restorePosition(i);
165 bool BufferView::isSavedPosition(unsigned int i)
167 return pimpl_->isSavedPosition(i);
171 void BufferView::update(LyXText * text, UpdateCodes f)
173 pimpl_->update(text, f);
177 void BufferView::setState()
183 void BufferView::insetSleep()
185 pimpl_->insetSleep();
189 void BufferView::insetWakeup()
191 pimpl_->insetWakeup();
196 void BufferView::insetUnlock()
198 pimpl_->insetUnlock();
202 bool BufferView::focus() const
204 return pimpl_->focus();
208 void BufferView::focus(bool f)
214 int BufferView::workWidth() const
216 return pimpl_->workarea().workWidth();
220 void BufferView::showCursor()
222 pimpl_->showCursor();
226 void BufferView::hideCursor()
228 pimpl_->hideCursor();
232 void BufferView::toggleSelection(bool b)
234 pimpl_->toggleSelection(b);
238 void BufferView::toggleToggle()
240 pimpl_->toggleToggle();
244 void BufferView::center()
250 void BufferView::pasteClipboard(bool asPara)
252 pimpl_->pasteClipboard(asPara);
256 string const BufferView::getClipboard() const
258 return pimpl_->workarea().getClipboard();
262 void BufferView::stuffClipboard(string const & stuff) const
264 pimpl_->stuffClipboard(stuff);
268 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
269 BufferView::UpdateCodes uc2)
271 return static_cast<BufferView::UpdateCodes>
272 (static_cast<int>(uc1) | static_cast<int>(uc2));
275 bool BufferView::Dispatch(kb_action action, string const & argument)
277 return pimpl_->Dispatch(action, argument);