]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
In for a penny, in for a pound. Consistent use of // -*- C++ -*-
[lyx.git] / src / BufferView.C
1 /* This file is part of
2  * ====================================================== 
3  * 
4  *           LyX, The Document Processor
5  *        
6  *           Copyright 1995 Matthias Ettrich
7  *           Copyright 1995-2001 The LyX Team.
8  *
9  * ====================================================== */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "BufferView.h"
18 #include "BufferView_pimpl.h"
19 #include "lyxtext.h"
20 #include "WorkArea.h"
21 #include "lyxscreen.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 }
30
31
32 BufferView::~BufferView()
33 {
34         delete text;
35         delete pimpl_;
36 }
37
38
39 Buffer * BufferView::buffer() const
40 {
41         return pimpl_->buffer_;
42 }
43
44
45 LyXScreen * BufferView::screen() const
46 {
47         return pimpl_->screen_.get();
48 }
49
50
51 LyXView * BufferView::owner() const
52 {
53         return pimpl_->owner_;
54 }
55
56
57 void BufferView::pushIntoUpdateList(Inset * i)
58 {
59         pimpl_->updatelist.push(i);
60 }
61
62
63 Painter & BufferView::painter() 
64 {
65         return pimpl_->painter();
66 }
67
68
69 void BufferView::buffer(Buffer * b)
70 {
71         pimpl_->buffer(b);
72 }
73
74
75 void BufferView::resize(int xpos, int ypos, int width, int height)
76 {
77         pimpl_->resize(xpos, ypos, width, height);
78 }
79
80
81 void BufferView::resize()
82 {
83         pimpl_->resize();
84 }
85
86
87 void BufferView::redraw()
88 {
89         pimpl_->redraw();
90 }
91
92
93 void BufferView::fitCursor(LyXText * text)
94 {
95         pimpl_->fitCursor(text);
96 }
97
98
99 void BufferView::update()
100 {
101         pimpl_->update();
102 }
103
104
105 void BufferView::updateScrollbar()
106 {
107         pimpl_->updateScrollbar();
108 }
109
110
111 void BufferView::scrollCB(double value)
112 {
113         pimpl_->scrollCB(value);
114 }
115
116
117 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y,
118                                   unsigned int button)
119 {
120         return pimpl_->checkInsetHit(text, x, y, button);
121 }
122
123
124 void BufferView::redoCurrentBuffer()
125 {
126         pimpl_->redoCurrentBuffer();
127 }
128
129
130 int BufferView::resizeCurrentBuffer()
131 {
132         return pimpl_->resizeCurrentBuffer();
133 }
134
135
136 void BufferView::cursorPrevious(LyXText * text)
137 {
138         pimpl_->cursorPrevious(text);
139 }
140
141
142 void BufferView::cursorNext(LyXText * text)
143 {
144         pimpl_->cursorNext(text);
145 }
146
147
148 bool BufferView::available() const
149 {
150         return pimpl_->available();
151 }
152
153
154 void BufferView::beforeChange(LyXText * text)
155 {
156         pimpl_->beforeChange(text);
157 }
158
159
160 void BufferView::savePosition(unsigned int i)
161 {
162         pimpl_->savePosition(i);
163 }
164
165
166 void BufferView::restorePosition(unsigned int i)
167 {
168         pimpl_->restorePosition(i);
169 }
170
171
172 bool BufferView::isSavedPosition(unsigned int i)
173 {
174         return pimpl_->isSavedPosition(i);
175 }
176
177
178 void BufferView::update(LyXText * text, UpdateCodes f)
179 {
180         pimpl_->update(text, f);
181 }
182
183
184 void BufferView::setState()
185 {
186         pimpl_->setState();
187 }
188
189
190 void BufferView::insetSleep()
191 {
192         pimpl_->insetSleep();
193 }
194
195
196 void BufferView::insetWakeup()
197 {
198         pimpl_->insetWakeup();
199 }
200
201
202 void BufferView::insetUnlock()
203 {
204         pimpl_->insetUnlock();
205 }
206
207
208 bool BufferView::focus() const
209 {
210         return pimpl_->focus();
211 }
212
213
214 void BufferView::focus(bool f)
215 {
216         pimpl_->focus(f);
217 }
218
219
220 bool BufferView::active() const
221 {
222         return pimpl_->active();
223 }
224
225
226 int BufferView::workWidth() const
227 {
228     return pimpl_->workarea_.workWidth();
229 }
230
231
232 bool BufferView::belowMouse() const 
233 {
234         return pimpl_->belowMouse();
235 }
236
237
238 void BufferView::showCursor()
239 {
240         pimpl_->showCursor();
241 }
242
243
244 void BufferView::hideCursor()
245 {
246         pimpl_->hideCursor();
247 }
248
249
250 void BufferView::toggleSelection(bool b)
251 {
252         pimpl_->toggleSelection(b);
253 }
254
255
256 void BufferView::toggleToggle()
257 {
258         pimpl_->toggleToggle();
259 }
260
261
262 void BufferView::center() 
263 {
264         pimpl_->center();
265 }
266
267
268 void BufferView::pasteClipboard(bool asPara)
269 {
270         pimpl_->pasteClipboard(asPara);
271 }
272
273
274 string const BufferView::getClipboard() const
275 {
276         return pimpl_->workarea_.getClipboard();
277 }
278
279
280 void BufferView::stuffClipboard(string const & stuff) const
281 {
282         pimpl_->stuffClipboard(stuff);
283 }
284
285
286 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
287                                   BufferView::UpdateCodes uc2)
288 {
289         return static_cast<BufferView::UpdateCodes>
290                 (static_cast<int>(uc1) | static_cast<int>(uc2));
291 }
292
293 bool BufferView::Dispatch(kb_action action, string const & argument)
294 {
295         return pimpl_->Dispatch(action, argument);
296 }