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