]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
Dekels tabular/textinset patches
[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         inset_slept = false;
31 }
32
33
34 BufferView::~BufferView()
35 {
36         delete text;
37         delete pimpl_;
38 }
39
40
41 Buffer * BufferView::buffer() const
42 {
43         return pimpl_->buffer_;
44 }
45
46
47 LyXScreen * BufferView::screen() const
48 {
49         return pimpl_->screen_;
50 }
51
52
53 WorkArea * BufferView::workarea() const
54 {
55         return pimpl_->workarea_;
56 }
57
58
59 LyXView * BufferView::owner() const
60 {
61         return pimpl_->owner_;
62 }
63
64
65 void BufferView::pushIntoUpdateList(Inset * i)
66 {
67         pimpl_->updatelist.push(i);
68 }
69
70
71 Painter & BufferView::painter() 
72 {
73         return pimpl_->painter();
74 }
75
76
77 void BufferView::buffer(Buffer * b)
78 {
79         pimpl_->buffer(b);
80 }
81
82
83 void BufferView::resize(int xpos, int ypos, int width, int height)
84 {
85         pimpl_->resize(xpos, ypos, width, height);
86 }
87
88
89 void BufferView::resize()
90 {
91         pimpl_->resize();
92 }
93
94
95 void BufferView::redraw()
96 {
97         pimpl_->redraw();
98 }
99
100
101 void BufferView::fitCursor(LyXText * text)
102 {
103         pimpl_->fitCursor(text);
104 }
105
106
107 void BufferView::update()
108 {
109         pimpl_->update();
110 }
111
112
113 void BufferView::updateScrollbar()
114 {
115         pimpl_->updateScrollbar();
116 }
117
118
119 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
120                                   unsigned int button)
121 {
122         return pimpl_->checkInsetHit(text, x, y, button);
123 }
124
125
126 void BufferView::redoCurrentBuffer()
127 {
128         pimpl_->redoCurrentBuffer();
129 }
130
131
132 int BufferView::resizeCurrentBuffer()
133 {
134         return pimpl_->resizeCurrentBuffer();
135 }
136
137
138 void BufferView::gotoError()
139 {
140         pimpl_->gotoError();
141 }
142
143
144 #if 0
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 #endif
200
201
202 void BufferView::cursorPrevious(LyXText * text)
203 {
204         pimpl_->cursorPrevious(text);
205 }
206
207
208 void BufferView::cursorNext(LyXText * text)
209 {
210         pimpl_->cursorNext(text);
211 }
212
213
214 bool BufferView::available() const
215 {
216         return pimpl_->available();
217 }
218
219
220 void BufferView::beforeChange()
221 {
222         pimpl_->beforeChange();
223 }
224
225
226 void BufferView::savePosition()
227 {
228         pimpl_->savePosition();
229 }
230
231
232 void BufferView::restorePosition()
233 {
234         pimpl_->restorePosition();
235 }
236
237
238 bool BufferView::NoSavedPositions()
239 {
240         return pimpl_->NoSavedPositions();
241 }
242
243
244 void BufferView::update(UpdateCodes f)
245 {
246         pimpl_->update(f);
247 }
248
249
250 void BufferView::setState()
251 {
252         pimpl_->setState();
253 }
254
255
256 void BufferView::insetSleep()
257 {
258         pimpl_->insetSleep();
259 }
260
261
262 void BufferView::insetWakeup()
263 {
264         pimpl_->insetWakeup();
265 }
266
267
268 void BufferView::insetUnlock()
269 {
270         pimpl_->insetUnlock();
271 }
272
273
274 bool BufferView::focus() const
275 {
276         return pimpl_->focus();
277 }
278
279
280 void BufferView::focus(bool f)
281 {
282         pimpl_->focus(f);
283 }
284
285
286 bool BufferView::active() const
287 {
288         return pimpl_->active();
289 }
290
291
292 int BufferView::workWidth() const
293 {
294     return pimpl_->workarea_->workWidth();
295 }
296
297
298 bool BufferView::belowMouse() const 
299 {
300         return pimpl_->belowMouse();
301 }
302
303
304 void BufferView::showCursor()
305 {
306         pimpl_->showCursor();
307 }
308
309
310 void BufferView::hideCursor()
311 {
312         pimpl_->hideCursor();
313 }
314
315
316 void BufferView::toggleSelection(bool b)
317 {
318         pimpl_->toggleSelection(b);
319 }
320
321
322 void BufferView::toggleToggle()
323 {
324         pimpl_->toggleToggle();
325 }
326
327
328 void BufferView::center() 
329 {
330         pimpl_->center();
331 }
332
333
334 void BufferView::pasteClipboard(bool asPara)
335 {
336         pimpl_->pasteClipboard(asPara);
337 }
338
339
340 void BufferView::stuffClipboard(string const & stuff) const
341 {
342         pimpl_->stuffClipboard(stuff);
343 }
344
345
346 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
347                                   BufferView::UpdateCodes uc2)
348 {
349         return static_cast<BufferView::UpdateCodes>
350                 (static_cast<int>(uc1) | static_cast<int>(uc2));
351 }