-rw-r--r-- | library/calendar.cpp | 11 | ||||
-rw-r--r-- | library/library.pro | 3 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 8 | ||||
-rw-r--r-- | library/qpeglobal.h | 55 | ||||
-rw-r--r-- | library/qpemessagebox.cpp | 9 | ||||
-rw-r--r-- | library/qt_override.cpp | 16 | ||||
-rw-r--r-- | library/stable.h | 2 |
7 files changed, 67 insertions, 37 deletions
diff --git a/library/calendar.cpp b/library/calendar.cpp index 70e764c..d281a14 100644 --- a/library/calendar.cpp +++ b/library/calendar.cpp | |||
@@ -13,36 +13,31 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "calendar.h" | 20 | #include "calendar.h" |
21 | #include "qpeglobal.h" | ||
21 | 22 | ||
22 | #include <qdatetime.h> | 23 | #include <qdatetime.h> |
23 | #include <qobject.h> | 24 | #include <qobject.h> |
24 | 25 | ||
26 | |||
25 | /*! \class Calendar calendar.html | 27 | /*! \class Calendar calendar.html |
26 | 28 | ||
27 | \brief The Calendar class provides programmers with an easy to calculate | 29 | \brief The Calendar class provides programmers with an easy to calculate |
28 | and get information about dates, months and years. | 30 | and get information about dates, months and years. |
29 | 31 | ||
30 | \ingroup qtopiaemb | 32 | \ingroup qtopiaemb |
31 | */ | 33 | */ |
32 | 34 | ||
33 | #ifdef Q_OS_MACX | 35 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() QPE_SYMBOL_UNUSED; |
34 | #define ATTRIBUTE_UNUSED | ||
35 | #else | ||
36 | #define ATTRIBUTE_UNUSED __attribute__((unused)) | ||
37 | #endif | ||
38 | |||
39 | |||
40 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED; | ||
41 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { | 36 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { |
42 | (void)QObject::tr("Jan"); | 37 | (void)QObject::tr("Jan"); |
43 | (void)QObject::tr("Feb"); | 38 | (void)QObject::tr("Feb"); |
44 | (void)QObject::tr("Mar"); | 39 | (void)QObject::tr("Mar"); |
45 | (void)QObject::tr("Apr"); | 40 | (void)QObject::tr("Apr"); |
46 | (void)QObject::tr("May"); | 41 | (void)QObject::tr("May"); |
47 | (void)QObject::tr("Jun"); | 42 | (void)QObject::tr("Jun"); |
48 | (void)QObject::tr("Jul"); | 43 | (void)QObject::tr("Jul"); |
diff --git a/library/library.pro b/library/library.pro index ffd20fd..cdc1dab 100644 --- a/library/library.pro +++ b/library/library.pro | |||
@@ -54,17 +54,18 @@ HEADERS = calendar.h \ | |||
54 | ir.h \ | 54 | ir.h \ |
55 | backend/vobject_p.h \ | 55 | backend/vobject_p.h \ |
56 | findwidget_p.h \ | 56 | findwidget_p.h \ |
57 | finddialog.h \ | 57 | finddialog.h \ |
58 | lnkproperties.h \ | 58 | lnkproperties.h \ |
59 | windowdecorationinterface.h \ | 59 | windowdecorationinterface.h \ |
60 | textcodecinterface.h \ | 60 | textcodecinterface.h \ |
61 | imagecodecinterface.h \ | 61 | imagecodecinterface.h \ |
62 | qt_override_p.h | 62 | qt_override_p.h \ |
63 | qpeglobal.h | ||
63 | 64 | ||
64 | SOURCES= calendar.cpp \ | 65 | SOURCES= calendar.cpp \ |
65 | global.cpp \ | 66 | global.cpp \ |
66 | xmlreader.cpp \ | 67 | xmlreader.cpp \ |
67 | mimetype.cpp \ | 68 | mimetype.cpp \ |
68 | menubutton.cpp \ | 69 | menubutton.cpp \ |
69 | network.cpp \ | 70 | network.cpp \ |
70 | networkinterface.cpp \ | 71 | networkinterface.cpp \ |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index df313ce..3efba20 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -83,16 +83,17 @@ | |||
83 | #include "fontdatabase.h" | 83 | #include "fontdatabase.h" |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #include "alarmserver.h" | 86 | #include "alarmserver.h" |
87 | #include "applnk.h" | 87 | #include "applnk.h" |
88 | #include "qpemenubar.h" | 88 | #include "qpemenubar.h" |
89 | #include "textcodecinterface.h" | 89 | #include "textcodecinterface.h" |
90 | #include "imagecodecinterface.h" | 90 | #include "imagecodecinterface.h" |
91 | #include <qtopia/qpeglobal.h> | ||
91 | 92 | ||
92 | #include <unistd.h> | 93 | #include <unistd.h> |
93 | #include <sys/file.h> | 94 | #include <sys/file.h> |
94 | #include <sys/ioctl.h> | 95 | #include <sys/ioctl.h> |
95 | #ifndef QT_NO_SOUND | 96 | #ifndef QT_NO_SOUND |
96 | #include <sys/soundcard.h> | 97 | #include <sys/soundcard.h> |
97 | #endif | 98 | #endif |
98 | #include "qt_override_p.h" | 99 | #include "qt_override_p.h" |
@@ -1289,22 +1290,17 @@ void QPEApplication::reset() { | |||
1289 | 1290 | ||
1290 | // Redraw everything | 1291 | // Redraw everything |
1291 | applyStyle(); | 1292 | applyStyle(); |
1292 | } | 1293 | } |
1293 | 1294 | ||
1294 | #if (QT_VERSION < 238) && defined Q_OS_MACX | 1295 | #if (QT_VERSION < 238) && defined Q_OS_MACX |
1295 | bool qt_left_hand_scrollbars = false; | 1296 | bool qt_left_hand_scrollbars = false; |
1296 | #else | 1297 | #else |
1297 | #ifdef Q_OS_MACX | 1298 | extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL; |
1298 | #define WEAK_SYMBOL __attribute__((weak_import)) | ||
1299 | #else | ||
1300 | #define WEAK_SYMBOL __attribute__((weak)) | ||
1301 | #endif | ||
1302 | extern bool qt_left_hand_scrollbars WEAK_SYMBOL; | ||
1303 | #endif | 1299 | #endif |
1304 | 1300 | ||
1305 | /*! | 1301 | /*! |
1306 | \internal | 1302 | \internal |
1307 | */ | 1303 | */ |
1308 | void QPEApplication::applyStyle() | 1304 | void QPEApplication::applyStyle() |
1309 | { | 1305 | { |
1310 | Config config( "qpe" ); | 1306 | Config config( "qpe" ); |
diff --git a/library/qpeglobal.h b/library/qpeglobal.h new file mode 100644 index 0000000..96ce3a6 --- a/dev/null +++ b/library/qpeglobal.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This library is free software; you can | ||
6 | .> <`_, > . <= redistribute it and/or modify it under | ||
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This library is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. .` .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #ifndef QPE_GLOBAL_H | ||
30 | #define QPE_GLOBAL_H | ||
31 | |||
32 | /** | ||
33 | * Defines for used compiler attributes | ||
34 | * | ||
35 | */ | ||
36 | #if defined(Q_OS_MACX) | ||
37 | #define QPE_WEAK_SYMBOL __attribute__((weak_import)) | ||
38 | #define QPE_SYMBOL_USED | ||
39 | #define QPE_SYMBOL_UNUSED | ||
40 | |||
41 | #elif defined(_OS_UNIX_) | ||
42 | #define QPE_WEAK_SYMBOL __attribute__((weak)) | ||
43 | #define QPE_SYMBOL_USED __attribute__((used)) | ||
44 | #define QPE_SYMBOL_UNUSED __attribute__((unused)) | ||
45 | |||
46 | |||
47 | #else // defined(Q_OS_WIN32) | ||
48 | #define QPE_WEAK_SYMBOL | ||
49 | #define QPE_SYMBOL_USED | ||
50 | #define QPE_SYMBOL_UNUSED | ||
51 | #endif | ||
52 | |||
53 | |||
54 | |||
55 | #endif | ||
diff --git a/library/qpemessagebox.cpp b/library/qpemessagebox.cpp index c38828a..1df108a 100644 --- a/library/qpemessagebox.cpp +++ b/library/qpemessagebox.cpp | |||
@@ -14,27 +14,22 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qpemessagebox.h" | 21 | #include "qpemessagebox.h" |
22 | #include "qpeglobal.h" | ||
22 | #include <qtopia/stringutil.h> | 23 | #include <qtopia/stringutil.h> |
23 | 24 | ||
24 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
25 | 26 | ||
26 | #ifdef Q_OS_MACX | 27 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() QPE_SYMBOL_UNUSED; |
27 | #define ATTRIBUTE_UNUSED | ||
28 | #else | ||
29 | #define ATTRIBUTE_UNUSED __attribute__((unused)) | ||
30 | #endif | ||
31 | |||
32 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() ATTRIBUTE_UNUSED; | ||
33 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { | 28 | static void never_called_tr_function_um_libqpe_ts_etwas_unter_zu_jubeln() { |
34 | (void)QMessageBox::tr("Yes"); | 29 | (void)QMessageBox::tr("Yes"); |
35 | (void)QMessageBox::tr("No"); | 30 | (void)QMessageBox::tr("No"); |
36 | } | 31 | } |
37 | 32 | ||
38 | 33 | ||
39 | /*! | 34 | /*! |
40 | \class QPEMessageBox qpemessagebox.h | 35 | \class QPEMessageBox qpemessagebox.h |
diff --git a/library/qt_override.cpp b/library/qt_override.cpp index 56f82d7..a0d753b 100644 --- a/library/qt_override.cpp +++ b/library/qt_override.cpp | |||
@@ -3,16 +3,17 @@ | |||
3 | #include <qfontdatabase.h> | 3 | #include <qfontdatabase.h> |
4 | 4 | ||
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <limits.h> | 8 | #include <limits.h> |
9 | #include <sys/param.h> // for toolchains with old libc headers | 9 | #include <sys/param.h> // for toolchains with old libc headers |
10 | 10 | ||
11 | #include <qtopia/qpeglobal.h> | ||
11 | #include "qt_override_p.h" | 12 | #include "qt_override_p.h" |
12 | 13 | ||
13 | #if QT_VERSION > 233 | 14 | #if QT_VERSION > 233 |
14 | 15 | ||
15 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX | 16 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX |
16 | struct color_fix_t { | 17 | struct color_fix_t { |
17 | char *m_app; | 18 | char *m_app; |
18 | char *m_class; | 19 | char *m_class; |
@@ -80,35 +81,32 @@ const char *Opie::binaryName ( ) | |||
80 | int Opie::force_appearance = 0; | 81 | int Opie::force_appearance = 0; |
81 | #endif | 82 | #endif |
82 | 83 | ||
83 | // Fix for a toolchain incompatibility (binaries compiled with | 84 | // Fix for a toolchain incompatibility (binaries compiled with |
84 | // old tcs using shared libs compiled with newer tcs) | 85 | // old tcs using shared libs compiled with newer tcs) |
85 | 86 | ||
86 | extern "C" { | 87 | extern "C" { |
87 | 88 | ||
88 | extern void __gmon_start__ ( ) __attribute__(( weak )); | 89 | extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL; |
89 | |||
90 | extern void __gmon_start__ ( ) | 90 | extern void __gmon_start__ ( ) |
91 | { | 91 | { |
92 | } | 92 | } |
93 | 93 | ||
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX | 97 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX |
98 | // Fix for apps, that use QPainter::eraseRect() which doesn't work with styles | 98 | // Fix for apps, that use QPainter::eraseRect() which doesn't work with styles |
99 | // that set a background pixmap (it would be easier to fix eraseRect(), but | 99 | // that set a background pixmap (it would be easier to fix eraseRect(), but |
100 | // TT made it an inline ...) | 100 | // TT made it an inline ...) |
101 | 101 | ||
102 | void QPEApplication::polish ( QWidget *w ) | 102 | void QPEApplication::polish ( QWidget *w ) |
103 | { | 103 | { |
104 | #ifndef OPIE_NO_OVERRIDE_QT | 104 | #ifndef OPIE_NO_OVERRIDE_QT |
105 | //qDebug ( "QPEApplication::polish()" ); | ||
106 | |||
107 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { | 105 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { |
108 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && | 106 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && |
109 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && | 107 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && |
110 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { | 108 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { |
111 | QPalette pal = w-> palette ( ); | 109 | QPalette pal = w-> palette ( ); |
112 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); | 110 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); |
113 | w-> setPalette ( pal ); | 111 | w-> setPalette ( pal ); |
114 | } | 112 | } |
@@ -120,18 +118,16 @@ void QPEApplication::polish ( QWidget *w ) | |||
120 | 118 | ||
121 | 119 | ||
122 | #ifndef OPIE_NO_OVERRIDE_QT | 120 | #ifndef OPIE_NO_OVERRIDE_QT |
123 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes | 121 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes |
124 | // were multiplied by 10 (which was incorrect) | 122 | // were multiplied by 10 (which was incorrect) |
125 | 123 | ||
126 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) | 124 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) |
127 | { | 125 | { |
128 | //qDebug ( "QFontDatabase::pointSizes()" ); | ||
129 | |||
130 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); | 126 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); |
131 | 127 | ||
132 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { | 128 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { |
133 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { | 129 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { |
134 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | 130 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) |
135 | *it *= 10; | 131 | *it *= 10; |
136 | } | 132 | } |
137 | } | 133 | } |
@@ -139,44 +135,36 @@ QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString cons | |||
139 | } | 135 | } |
140 | 136 | ||
141 | 137 | ||
142 | // Various style/font/color related overrides for weak symbols in Qt/E, | 138 | // Various style/font/color related overrides for weak symbols in Qt/E, |
143 | // which allows us to force the usage of the global Opie appearance. | 139 | // which allows us to force the usage of the global Opie appearance. |
144 | 140 | ||
145 | void QApplication::setStyle ( QStyle *style ) | 141 | void QApplication::setStyle ( QStyle *style ) |
146 | { | 142 | { |
147 | //qDebug ( "QApplication::setStyle()" ); | ||
148 | |||
149 | if ( Opie::force_appearance & Opie::Force_Style ) | 143 | if ( Opie::force_appearance & Opie::Force_Style ) |
150 | delete style; | 144 | delete style; |
151 | else | 145 | else |
152 | QApplication::setStyle_NonWeak ( style ); | 146 | QApplication::setStyle_NonWeak ( style ); |
153 | } | 147 | } |
154 | 148 | ||
155 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) | 149 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) |
156 | { | 150 | { |
157 | //qDebug ( "QApplication::setPalette()" ); | ||
158 | |||
159 | if (!( Opie::force_appearance & Opie::Force_Style )) | 151 | if (!( Opie::force_appearance & Opie::Force_Style )) |
160 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); | 152 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); |
161 | } | 153 | } |
162 | 154 | ||
163 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) | 155 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) |
164 | { | 156 | { |
165 | //qDebug ( "QApplication::setFont()" ); | ||
166 | |||
167 | if (!( Opie::force_appearance & Opie::Force_Font )) | 157 | if (!( Opie::force_appearance & Opie::Force_Font )) |
168 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); | 158 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); |
169 | } | 159 | } |
170 | 160 | ||
171 | 161 | ||
172 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) | 162 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) |
173 | { | 163 | { |
174 | //qDebug ( "QApplication::qwsSetDecoration()" ); | ||
175 | |||
176 | if ( Opie::force_appearance & Opie::Force_Decoration ) | 164 | if ( Opie::force_appearance & Opie::Force_Decoration ) |
177 | delete deco; | 165 | delete deco; |
178 | else | 166 | else |
179 | QApplication::qwsSetDecoration_NonWeak ( deco ); | 167 | QApplication::qwsSetDecoration_NonWeak ( deco ); |
180 | } | 168 | } |
181 | #endif | 169 | #endif |
182 | #endif | 170 | #endif |
diff --git a/library/stable.h b/library/stable.h index 10f13a6..ea4526c 100644 --- a/library/stable.h +++ b/library/stable.h | |||
@@ -67,11 +67,11 @@ | |||
67 | #include <qtopia/xmlreader.h> | 67 | #include <qtopia/xmlreader.h> |
68 | #include <qtopia/windowdecorationinterface.h> | 68 | #include <qtopia/windowdecorationinterface.h> |
69 | 69 | ||
70 | #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL | 70 | #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL |
71 | #include <qtopia/tzselect.h> | 71 | #include <qtopia/tzselect.h> |
72 | #undef QTOPIA_INTERNAL_TZSELECT_INC_LOCAL | 72 | #undef QTOPIA_INTERNAL_TZSELECT_INC_LOCAL |
73 | 73 | ||
74 | #include <qtopia/applicationinterface.h> | 74 | #include <qtopia/applicationinterface.h> |
75 | 75 | #include <qtopia/qpeglobal.h> | |
76 | 76 | ||
77 | #endif | 77 | #endif |