Diffstat (limited to 'noncore/apps/opie-console/widget_layer.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/widget_layer.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index 07ec12a..99d248e 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h | |||
@@ -12,41 +12,52 @@ | |||
12 | 12 | ||
13 | #ifndef WIDGET_LAYER_H | 13 | #ifndef WIDGET_LAYER_H |
14 | #define WIDGET_LAYER_H | 14 | #define WIDGET_LAYER_H |
15 | 15 | ||
16 | // qt includes | 16 | // qt includes |
17 | #include <qapplication.h> | 17 | #include <qapplication.h> |
18 | #include <qframe.h> | ||
19 | #include <qarray.h> | ||
18 | #include <qtimer.h> | 20 | #include <qtimer.h> |
19 | #include <qkeycode.h> | 21 | #include <qkeycode.h> |
20 | #include <qclipboard.h> | 22 | #include <qclipboard.h> |
21 | 23 | ||
22 | 24 | ||
23 | // opie-console includes | 25 | // opie-console includes |
24 | #include "session.h" | 26 | #include "session.h" |
25 | #include "common.h" | 27 | #include "common.h" |
26 | 28 | ||
27 | class WidgetLayer : public QObject | 29 | /* |
30 | * given a pseudo location ( column, line ), | ||
31 | * returns the actual index, in the QArray<Character> | ||
32 | */ | ||
33 | #define loc(X,Y) ((Y)*m_columns+(X)) | ||
34 | |||
35 | |||
36 | |||
37 | |||
38 | class WidgetLayer : public QFrame | ||
28 | { Q_OBJECT | 39 | { Q_OBJECT |
29 | 40 | ||
30 | public: | 41 | public: |
31 | 42 | ||
32 | /** | 43 | /** |
33 | * constructor | 44 | * constructor |
34 | */ | 45 | */ |
35 | WidgetLayer( QObject *parent=0, const char *name=0 ); | 46 | WidgetLayer( QWidget *parent=0, const char *name=0 ); |
36 | 47 | ||
37 | /** | 48 | /** |
38 | * destructor | 49 | * destructor |
39 | */ | 50 | */ |
40 | virtual ~WidgetLayer(); | 51 | virtual ~WidgetLayer(); |
41 | 52 | ||
42 | public: | 53 | public: |
43 | /** | 54 | /** |
44 | * sets the image | 55 | * sets the image |
45 | */ | 56 | */ |
46 | virtual void setImage( const Character* const newimg, int lines, int colums ) = 0; | 57 | virtual void setImage( QArray<Character> const newimg, int lines, int colums ); |
47 | 58 | ||
48 | /** | 59 | /** |
49 | * annoy the user | 60 | * annoy the user |
50 | */ | 61 | */ |
51 | void bell(); | 62 | void bell(); |
52 | 63 | ||
@@ -138,13 +149,13 @@ protected: | |||
138 | * changes image, to suit new size | 149 | * changes image, to suit new size |
139 | * TODO: find meaningful name! | 150 | * TODO: find meaningful name! |
140 | */ | 151 | */ |
141 | void propagateSize(); | 152 | void propagateSize(); |
142 | 153 | ||
143 | /** | 154 | /** |
144 | * | 155 | *determines count of lines and columns |
145 | */ | 156 | */ |
146 | virtual void calcGeometry() = 0; | 157 | virtual void calcGeometry() = 0; |
147 | 158 | ||
148 | /** | 159 | /** |
149 | * makes an empty image | 160 | * makes an empty image |
150 | */ | 161 | */ |
@@ -170,12 +181,18 @@ protected: | |||
170 | * current Session | 181 | * current Session |
171 | */ | 182 | */ |
172 | Session *m_session; | 183 | Session *m_session; |
173 | 184 | ||
174 | /** | 185 | /** |
175 | * current character image | 186 | * current character image |
187 | * | ||
188 | * a Character at loc( column, line ) | ||
189 | * has the actual index: | ||
190 | * ix = line * m_columns + column; | ||
191 | * | ||
192 | * use loc( x, y ) macro to access. | ||
176 | */ | 193 | */ |
177 | QArray<Character> m_image; | 194 | QArray<Character> m_image; |
178 | 195 | ||
179 | /** | 196 | /** |
180 | * lines count | 197 | * lines count |
181 | */ | 198 | */ |
@@ -189,12 +206,12 @@ protected: | |||
189 | /** | 206 | /** |
190 | * clipboard | 207 | * clipboard |
191 | */ | 208 | */ |
192 | QClipboard* m_clipboard; | 209 | QClipboard* m_clipboard; |
193 | 210 | ||
194 | /** | 211 | /** |
195 | * whether widget was resized | 212 | * whether widget is resizing |
196 | */ | 213 | */ |
197 | bool m_resizing; | 214 | bool m_resizing; |
198 | }; | 215 | }; |
199 | 216 | ||
200 | #endif // WIDGET_LAYER_H | 217 | #endif // WIDGET_LAYER_H |