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