]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
John's Layout Tabular UI improvements and Martins fixes to clearing the
[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()
93 {
94         pimpl_->fitCursor();
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 {
118         return pimpl_->checkInsetHit(text, x, y);
119 }
120
121
122 void BufferView::redoCurrentBuffer()
123 {
124         pimpl_->redoCurrentBuffer();
125 }
126
127
128 int BufferView::resizeCurrentBuffer()
129 {
130         return pimpl_->resizeCurrentBuffer();
131 }
132
133
134 void BufferView::cursorPrevious(LyXText * text)
135 {
136         pimpl_->cursorPrevious(text);
137 }
138
139
140 void BufferView::cursorNext(LyXText * text)
141 {
142         pimpl_->cursorNext(text);
143 }
144
145
146 bool BufferView::available() const
147 {
148         return pimpl_->available();
149 }
150
151
152 void BufferView::beforeChange(LyXText * text)
153 {
154         pimpl_->beforeChange(text);
155 }
156
157
158 void BufferView::savePosition(unsigned int i)
159 {
160         pimpl_->savePosition(i);
161 }
162
163
164 void BufferView::restorePosition(unsigned int i)
165 {
166         pimpl_->restorePosition(i);
167 }
168
169
170 bool BufferView::isSavedPosition(unsigned int i)
171 {
172         return pimpl_->isSavedPosition(i);
173 }
174
175
176 void BufferView::update(LyXText * text, UpdateCodes f)
177 {
178         pimpl_->update(text, f);
179 }
180
181
182 void BufferView::setState()
183 {
184         pimpl_->setState();
185 }
186
187
188 void BufferView::insetSleep()
189 {
190         pimpl_->insetSleep();
191 }
192
193
194 void BufferView::insetWakeup()
195 {
196         pimpl_->insetWakeup();
197 }
198
199
200 void BufferView::insetUnlock()
201 {
202         pimpl_->insetUnlock();
203 }
204
205
206 bool BufferView::focus() const
207 {
208         return pimpl_->focus();
209 }
210
211
212 void BufferView::focus(bool f)
213 {
214         pimpl_->focus(f);
215 }
216
217
218 bool BufferView::active() const
219 {
220         return pimpl_->active();
221 }
222
223
224 int BufferView::workWidth() const
225 {
226     return pimpl_->workarea_.workWidth();
227 }
228
229
230 bool BufferView::belowMouse() const 
231 {
232         return pimpl_->belowMouse();
233 }
234
235
236 void BufferView::showCursor()
237 {
238         pimpl_->showCursor();
239 }
240
241
242 void BufferView::hideCursor()
243 {
244         pimpl_->hideCursor();
245 }
246
247
248 void BufferView::toggleSelection(bool b)
249 {
250         pimpl_->toggleSelection(b);
251 }
252
253
254 void BufferView::toggleToggle()
255 {
256         pimpl_->toggleToggle();
257 }
258
259
260 void BufferView::center() 
261 {
262         pimpl_->center();
263 }
264
265
266 void BufferView::pasteClipboard(bool asPara)
267 {
268         pimpl_->pasteClipboard(asPara);
269 }
270
271
272 string const BufferView::getClipboard() const
273 {
274         return pimpl_->workarea_.getClipboard();
275 }
276
277
278 void BufferView::stuffClipboard(string const & stuff) const
279 {
280         pimpl_->stuffClipboard(stuff);
281 }
282
283
284 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
285                                   BufferView::UpdateCodes uc2)
286 {
287         return static_cast<BufferView::UpdateCodes>
288                 (static_cast<int>(uc1) | static_cast<int>(uc2));
289 }
290
291 bool BufferView::Dispatch(kb_action action, string const & argument)
292 {
293         return pimpl_->Dispatch(action, argument);
294 }