]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
88cbba5f8f7f927f7b276d664dd3f2ce37eedb85
[lyx.git] / src / BufferView.C
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "BufferView.h"
19 #include "BufferView_pimpl.h"
20 #include "lyxtext.h"
21 #include "WorkArea.h"
22 #include "lyxscreen.h"
23
24
25 BufferView::BufferView(LyXView * o, int xpos, int ypos,
26                        int width, int height)
27         : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
28 {
29         text = 0;
30         the_locking_inset = 0;
31         inset_slept = false;
32 }
33
34
35 BufferView::~BufferView()
36 {
37         delete text;
38         delete pimpl_;
39 }
40
41
42 Buffer * BufferView::buffer() const
43 {
44         return pimpl_->buffer_;
45 }
46
47
48 LyXScreen * BufferView::screen() const
49 {
50         return pimpl_->screen_;
51 }
52
53
54 WorkArea * BufferView::workarea() const
55 {
56         return pimpl_->workarea_;
57 }
58
59
60 LyXView * BufferView::owner() const
61 {
62         return pimpl_->owner_;
63 }
64
65
66 void BufferView::pushIntoUpdateList(Inset * i)
67 {
68         pimpl_->updatelist.push(i);
69 }
70
71
72 Painter & BufferView::painter() 
73 {
74         return pimpl_->painter();
75 }
76
77
78 void BufferView::buffer(Buffer * b)
79 {
80         pimpl_->buffer(b);
81 }
82
83
84 void BufferView::resize(int xpos, int ypos, int width, int height)
85 {
86         pimpl_->resize(xpos, ypos, width, height);
87 }
88
89
90 void BufferView::resize()
91 {
92         pimpl_->resize();
93 }
94
95
96 void BufferView::redraw()
97 {
98         pimpl_->redraw();
99 }
100
101
102 void BufferView::fitCursor(LyXText * text)
103 {
104         pimpl_->fitCursor(text);
105 }
106
107
108 void BufferView::update()
109 {
110         pimpl_->update();
111 }
112
113
114 void BufferView::updateScrollbar()
115 {
116         pimpl_->updateScrollbar();
117 }
118
119
120 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
121                                   unsigned int button)
122 {
123         return pimpl_->checkInsetHit(text, x, y, button);
124 }
125
126
127 void BufferView::redoCurrentBuffer()
128 {
129         pimpl_->redoCurrentBuffer();
130 }
131
132
133 int BufferView::resizeCurrentBuffer()
134 {
135         return pimpl_->resizeCurrentBuffer();
136 }
137
138
139 void BufferView::gotoError()
140 {
141         pimpl_->gotoError();
142 }
143
144
145 void BufferView::enterView()
146 {
147         pimpl_->enterView();
148 }
149
150
151 void BufferView::leaveView()
152 {
153         pimpl_->leaveView();
154 }
155
156
157 // Callback for scrollbar slider
158 void BufferView::scrollCB(double value)
159 {
160         pimpl_->scrollCB(value);
161 }
162
163
164 void BufferView::workAreaMotionNotify(int x, int y, unsigned int state)
165 {
166         pimpl_->workAreaMotionNotify(x, y, state);
167 }
168
169
170 ///  Single-click on work area
171 void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
172 {
173         pimpl_->workAreaButtonPress(xpos, ypos, button);
174 }
175
176
177 void BufferView::doubleClick(int x, int y, unsigned int button) 
178 {
179         pimpl_->doubleClick(x, y, button);
180 }
181
182
183 void BufferView::tripleClick(int x, int y, unsigned int button)
184 {
185         pimpl_->tripleClick(x, y, button);
186 }
187
188
189 void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
190 {
191         pimpl_->workAreaButtonRelease(x, y, button);
192 }
193
194
195 void BufferView::workAreaExpose()
196 {
197         pimpl_->workAreaExpose();
198 }
199
200
201 void BufferView::cursorPrevious()
202 {
203         pimpl_->cursorPrevious();
204 }
205
206
207 void BufferView::cursorNext()
208 {
209         pimpl_->cursorNext();
210 }
211
212
213 bool BufferView::available() const
214 {
215         return pimpl_->available();
216 }
217
218
219 void BufferView::beforeChange()
220 {
221         pimpl_->beforeChange();
222 }
223
224
225 void BufferView::savePosition()
226 {
227         pimpl_->savePosition();
228 }
229
230
231 void BufferView::restorePosition()
232 {
233         pimpl_->restorePosition();
234 }
235
236
237 bool BufferView::NoSavedPositions()
238 {
239         return pimpl_->NoSavedPositions();
240 }
241
242
243 void BufferView::update(UpdateCodes f)
244 {
245         pimpl_->update(f);
246 }
247
248
249 void BufferView::setState()
250 {
251         pimpl_->setState();
252 }
253
254
255 void BufferView::insetSleep()
256 {
257         pimpl_->insetSleep();
258 }
259
260
261 void BufferView::insetWakeup()
262 {
263         pimpl_->insetWakeup();
264 }
265
266
267 void BufferView::insetUnlock()
268 {
269         pimpl_->insetUnlock();
270 }
271
272
273 bool BufferView::focus() const
274 {
275         return pimpl_->focus();
276 }
277
278
279 void BufferView::focus(bool f)
280 {
281         pimpl_->focus(f);
282 }
283
284
285 bool BufferView::active() const
286 {
287         return pimpl_->active();
288 }
289
290
291 int BufferView::workWidth() const
292 {
293     return pimpl_->workarea_->workWidth();
294 }
295
296
297 bool BufferView::belowMouse() const 
298 {
299         return pimpl_->belowMouse();
300 }
301
302
303 void BufferView::showCursor()
304 {
305         pimpl_->showCursor();
306 }
307
308
309 void BufferView::hideCursor()
310 {
311         pimpl_->hideCursor();
312 }
313
314
315 void BufferView::toggleSelection(bool b)
316 {
317         pimpl_->toggleSelection(b);
318 }
319
320
321 void BufferView::toggleToggle()
322 {
323         pimpl_->toggleToggle();
324 }
325
326
327 void BufferView::center() 
328 {
329         pimpl_->center();
330 }
331
332
333 void BufferView::pasteClipboard(bool asPara)
334 {
335         pimpl_->pasteClipboard(asPara);
336 }
337
338
339 void BufferView::stuffClipboard(string const & stuff) const
340 {
341         pimpl_->stuffClipboard(stuff);
342 }
343
344
345 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
346                                   BufferView::UpdateCodes uc2)
347 {
348         return static_cast<BufferView::UpdateCodes>
349                 (static_cast<int>(uc1) | static_cast<int>(uc2));
350 }