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