]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
60f0297b525a56e458dc214ac2bbc7529df00dda
[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 void BufferView::enterView()
145 {
146         pimpl_->enterView();
147 }
148
149
150 void BufferView::leaveView()
151 {
152         pimpl_->leaveView();
153 }
154
155
156 // Callback for scrollbar slider
157 void BufferView::scrollCB(double value)
158 {
159         pimpl_->scrollCB(value);
160 }
161
162
163 void BufferView::workAreaMotionNotify(int x, int y, unsigned int state)
164 {
165         pimpl_->workAreaMotionNotify(x, y, state);
166 }
167
168
169 ///  Single-click on work area
170 void BufferView::workAreaButtonPress(int xpos, int ypos, unsigned int button)
171 {
172         pimpl_->workAreaButtonPress(xpos, ypos, button);
173 }
174
175
176 void BufferView::doubleClick(int x, int y, unsigned int button) 
177 {
178         pimpl_->doubleClick(x, y, button);
179 }
180
181
182 void BufferView::tripleClick(int x, int y, unsigned int button)
183 {
184         pimpl_->tripleClick(x, y, button);
185 }
186
187
188 void BufferView::workAreaButtonRelease(int x, int y, unsigned int button)
189 {
190         pimpl_->workAreaButtonRelease(x, y, button);
191 }
192
193
194 void BufferView::workAreaExpose()
195 {
196         pimpl_->workAreaExpose();
197 }
198
199
200 void BufferView::cursorPrevious(LyXText * text)
201 {
202         pimpl_->cursorPrevious(text);
203 }
204
205
206 void BufferView::cursorNext(LyXText * text)
207 {
208         pimpl_->cursorNext(text);
209 }
210
211
212 bool BufferView::available() const
213 {
214         return pimpl_->available();
215 }
216
217
218 void BufferView::beforeChange()
219 {
220         pimpl_->beforeChange();
221 }
222
223
224 void BufferView::savePosition()
225 {
226         pimpl_->savePosition();
227 }
228
229
230 void BufferView::restorePosition()
231 {
232         pimpl_->restorePosition();
233 }
234
235
236 bool BufferView::NoSavedPositions()
237 {
238         return pimpl_->NoSavedPositions();
239 }
240
241
242 void BufferView::update(UpdateCodes f)
243 {
244         pimpl_->update(f);
245 }
246
247
248 void BufferView::setState()
249 {
250         pimpl_->setState();
251 }
252
253
254 void BufferView::insetSleep()
255 {
256         pimpl_->insetSleep();
257 }
258
259
260 void BufferView::insetWakeup()
261 {
262         pimpl_->insetWakeup();
263 }
264
265
266 void BufferView::insetUnlock()
267 {
268         pimpl_->insetUnlock();
269 }
270
271
272 bool BufferView::focus() const
273 {
274         return pimpl_->focus();
275 }
276
277
278 void BufferView::focus(bool f)
279 {
280         pimpl_->focus(f);
281 }
282
283
284 bool BufferView::active() const
285 {
286         return pimpl_->active();
287 }
288
289
290 int BufferView::workWidth() const
291 {
292     return pimpl_->workarea_->workWidth();
293 }
294
295
296 bool BufferView::belowMouse() const 
297 {
298         return pimpl_->belowMouse();
299 }
300
301
302 void BufferView::showCursor()
303 {
304         pimpl_->showCursor();
305 }
306
307
308 void BufferView::hideCursor()
309 {
310         pimpl_->hideCursor();
311 }
312
313
314 void BufferView::toggleSelection(bool b)
315 {
316         pimpl_->toggleSelection(b);
317 }
318
319
320 void BufferView::toggleToggle()
321 {
322         pimpl_->toggleToggle();
323 }
324
325
326 void BufferView::center() 
327 {
328         pimpl_->center();
329 }
330
331
332 void BufferView::pasteClipboard(bool asPara)
333 {
334         pimpl_->pasteClipboard(asPara);
335 }
336
337
338 void BufferView::stuffClipboard(string const & stuff) const
339 {
340         pimpl_->stuffClipboard(stuff);
341 }
342
343
344 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
345                                   BufferView::UpdateCodes uc2)
346 {
347         return static_cast<BufferView::UpdateCodes>
348                 (static_cast<int>(uc1) | static_cast<int>(uc2));
349 }