summaryrefslogtreecommitdiff
path: root/qt
authormickeyl <mickeyl>2004-11-03 10:02:18 (UTC)
committer mickeyl <mickeyl>2004-11-03 10:02:18 (UTC)
commitda3c9206558e9b03be2270ab5e9b3406d9c3cad8 (patch) (unidiff)
tree23b054a535a4e73b936fbcf5ab07ad45eb2a1a81 /qt
parent6034297853dc1edd6009cfe7c6786d12cab9367a (diff)
downloadopie-da3c9206558e9b03be2270ab5e9b3406d9c3cad8.zip
opie-da3c9206558e9b03be2270ab5e9b3406d9c3cad8.tar.gz
opie-da3c9206558e9b03be2270ab5e9b3406d9c3cad8.tar.bz2
rediffed against qte-2.3.9-snapshot-20041101
low level qgfx stuff no longer applies, need to check if it's still needed
Diffstat (limited to 'qt') (more/less context) (ignore whitespace changes)
-rw-r--r--qt/qt-2.3.9.patch/qte239-all.patch510
1 files changed, 510 insertions, 0 deletions
diff --git a/qt/qt-2.3.9.patch/qte239-all.patch b/qt/qt-2.3.9.patch/qte239-all.patch
new file mode 100644
index 0000000..533652d
--- a/dev/null
+++ b/qt/qt-2.3.9.patch/qte239-all.patch
@@ -0,0 +1,510 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- qt-2.3.9-snapshot-20041102/src/iconview/qiconview.cpp~qte239-all
7+++ qt-2.3.9-snapshot-20041102/src/iconview/qiconview.cpp
8@@ -225,6 +225,7 @@
9 QIconView::SelectionMode selectionMode;
10 QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, *startDragItem, *pressedItem, *selectAnchor;
11 QRect *rubber;
12+ QPixmap *backBuffer;
13 QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer,
14 *fullRedrawTimer;
15 int rastX, rastY, spacing;
16@@ -2268,6 +2269,7 @@
17 d->currentItem = 0;
18 d->highlightedItem = 0;
19 d->rubber = 0;
20+ d->backBuffer = 0;
21 d->scrollTimer = 0;
22 d->startDragItem = 0;
23 d->tmpCurrentItem = 0;
24@@ -2416,6 +2418,8 @@
25 delete item;
26 item = tmp;
27 }
28+ delete d->backBuffer;
29+ d->backBuffer = 0;
30 delete d->fm;
31 d->fm = 0;
32 #ifndef QT_NO_TOOLTIP
33@@ -2882,6 +2886,48 @@
34 }
35
36 /*!
37+ This function grabs all paintevents that otherwise would have been
38+ processed by the QScrollView::viewportPaintEvent(). Here we use a
39+ doublebuffer to reduce 'on-paint' flickering on QIconView
40+ (and of course its childs).
41+
42+ \sa QScrollView::viewportPaintEvent(), QIconView::drawContents()
43+*/
44+
45+void QIconView::bufferedPaintEvent( QPaintEvent* pe )
46+{
47+ QWidget* vp = viewport();
48+ QRect r = pe->rect() & vp->rect();
49+ int ex = r.x() + contentsX();
50+ int ey = r.y() + contentsY();
51+ int ew = r.width();
52+ int eh = r.height();
53+
54+ if ( !d->backBuffer )
55 +d->backBuffer = new QPixmap(vp->size());
56+ if ( d->backBuffer->size() != vp->size() ) {
57 +//Resize function (with hysteesis). Uses a good compromise between memory
58 +//consumption and speed (number) of resizes.
59+ float newWidth = (float)vp->width();
60 +float newHeight = (float)vp->height();
61 +if ( newWidth > d->backBuffer->width() || newHeight > d->backBuffer->height() )
62 +{
63 + newWidth *= 1.1892;
64 + newHeight *= 1.1892;
65 + d->backBuffer->resize( (int)newWidth, (int)newHeight );
66 +} else if ( 1.5*newWidth < d->backBuffer->width() || 1.5*newHeight < d->backBuffer->height() )
67 + d->backBuffer->resize( (int)newWidth, (int)newHeight );
68+ }
69+
70+ QPainter p;
71+ p.begin(d->backBuffer, vp);
72+ drawContentsOffset(&p, contentsX(), contentsY(), ex, ey, ew, eh);
73+ p.end();
74+ bitBlt(vp, r.x(), r.y(), d->backBuffer, r.x(), r.y(), ew, eh);
75+}
76+
77+/*!
78+
79 \reimp
80 */
81
82@@ -4939,7 +4985,7 @@
83 if ( !d->rubber )
84 drawDragShapes( d->oldDragPos );
85 }
86 - viewportPaintEvent( (QPaintEvent*)e );
87+ bufferedPaintEvent ((QPaintEvent*)e );
88 if ( d->dragging ) {
89 if ( !d->rubber )
90 drawDragShapes( d->oldDragPos );
91@@ -5377,11 +5423,19 @@
92 return;
93
94 if ( item->d->container1 && d->firstContainer ) {
95 -item->d->container1->items.removeRef( item );
96+ //Special-case checking of the last item, since this may be
97+ //called a few times for the same item.
98+ if (item->d->container1->items.last() == item)
99+ item->d->container1->items.removeLast();
100+ else
101+ item->d->container1->items.removeRef( item );
102 }
103 item->d->container1 = 0;
104 if ( item->d->container2 && d->firstContainer ) {
105 -item->d->container2->items.removeRef( item );
106+ if (item->d->container2->items.last() == item)
107+ item->d->container2->items.removeLast();
108+ else
109+ item->d->container2->items.removeRef( item );
110 }
111 item->d->container2 = 0;
112
113--- qt-2.3.9-snapshot-20041102/src/iconview/qiconview.h~qte239-all
114+++ qt-2.3.9-snapshot-20041102/src/iconview/qiconview.h
115@@ -444,6 +444,7 @@
116 virtual void contentsDropEvent( QDropEvent *e );
117 #endif
118
119+ void bufferedPaintEvent( QPaintEvent* );
120 virtual void resizeEvent( QResizeEvent* e );
121 virtual void keyPressEvent( QKeyEvent *e );
122 virtual void focusInEvent( QFocusEvent *e );
123--- qt-2.3.9-snapshot-20041102/src/kernel/qapplication.cpp~qte239-all
124+++ qt-2.3.9-snapshot-20041102/src/kernel/qapplication.cpp
125@@ -35,6 +35,8 @@
126 **
127 **********************************************************************/
128
129 +#define QT_WEAK_SYMBOL__attribute__(( weak ))
130+
131 #include "qobjectlist.h"
132 #include "qobjectdict.h"
133 #include "qapplication.h"
134@@ -937,11 +939,16 @@
135 #ifndef QT_NO_STYLE
136 void QApplication::setStyle( QStyle *style )
137 {
138 +setStyle_NonWeak ( style );
139+}
140+
141+void QApplication::setStyle_NonWeak( QStyle *style )
142+{
143 QStyle* old = app_style;
144- app_style = style;
145
146 if ( startingUp() ) {
147 delete old;
148 +app_style = style;
149 return;
150 }
151
152@@ -962,6 +969,8 @@
153 old->unPolish( qApp );
154 }
155
156+ app_style = style;
157+
158 // take care of possible palette requirements of certain gui
159 // styles. Do it before polishing the application since the style
160 // might call QApplication::setStyle() itself
161@@ -1188,13 +1197,30 @@
162 \sa QWidget::setPalette(), palette(), QStyle::polish()
163 */
164
165-void QApplication::setPalette( const QPalette &palette, bool informWidgets,
166+void QApplication::setPalette ( const QPalette &palette, bool informWidgets,
167 + const char* className )
168+{
169 +setPalette_NonWeak ( palette, informWidgets, className );
170+}
171+
172+void QApplication::setPalette_NonWeak ( const QPalette &palette, bool informWidgets,
173 const char* className )
174 {
175 QPalette pal = palette;
176 #ifndef QT_NO_STYLE
177- if ( !startingUp() )
178+ if ( !startingUp() ) {
179 qApp->style().polish( pal );// NB: non-const reference
180 +if ( className ) {
181 + // if we just polished a class specific palette (this normally
182 + // only called by qt_fix_tooltips - see below), we better re-
183 + // polish the global palette. Some styles like liquid can get
184 + // confused, because they can not detect if the polished palette
185 + // is the global one or only a class specific one.
186 + // (liquid uses this palette to calculate blending pixmaps)
187 + QPalette p = qApp-> palette ( );
188 + qApp->style().polish ( p );
189 +}
190+ }
191 #endif
192 bool all = FALSE;
193 if ( !className ) {
194@@ -1279,6 +1305,12 @@
195 void QApplication::setFont( const QFont &font, bool informWidgets,
196 const char* className )
197 {
198 +setFont_NonWeak ( font, informWidgets, className );
199+}
200+
201+void QApplication::setFont_NonWeak( const QFont &font, bool informWidgets,
202 + const char* className )
203+{
204 bool all = FALSE;
205 if ( !className ) {
206 if ( !app_font ) {
207--- qt-2.3.9-snapshot-20041102/src/kernel/qapplication.h~qte239-all
208+++ qt-2.3.9-snapshot-20041102/src/kernel/qapplication.h
209@@ -61,6 +61,10 @@
210 class QSemaphore;
211 #endif
212
213+#if !defined( QT_WEAK_SYMBOL )
214+#define QT_WEAK_SYMBOL
215+#endif
216+
217 // REMOVE IN 3.0 (just here for moc source compatibility)
218 #define QNonBaseApplication QApplication
219
220@@ -85,7 +89,10 @@
221
222 #ifndef QT_NO_STYLE
223 static QStyle &style();
224 - static void setStyle( QStyle* );
225 + static void setStyle( QStyle* ) QT_WEAK_SYMBOL;
226+private:
227 +static void setStyle_NonWeak( QStyle* );
228+public:
229 #endif
230 #if 1/* OBSOLETE */
231 enum ColorMode { NormalColors, CustomColors };
232@@ -106,11 +113,19 @@
233 #ifndef QT_NO_PALETTE
234 static QPalette palette( const QWidget* = 0 );
235 static void setPalette( const QPalette &, bool informWidgets=FALSE,
236 + const char* className = 0 ) QT_WEAK_SYMBOL;
237+private:
238 + static void setPalette_NonWeak( const QPalette &, bool informWidgets=FALSE,
239 const char* className = 0 );
240+public:
241 #endif
242 static QFont font( const QWidget* = 0 );
243 static void setFont( const QFont &, bool informWidgets=FALSE,
244 + const char* className = 0 ) QT_WEAK_SYMBOL;
245+private:
246 + static void setFont_NonWeak( const QFont &, bool informWidgets=FALSE,
247 const char* className = 0 );
248 +public:
249 static QFontMetrics fontMetrics();
250
251 QWidget *mainWidget() const;
252@@ -207,7 +222,10 @@
253 void qwsSetCustomColors( QRgb *colortable, int start, int numColors );
254 #ifndef QT_NO_QWS_MANAGER
255 static QWSDecoration &qwsDecoration();
256- static void qwsSetDecoration( QWSDecoration *);
257+ static void qwsSetDecoration( QWSDecoration *) QT_WEAK_SYMBOL;
258+private:
259+ static void qwsSetDecoration_NonWeak( QWSDecoration *);
260+public:
261 #endif
262 #endif
263
264--- qt-2.3.9-snapshot-20041102/src/kernel/qapplication_qws.cpp~qte239-all
265+++ qt-2.3.9-snapshot-20041102/src/kernel/qapplication_qws.cpp
266@@ -2905,6 +2905,11 @@
267 */
268 void QApplication::qwsSetDecoration( QWSDecoration *d )
269 {
270 +qwsSetDecoration_NonWeak ( d );
271+}
272+
273+void QApplication::qwsSetDecoration_NonWeak( QWSDecoration *d )
274+{
275 if ( d ) {
276 delete qws_decoration;
277 qws_decoration = d;
278--- qt-2.3.9-snapshot-20041102/src/kernel/qfontdatabase.cpp~qte239-all
279+++ qt-2.3.9-snapshot-20041102/src/kernel/qfontdatabase.cpp
280@@ -35,6 +35,8 @@
281 **
282 **********************************************************************/
283
284+#define QT_WEAK_SYMBOL __attribute__(( weak ))
285+
286 #include "qfontdatabase.h"
287
288 #ifndef QT_NO_FONTDATABASE
289@@ -2424,6 +2426,13 @@
290 const QString &style,
291 const QString &charSet )
292 {
293 +return pointSizes_NonWeak ( family, style, charSet );
294+}
295+
296+QValueList<int> QFontDatabase::pointSizes_NonWeak ( const QString &family,
297+ const QString &style,
298+ const QString &charSet )
299+{
300 QString cs( charSet );
301 if ( charSet.isEmpty() ) {
302 QStringList lst = charSets( family );
303--- qt-2.3.9-snapshot-20041102/src/kernel/qfontdatabase.h~qte239-all
304+++ qt-2.3.9-snapshot-20041102/src/kernel/qfontdatabase.h
305@@ -59,6 +59,10 @@
306 class QDiskFont;
307 #endif
308
309+#if !defined( QT_WEAK_SYMBOL )
310+#define QT_WEAK_SYMBOL
311+#endif
312+
313 class QFontDatabasePrivate;
314
315 class Q_EXPORT QFontDatabase
316@@ -67,9 +71,16 @@
317 QFontDatabase();
318
319 QStringList families( bool onlyForLocale = TRUE ) const;
320+
321+
322 QValueList<int> pointSizes( const QString &family,
323 const QString &style = QString::null,
324 - const QString &charSet = QString::null );
325 + const QString &charSet = QString::null ) QT_WEAK_SYMBOL;
326+private:
327+ QValueList<int> pointSizes_NonWeak( const QString &family,
328 + const QString &style,
329 + const QString &charSet );
330+public:
331 QStringList styles( const QString &family,
332 const QString &charSet = QString::null ) const;
333 QStringList charSets( const QString &familyName,
334--- qt-2.3.9-snapshot-20041102/src/kernel/qgfxraster_qws.cpp~qte239-all
335+++ qt-2.3.9-snapshot-20041102/src/kernel/qgfxraster_qws.cpp
336@@ -4408,7 +4408,7 @@
337 setAlphaType(IgnoreAlpha);
338 if ( w <= 0 || h <= 0 || !ncliprect ) return;
339 GFX_START(QRect(rx+xoffs, ry+yoffs, w+1, h+1))
340-#ifdef QWS_EXPERIMENTAL_FASTPATH
341+#if 0 // def QWS_EXPERIMENTAL_FASTPATH !! this is crashing HancomWord on OZ !!
342 // ### fix for 8bpp
343 // This seems to be reliable now, at least for 16bpp
344
345--- qt-2.3.9-snapshot-20041102/src/kernel/qkeyboard_qws.cpp~qte239-all
346+++ qt-2.3.9-snapshot-20041102/src/kernel/qkeyboard_qws.cpp
347@@ -314,7 +314,7 @@
348 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 63
349 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 64
350 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 65
351 - { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 66
352+ { Qt::Key_F14, 0xffff , 0xffff , 0xffff }, // 66
353 { Qt::Key_Meta, 0xffff , 0xffff , 0xffff }, // 67
354 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 68
355 { Qt::Key_unknown,0xffff , 0xffff , 0xffff }, // 69
356--- qt-2.3.9-snapshot-20041102/src/kernel/qwindowsystem_qws.cpp~qte239-all
357+++ qt-2.3.9-snapshot-20041102/src/kernel/qwindowsystem_qws.cpp
358@@ -913,6 +913,18 @@
359 {
360 }
361
362+static void catchSegvSignal( int )
363+{
364+#ifndef QT_NO_QWS_KEYBOARD
365+ if ( qwsServer )
366 +qwsServer->closeKeyboard();
367+#endif
368+ QWSServer::closedown();
369+ fprintf(stderr, "Segmentation fault.\n");
370+ exit(1);
371+}
372+
373+
374 /*!
375 \class QWSServer qwindowsystem_qws.h
376 \brief Server-specific functionality in Qt/Embedded
377@@ -1038,6 +1050,7 @@
378 }
379
380 signal(SIGPIPE, ignoreSignal); //we get it when we read
381+ signal(SIGSEGV, catchSegvSignal); //recover the keyboard on crash
382 #endif
383 focusw = 0;
384 mouseGrabber = 0;
385--- qt-2.3.9-snapshot-20041102/src/tools/qcstring.h~qte239-all
386+++ qt-2.3.9-snapshot-20041102/src/tools/qcstring.h
387@@ -119,7 +119,7 @@
388 // We want to keep source compatibility for 2.x
389 // ### TODO for 4.0: completely remove these and the cstr* functions
390
391-#if !defined(QT_GENUINE_STR)
392+#if 0
393
394 #undefstrlen
395 #define strlen qstrlen
396--- qt-2.3.9-snapshot-20041102/src/tools/qglobal.h~qte239-all
397+++ qt-2.3.9-snapshot-20041102/src/tools/qglobal.h
398@@ -207,8 +207,16 @@
399 #if __GNUC__ == 2 && __GNUC_MINOR__ == 96
400 #define Q_FP_CCAST_BROKEN
401 #endif
402+/* ARM gcc pads structs to 32 bits, even when they contain a single
403+ char, or short. We tell gcc to pack QChars to 16 bits, to avoid
404+ QString bloat. However, gcc 3.4 doesn't allow us to create references to
405+ members of a packed struct. (Pointers are OK, because then you
406+ supposedly know what you are doing.) */
407 #if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
408 #define Q_PACKED __attribute__ ((packed))
409+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
410+# define Q_NO_PACKED_REFERENCE
411+# endif
412 #endif
413 #elif defined(__xlC__)
414 #define _CC_XLC_
415--- qt-2.3.9-snapshot-20041102/src/tools/qstring.cpp~qte239-all
416+++ qt-2.3.9-snapshot-20041102/src/tools/qstring.cpp
417@@ -14469,7 +14469,11 @@
418 return qt_winQString2MB( *this );
419 #endif
420 #ifdef _WS_QWS_
421- return utf8(); // ##### if there is ANY 8 bit format supported?
422+ QTextCodec* codec = QTextCodec::codecForLocale();
423+ return codec
424 + ? codec->fromUnicode(*this)
425 + : utf8();
426+ //return latin1(); // ##### if there is ANY 8 bit format supported?
427 #endif
428 #endif
429 }
430@@ -14515,7 +14519,12 @@
431 return qt_winMB2QString( local8Bit );
432 #endif
433 #ifdef _WS_QWS_
434- return fromUtf8(local8Bit,len);
435+ QTextCodec* codec = QTextCodec::codecForLocale();
436+ if( len < 0) len = qstrlen(local8Bit);
437+ return codec
438 + ? codec->toUnicode(local8Bit, len)
439 + : QString::fromUtf8(local8Bit,len);
440+// return fromLatin1(local8Bit,len);
441 #endif
442 #endif // QT_NO_TEXTCODEC
443 }
444--- qt-2.3.9-snapshot-20041102/src/widgets/qcommonstyle.cpp~qte239-all
445+++ qt-2.3.9-snapshot-20041102/src/widgets/qcommonstyle.cpp
446@@ -572,7 +572,7 @@
447 bool enabled, bool active )
448 {
449 #ifndef QT_NO_MENUBAR
450-#ifndef QT_NO_STYLE_SGI
451+#if 1 // #ifndef QT_NO_STYLE_SGI
452 if (draw_menu_bar_impl != 0) {
453 QDrawMenuBarItemImpl impl = draw_menu_bar_impl;
454 (this->*impl)(p, x, y, w, h, mi, g, enabled, active);
455--- qt-2.3.9-snapshot-20041102/src/widgets/qlistview.cpp~qte239-all
456+++ qt-2.3.9-snapshot-20041102/src/widgets/qlistview.cpp
457@@ -5051,9 +5051,9 @@
458 l = l->childItem ? l->childItem : l->siblingItem;
459
460 if ( l && l->height() )
461 -s.setHeight( s.height() + 10 * l->height() );
462- else
463 -s.setHeight( s.height() + 140 );
464 +s.setHeight( s.height() + 4 /*10*/ * l->height() );
465+ else // ^v much too big for handhelds
466 +s.setHeight( s.height() + 30 /*140*/ );
467
468 if ( s.width() > s.height() * 3 )
469 s.setHeight( s.width() / 3 );
470--- qt-2.3.9-snapshot-20041102/src/widgets/qscrollview.cpp~qte239-all
471+++ qt-2.3.9-snapshot-20041102/src/widgets/qscrollview.cpp
472@@ -1285,6 +1285,9 @@
473 case QEvent::LayoutHint:
474 d->autoResizeHint(this);
475 break;
476 +case QEvent::WindowActivate:
477 +case QEvent::WindowDeactivate:
478 + return TRUE;
479 default:
480 break;
481 }
482--- qt-2.3.9-snapshot-20041102/src/widgets/qtoolbutton.cpp~qte239-all
483+++ qt-2.3.9-snapshot-20041102/src/widgets/qtoolbutton.cpp
484@@ -238,7 +238,7 @@
485 else
486 QToolTip::add( this, textLabel );
487 }
488 -#endif
489+#endif
490 }
491
492
493@@ -332,12 +332,12 @@
494 QPixmap pm = iconSet(TRUE).pixmap(QIconSet::Large, QIconSet::Normal);
495 w = pm.width();
496 h = pm.height();
497 -if ( w < 32 )
498 - w = 32;
499 -if ( h < 32 )
500 - h = 32;
501 +if ( w < 24 )
502 + w = 24;
503 +if ( h < 24 )
504 + h = 24;
505 } else {
506 -w = h = 16;
507 +w = h = 14;
508 QPixmap pm = iconSet(TRUE).pixmap(QIconSet::Small, QIconSet::Normal);
509 w = pm.width();
510 h = pm.height();