]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
move some stuff from BufferView_pimpl.C to text3.C and lose a few lines...
[lyx.git] / src / BufferView.C
1 /**
2  * \file BufferView.C
3  * Copyright 1995-2002 the LyX Team
4  * Read the file COPYING
5  *
6  * \author unknown
7  * \author John Levon <moz@compsoc.man.ac.uk>
8  */
9
10 #include <config.h>
11
12 #ifdef __GNUG__
13 #pragma implementation
14 #endif
15
16 #include "BufferView.h"
17 #include "BufferView_pimpl.h"
18 #include "lyxtext.h"
19 #include "frontends/screen.h"
20 #include "frontends/WorkArea.h"
21 #include "frontends/LyXView.h"
22
23
24 BufferView::BufferView(LyXView * owner, int xpos, int ypos,
25                        int width, int height)
26         : pimpl_(new Pimpl(this, owner, 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();
48 }
49
50
51 WorkArea & BufferView::workarea() const
52 {
53         return pimpl_->workarea();
54 }
55
56
57 LyXView * BufferView::owner() const
58 {
59         return pimpl_->owner_;
60 }
61
62
63 Painter & BufferView::painter() const
64 {
65         return pimpl_->painter();
66 }
67
68
69 void BufferView::buffer(Buffer * b)
70 {
71         pimpl_->buffer(b);
72 }
73
74
75 void BufferView::resize()
76 {
77         if (pimpl_->buffer_) {
78                 pimpl_->resizeCurrentBuffer();
79         }
80 }
81
82
83 void BufferView::repaint()
84 {
85         pimpl_->repaint();
86 }
87
88
89 bool BufferView::fitCursor()
90 {
91         return pimpl_->fitCursor();
92 }
93
94
95 void BufferView::update()
96 {
97         pimpl_->update();
98 }
99
100
101 void BufferView::updateScrollbar()
102 {
103         pimpl_->updateScrollbar();
104 }
105
106
107 void BufferView::scrollDocView(int value)
108 {
109         pimpl_->scrollDocView(value);
110 }
111
112
113 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
114 {
115         return pimpl_->checkInsetHit(text, x, y);
116 }
117
118
119 void BufferView::redoCurrentBuffer()
120 {
121         pimpl_->redoCurrentBuffer();
122 }
123
124
125 bool BufferView::available() const
126 {
127         return pimpl_->available();
128 }
129
130
131 void BufferView::beforeChange(LyXText * text)
132 {
133         pimpl_->beforeChange(text);
134 }
135
136
137 void BufferView::finishChange(bool fitcur)
138 {
139         pimpl_->finishChange(fitcur);
140 }
141
142
143 void BufferView::savePosition(unsigned int i)
144 {
145         pimpl_->savePosition(i);
146 }
147
148
149 void BufferView::restorePosition(unsigned int i)
150 {
151         pimpl_->restorePosition(i);
152 }
153
154
155 bool BufferView::isSavedPosition(unsigned int i)
156 {
157         return pimpl_->isSavedPosition(i);
158 }
159
160
161 void BufferView::update(LyXText * text, UpdateCodes f)
162 {
163         pimpl_->update(text, f);
164 }
165
166
167 void BufferView::switchKeyMap()
168 {
169         pimpl_->switchKeyMap();
170 }
171
172
173 void BufferView::insetUnlock()
174 {
175         pimpl_->insetUnlock();
176 }
177
178
179 int BufferView::workWidth() const
180 {
181         return pimpl_->workarea().workWidth();
182 }
183
184
185 void BufferView::showCursor()
186 {
187         pimpl_->showCursor();
188 }
189
190
191 void BufferView::hideCursor()
192 {
193         pimpl_->hideCursor();
194 }
195
196
197 void BufferView::toggleSelection(bool b)
198 {
199         pimpl_->toggleSelection(b);
200 }
201
202
203 void BufferView::toggleToggle()
204 {
205         pimpl_->toggleToggle();
206 }
207
208
209 void BufferView::center()
210 {
211         pimpl_->center();
212 }
213
214
215 string const BufferView::getClipboard() const
216 {
217         return pimpl_->workarea().getClipboard();
218 }
219
220
221 void BufferView::stuffClipboard(string const & stuff) const
222 {
223         pimpl_->stuffClipboard(stuff);
224 }
225
226
227 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
228                                   BufferView::UpdateCodes uc2)
229 {
230         return static_cast<BufferView::UpdateCodes>
231                 (static_cast<int>(uc1) | static_cast<int>(uc2));
232 }
233
234
235 bool BufferView::dispatch(FuncRequest const & ev)
236 {
237         return pimpl_->dispatch(ev);
238 }
239
240
241 void BufferView::moveCursorUpdate(bool selecting, bool fitcur)
242 {
243         pimpl_->moveCursorUpdate(selecting, fitcur);
244 }