]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
apply workarea() patch. Most of it is orthogonal to the scoped_ptr
[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 "frontends/screen.h"
21 #include "frontends/WorkArea.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 Painter & BufferView::painter()
58 {
59         return pimpl_->painter();
60 }
61
62
63 void BufferView::buffer(Buffer * b)
64 {
65         pimpl_->buffer(b);
66 }
67
68
69 void BufferView::resize(int xpos, int ypos, int width, int height)
70 {
71         pimpl_->resize(xpos, ypos, width, height);
72 }
73
74
75 void BufferView::resize()
76 {
77         pimpl_->resize();
78 }
79
80
81 void BufferView::redraw()
82 {
83         pimpl_->redraw();
84 }
85
86
87 bool BufferView::fitCursor()
88 {
89         return pimpl_->fitCursor();
90 }
91
92
93 void BufferView::update()
94 {
95         pimpl_->update();
96 }
97
98
99 void BufferView::updateScrollbar()
100 {
101         pimpl_->updateScrollbar();
102 }
103
104
105 void BufferView::scrollCB(double value)
106 {
107         pimpl_->scrollCB(value);
108 }
109
110
111 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
112 {
113         return pimpl_->checkInsetHit(text, x, y);
114 }
115
116
117 void BufferView::redoCurrentBuffer()
118 {
119         pimpl_->redoCurrentBuffer();
120 }
121
122
123 int BufferView::resizeCurrentBuffer()
124 {
125         return pimpl_->resizeCurrentBuffer();
126 }
127
128
129 void BufferView::cursorPrevious(LyXText * text)
130 {
131         pimpl_->cursorPrevious(text);
132 }
133
134
135 void BufferView::cursorNext(LyXText * text)
136 {
137         pimpl_->cursorNext(text);
138 }
139
140
141 bool BufferView::available() const
142 {
143         return pimpl_->available();
144 }
145
146
147 void BufferView::beforeChange(LyXText * text)
148 {
149         pimpl_->beforeChange(text);
150 }
151
152
153 void BufferView::savePosition(unsigned int i)
154 {
155         pimpl_->savePosition(i);
156 }
157
158
159 void BufferView::restorePosition(unsigned int i)
160 {
161         pimpl_->restorePosition(i);
162 }
163
164
165 bool BufferView::isSavedPosition(unsigned int i)
166 {
167         return pimpl_->isSavedPosition(i);
168 }
169
170
171 void BufferView::update(LyXText * text, UpdateCodes f)
172 {
173         pimpl_->update(text, f);
174 }
175
176
177 void BufferView::setState()
178 {
179         pimpl_->setState();
180 }
181
182 #if 0
183 void BufferView::insetSleep()
184 {
185         pimpl_->insetSleep();
186 }
187
188
189 void BufferView::insetWakeup()
190 {
191         pimpl_->insetWakeup();
192 }
193 #endif
194
195
196 void BufferView::insetUnlock()
197 {
198         pimpl_->insetUnlock();
199 }
200
201
202 bool BufferView::focus() const
203 {
204         return pimpl_->focus();
205 }
206
207
208 void BufferView::focus(bool f)
209 {
210         pimpl_->focus(f);
211 }
212
213
214 int BufferView::workWidth() const
215 {
216         return pimpl_->workarea().workWidth();
217 }
218
219
220 void BufferView::showCursor()
221 {
222         pimpl_->showCursor();
223 }
224
225
226 void BufferView::hideCursor()
227 {
228         pimpl_->hideCursor();
229 }
230
231
232 void BufferView::toggleSelection(bool b)
233 {
234         pimpl_->toggleSelection(b);
235 }
236
237
238 void BufferView::toggleToggle()
239 {
240         pimpl_->toggleToggle();
241 }
242
243
244 void BufferView::center()
245 {
246         pimpl_->center();
247 }
248
249
250 void BufferView::pasteClipboard(bool asPara)
251 {
252         pimpl_->pasteClipboard(asPara);
253 }
254
255
256 string const BufferView::getClipboard() const
257 {
258         return pimpl_->workarea().getClipboard();
259 }
260
261
262 void BufferView::stuffClipboard(string const & stuff) const
263 {
264         pimpl_->stuffClipboard(stuff);
265 }
266
267
268 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
269                                   BufferView::UpdateCodes uc2)
270 {
271         return static_cast<BufferView::UpdateCodes>
272                 (static_cast<int>(uc1) | static_cast<int>(uc2));
273 }
274
275 bool BufferView::Dispatch(kb_action action, string const & argument)
276 {
277         return pimpl_->Dispatch(action, argument);
278 }