]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
redraw() cleanup
[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
22
23 BufferView::BufferView(LyXView * o, int xpos, int ypos,
24                        int width, int height)
25         : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
26 {
27         text = 0;
28 }
29
30
31 BufferView::~BufferView()
32 {
33         delete text;
34         delete pimpl_;
35 }
36
37
38 Buffer * BufferView::buffer() const
39 {
40         return pimpl_->buffer_;
41 }
42
43
44 LyXScreen & BufferView::screen() const
45 {
46         return pimpl_->screen();
47 }
48
49
50 LyXView * BufferView::owner() const
51 {
52         return pimpl_->owner_;
53 }
54
55
56 Painter & BufferView::painter() const
57 {
58         return pimpl_->painter();
59 }
60
61
62 void BufferView::buffer(Buffer * b)
63 {
64         pimpl_->buffer(b);
65 }
66
67
68 void BufferView::resize()
69 {
70         pimpl_->resizeCurrentBuffer();
71 }
72
73
74 void BufferView::repaint()
75 {
76         pimpl_->repaint();
77 }
78
79
80 bool BufferView::fitCursor()
81 {
82         return pimpl_->fitCursor();
83 }
84
85
86 void BufferView::update()
87 {
88         pimpl_->update();
89 }
90
91
92 void BufferView::updateScrollbar()
93 {
94         pimpl_->updateScrollbar();
95 }
96
97
98 void BufferView::scrollDocView(int value)
99 {
100         pimpl_->scrollDocView(value);
101 }
102
103
104 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
105 {
106         return pimpl_->checkInsetHit(text, x, y);
107 }
108
109
110 void BufferView::redoCurrentBuffer()
111 {
112         pimpl_->redoCurrentBuffer();
113 }
114
115
116 void BufferView::cursorPrevious(LyXText * text)
117 {
118         pimpl_->cursorPrevious(text);
119 }
120
121
122 void BufferView::cursorNext(LyXText * text)
123 {
124         pimpl_->cursorNext(text);
125 }
126
127
128 bool BufferView::available() const
129 {
130         return pimpl_->available();
131 }
132
133
134 void BufferView::beforeChange(LyXText * text)
135 {
136         pimpl_->beforeChange(text);
137 }
138
139
140 void BufferView::savePosition(unsigned int i)
141 {
142         pimpl_->savePosition(i);
143 }
144
145
146 void BufferView::restorePosition(unsigned int i)
147 {
148         pimpl_->restorePosition(i);
149 }
150
151
152 bool BufferView::isSavedPosition(unsigned int i)
153 {
154         return pimpl_->isSavedPosition(i);
155 }
156
157
158 void BufferView::update(LyXText * text, UpdateCodes f)
159 {
160         pimpl_->update(text, f);
161 }
162
163
164 void BufferView::setState()
165 {
166         pimpl_->setState();
167 }
168
169
170 void BufferView::insetUnlock()
171 {
172         pimpl_->insetUnlock();
173 }
174
175
176 int BufferView::workWidth() const
177 {
178         return pimpl_->workarea().workWidth();
179 }
180
181
182 void BufferView::showCursor()
183 {
184         pimpl_->showCursor();
185 }
186
187
188 void BufferView::hideCursor()
189 {
190         pimpl_->hideCursor();
191 }
192
193
194 void BufferView::toggleSelection(bool b)
195 {
196         pimpl_->toggleSelection(b);
197 }
198
199
200 void BufferView::toggleToggle()
201 {
202         pimpl_->toggleToggle();
203 }
204
205
206 void BufferView::center()
207 {
208         pimpl_->center();
209 }
210
211
212 void BufferView::pasteClipboard(bool asPara)
213 {
214         pimpl_->pasteClipboard(asPara);
215 }
216
217
218 string const BufferView::getClipboard() const
219 {
220         return pimpl_->workarea().getClipboard();
221 }
222
223
224 void BufferView::stuffClipboard(string const & stuff) const
225 {
226         pimpl_->stuffClipboard(stuff);
227 }
228
229
230 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
231                                   BufferView::UpdateCodes uc2)
232 {
233         return static_cast<BufferView::UpdateCodes>
234                 (static_cast<int>(uc1) | static_cast<int>(uc2));
235 }
236
237 bool BufferView::Dispatch(kb_action action, string const & argument)
238 {
239         return pimpl_->Dispatch(action, argument);
240 }