2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
15 #pragma implementation
18 #include "BufferView.h"
19 #include "BufferView_pimpl.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))
28 the_locking_inset = 0;
33 BufferView::~BufferView()
40 Buffer * BufferView::buffer() const
42 return pimpl_->buffer_;
46 LyXView * BufferView::owner() const
48 return pimpl_->owner_;
52 void BufferView::pushIntoUpdateList(Inset * i)
54 pimpl_->updatelist.push(i);
58 Painter & BufferView::painter()
60 return pimpl_->painter();
64 void BufferView::buffer(Buffer * b)
70 void BufferView::resize(int xpos, int ypos, int width, int height)
72 pimpl_->resize(xpos, ypos, width, height);
76 void BufferView::resize()
82 void BufferView::redraw()
88 void BufferView::fitCursor()
94 void BufferView::update()
100 void BufferView::updateScrollbar()
102 pimpl_->updateScrollbar();
106 void BufferView::redoCurrentBuffer()
108 pimpl_->redoCurrentBuffer();
112 int BufferView::resizeCurrentBuffer()
114 return pimpl_->resizeCurrentBuffer();
118 void BufferView::gotoError()
126 void C_BufferView_CursorToggleCB(FL_OBJECT * ob, long buf)
128 BufferView::cursorToggleCB(ob, buf);
133 void BufferView::enterView()
139 void BufferView::leaveView()
145 // Callback for scrollbar slider
146 void BufferView::scrollCB(double value)
148 pimpl_->scrollCB(value);
152 void BufferView::workAreaMotionNotify(int x, int y, unsigned int state)
154 pimpl_->workAreaMotionNotify(x, y, state);
158 /// Single-click on work area
159 void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
161 pimpl_->workAreaButtonPress(xpos, ypos, button);
165 void BufferView::doubleClick(int x, int y, unsigned int button)
167 pimpl_->doubleClick(x, y, button);
171 void BufferView::tripleClick(int x, int y, unsigned int button)
173 pimpl_->tripleClick(x, y, button);
177 void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
179 pimpl_->workAreaButtonRelease(x, y, button);
183 void BufferView::workAreaExpose()
185 pimpl_->workAreaExpose();
189 // // Callback for cursor timer
190 void BufferView::cursorToggleCB(void * ob)
192 BufferView * view = static_cast<BufferView*>(ob);
193 view->pimpl_->cursorToggle();
197 void BufferView::cursorPrevious()
199 pimpl_->cursorPrevious();
203 void BufferView::cursorNext()
205 pimpl_->cursorNext();
209 bool BufferView::available() const
211 return pimpl_->available();
215 void BufferView::beforeChange()
217 pimpl_->beforeChange();
221 void BufferView::savePosition()
223 pimpl_->savePosition();
227 void BufferView::restorePosition()
229 pimpl_->restorePosition();
233 bool BufferView::NoSavedPositions()
235 return pimpl_->NoSavedPositions();
239 void BufferView::update(signed char f)
245 void BufferView::setState()
251 void BufferView::insetSleep()
253 pimpl_->insetSleep();
257 void BufferView::insetWakeup()
259 pimpl_->insetWakeup();
263 void BufferView::insetUnlock()
265 pimpl_->insetUnlock();
269 bool BufferView::focus() const
271 return pimpl_->focus();
275 void BufferView::focus(bool f)
281 bool BufferView::active() const
283 return pimpl_->active();
287 unsigned short BufferView::paperWidth() const
289 return text->paperWidth();
293 bool BufferView::belowMouse() const
295 return pimpl_->belowMouse();
299 void BufferView::showCursor()
301 pimpl_->showCursor();
305 void BufferView::hideCursor()
307 pimpl_->hideCursor();
311 void BufferView::toggleSelection(bool b)
313 pimpl_->toggleSelection(b);
317 void BufferView::toggleToggle()
319 pimpl_->toggleToggle();
323 void BufferView::center()
329 void BufferView::pasteClipboard(bool asPara)
331 pimpl_->pasteClipboard(asPara);
335 void BufferView::stuffClipboard(string const & stuff) const
337 pimpl_->stuffClipboard(stuff);