author | zecke <zecke> | 2004-10-15 19:23:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-15 19:23:42 (UTC) |
commit | ac36bfe2794741188da1d6d4b471f96fd15d47ee (patch) (unidiff) | |
tree | 5c1bc264fd554142993be8963aed159f32877d6a | |
parent | a979ea08e8f9dbade70a9bf4fdc93dcbebb5f3fa (diff) | |
download | opie-ac36bfe2794741188da1d6d4b471f96fd15d47ee.zip opie-ac36bfe2794741188da1d6d4b471f96fd15d47ee.tar.gz opie-ac36bfe2794741188da1d6d4b471f96fd15d47ee.tar.bz2 |
-Add a QPEGLOBAL that adds define for 'weak', 'used' and unused symbols
Make use of the newly added qpeglobal.h to kill custom versions of
similiar macros
-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 | |||
@@ -1,104 +1,99 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
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"); |
49 | (void)QObject::tr("Aug"); | 44 | (void)QObject::tr("Aug"); |
50 | (void)QObject::tr("Sep"); | 45 | (void)QObject::tr("Sep"); |
51 | (void)QObject::tr("Oct"); | 46 | (void)QObject::tr("Oct"); |
52 | (void)QObject::tr("Nov"); | 47 | (void)QObject::tr("Nov"); |
53 | (void)QObject::tr("Dec"); | 48 | (void)QObject::tr("Dec"); |
54 | (void)QObject::tr("Mon"); | 49 | (void)QObject::tr("Mon"); |
55 | (void)QObject::tr("Tue"); | 50 | (void)QObject::tr("Tue"); |
56 | (void)QObject::tr("Wed"); | 51 | (void)QObject::tr("Wed"); |
57 | (void)QObject::tr("Thu"); | 52 | (void)QObject::tr("Thu"); |
58 | (void)QObject::tr("Fri"); | 53 | (void)QObject::tr("Fri"); |
59 | (void)QObject::tr("Sat"); | 54 | (void)QObject::tr("Sat"); |
60 | (void)QObject::tr("Sun"); | 55 | (void)QObject::tr("Sun"); |
61 | } | 56 | } |
62 | 57 | ||
63 | 58 | ||
64 | 59 | ||
65 | /*! | 60 | /*! |
66 | Returns the name of the month for \a m. | 61 | Returns the name of the month for \a m. |
67 | Equivalent to QDate::monthName(). | 62 | Equivalent to QDate::monthName(). |
68 | */ | 63 | */ |
69 | 64 | ||
70 | QString Calendar::nameOfMonth( int m ) | 65 | QString Calendar::nameOfMonth( int m ) |
71 | { | 66 | { |
72 | QDate d; | 67 | QDate d; |
73 | return QObject::tr( d.monthName( m ) ); | 68 | return QObject::tr( d.monthName( m ) ); |
74 | } | 69 | } |
75 | 70 | ||
76 | /*! | 71 | /*! |
77 | Returns the name of the day for \a d. | 72 | Returns the name of the day for \a d. |
78 | Equivalent to QDate::dayName(). | 73 | Equivalent to QDate::dayName(). |
79 | */ | 74 | */ |
80 | QString Calendar::nameOfDay( int d ) | 75 | QString Calendar::nameOfDay( int d ) |
81 | { | 76 | { |
82 | QDate dt; | 77 | QDate dt; |
83 | return QObject::tr( dt.dayName( d ) ); | 78 | return QObject::tr( dt.dayName( d ) ); |
84 | } | 79 | } |
85 | 80 | ||
86 | /*! \obsolete */ | 81 | /*! \obsolete */ |
87 | QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month, | 82 | QValueList<Calendar::Day> Calendar::daysOfMonth( int year, int month, |
88 | bool startWithMonday ) | 83 | bool startWithMonday ) |
89 | { | 84 | { |
90 | QDate temp; | 85 | QDate temp; |
91 | temp.setYMD( year, month, 1 ); | 86 | temp.setYMD( year, month, 1 ); |
92 | int firstDay = temp.dayOfWeek(); | 87 | int firstDay = temp.dayOfWeek(); |
93 | int i; | 88 | int i; |
94 | QDate prev; | 89 | QDate prev; |
95 | QValueList<Day> days; | 90 | QValueList<Day> days; |
96 | 91 | ||
97 | if ( startWithMonday ) | 92 | if ( startWithMonday ) |
98 | i = 1; | 93 | i = 1; |
99 | else | 94 | else |
100 | i = 0; | 95 | i = 0; |
101 | 96 | ||
102 | if ( month > 1 ) | 97 | if ( month > 1 ) |
103 | prev.setYMD( year, month - 1, 1 ); | 98 | prev.setYMD( year, month - 1, 1 ); |
104 | else | 99 | else |
diff --git a/library/library.pro b/library/library.pro index ffd20fd..cdc1dab 100644 --- a/library/library.pro +++ b/library/library.pro | |||
@@ -1,126 +1,127 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | #CONFIG += qt warn_on release | 2 | #CONFIG += qt warn_on release |
3 | CONFIG += qt warn_on debug | 3 | CONFIG += qt warn_on debug |
4 | HEADERS= calendar.h \ | 4 | HEADERS= calendar.h \ |
5 | global.h \ | 5 | global.h \ |
6 | resource.h \ | 6 | resource.h \ |
7 | xmlreader.h \ | 7 | xmlreader.h \ |
8 | mimetype.h \ | 8 | mimetype.h \ |
9 | menubutton.h \ | 9 | menubutton.h \ |
10 | network.h \ | 10 | network.h \ |
11 | networkinterface.h \ | 11 | networkinterface.h \ |
12 | filemanager.h \ | 12 | filemanager.h \ |
13 | fontmanager.h \ | 13 | fontmanager.h \ |
14 | qdawg.h \ | 14 | qdawg.h \ |
15 | datebookmonth.h \ | 15 | datebookmonth.h \ |
16 | fileselector.h \ | 16 | fileselector.h \ |
17 | fileselector_p.h \ | 17 | fileselector_p.h \ |
18 | imageedit.h \ | 18 | imageedit.h \ |
19 | qcopenvelope_qws.h \ | 19 | qcopenvelope_qws.h \ |
20 | qpedecoration_qws.h \ | 20 | qpedecoration_qws.h \ |
21 | qpeapplication.h \ | 21 | qpeapplication.h \ |
22 | qpestyle.h \ | 22 | qpestyle.h \ |
23 | qpedialog.h \ | 23 | qpedialog.h \ |
24 | lightstyle.h \ | 24 | lightstyle.h \ |
25 | config.h \ | 25 | config.h \ |
26 | applnk.h \ | 26 | applnk.h \ |
27 | sound.h \ | 27 | sound.h \ |
28 | tzselect.h \ | 28 | tzselect.h \ |
29 | qmath.h \ | 29 | qmath.h \ |
30 | datebookdb.h \ | 30 | datebookdb.h \ |
31 | alarmserver.h \ | 31 | alarmserver.h \ |
32 | process.h \ | 32 | process.h \ |
33 | password.h \ | 33 | password.h \ |
34 | timestring.h \ | 34 | timestring.h \ |
35 | fontfactoryinterface.h \ | 35 | fontfactoryinterface.h \ |
36 | fontdatabase.h \ | 36 | fontdatabase.h \ |
37 | power.h \ | 37 | power.h \ |
38 | storage.h \ | 38 | storage.h \ |
39 | qpemessagebox.h \ | 39 | qpemessagebox.h \ |
40 | timeconversion.h \ | 40 | timeconversion.h \ |
41 | qpedebug.h \ | 41 | qpedebug.h \ |
42 | qpemenubar.h \ | 42 | qpemenubar.h \ |
43 | qpetoolbar.h \ | 43 | qpetoolbar.h \ |
44 | backend/categories.h \ | 44 | backend/categories.h \ |
45 | stringutil.h \ | 45 | stringutil.h \ |
46 | backend/palmtoprecord.h \ | 46 | backend/palmtoprecord.h \ |
47 | backend/task.h \ | 47 | backend/task.h \ |
48 | backend/event.h \ | 48 | backend/event.h \ |
49 | backend/contact.h\ | 49 | backend/contact.h\ |
50 | categorymenu.h \ | 50 | categorymenu.h \ |
51 | categoryedit_p.h \ | 51 | categoryedit_p.h \ |
52 | categoryselect.h \ | 52 | categoryselect.h \ |
53 | categorywidget.h \ | 53 | categorywidget.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 \ |
71 | filemanager.cpp \ | 72 | filemanager.cpp \ |
72 | fontmanager.cpp \ | 73 | fontmanager.cpp \ |
73 | qdawg.cpp \ | 74 | qdawg.cpp \ |
74 | datebookmonth.cpp \ | 75 | datebookmonth.cpp \ |
75 | fileselector.cpp \ | 76 | fileselector.cpp \ |
76 | imageedit.cpp \ | 77 | imageedit.cpp \ |
77 | resource.cpp \ | 78 | resource.cpp \ |
78 | qpedecoration_qws.cpp \ | 79 | qpedecoration_qws.cpp \ |
79 | qcopenvelope_qws.cpp \ | 80 | qcopenvelope_qws.cpp \ |
80 | qpeapplication.cpp \ | 81 | qpeapplication.cpp \ |
81 | qpestyle.cpp \ | 82 | qpestyle.cpp \ |
82 | qpedialog.cpp \ | 83 | qpedialog.cpp \ |
83 | lightstyle.cpp \ | 84 | lightstyle.cpp \ |
84 | config.cpp \ | 85 | config.cpp \ |
85 | applnk.cpp \ | 86 | applnk.cpp \ |
86 | sound.cpp \ | 87 | sound.cpp \ |
87 | tzselect.cpp \ | 88 | tzselect.cpp \ |
88 | qmath.c \ | 89 | qmath.c \ |
89 | datebookdb.cpp \ | 90 | datebookdb.cpp \ |
90 | alarmserver.cpp \ | 91 | alarmserver.cpp \ |
91 | password.cpp \ | 92 | password.cpp \ |
92 | process.cpp \ | 93 | process.cpp \ |
93 | process_unix.cpp \ | 94 | process_unix.cpp \ |
94 | timestring.cpp \ | 95 | timestring.cpp \ |
95 | fontdatabase.cpp \ | 96 | fontdatabase.cpp \ |
96 | power.cpp \ | 97 | power.cpp \ |
97 | storage.cpp \ | 98 | storage.cpp \ |
98 | qpemessagebox.cpp \ | 99 | qpemessagebox.cpp \ |
99 | backend/timeconversion.cpp \ | 100 | backend/timeconversion.cpp \ |
100 | qpedebug.cpp \ | 101 | qpedebug.cpp \ |
101 | qpemenubar.cpp \ | 102 | qpemenubar.cpp \ |
102 | qpetoolbar.cpp \ | 103 | qpetoolbar.cpp \ |
103 | backend/categories.cpp \ | 104 | backend/categories.cpp \ |
104 | backend/stringutil.cpp \ | 105 | backend/stringutil.cpp \ |
105 | backend/palmtoprecord.cpp \ | 106 | backend/palmtoprecord.cpp \ |
106 | backend/task.cpp \ | 107 | backend/task.cpp \ |
107 | backend/event.cpp \ | 108 | backend/event.cpp \ |
108 | backend/contact.cpp \ | 109 | backend/contact.cpp \ |
109 | categorymenu.cpp \ | 110 | categorymenu.cpp \ |
110 | categoryedit_p.cpp \ | 111 | categoryedit_p.cpp \ |
111 | categoryselect.cpp \ | 112 | categoryselect.cpp \ |
112 | categorywidget.cpp \ | 113 | categorywidget.cpp \ |
113 | ir.cpp \ | 114 | ir.cpp \ |
114 | backend/vcc_yacc.cpp \ | 115 | backend/vcc_yacc.cpp \ |
115 | backend/vobject.cpp \ | 116 | backend/vobject.cpp \ |
116 | findwidget_p.cpp \ | 117 | findwidget_p.cpp \ |
117 | finddialog.cpp \ | 118 | finddialog.cpp \ |
118 | lnkproperties.cpp \ | 119 | lnkproperties.cpp \ |
119 | qt_override.cpp | 120 | qt_override.cpp |
120 | 121 | ||
121 | 122 | ||
122 | 123 | ||
123 | # Qt 3 compatibility | 124 | # Qt 3 compatibility |
124 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h | 125 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h |
125 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp | 126 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp |
126 | INCLUDEPATH += $(OPIEDIR)/include backend | 127 | INCLUDEPATH += $(OPIEDIR)/include backend |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index df313ce..3efba20 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -27,128 +27,129 @@ | |||
27 | #include <qqueue.h> | 27 | #include <qqueue.h> |
28 | #ifdef Q_WS_QWS | 28 | #ifdef Q_WS_QWS |
29 | #ifndef QT_NO_COP | 29 | #ifndef QT_NO_COP |
30 | #if QT_VERSION <= 231 | 30 | #if QT_VERSION <= 231 |
31 | #define private public | 31 | #define private public |
32 | #define sendLocally processEvent | 32 | #define sendLocally processEvent |
33 | #include "qcopenvelope_qws.h" | 33 | #include "qcopenvelope_qws.h" |
34 | #undef private | 34 | #undef private |
35 | #else | 35 | #else |
36 | #include "qcopenvelope_qws.h" | 36 | #include "qcopenvelope_qws.h" |
37 | #endif | 37 | #endif |
38 | #endif | 38 | #endif |
39 | #include <qwindowsystem_qws.h> | 39 | #include <qwindowsystem_qws.h> |
40 | #endif | 40 | #endif |
41 | #include <qtextstream.h> | 41 | #include <qtextstream.h> |
42 | #include <qpalette.h> | 42 | #include <qpalette.h> |
43 | #include <qbuffer.h> | 43 | #include <qbuffer.h> |
44 | #include <qptrdict.h> | 44 | #include <qptrdict.h> |
45 | #include <qregexp.h> | 45 | #include <qregexp.h> |
46 | #include <qdir.h> | 46 | #include <qdir.h> |
47 | #include <qlabel.h> | 47 | #include <qlabel.h> |
48 | #include <qdialog.h> | 48 | #include <qdialog.h> |
49 | #include <qdragobject.h> | 49 | #include <qdragobject.h> |
50 | #include <qtextcodec.h> | 50 | #include <qtextcodec.h> |
51 | #include <qevent.h> | 51 | #include <qevent.h> |
52 | #include <qtooltip.h> | 52 | #include <qtooltip.h> |
53 | #include <qsignal.h> | 53 | #include <qsignal.h> |
54 | #include <qmainwindow.h> | 54 | #include <qmainwindow.h> |
55 | #include <qwidgetlist.h> | 55 | #include <qwidgetlist.h> |
56 | #include <qpixmapcache.h> | 56 | #include <qpixmapcache.h> |
57 | 57 | ||
58 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 58 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
59 | #define QTOPIA_INTERNAL_INITAPP | 59 | #define QTOPIA_INTERNAL_INITAPP |
60 | #include "qpeapplication.h" | 60 | #include "qpeapplication.h" |
61 | #include "qpestyle.h" | 61 | #include "qpestyle.h" |
62 | #include "styleinterface.h" | 62 | #include "styleinterface.h" |
63 | #if QT_VERSION >= 300 | 63 | #if QT_VERSION >= 300 |
64 | #include <qstylefactory.h> | 64 | #include <qstylefactory.h> |
65 | #else | 65 | #else |
66 | #include <qplatinumstyle.h> | 66 | #include <qplatinumstyle.h> |
67 | #include <qwindowsstyle.h> | 67 | #include <qwindowsstyle.h> |
68 | #include <qmotifstyle.h> | 68 | #include <qmotifstyle.h> |
69 | #include <qmotifplusstyle.h> | 69 | #include <qmotifplusstyle.h> |
70 | #include "lightstyle.h" | 70 | #include "lightstyle.h" |
71 | 71 | ||
72 | #include <qpe/qlibrary.h> | 72 | #include <qpe/qlibrary.h> |
73 | #endif | 73 | #endif |
74 | #include "global.h" | 74 | #include "global.h" |
75 | #include "resource.h" | 75 | #include "resource.h" |
76 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 76 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
77 | #include "qutfcodec.h" | 77 | #include "qutfcodec.h" |
78 | #endif | 78 | #endif |
79 | #include "config.h" | 79 | #include "config.h" |
80 | #include "network.h" | 80 | #include "network.h" |
81 | #ifdef QWS | 81 | #ifdef QWS |
82 | #include "fontmanager.h" | 82 | #include "fontmanager.h" |
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" |
99 | 100 | ||
100 | #include <backend/rohfeedback.h> | 101 | #include <backend/rohfeedback.h> |
101 | 102 | ||
102 | 103 | ||
103 | static bool useBigPixmaps = 0; | 104 | static bool useBigPixmaps = 0; |
104 | 105 | ||
105 | class HackWidget : public QWidget | 106 | class HackWidget : public QWidget |
106 | { | 107 | { |
107 | public: | 108 | public: |
108 | bool needsOk() | 109 | bool needsOk() |
109 | { return (getWState() & WState_Reserved1 ); } | 110 | { return (getWState() & WState_Reserved1 ); } |
110 | 111 | ||
111 | QRect normalGeometry() | 112 | QRect normalGeometry() |
112 | { return topData()->normalGeometry; }; | 113 | { return topData()->normalGeometry; }; |
113 | }; | 114 | }; |
114 | 115 | ||
115 | class QPEApplicationData | 116 | class QPEApplicationData |
116 | { | 117 | { |
117 | public: | 118 | public: |
118 | QPEApplicationData ( ) : | 119 | QPEApplicationData ( ) : |
119 | presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), | 120 | presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), |
120 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), | 121 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), |
121 | keep_running( true ), qcopQok( false ), | 122 | keep_running( true ), qcopQok( false ), |
122 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), | 123 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), |
123 | bigIconSize( 32 ), qpe_main_widget( 0 ) | 124 | bigIconSize( 32 ), qpe_main_widget( 0 ) |
124 | { | 125 | { |
125 | Config cfg( "qpe" ); | 126 | Config cfg( "qpe" ); |
126 | cfg.setGroup( "Appearance" ); | 127 | cfg.setGroup( "Appearance" ); |
127 | useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false ); | 128 | useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false ); |
128 | fontFamily = cfg.readEntry( "FontFamily", "Vera" ); | 129 | fontFamily = cfg.readEntry( "FontFamily", "Vera" ); |
129 | fontSize = cfg.readNumEntry( "FontSize", 10 ); | 130 | fontSize = cfg.readNumEntry( "FontSize", 10 ); |
130 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); | 131 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); |
131 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); | 132 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); |
132 | #ifdef OPIE_WITHROHFEEDBACK | 133 | #ifdef OPIE_WITHROHFEEDBACK |
133 | RoH = 0; | 134 | RoH = 0; |
134 | #endif | 135 | #endif |
135 | } | 136 | } |
136 | 137 | ||
137 | int presstimer; | 138 | int presstimer; |
138 | QWidget* presswidget; | 139 | QWidget* presswidget; |
139 | QPoint presspos; | 140 | QPoint presspos; |
140 | #ifdef OPIE_WITHROHFEEDBACK | 141 | #ifdef OPIE_WITHROHFEEDBACK |
141 | Opie::Internal::RoHFeedback *RoH; | 142 | Opie::Internal::RoHFeedback *RoH; |
142 | #endif | 143 | #endif |
143 | 144 | ||
144 | bool rightpressed : 1; | 145 | bool rightpressed : 1; |
145 | bool kbgrabbed : 1; | 146 | bool kbgrabbed : 1; |
146 | bool notbusysent : 1; | 147 | bool notbusysent : 1; |
147 | bool preloaded : 1; | 148 | bool preloaded : 1; |
148 | bool forceshow : 1; | 149 | bool forceshow : 1; |
149 | bool nomaximize : 1; | 150 | bool nomaximize : 1; |
150 | bool keep_running : 1; | 151 | bool keep_running : 1; |
151 | bool qcopQok : 1; | 152 | bool qcopQok : 1; |
152 | 153 | ||
153 | QCString fontFamily; | 154 | QCString fontFamily; |
154 | int fontSize; | 155 | int fontSize; |
@@ -1233,134 +1234,129 @@ int QPEApplication::defaultRotation() | |||
1233 | 1234 | ||
1234 | /*! | 1235 | /*! |
1235 | \internal | 1236 | \internal |
1236 | */ | 1237 | */ |
1237 | void QPEApplication::setDefaultRotation( int r ) | 1238 | void QPEApplication::setDefaultRotation( int r ) |
1238 | { | 1239 | { |
1239 | if ( qApp->type() == GuiServer ) { | 1240 | if ( qApp->type() == GuiServer ) { |
1240 | deforient = r; | 1241 | deforient = r; |
1241 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 1242 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
1242 | Config config("qpe"); | 1243 | Config config("qpe"); |
1243 | config.setGroup( "Rotation" ); | 1244 | config.setGroup( "Rotation" ); |
1244 | config.writeEntry( "Rot", r ); | 1245 | config.writeEntry( "Rot", r ); |
1245 | } | 1246 | } |
1246 | else { | 1247 | else { |
1247 | #ifndef QT_NO_COP | 1248 | #ifndef QT_NO_COP |
1248 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 1249 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
1249 | e << r; | 1250 | e << r; |
1250 | } | 1251 | } |
1251 | #endif | 1252 | #endif |
1252 | 1253 | ||
1253 | } | 1254 | } |
1254 | } | 1255 | } |
1255 | 1256 | ||
1256 | #include <qgfx_qws.h> | 1257 | #include <qgfx_qws.h> |
1257 | #include <qwindowsystem_qws.h> | 1258 | #include <qwindowsystem_qws.h> |
1258 | 1259 | ||
1259 | #if QT_VERSION > 236 | 1260 | #if QT_VERSION > 236 |
1260 | extern void qws_clearLoadedFonts(); | 1261 | extern void qws_clearLoadedFonts(); |
1261 | #endif | 1262 | #endif |
1262 | 1263 | ||
1263 | void QPEApplication::setCurrentMode( int x, int y, int depth ) | 1264 | void QPEApplication::setCurrentMode( int x, int y, int depth ) |
1264 | { | 1265 | { |
1265 | // Reset the caches | 1266 | // Reset the caches |
1266 | #if QT_VERSION > 236 | 1267 | #if QT_VERSION > 236 |
1267 | qws_clearLoadedFonts(); | 1268 | qws_clearLoadedFonts(); |
1268 | #endif | 1269 | #endif |
1269 | QPixmapCache::clear(); | 1270 | QPixmapCache::clear(); |
1270 | 1271 | ||
1271 | // Change the screen mode | 1272 | // Change the screen mode |
1272 | qt_screen->setMode(x, y, depth); | 1273 | qt_screen->setMode(x, y, depth); |
1273 | 1274 | ||
1274 | if ( qApp->type() == GuiServer ) { | 1275 | if ( qApp->type() == GuiServer ) { |
1275 | #if QT_VERSION > 236 | 1276 | #if QT_VERSION > 236 |
1276 | // Reconfigure the GuiServer | 1277 | // Reconfigure the GuiServer |
1277 | qwsServer->beginDisplayReconfigure(); | 1278 | qwsServer->beginDisplayReconfigure(); |
1278 | qwsServer->endDisplayReconfigure(); | 1279 | qwsServer->endDisplayReconfigure(); |
1279 | #endif | 1280 | #endif |
1280 | // Get all the running apps to reset | 1281 | // Get all the running apps to reset |
1281 | QCopEnvelope env( "QPE/System", "reset()" ); | 1282 | QCopEnvelope env( "QPE/System", "reset()" ); |
1282 | } | 1283 | } |
1283 | } | 1284 | } |
1284 | 1285 | ||
1285 | void QPEApplication::reset() { | 1286 | void QPEApplication::reset() { |
1286 | // Reconnect to the screen | 1287 | // Reconnect to the screen |
1287 | qt_screen->disconnect(); | 1288 | qt_screen->disconnect(); |
1288 | qt_screen->connect( QString::null ); | 1289 | qt_screen->connect( QString::null ); |
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" ); |
1311 | config.setGroup( "Appearance" ); | 1307 | config.setGroup( "Appearance" ); |
1312 | 1308 | ||
1313 | #if QT_VERSION > 233 | 1309 | #if QT_VERSION > 233 |
1314 | #if !defined(OPIE_NO_OVERRIDE_QT) | 1310 | #if !defined(OPIE_NO_OVERRIDE_QT) |
1315 | // don't block ourselves ... | 1311 | // don't block ourselves ... |
1316 | Opie::force_appearance = 0; | 1312 | Opie::force_appearance = 0; |
1317 | 1313 | ||
1318 | static QString appname = Opie::binaryName ( ); | 1314 | static QString appname = Opie::binaryName ( ); |
1319 | 1315 | ||
1320 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 1316 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
1321 | int nostyle = 0; | 1317 | int nostyle = 0; |
1322 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 1318 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
1323 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 1319 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
1324 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 1320 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
1325 | break; | 1321 | break; |
1326 | } | 1322 | } |
1327 | } | 1323 | } |
1328 | #else | 1324 | #else |
1329 | int nostyle = 0; | 1325 | int nostyle = 0; |
1330 | #endif | 1326 | #endif |
1331 | 1327 | ||
1332 | // Widget style | 1328 | // Widget style |
1333 | QString style = config.readEntry( "Style", "FlatStyle" ); | 1329 | QString style = config.readEntry( "Style", "FlatStyle" ); |
1334 | 1330 | ||
1335 | // don't set a custom style | 1331 | // don't set a custom style |
1336 | if ( nostyle & Opie::Force_Style ) | 1332 | if ( nostyle & Opie::Force_Style ) |
1337 | style = "FlatStyle"; | 1333 | style = "FlatStyle"; |
1338 | 1334 | ||
1339 | internalSetStyle ( style ); | 1335 | internalSetStyle ( style ); |
1340 | 1336 | ||
1341 | // Colors - from /etc/colors/Liquid.scheme | 1337 | // Colors - from /etc/colors/Liquid.scheme |
1342 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); | 1338 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); |
1343 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); | 1339 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); |
1344 | QPalette pal( btncolor, bgcolor ); | 1340 | QPalette pal( btncolor, bgcolor ); |
1345 | QString color = config.readEntry( "Highlight", "#73adef" ); | 1341 | QString color = config.readEntry( "Highlight", "#73adef" ); |
1346 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1342 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1347 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1343 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1348 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1344 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
1349 | color = config.readEntry( "Text", "#000000" ); | 1345 | color = config.readEntry( "Text", "#000000" ); |
1350 | pal.setColor( QColorGroup::Text, QColor( color ) ); | 1346 | pal.setColor( QColorGroup::Text, QColor( color ) ); |
1351 | color = config.readEntry( "ButtonText", "#000000" ); | 1347 | color = config.readEntry( "ButtonText", "#000000" ); |
1352 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); | 1348 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); |
1353 | color = config.readEntry( "Base", "#FFFFFF" ); | 1349 | color = config.readEntry( "Base", "#FFFFFF" ); |
1354 | pal.setColor( QColorGroup::Base, QColor( color ) ); | 1350 | pal.setColor( QColorGroup::Base, QColor( color ) ); |
1355 | 1351 | ||
1356 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 1352 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
1357 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); | 1353 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); |
1358 | 1354 | ||
1359 | setPalette( pal, TRUE ); | 1355 | setPalette( pal, TRUE ); |
1360 | 1356 | ||
1361 | 1357 | ||
1362 | // Set the ScrollBar on the 'right' side but only if the weak symbol is present | 1358 | // Set the ScrollBar on the 'right' side but only if the weak symbol is present |
1363 | if (&qt_left_hand_scrollbars ) | 1359 | if (&qt_left_hand_scrollbars ) |
1364 | qt_left_hand_scrollbars = config.readBoolEntry( "LeftHand", false ); | 1360 | qt_left_hand_scrollbars = config.readBoolEntry( "LeftHand", false ); |
1365 | 1361 | ||
1366 | // Window Decoration | 1362 | // Window Decoration |
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 | |||
@@ -1,60 +1,55 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
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 | 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 |
41 | \brief A message box that provides yes, no and cancel options. | 36 | \brief A message box that provides yes, no and cancel options. |
42 | 37 | ||
43 | \ingroup qtopiaemb | 38 | \ingroup qtopiaemb |
44 | */ | 39 | */ |
45 | 40 | ||
46 | /*! | 41 | /*! |
47 | Displays a QMessageBox with parent \a parent and caption \a caption. | 42 | Displays a QMessageBox with parent \a parent and caption \a caption. |
48 | The message displayed is "Are you sure you want to delete: ", | 43 | The message displayed is "Are you sure you want to delete: ", |
49 | followed by \a object. | 44 | followed by \a object. |
50 | */ | 45 | */ |
51 | bool QPEMessageBox::confirmDelete( QWidget *parent, const QString & caption, | 46 | bool QPEMessageBox::confirmDelete( QWidget *parent, const QString & caption, |
52 | const QString & object ) | 47 | const QString & object ) |
53 | { | 48 | { |
54 | QString msg = QObject::tr("<qt>Are you sure you want to delete\n %1?</qt>").arg( Qtopia::escapeString( object ) ); // use <qt> an esacpe String.... | 49 | QString msg = QObject::tr("<qt>Are you sure you want to delete\n %1?</qt>").arg( Qtopia::escapeString( object ) ); // use <qt> an esacpe String.... |
55 | int r = QMessageBox::warning( parent, caption, msg, QMessageBox::Yes, | 50 | int r = QMessageBox::warning( parent, caption, msg, QMessageBox::Yes, |
56 | QMessageBox::No|QMessageBox::Default| | 51 | QMessageBox::No|QMessageBox::Default| |
57 | QMessageBox::Escape, 0 ); | 52 | QMessageBox::Escape, 0 ); |
58 | 53 | ||
59 | return r == QMessageBox::Yes; | 54 | return r == QMessageBox::Yes; |
60 | } | 55 | } |
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 | |||
@@ -1,182 +1,170 @@ | |||
1 | 1 | ||
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
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; |
19 | char *m_name; | 20 | char *m_name; |
20 | QColorGroup::ColorRole m_set; | 21 | QColorGroup::ColorRole m_set; |
21 | QColorGroup::ColorRole m_get; | 22 | QColorGroup::ColorRole m_get; |
22 | }; | 23 | }; |
23 | 24 | ||
24 | 25 | ||
25 | 26 | ||
26 | static const color_fix_t apps_that_need_special_colors [] = { | 27 | static const color_fix_t apps_that_need_special_colors [] = { |
27 | { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, | 28 | { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, |
28 | { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, | 29 | { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, |
29 | 30 | ||
30 | { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } | 31 | { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } |
31 | }; | 32 | }; |
32 | 33 | ||
33 | #endif | 34 | #endif |
34 | 35 | ||
35 | #ifndef OPIE_NO_OVERRIDE_QT | 36 | #ifndef OPIE_NO_OVERRIDE_QT |
36 | 37 | ||
37 | static const char * const apps_that_need_pointsizes_times_10 [] = { | 38 | static const char * const apps_that_need_pointsizes_times_10 [] = { |
38 | "HancomMobileWord", | 39 | "HancomMobileWord", |
39 | "hancomsheet", | 40 | "hancomsheet", |
40 | "HancomPresenterViewer", | 41 | "HancomPresenterViewer", |
41 | 42 | ||
42 | 0 | 43 | 0 |
43 | }; | 44 | }; |
44 | 45 | ||
45 | 46 | ||
46 | 47 | ||
47 | 48 | ||
48 | int Opie::force_appearance = 0; | 49 | int Opie::force_appearance = 0; |
49 | 50 | ||
50 | 51 | ||
51 | // Return the *real* name of the binary - not just a quick guess | 52 | // Return the *real* name of the binary - not just a quick guess |
52 | // by looking at argv [0] (which could be anything) | 53 | // by looking at argv [0] (which could be anything) |
53 | 54 | ||
54 | static void binaryNameFree ( ) | 55 | static void binaryNameFree ( ) |
55 | { | 56 | { |
56 | ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here | 57 | ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here |
57 | } | 58 | } |
58 | 59 | ||
59 | const char *Opie::binaryName ( ) | 60 | const char *Opie::binaryName ( ) |
60 | { | 61 | { |
61 | static const char *appname = 0; | 62 | static const char *appname = 0; |
62 | 63 | ||
63 | if ( !appname ) { | 64 | if ( !appname ) { |
64 | char dst [PATH_MAX + 1]; | 65 | char dst [PATH_MAX + 1]; |
65 | int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); | 66 | int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); |
66 | 67 | ||
67 | if ( l <= 0 ) | 68 | if ( l <= 0 ) |
68 | l = 0; | 69 | l = 0; |
69 | 70 | ||
70 | dst [l] = 0; | 71 | dst [l] = 0; |
71 | const char *b = ::strrchr ( dst, '/' ); | 72 | const char *b = ::strrchr ( dst, '/' ); |
72 | appname = ::strdup ( b ? b + 1 : dst ); | 73 | appname = ::strdup ( b ? b + 1 : dst ); |
73 | 74 | ||
74 | ::atexit ( binaryNameFree ); | 75 | ::atexit ( binaryNameFree ); |
75 | } | 76 | } |
76 | return appname; | 77 | return appname; |
77 | } | 78 | } |
78 | 79 | ||
79 | #else | 80 | #else |
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 | } |
115 | } | 113 | } |
116 | #endif | 114 | #endif |
117 | QApplication::polish ( w ); | 115 | QApplication::polish ( w ); |
118 | } | 116 | } |
119 | #endif | 117 | #endif |
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 | } |
138 | return sl; | 134 | return sl; |
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 | |||
@@ -11,67 +11,67 @@ | |||
11 | #include <qimage.h> | 11 | #include <qimage.h> |
12 | #include <qlayout.h> | 12 | #include <qlayout.h> |
13 | 13 | ||
14 | #define INCLUDE_MENUITEM_DEF | 14 | #define INCLUDE_MENUITEM_DEF |
15 | #include <qpopupmenu.h> | 15 | #include <qpopupmenu.h> |
16 | #undef INCLUDE_MENUITEM_DEF | 16 | #undef INCLUDE_MENUITEM_DEF |
17 | 17 | ||
18 | 18 | ||
19 | #define QTOPIA_INTERNAL_LANGLIST | 19 | #define QTOPIA_INTERNAL_LANGLIST |
20 | #define QTOPIA_INTERNAL_INITAPP | 20 | #define QTOPIA_INTERNAL_INITAPP |
21 | #define QTOPIA_INTERNAL_PRELOADACCESS | 21 | #define QTOPIA_INTERNAL_PRELOADACCESS |
22 | #include <qtopia/qpeapplication.h> | 22 | #include <qtopia/qpeapplication.h> |
23 | #include <qtopia/global.h> | 23 | #include <qtopia/global.h> |
24 | 24 | ||
25 | #define QTOPIA_INTERNAL_MIMEEXT | 25 | #define QTOPIA_INTERNAL_MIMEEXT |
26 | #define QTOPIA_INTERNAL_PRELOADACCESS | 26 | #define QTOPIA_INTERNAL_PRELOADACCESS |
27 | #define QTOPIA_INTERNAL_APPLNKASSIGN | 27 | #define QTOPIA_INTERNAL_APPLNKASSIGN |
28 | #include <qtopia/applnk.h> | 28 | #include <qtopia/applnk.h> |
29 | #undef QTOPIA_INTERNAL_PRELOADACCESS | 29 | #undef QTOPIA_INTERNAL_PRELOADACCESS |
30 | #undef QTOPIA_INTERNAL_MIMEEXT | 30 | #undef QTOPIA_INTERNAL_MIMEEXT |
31 | #undef QTOPIA_INTERNAL_APPLNKASSIGN | 31 | #undef QTOPIA_INTERNAL_APPLNKASSIGN |
32 | 32 | ||
33 | #include "categoryedit_p.h" | 33 | #include "categoryedit_p.h" |
34 | #include <qtopia/categorymenu.h> | 34 | #include <qtopia/categorymenu.h> |
35 | #include <qtopia/categoryselect.h> | 35 | #include <qtopia/categoryselect.h> |
36 | #include <qtopia/categorywidget.h> | 36 | #include <qtopia/categorywidget.h> |
37 | 37 | ||
38 | #define QTOPIA_INTERNAL_LANGLIST | 38 | #define QTOPIA_INTERNAL_LANGLIST |
39 | #include <qtopia/config.h> | 39 | #include <qtopia/config.h> |
40 | #undef QTOPIA_INTERNAL_LANGLIST | 40 | #undef QTOPIA_INTERNAL_LANGLIST |
41 | 41 | ||
42 | #include <qtopia/datebookdb.h> | 42 | #include <qtopia/datebookdb.h> |
43 | #include <qtopia/datebookmonth.h> | 43 | #include <qtopia/datebookmonth.h> |
44 | 44 | ||
45 | #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL | 45 | #define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL |
46 | #include <qtopia/tzselect.h> | 46 | #include <qtopia/tzselect.h> |
47 | #undef QTOPIA_INTERNAL_TZSELECT_INC_LOCAL | 47 | #undef QTOPIA_INTERNAL_TZSELECT_INC_LOCAL |
48 | 48 | ||
49 | #include <qtopia/resource.h> | 49 | #include <qtopia/resource.h> |
50 | #include <qtopia/version.h> | 50 | #include <qtopia/version.h> |
51 | #include <qtopia/storage.h> | 51 | #include <qtopia/storage.h> |
52 | #include <qtopia/qpestyle.h> | 52 | #include <qtopia/qpestyle.h> |
53 | 53 | ||
54 | #include <qtopia/alarmserver.h> | 54 | #include <qtopia/alarmserver.h> |
55 | #include <qtopia/calendar.h> | 55 | #include <qtopia/calendar.h> |
56 | #include <qtopia/fileselector.h> | 56 | #include <qtopia/fileselector.h> |
57 | #include <qtopia/filemanager.h> | 57 | #include <qtopia/filemanager.h> |
58 | #include <qtopia/qcom.h> | 58 | #include <qtopia/qcom.h> |
59 | #include <qtopia/qcopenvelope_qws.h> | 59 | #include <qtopia/qcopenvelope_qws.h> |
60 | #include <qtopia/qpemessagebox.h> | 60 | #include <qtopia/qpemessagebox.h> |
61 | 61 | ||
62 | 62 | ||
63 | #undef QTOPIA_INTERAL_PRELOADACCESS | 63 | #undef QTOPIA_INTERAL_PRELOADACCESS |
64 | #undef QTOPIA_INTERNAL_INITAPP | 64 | #undef QTOPIA_INTERNAL_INITAPP |
65 | #undef QTOPIA_INTERNAL_LANGLIST | 65 | #undef QTOPIA_INTERNAL_LANGLIST |
66 | 66 | ||
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 |