-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index cacc3c4..4c6ea2a 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp | |||
@@ -1,570 +1,570 @@ | |||
1 | /* ------------------------------------------------------------------------ */ | 1 | /* ------------------------------------------------------------------------ */ |
2 | /* */ | 2 | /* */ |
3 | /* [TEWidget.C] Terminal Emulation Widget */ | 3 | /* [TEWidget.C] Terminal Emulation Widget */ |
4 | /* */ | 4 | /* */ |
5 | /* ------------------------------------------------------------------------ */ | 5 | /* ------------------------------------------------------------------------ */ |
6 | /* */ | 6 | /* */ |
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
8 | /* */ | 8 | /* */ |
9 | /* This file is part of Konsole - an X terminal for KDE */ | 9 | /* This file is part of Konsole - an X terminal for KDE */ |
10 | /* */ | 10 | /* */ |
11 | /* ------------------------------------------------------------------------ */ | 11 | /* ------------------------------------------------------------------------ */ |
12 | /* */ | 12 | /* */ |
13 | /* Ported Konsole to Qt/Embedded */ | 13 | /* Ported Konsole to Qt/Embedded */ |
14 | /* */ | 14 | /* */ |
15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | 15 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ |
16 | /* */ | 16 | /* */ |
17 | /* -------------------------------------------------------------------------- */ | 17 | /* -------------------------------------------------------------------------- */ |
18 | /*! \class TEWidget | 18 | /*! \class TEWidget |
19 | 19 | ||
20 | \brief Visible screen contents | 20 | \brief Visible screen contents |
21 | 21 | ||
22 | This class is responsible to map the `image' of a terminal emulation to the | 22 | This class is responsible to map the `image' of a terminal emulation to the |
23 | display. All the dependency of the emulation to a specific GUI or toolkit is | 23 | display. All the dependency of the emulation to a specific GUI or toolkit is |
24 | localized here. Further, this widget has no knowledge about being part of an | 24 | localized here. Further, this widget has no knowledge about being part of an |
25 | emulation, it simply work within the terminal emulation framework by exposing | 25 | emulation, it simply work within the terminal emulation framework by exposing |
26 | size and key events and by being ordered to show a new image. | 26 | size and key events and by being ordered to show a new image. |
27 | 27 | ||
28 | <ul> | 28 | <ul> |
29 | <li> The internal image has the size of the widget (evtl. rounded up) | 29 | <li> The internal image has the size of the widget (evtl. rounded up) |
30 | <li> The external image used in setImage can have any size. | 30 | <li> The external image used in setImage can have any size. |
31 | <li> (internally) the external image is simply copied to the internal | 31 | <li> (internally) the external image is simply copied to the internal |
32 | when a setImage happens. During a resizeEvent no painting is done | 32 | when a setImage happens. During a resizeEvent no painting is done |
33 | a paintEvent is expected to follow anyway. | 33 | a paintEvent is expected to follow anyway. |
34 | </ul> | 34 | </ul> |
35 | 35 | ||
36 | \sa TEScreen \sa Emulation | 36 | \sa TEScreen \sa Emulation |
37 | */ | 37 | */ |
38 | 38 | ||
39 | /* FIXME: | 39 | /* FIXME: |
40 | - 'image' may also be used uninitialized (it isn't in fact) in resizeEvent | 40 | - 'image' may also be used uninitialized (it isn't in fact) in resizeEvent |
41 | - 'font_a' not used in mouse events | 41 | - 'font_a' not used in mouse events |
42 | - add destructor | 42 | - add destructor |
43 | */ | 43 | */ |
44 | 44 | ||
45 | /* TODO | 45 | /* TODO |
46 | - evtl. be sensitive to `paletteChange' while using default colors. | 46 | - evtl. be sensitive to `paletteChange' while using default colors. |
47 | - set different 'rounding' styles? I.e. have a mode to show clipped chars? | 47 | - set different 'rounding' styles? I.e. have a mode to show clipped chars? |
48 | */ | 48 | */ |
49 | 49 | ||
50 | // #include "config.h" | 50 | // #include "config.h" |
51 | #include "TEWidget.h" | 51 | #include "TEWidget.h" |
52 | #include "session.h" | 52 | #include "session.h" |
53 | #include <qpe/config.h> | 53 | #include <qpe/config.h> |
54 | 54 | ||
55 | #include <qpe/resource.h> | 55 | #include <qpe/resource.h> |
56 | #include <qpe/sound.h> | 56 | #include <qpe/sound.h> |
57 | 57 | ||
58 | #ifdef QWS | 58 | #if !(QT_NO_COP) |
59 | #include <qpe/qcopenvelope_qws.h> | 59 | #include <qpe/qcopenvelope_qws.h> |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | #include <qcursor.h> | 62 | #include <qcursor.h> |
63 | #include <qregexp.h> | 63 | #include <qregexp.h> |
64 | #include <qpainter.h> | 64 | #include <qpainter.h> |
65 | #include <qclipboard.h> | 65 | #include <qclipboard.h> |
66 | #include <qstyle.h> | 66 | #include <qstyle.h> |
67 | #include <qfile.h> | 67 | #include <qfile.h> |
68 | #include <qdragobject.h> | 68 | #include <qdragobject.h> |
69 | 69 | ||
70 | #include <stdio.h> | 70 | #include <stdio.h> |
71 | #include <stdlib.h> | 71 | #include <stdlib.h> |
72 | #include <unistd.h> | 72 | #include <unistd.h> |
73 | #include <ctype.h> | 73 | #include <ctype.h> |
74 | #include <sys/stat.h> | 74 | #include <sys/stat.h> |
75 | #include <sys/types.h> | 75 | #include <sys/types.h> |
76 | #include <signal.h> | 76 | #include <signal.h> |
77 | 77 | ||
78 | #include <assert.h> | 78 | #include <assert.h> |
79 | 79 | ||
80 | // #include "TEWidget.moc" | 80 | // #include "TEWidget.moc" |
81 | //#include <kapp.h> | 81 | //#include <kapp.h> |
82 | //#include <kcursor.h> | 82 | //#include <kcursor.h> |
83 | //#include <kurl.h> | 83 | //#include <kurl.h> |
84 | //#include <kdebug.h> | 84 | //#include <kdebug.h> |
85 | //#include <klocale.h> | 85 | //#include <klocale.h> |
86 | 86 | ||
87 | #define HERE printf("%s(%d): %s\n",__FILE__,__LINE__,__FUNCTION__) | 87 | #define HERE printf("%s(%d): %s\n",__FILE__,__LINE__,__FUNCTION__) |
88 | #define HCNT(Name) // { static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); } | 88 | #define HCNT(Name) // { static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); } |
89 | 89 | ||
90 | #define loc(X,Y) ((Y)*columns+(X)) | 90 | #define loc(X,Y) ((Y)*columns+(X)) |
91 | 91 | ||
92 | //FIXME: the rim should normally be 1, 0 only when running in full screen mode. | 92 | //FIXME: the rim should normally be 1, 0 only when running in full screen mode. |
93 | #define rimX 0 // left/right rim width | 93 | #define rimX 0 // left/right rim width |
94 | #define rimY 0 // top/bottom rim high | 94 | #define rimY 0 // top/bottom rim high |
95 | 95 | ||
96 | #define SCRWIDTH 16 // width of the scrollbar | 96 | #define SCRWIDTH 16 // width of the scrollbar |
97 | 97 | ||
98 | #define yMouseScroll 1 | 98 | #define yMouseScroll 1 |
99 | // scroll increment used when dragging selection at top/bottom of window. | 99 | // scroll increment used when dragging selection at top/bottom of window. |
100 | 100 | ||
101 | /* ------------------------------------------------------------------------- */ | 101 | /* ------------------------------------------------------------------------- */ |
102 | /* */ | 102 | /* */ |
103 | /* Colors */ | 103 | /* Colors */ |
104 | /* */ | 104 | /* */ |
105 | /* ------------------------------------------------------------------------- */ | 105 | /* ------------------------------------------------------------------------- */ |
106 | 106 | ||
107 | //FIXME: the default color table is in session.C now. | 107 | //FIXME: the default color table is in session.C now. |
108 | // We need a way to get rid of this one, here. | 108 | // We need a way to get rid of this one, here. |
109 | static const ColorEntry base_color_table[TABLE_COLORS] = | 109 | static const ColorEntry base_color_table[TABLE_COLORS] = |
110 | // The following are almost IBM standard color codes, with some slight | 110 | // The following are almost IBM standard color codes, with some slight |
111 | // gamma correction for the dim colors to compensate for bright X screens. | 111 | // gamma correction for the dim colors to compensate for bright X screens. |
112 | // It contains the 8 ansiterm/xterm colors in 2 intensities. | 112 | // It contains the 8 ansiterm/xterm colors in 2 intensities. |
113 | { | 113 | { |
114 | // Fixme: could add faint colors here, also. | 114 | // Fixme: could add faint colors here, also. |
115 | // normal | 115 | // normal |
116 | ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 1, 0 ), // Dfore, Dback | 116 | ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 1, 0 ), // Dfore, Dback |
117 | ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0x18), 0, 0 ), // Black, Red | 117 | ColorEntry(QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0x18), 0, 0 ), // Black, Red |
118 | ColorEntry(QColor(0x18,0xB2,0x18), 0, 0 ), ColorEntry( QColor(0xB2,0x68,0x18), 0, 0 ), // Green, Yellow | 118 | ColorEntry(QColor(0x18,0xB2,0x18), 0, 0 ), ColorEntry( QColor(0xB2,0x68,0x18), 0, 0 ), // Green, Yellow |
119 | ColorEntry(QColor(0x18,0x18,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), // Blue, Magenta | 119 | ColorEntry(QColor(0x18,0x18,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), // Blue, Magenta |
120 | ColorEntry(QColor(0x18,0xB2,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 0, 0 ), // Cyan, White | 120 | ColorEntry(QColor(0x18,0xB2,0xB2), 0, 0 ), ColorEntry( QColor(0xB2,0xB2,0xB2), 0, 0 ), // Cyan, White |
121 | // intensiv | 121 | // intensiv |
122 | ColorEntry(QColor(0x00,0x00,0x00), 0, 1 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 1, 0 ), | 122 | ColorEntry(QColor(0x00,0x00,0x00), 0, 1 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 1, 0 ), |
123 | ColorEntry(QColor(0x68,0x68,0x68), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0x54), 0, 0 ), | 123 | ColorEntry(QColor(0x68,0x68,0x68), 0, 0 ), ColorEntry( QColor(0xFF,0x54,0x54), 0, 0 ), |
124 | ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ), | 124 | ColorEntry(QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0x54), 0, 0 ), |
125 | ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), | 125 | ColorEntry(QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( QColor(0xB2,0x18,0xB2), 0, 0 ), |
126 | ColorEntry(QColor(0x54,0xFF,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 0, 0 ) | 126 | ColorEntry(QColor(0x54,0xFF,0xFF), 0, 0 ), ColorEntry( QColor(0xFF,0xFF,0xFF), 0, 0 ) |
127 | }; | 127 | }; |
128 | 128 | ||
129 | /* Note that we use ANSI color order (bgr), while IBMPC color order is (rgb) | 129 | /* Note that we use ANSI color order (bgr), while IBMPC color order is (rgb) |
130 | 130 | ||
131 | Code 0 1 2 3 4 5 6 7 | 131 | Code 0 1 2 3 4 5 6 7 |
132 | ----------- ------- ------- ------- ------- ------- ------- ------- ------- | 132 | ----------- ------- ------- ------- ------- ------- ------- ------- ------- |
133 | ANSI (bgr) Black Red Green Yellow Blue Magenta Cyan White | 133 | ANSI (bgr) Black Red Green Yellow Blue Magenta Cyan White |
134 | IBMPC (rgb) Black Blue Green Cyan Red Magenta Yellow White | 134 | IBMPC (rgb) Black Blue Green Cyan Red Magenta Yellow White |
135 | */ | 135 | */ |
136 | 136 | ||
137 | QColor TEWidget::getDefaultBackColor() | 137 | QColor TEWidget::getDefaultBackColor() |
138 | { | 138 | { |
139 | return color_table[DEFAULT_BACK_COLOR].color; | 139 | return color_table[DEFAULT_BACK_COLOR].color; |
140 | } | 140 | } |
141 | 141 | ||
142 | const ColorEntry* TEWidget::getColorTable() const | 142 | const ColorEntry* TEWidget::getColorTable() const |
143 | { | 143 | { |
144 | return color_table; | 144 | return color_table; |
145 | } | 145 | } |
146 | 146 | ||
147 | const ColorEntry* TEWidget::getdefaultColorTable() const | 147 | const ColorEntry* TEWidget::getdefaultColorTable() const |
148 | { | 148 | { |
149 | return base_color_table; | 149 | return base_color_table; |
150 | } | 150 | } |
151 | 151 | ||
152 | 152 | ||
153 | const QPixmap *TEWidget::backgroundPixmap() | 153 | const QPixmap *TEWidget::backgroundPixmap() |
154 | { | 154 | { |
155 | static QPixmap *bg = new QPixmap("~/qpim/main/pics/faded_bg.xpm"); | 155 | static QPixmap *bg = new QPixmap("~/qpim/main/pics/faded_bg.xpm"); |
156 | const QPixmap *pm = bg; | 156 | const QPixmap *pm = bg; |
157 | return pm; | 157 | return pm; |
158 | } | 158 | } |
159 | 159 | ||
160 | void TEWidget::setColorTable(const ColorEntry table[]) | 160 | void TEWidget::setColorTable(const ColorEntry table[]) |
161 | { | 161 | { |
162 | for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i]; | 162 | for (int i = 0; i < TABLE_COLORS; i++) color_table[i] = table[i]; |
163 | 163 | ||
164 | const QPixmap* pm = backgroundPixmap(); | 164 | const QPixmap* pm = backgroundPixmap(); |
165 | if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color); | 165 | if (!pm) setBackgroundColor(color_table[DEFAULT_BACK_COLOR].color); |
166 | update(); | 166 | update(); |
167 | } | 167 | } |
168 | 168 | ||
169 | //FIXME: add backgroundPixmapChanged. | 169 | //FIXME: add backgroundPixmapChanged. |
170 | 170 | ||
171 | /* ------------------------------------------------------------------------- */ | 171 | /* ------------------------------------------------------------------------- */ |
172 | /* */ | 172 | /* */ |
173 | /* Font */ | 173 | /* Font */ |
174 | /* */ | 174 | /* */ |
175 | /* ------------------------------------------------------------------------- */ | 175 | /* ------------------------------------------------------------------------- */ |
176 | 176 | ||
177 | /* | 177 | /* |
178 | The VT100 has 32 special graphical characters. The usual vt100 extended | 178 | The VT100 has 32 special graphical characters. The usual vt100 extended |
179 | xterm fonts have these at 0x00..0x1f. | 179 | xterm fonts have these at 0x00..0x1f. |
180 | 180 | ||
181 | QT's iso mapping leaves 0x00..0x7f without any changes. But the graphicals | 181 | QT's iso mapping leaves 0x00..0x7f without any changes. But the graphicals |
182 | come in here as proper unicode characters. | 182 | come in here as proper unicode characters. |
183 | 183 | ||
184 | We treat non-iso10646 fonts as VT100 extended and do the requiered mapping | 184 | We treat non-iso10646 fonts as VT100 extended and do the requiered mapping |
185 | from unicode to 0x00..0x1f. The remaining translation is then left to the | 185 | from unicode to 0x00..0x1f. The remaining translation is then left to the |
186 | QCodec. | 186 | QCodec. |
187 | */ | 187 | */ |
188 | 188 | ||
189 | // assert for i in [0..31] : vt100extended(vt100_graphics[i]) == i. | 189 | // assert for i in [0..31] : vt100extended(vt100_graphics[i]) == i. |
190 | 190 | ||
191 | unsigned short vt100_graphics[32] = | 191 | unsigned short vt100_graphics[32] = |
192 | { // 0/8 1/9 2/10 3/11 4/12 5/13 6/14 7/15 | 192 | { // 0/8 1/9 2/10 3/11 4/12 5/13 6/14 7/15 |
193 | 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, | 193 | 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, |
194 | 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, | 194 | 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, |
195 | 0xF800, 0xF801, 0x2500, 0xF803, 0xF804, 0x251c, 0x2524, 0x2534, | 195 | 0xF800, 0xF801, 0x2500, 0xF803, 0xF804, 0x251c, 0x2524, 0x2534, |
196 | 0x252c, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00b7 | 196 | 0x252c, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00b7 |
197 | }; | 197 | }; |
198 | 198 | ||
199 | static QChar vt100extended(QChar c) | 199 | static QChar vt100extended(QChar c) |
200 | { | 200 | { |
201 | switch (c.unicode()) | 201 | switch (c.unicode()) |
202 | { | 202 | { |
203 | case 0x25c6 : return 1; | 203 | case 0x25c6 : return 1; |
204 | case 0x2592 : return 2; | 204 | case 0x2592 : return 2; |
205 | case 0x2409 : return 3; | 205 | case 0x2409 : return 3; |
206 | case 0x240c : return 4; | 206 | case 0x240c : return 4; |
207 | case 0x240d : return 5; | 207 | case 0x240d : return 5; |
208 | case 0x240a : return 6; | 208 | case 0x240a : return 6; |
209 | case 0x00b0 : return 7; | 209 | case 0x00b0 : return 7; |
210 | case 0x00b1 : return 8; | 210 | case 0x00b1 : return 8; |
211 | case 0x2424 : return 9; | 211 | case 0x2424 : return 9; |
212 | case 0x240b : return 10; | 212 | case 0x240b : return 10; |
213 | case 0x2518 : return 11; | 213 | case 0x2518 : return 11; |
214 | case 0x2510 : return 12; | 214 | case 0x2510 : return 12; |
215 | case 0x250c : return 13; | 215 | case 0x250c : return 13; |
216 | case 0x2514 : return 14; | 216 | case 0x2514 : return 14; |
217 | case 0x253c : return 15; | 217 | case 0x253c : return 15; |
218 | case 0xf800 : return 16; | 218 | case 0xf800 : return 16; |
219 | case 0xf801 : return 17; | 219 | case 0xf801 : return 17; |
220 | case 0x2500 : return 18; | 220 | case 0x2500 : return 18; |
221 | case 0xf803 : return 19; | 221 | case 0xf803 : return 19; |
222 | case 0xf804 : return 20; | 222 | case 0xf804 : return 20; |
223 | case 0x251c : return 21; | 223 | case 0x251c : return 21; |
224 | case 0x2524 : return 22; | 224 | case 0x2524 : return 22; |
225 | case 0x2534 : return 23; | 225 | case 0x2534 : return 23; |
226 | case 0x252c : return 24; | 226 | case 0x252c : return 24; |
227 | case 0x2502 : return 25; | 227 | case 0x2502 : return 25; |
228 | case 0x2264 : return 26; | 228 | case 0x2264 : return 26; |
229 | case 0x2265 : return 27; | 229 | case 0x2265 : return 27; |
230 | case 0x03c0 : return 28; | 230 | case 0x03c0 : return 28; |
231 | case 0x2260 : return 29; | 231 | case 0x2260 : return 29; |
232 | case 0x00a3 : return 30; | 232 | case 0x00a3 : return 30; |
233 | case 0x00b7 : return 31; | 233 | case 0x00b7 : return 31; |
234 | } | 234 | } |
235 | return c; | 235 | return c; |
236 | } | 236 | } |
237 | 237 | ||
238 | static QChar identicalMap(QChar c) | 238 | static QChar identicalMap(QChar c) |
239 | { | 239 | { |
240 | return c; | 240 | return c; |
241 | } | 241 | } |
242 | 242 | ||
243 | void TEWidget::fontChange(const QFont &) | 243 | void TEWidget::fontChange(const QFont &) |
244 | { | 244 | { |
245 | QFontMetrics fm(font()); | 245 | QFontMetrics fm(font()); |
246 | font_h = fm.height(); | 246 | font_h = fm.height(); |
247 | font_w = fm.maxWidth(); | 247 | font_w = fm.maxWidth(); |
248 | font_a = fm.ascent(); | 248 | font_a = fm.ascent(); |
249 | //printf("font_h: %d\n",font_h); | 249 | //printf("font_h: %d\n",font_h); |
250 | //printf("font_w: %d\n",font_w); | 250 | //printf("font_w: %d\n",font_w); |
251 | //printf("font_a: %d\n",font_a); | 251 | //printf("font_a: %d\n",font_a); |
252 | //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); | 252 | //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); |
253 | //printf("rawname: %s\n",font().rawName().ascii()); | 253 | //printf("rawname: %s\n",font().rawName().ascii()); |
254 | fontMap = | 254 | fontMap = |
255 | #if QT_VERSION < 300 | 255 | #if QT_VERSION < 300 |
256 | strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") | 256 | strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") |
257 | ? vt100extended | 257 | ? vt100extended |
258 | : | 258 | : |
259 | #endif | 259 | #endif |
260 | identicalMap; | 260 | identicalMap; |
261 | propagateSize(); | 261 | propagateSize(); |
262 | update(); | 262 | update(); |
263 | } | 263 | } |
264 | 264 | ||
265 | void TEWidget::setVTFont(const QFont& f) | 265 | void TEWidget::setVTFont(const QFont& f) |
266 | { | 266 | { |
267 | QFrame::setFont(f); | 267 | QFrame::setFont(f); |
268 | } | 268 | } |
269 | 269 | ||
270 | QFont TEWidget::getVTFont() { | 270 | QFont TEWidget::getVTFont() { |
271 | return font(); | 271 | return font(); |
272 | } | 272 | } |
273 | 273 | ||
274 | void TEWidget::setFont(const QFont &) | 274 | void TEWidget::setFont(const QFont &) |
275 | { | 275 | { |
276 | // ignore font change request if not coming from konsole itself | 276 | // ignore font change request if not coming from konsole itself |
277 | } | 277 | } |
278 | 278 | ||
279 | /* ------------------------------------------------------------------------- */ | 279 | /* ------------------------------------------------------------------------- */ |
280 | /* */ | 280 | /* */ |
281 | /* Constructor / Destructor */ | 281 | /* Constructor / Destructor */ |
282 | /* */ | 282 | /* */ |
283 | /* ------------------------------------------------------------------------- */ | 283 | /* ------------------------------------------------------------------------- */ |
284 | 284 | ||
285 | TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) | 285 | TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) |
286 | { | 286 | { |
287 | #ifndef QT_NO_CLIPBOARD | 287 | #ifndef QT_NO_CLIPBOARD |
288 | cb = QApplication::clipboard(); | 288 | cb = QApplication::clipboard(); |
289 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), | 289 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), |
290 | this, SLOT(onClearSelection()) ); | 290 | this, SLOT(onClearSelection()) ); |
291 | #endif | 291 | #endif |
292 | 292 | ||
293 | scrollbar = new QScrollBar(this); | 293 | scrollbar = new QScrollBar(this); |
294 | scrollbar->setCursor( arrowCursor ); | 294 | scrollbar->setCursor( arrowCursor ); |
295 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); | 295 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); |
296 | 296 | ||
297 | hScrollbar = new QScrollBar(this); | 297 | hScrollbar = new QScrollBar(this); |
298 | hScrollbar->setCursor( arrowCursor ); | 298 | hScrollbar->setCursor( arrowCursor ); |
299 | hScrollbar->setOrientation(QScrollBar::Horizontal); | 299 | hScrollbar->setOrientation(QScrollBar::Horizontal); |
300 | hScrollbar->setMaximumHeight(16); | 300 | hScrollbar->setMaximumHeight(16); |
301 | 301 | ||
302 | connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); | 302 | connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); |
303 | 303 | ||
304 | Config cfg("Konsole"); | 304 | Config cfg("Konsole"); |
305 | cfg.setGroup("ScrollBar"); | 305 | cfg.setGroup("ScrollBar"); |
306 | switch( cfg.readNumEntry("Position",2)){ | 306 | switch( cfg.readNumEntry("Position",2)){ |
307 | case 0: | 307 | case 0: |
308 | scrollLoc = SCRNONE; | 308 | scrollLoc = SCRNONE; |
309 | break; | 309 | break; |
310 | case 1: | 310 | case 1: |
311 | scrollLoc = SCRLEFT; | 311 | scrollLoc = SCRLEFT; |
312 | break; | 312 | break; |
313 | case 2: | 313 | case 2: |
314 | scrollLoc = SCRRIGHT; | 314 | scrollLoc = SCRRIGHT; |
315 | break; | 315 | break; |
316 | }; | 316 | }; |
317 | 317 | ||
318 | useHorzScroll=cfg.readBoolEntry("HorzScroll",0); | 318 | useHorzScroll=cfg.readBoolEntry("HorzScroll",0); |
319 | 319 | ||
320 | blinkT = new QTimer(this); | 320 | blinkT = new QTimer(this); |
321 | connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); | 321 | connect(blinkT, SIGNAL(timeout()), this, SLOT(blinkEvent())); |
322 | // blinking = FALSE; | 322 | // blinking = FALSE; |
323 | blinking = TRUE; | 323 | blinking = TRUE; |
324 | 324 | ||
325 | resizing = FALSE; | 325 | resizing = FALSE; |
326 | actSel = 0; | 326 | actSel = 0; |
327 | image = 0; | 327 | image = 0; |
328 | lines = 1; | 328 | lines = 1; |
329 | columns = 1; | 329 | columns = 1; |
330 | font_w = 1; | 330 | font_w = 1; |
331 | font_h = 1; | 331 | font_h = 1; |
332 | font_a = 1; | 332 | font_a = 1; |
333 | word_selection_mode = FALSE; | 333 | word_selection_mode = FALSE; |
334 | hposition = 0; | 334 | hposition = 0; |
335 | vcolumns = 0; | 335 | vcolumns = 0; |
336 | 336 | ||
337 | setMouseMarks(TRUE); | 337 | setMouseMarks(TRUE); |
338 | setVTFont( QFont("fixed") ); | 338 | setVTFont( QFont("fixed") ); |
339 | setColorTable(base_color_table); // init color table | 339 | setColorTable(base_color_table); // init color table |
340 | 340 | ||
341 | qApp->installEventFilter( this ); //FIXME: see below | 341 | qApp->installEventFilter( this ); //FIXME: see below |
342 | // KCursor::setAutoHideCursor( this, true ); | 342 | // KCursor::setAutoHideCursor( this, true ); |
343 | 343 | ||
344 | // Init DnD //////////////////////////////////////////////////////////////// | 344 | // Init DnD //////////////////////////////////////////////////////////////// |
345 | currentSession = NULL; | 345 | currentSession = NULL; |
346 | // setAcceptDrops(true); // attempt | 346 | // setAcceptDrops(true); // attempt |
347 | // m_drop = new QPopupMenu(this); | 347 | // m_drop = new QPopupMenu(this); |
348 | // m_drop->insertItem( QString("Paste"), 0); | 348 | // m_drop->insertItem( QString("Paste"), 0); |
349 | // m_drop->insertItem( QString("cd"), 1); | 349 | // m_drop->insertItem( QString("cd"), 1); |
350 | // connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int))); | 350 | // connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int))); |
351 | 351 | ||
352 | // we need focus so that the auto-hide cursor feature works | 352 | // we need focus so that the auto-hide cursor feature works |
353 | setFocus(); | 353 | setFocus(); |
354 | setFocusPolicy( WheelFocus ); | 354 | setFocusPolicy( WheelFocus ); |
355 | } | 355 | } |
356 | 356 | ||
357 | //FIXME: make proper destructor | 357 | //FIXME: make proper destructor |
358 | // Here's a start (David) | 358 | // Here's a start (David) |
359 | TEWidget::~TEWidget() | 359 | TEWidget::~TEWidget() |
360 | { | 360 | { |
361 | qApp->removeEventFilter( this ); | 361 | qApp->removeEventFilter( this ); |
362 | if (image) free(image); | 362 | if (image) free(image); |
363 | } | 363 | } |
364 | 364 | ||
365 | /* ------------------------------------------------------------------------- */ | 365 | /* ------------------------------------------------------------------------- */ |
366 | /* */ | 366 | /* */ |
367 | /* Display Operations */ | 367 | /* Display Operations */ |
368 | /* */ | 368 | /* */ |
369 | /* ------------------------------------------------------------------------- */ | 369 | /* ------------------------------------------------------------------------- */ |
370 | 370 | ||
371 | /*! | 371 | /*! |
372 | attributed string draw primitive | 372 | attributed string draw primitive |
373 | */ | 373 | */ |
374 | 374 | ||
375 | void TEWidget::drawAttrStr(QPainter &paint, QRect rect, | 375 | void TEWidget::drawAttrStr(QPainter &paint, QRect rect, |
376 | QString& str, ca attr, BOOL pm, BOOL clear) | 376 | QString& str, ca attr, BOOL pm, BOOL clear) |
377 | { | 377 | { |
378 | if (pm && color_table[attr.b].transparent) | 378 | if (pm && color_table[attr.b].transparent) |
379 | { | 379 | { |
380 | paint.setBackgroundMode( TransparentMode ); | 380 | paint.setBackgroundMode( TransparentMode ); |
381 | if (clear) erase(rect); | 381 | if (clear) erase(rect); |
382 | } | 382 | } |
383 | else | 383 | else |
384 | { | 384 | { |
385 | if (blinking) | 385 | if (blinking) |
386 | paint.fillRect(rect, color_table[attr.b].color); | 386 | paint.fillRect(rect, color_table[attr.b].color); |
387 | else | 387 | else |
388 | { | 388 | { |
389 | paint.setBackgroundMode( OpaqueMode ); | 389 | paint.setBackgroundMode( OpaqueMode ); |
390 | paint.setBackgroundColor( color_table[attr.b].color ); | 390 | paint.setBackgroundColor( color_table[attr.b].color ); |
391 | } | 391 | } |
392 | } | 392 | } |
393 | 393 | ||
394 | if (color_table[attr.f].bold) | 394 | if (color_table[attr.f].bold) |
395 | paint.setPen(QColor( 0x8F, 0x00, 0x00 )); | 395 | paint.setPen(QColor( 0x8F, 0x00, 0x00 )); |
396 | else | 396 | else |
397 | paint.setPen(color_table[attr.f].color); | 397 | paint.setPen(color_table[attr.f].color); |
398 | 398 | ||
399 | paint.drawText(rect.x(),rect.y()+font_a, str); | 399 | paint.drawText(rect.x(),rect.y()+font_a, str); |
400 | 400 | ||
401 | if (attr.r & RE_UNDERLINE) | 401 | if (attr.r & RE_UNDERLINE) |
402 | paint.drawLine(rect.left(), rect.y()+font_a+1, rect.right(),rect.y()+font_a+1 ); | 402 | paint.drawLine(rect.left(), rect.y()+font_a+1, rect.right(),rect.y()+font_a+1 ); |
403 | } | 403 | } |
404 | 404 | ||
405 | /*! | 405 | /*! |
406 | The image can only be set completely. | 406 | The image can only be set completely. |
407 | 407 | ||
408 | The size of the new image may or may not match the size of the widget. | 408 | The size of the new image may or may not match the size of the widget. |
409 | */ | 409 | */ |
410 | 410 | ||
411 | void TEWidget::setImage(const ca* const newimg, int lines, int columns) | 411 | void TEWidget::setImage(const ca* const newimg, int lines, int columns) |
412 | { int y,x,len; | 412 | { int y,x,len; |
413 | const QPixmap* pm = backgroundPixmap(); | 413 | const QPixmap* pm = backgroundPixmap(); |
414 | QPainter paint; | 414 | QPainter paint; |
415 | setUpdatesEnabled(FALSE); | 415 | setUpdatesEnabled(FALSE); |
416 | paint.begin( this ); | 416 | paint.begin( this ); |
417 | HCNT("setImage"); | 417 | HCNT("setImage"); |
418 | 418 | ||
419 | QPoint tL = contentsRect().topLeft(); | 419 | QPoint tL = contentsRect().topLeft(); |
420 | int tLx = tL.x(); | 420 | int tLx = tL.x(); |
421 | int tLy = tL.y(); | 421 | int tLy = tL.y(); |
422 | hasBlinker = FALSE; | 422 | hasBlinker = FALSE; |
423 | 423 | ||
424 | int cf = -1; // undefined | 424 | int cf = -1; // undefined |
425 | int cb = -1; // undefined | 425 | int cb = -1; // undefined |
426 | int cr = -1; // undefined | 426 | int cr = -1; // undefined |
427 | 427 | ||
428 | int lins = QMIN(this->lines, QMAX(0,lines )); | 428 | int lins = QMIN(this->lines, QMAX(0,lines )); |
429 | int cols = QMIN(this->columns,QMAX(0,columns)); | 429 | int cols = QMIN(this->columns,QMAX(0,columns)); |
430 | QChar *disstrU = new QChar[cols]; | 430 | QChar *disstrU = new QChar[cols]; |
431 | for (y = 0; y < lins; y++) { | 431 | for (y = 0; y < lins; y++) { |
432 | const ca* lcl = &image[y*this->columns]; | 432 | const ca* lcl = &image[y*this->columns]; |
433 | const ca* const ext = &newimg[y*columns]; | 433 | const ca* const ext = &newimg[y*columns]; |
434 | if (!resizing) // not while resizing, we're expecting a paintEvent | 434 | if (!resizing) // not while resizing, we're expecting a paintEvent |
435 | for (x = 0; x < cols; x++) | 435 | for (x = 0; x < cols; x++) |
436 | { | 436 | { |
437 | hasBlinker |= (ext[x].r & RE_BLINK); | 437 | hasBlinker |= (ext[x].r & RE_BLINK); |
438 | if (ext[x] != lcl[x]) | 438 | if (ext[x] != lcl[x]) |
439 | { | 439 | { |
440 | cr = ext[x].r; | 440 | cr = ext[x].r; |
441 | cb = ext[x].b; | 441 | cb = ext[x].b; |
442 | if (ext[x].f != cf) cf = ext[x].f; | 442 | if (ext[x].f != cf) cf = ext[x].f; |
443 | int lln = cols - x; | 443 | int lln = cols - x; |
444 | disstrU[0] = fontMap(ext[x+0].c); | 444 | disstrU[0] = fontMap(ext[x+0].c); |
445 | for (len = 1; len < lln; len++) | 445 | for (len = 1; len < lln; len++) |
446 | { | 446 | { |
447 | if (ext[x+len].f != cf || ext[x+len].b != cb || ext[x+len].r != cr || | 447 | if (ext[x+len].f != cf || ext[x+len].b != cb || ext[x+len].r != cr || |
448 | ext[x+len] == lcl[x+len] ) | 448 | ext[x+len] == lcl[x+len] ) |
449 | break; | 449 | break; |
450 | disstrU[len] = fontMap(ext[x+len].c); | 450 | disstrU[len] = fontMap(ext[x+len].c); |
451 | } | 451 | } |
452 | QString unistr(disstrU,len); | 452 | QString unistr(disstrU,len); |
453 | drawAttrStr(paint, | 453 | drawAttrStr(paint, |
454 | QRect(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h), | 454 | QRect(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h), |
455 | unistr, ext[x], pm != NULL, true); | 455 | unistr, ext[x], pm != NULL, true); |
456 | x += len - 1; | 456 | x += len - 1; |
457 | } | 457 | } |
458 | } | 458 | } |
459 | // finally, make `image' become `newimg'. | 459 | // finally, make `image' become `newimg'. |
460 | memcpy((void*)lcl,(const void*)ext,cols*sizeof(ca)); | 460 | memcpy((void*)lcl,(const void*)ext,cols*sizeof(ca)); |
461 | } | 461 | } |
462 | drawFrame( &paint ); | 462 | drawFrame( &paint ); |
463 | paint.end(); | 463 | paint.end(); |
464 | setUpdatesEnabled(TRUE); | 464 | setUpdatesEnabled(TRUE); |
465 | if ( hasBlinker && !blinkT->isActive()) blinkT->start(1000); // 1000 ms | 465 | if ( hasBlinker && !blinkT->isActive()) blinkT->start(1000); // 1000 ms |
466 | if (!hasBlinker && blinkT->isActive()) { blinkT->stop(); blinking = FALSE; } | 466 | if (!hasBlinker && blinkT->isActive()) { blinkT->stop(); blinking = FALSE; } |
467 | delete [] disstrU; | 467 | delete [] disstrU; |
468 | } | 468 | } |
469 | 469 | ||
470 | // paint Event //////////////////////////////////////////////////// | 470 | // paint Event //////////////////////////////////////////////////// |
471 | 471 | ||
472 | /*! | 472 | /*! |
473 | The difference of this routine vs. the `setImage' is, | 473 | The difference of this routine vs. the `setImage' is, |
474 | that the drawing does not include a difference analysis | 474 | that the drawing does not include a difference analysis |
475 | between the old and the new image. Instead, the internal | 475 | between the old and the new image. Instead, the internal |
476 | image is used and the painting bound by the PaintEvent box. | 476 | image is used and the painting bound by the PaintEvent box. |
477 | */ | 477 | */ |
478 | 478 | ||
479 | void TEWidget::paintEvent( QPaintEvent* pe ) | 479 | void TEWidget::paintEvent( QPaintEvent* pe ) |
480 | { | 480 | { |
481 | 481 | ||
482 | //{ static int cnt = 0; printf("paint %d\n",cnt++); } | 482 | //{ static int cnt = 0; printf("paint %d\n",cnt++); } |
483 | const QPixmap* pm = backgroundPixmap(); | 483 | const QPixmap* pm = backgroundPixmap(); |
484 | QPainter paint; | 484 | QPainter paint; |
485 | setUpdatesEnabled(FALSE); | 485 | setUpdatesEnabled(FALSE); |
486 | paint.begin( this ); | 486 | paint.begin( this ); |
487 | paint.setBackgroundMode( TransparentMode ); | 487 | paint.setBackgroundMode( TransparentMode ); |
488 | HCNT("paintEvent"); | 488 | HCNT("paintEvent"); |
489 | 489 | ||
490 | // Note that the actual widget size can be slightly larger | 490 | // Note that the actual widget size can be slightly larger |
491 | // that the image (the size is truncated towards the smaller | 491 | // that the image (the size is truncated towards the smaller |
492 | // number of characters in `resizeEvent'. The paint rectangle | 492 | // number of characters in `resizeEvent'. The paint rectangle |
493 | // can thus be larger than the image, but less then the size | 493 | // can thus be larger than the image, but less then the size |
494 | // of one character. | 494 | // of one character. |
495 | 495 | ||
496 | QRect rect = pe->rect().intersect(contentsRect()); | 496 | QRect rect = pe->rect().intersect(contentsRect()); |
497 | 497 | ||
498 | QPoint tL = contentsRect().topLeft(); | 498 | QPoint tL = contentsRect().topLeft(); |
499 | int tLx = tL.x(); | 499 | int tLx = tL.x(); |
500 | int tLy = tL.y(); | 500 | int tLy = tL.y(); |
501 | 501 | ||
502 | int lux = QMIN(columns-1, QMAX(0,(rect.left() - tLx - blX ) / font_w)); | 502 | int lux = QMIN(columns-1, QMAX(0,(rect.left() - tLx - blX ) / font_w)); |
503 | int luy = QMIN(lines-1, QMAX(0,(rect.top() - tLy - bY ) / font_h)); | 503 | int luy = QMIN(lines-1, QMAX(0,(rect.top() - tLy - bY ) / font_h)); |
504 | int rlx = QMIN(columns-1, QMAX(0,(rect.right() - tLx - blX ) / font_w)); | 504 | int rlx = QMIN(columns-1, QMAX(0,(rect.right() - tLx - blX ) / font_w)); |
505 | int rly = QMIN(lines-1, QMAX(0,(rect.bottom() - tLy - bY ) / font_h)); | 505 | int rly = QMIN(lines-1, QMAX(0,(rect.bottom() - tLy - bY ) / font_h)); |
506 | 506 | ||
507 | /* | 507 | /* |
508 | printf("paintEvent: %d..%d, %d..%d (%d..%d, %d..%d)\n",lux,rlx,luy,rly, | 508 | printf("paintEvent: %d..%d, %d..%d (%d..%d, %d..%d)\n",lux,rlx,luy,rly, |
509 | rect.left(), rect.right(), rect.top(), rect.bottom()); | 509 | rect.left(), rect.right(), rect.top(), rect.bottom()); |
510 | */ | 510 | */ |
511 | 511 | ||
512 | // if (pm != NULL && color_table[image->b].transparent) | 512 | // if (pm != NULL && color_table[image->b].transparent) |
513 | // erase(rect); | 513 | // erase(rect); |
514 | // BL: I have no idea why we need this, and it breaks the refresh. | 514 | // BL: I have no idea why we need this, and it breaks the refresh. |
515 | 515 | ||
516 | QChar *disstrU = new QChar[columns]; | 516 | QChar *disstrU = new QChar[columns]; |
517 | for (int y = luy; y <= rly; y++) | 517 | for (int y = luy; y <= rly; y++) |
518 | for (int x = lux; x <= rlx; x++) | 518 | for (int x = lux; x <= rlx; x++) |
519 | { | 519 | { |
520 | int len = 1; | 520 | int len = 1; |
521 | disstrU[0] = fontMap(image[loc(x,y)].c); | 521 | disstrU[0] = fontMap(image[loc(x,y)].c); |
522 | int cf = image[loc(x,y)].f; | 522 | int cf = image[loc(x,y)].f; |
523 | int cb = image[loc(x,y)].b; | 523 | int cb = image[loc(x,y)].b; |
524 | int cr = image[loc(x,y)].r; | 524 | int cr = image[loc(x,y)].r; |
525 | while (x+len <= rlx && | 525 | while (x+len <= rlx && |
526 | image[loc(x+len,y)].f == cf && | 526 | image[loc(x+len,y)].f == cf && |
527 | image[loc(x+len,y)].b == cb && | 527 | image[loc(x+len,y)].b == cb && |
528 | image[loc(x+len,y)].r == cr ) | 528 | image[loc(x+len,y)].r == cr ) |
529 | { | 529 | { |
530 | disstrU[len] = fontMap(image[loc(x+len,y)].c); | 530 | disstrU[len] = fontMap(image[loc(x+len,y)].c); |
531 | len += 1; | 531 | len += 1; |
532 | } | 532 | } |
533 | QString unistr(disstrU,len); | 533 | QString unistr(disstrU,len); |
534 | drawAttrStr(paint, | 534 | drawAttrStr(paint, |
535 | QRect(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h), | 535 | QRect(blX+tLx+font_w*x,bY+tLy+font_h*y,font_w*len,font_h), |
536 | unistr, image[loc(x,y)], pm != NULL, false); | 536 | unistr, image[loc(x,y)], pm != NULL, false); |
537 | x += len - 1; | 537 | x += len - 1; |
538 | } | 538 | } |
539 | delete [] disstrU; | 539 | delete [] disstrU; |
540 | drawFrame( &paint ); | 540 | drawFrame( &paint ); |
541 | paint.end(); | 541 | paint.end(); |
542 | setUpdatesEnabled(TRUE); | 542 | setUpdatesEnabled(TRUE); |
543 | } | 543 | } |
544 | 544 | ||
545 | void TEWidget::blinkEvent() | 545 | void TEWidget::blinkEvent() |
546 | { | 546 | { |
547 | blinking = !blinking; | 547 | blinking = !blinking; |
548 | repaint(FALSE); | 548 | repaint(FALSE); |
549 | } | 549 | } |
550 | 550 | ||
551 | /* ------------------------------------------------------------------------- */ | 551 | /* ------------------------------------------------------------------------- */ |
552 | /* */ | 552 | /* */ |
553 | /* Resizing */ | 553 | /* Resizing */ |
554 | /* */ | 554 | /* */ |
555 | /* ------------------------------------------------------------------------- */ | 555 | /* ------------------------------------------------------------------------- */ |
556 | 556 | ||
557 | void TEWidget::resizeEvent(QResizeEvent* ev) | 557 | void TEWidget::resizeEvent(QResizeEvent* ev) |
558 | { | 558 | { |
559 | // printf("resize: %d,%d\n",ev->size().width(),ev->size().height()); | 559 | // printf("resize: %d,%d\n",ev->size().width(),ev->size().height()); |
560 | //printf("approx: %d,%d\n",ev->size().width()/font_w,ev->size().height()/font_h); | 560 | //printf("approx: %d,%d\n",ev->size().width()/font_w,ev->size().height()/font_h); |
561 | //printf("leaves: %d,%d\n",ev->size().width()%font_w,ev->size().height()%font_h); | 561 | //printf("leaves: %d,%d\n",ev->size().width()%font_w,ev->size().height()%font_h); |
562 | //printf("curren: %d,%d\n",width(),height()); | 562 | //printf("curren: %d,%d\n",width(),height()); |
563 | HCNT("resizeEvent"); | 563 | HCNT("resizeEvent"); |
564 | 564 | ||
565 | // see comment in `paintEvent' concerning the rounding. | 565 | // see comment in `paintEvent' concerning the rounding. |
566 | //FIXME: could make a routine here; check width(),height() | 566 | //FIXME: could make a routine here; check width(),height() |
567 | assert(ev->size().width() == width()); | 567 | assert(ev->size().width() == width()); |
568 | assert(ev->size().height() == height()); | 568 | assert(ev->size().height() == height()); |
569 | 569 | ||
570 | propagateSize(); | 570 | propagateSize(); |