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