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