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