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