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