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"
21 #include "lyxscreen.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 void BufferView::pushIntoUpdateList(Inset * i)
59 pimpl_->updatelist.push(i);
63 Painter & BufferView::painter()
65 return pimpl_->painter();
69 void BufferView::buffer(Buffer * b)
75 void BufferView::resize(int xpos, int ypos, int width, int height)
77 pimpl_->resize(xpos, ypos, width, height);
81 void BufferView::resize()
87 void BufferView::redraw()
93 void BufferView::fitCursor(LyXText * text)
95 pimpl_->fitCursor(text);
99 void BufferView::update()
105 void BufferView::updateScrollbar()
107 pimpl_->updateScrollbar();
111 void BufferView::scrollCB(double value)
113 pimpl_->scrollCB(value);
117 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
120 return pimpl_->checkInsetHit(text, x, y, button);
124 void BufferView::redoCurrentBuffer()
126 pimpl_->redoCurrentBuffer();
130 int BufferView::resizeCurrentBuffer()
132 return pimpl_->resizeCurrentBuffer();
136 void BufferView::cursorPrevious(LyXText * text)
138 pimpl_->cursorPrevious(text);
142 void BufferView::cursorNext(LyXText * text)
144 pimpl_->cursorNext(text);
148 bool BufferView::available() const
150 return pimpl_->available();
154 void BufferView::beforeChange(LyXText * text)
156 pimpl_->beforeChange(text);
160 void BufferView::savePosition(unsigned int i)
162 pimpl_->savePosition(i);
166 void BufferView::restorePosition(unsigned int i)
168 pimpl_->restorePosition(i);
172 bool BufferView::isSavedPosition(unsigned int i)
174 return pimpl_->isSavedPosition(i);
178 void BufferView::update(LyXText * text, UpdateCodes f)
180 pimpl_->update(text, f);
184 void BufferView::setState()
190 void BufferView::insetSleep()
192 pimpl_->insetSleep();
196 void BufferView::insetWakeup()
198 pimpl_->insetWakeup();
202 void BufferView::insetUnlock()
204 pimpl_->insetUnlock();
208 bool BufferView::focus() const
210 return pimpl_->focus();
214 void BufferView::focus(bool f)
220 bool BufferView::active() const
222 return pimpl_->active();
226 int BufferView::workWidth() const
228 return pimpl_->workarea_.workWidth();
232 bool BufferView::belowMouse() const
234 return pimpl_->belowMouse();
238 void BufferView::showCursor()
240 pimpl_->showCursor();
244 void BufferView::hideCursor()
246 pimpl_->hideCursor();
250 void BufferView::toggleSelection(bool b)
252 pimpl_->toggleSelection(b);
256 void BufferView::toggleToggle()
258 pimpl_->toggleToggle();
262 void BufferView::center()
268 void BufferView::pasteClipboard(bool asPara)
270 pimpl_->pasteClipboard(asPara);
274 string const BufferView::getClipboard() const
276 return pimpl_->workarea_.getClipboard();
280 void BufferView::stuffClipboard(string const & stuff) const
282 pimpl_->stuffClipboard(stuff);
286 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
287 BufferView::UpdateCodes uc2)
289 return static_cast<BufferView::UpdateCodes>
290 (static_cast<int>(uc1) | static_cast<int>(uc2));
293 bool BufferView::Dispatch(kb_action action, string const & argument)
295 return pimpl_->Dispatch(action, argument);