]> git.lyx.org Git - lyx.git/blob - src/BufferView.C
Make showState be view_state_changed, and rename setState to something
[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         if (pimpl_->buffer_) {
71                 pimpl_->resizeCurrentBuffer();
72         }
73 }
74
75
76 void BufferView::repaint()
77 {
78         pimpl_->repaint();
79 }
80
81
82 bool BufferView::fitCursor()
83 {
84         return pimpl_->fitCursor();
85 }
86
87
88 void BufferView::update()
89 {
90         pimpl_->update();
91 }
92
93
94 void BufferView::updateScrollbar()
95 {
96         pimpl_->updateScrollbar();
97 }
98
99
100 void BufferView::scrollDocView(int value)
101 {
102         pimpl_->scrollDocView(value);
103 }
104
105
106 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
107 {
108         return pimpl_->checkInsetHit(text, x, y);
109 }
110
111
112 void BufferView::redoCurrentBuffer()
113 {
114         pimpl_->redoCurrentBuffer();
115 }
116
117
118 void BufferView::cursorPrevious(LyXText * text)
119 {
120         pimpl_->cursorPrevious(text);
121 }
122
123
124 void BufferView::cursorNext(LyXText * text)
125 {
126         pimpl_->cursorNext(text);
127 }
128
129
130 bool BufferView::available() const
131 {
132         return pimpl_->available();
133 }
134
135
136 void BufferView::beforeChange(LyXText * text)
137 {
138         pimpl_->beforeChange(text);
139 }
140
141
142 void BufferView::savePosition(unsigned int i)
143 {
144         pimpl_->savePosition(i);
145 }
146
147
148 void BufferView::restorePosition(unsigned int i)
149 {
150         pimpl_->restorePosition(i);
151 }
152
153
154 bool BufferView::isSavedPosition(unsigned int i)
155 {
156         return pimpl_->isSavedPosition(i);
157 }
158
159
160 void BufferView::update(LyXText * text, UpdateCodes f)
161 {
162         pimpl_->update(text, f);
163 }
164
165
166 void BufferView::switchKeyMap()
167 {
168         pimpl_->switchKeyMap();
169 }
170
171
172 void BufferView::insetUnlock()
173 {
174         pimpl_->insetUnlock();
175 }
176
177
178 int BufferView::workWidth() const
179 {
180         return pimpl_->workarea().workWidth();
181 }
182
183
184 void BufferView::showCursor()
185 {
186         pimpl_->showCursor();
187 }
188
189
190 void BufferView::hideCursor()
191 {
192         pimpl_->hideCursor();
193 }
194
195
196 void BufferView::toggleSelection(bool b)
197 {
198         pimpl_->toggleSelection(b);
199 }
200
201
202 void BufferView::toggleToggle()
203 {
204         pimpl_->toggleToggle();
205 }
206
207
208 void BufferView::center()
209 {
210         pimpl_->center();
211 }
212
213
214 void BufferView::pasteClipboard(bool asPara)
215 {
216         pimpl_->pasteClipboard(asPara);
217 }
218
219
220 string const BufferView::getClipboard() const
221 {
222         return pimpl_->workarea().getClipboard();
223 }
224
225
226 void BufferView::stuffClipboard(string const & stuff) const
227 {
228         pimpl_->stuffClipboard(stuff);
229 }
230
231
232 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
233                                   BufferView::UpdateCodes uc2)
234 {
235         return static_cast<BufferView::UpdateCodes>
236                 (static_cast<int>(uc1) | static_cast<int>(uc2));
237 }
238
239 bool BufferView::Dispatch(kb_action action, string const & argument)
240 {
241         return pimpl_->Dispatch(action, argument);
242 }