-rw-r--r-- | library/library.pro | 6 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 10 | ||||
-rw-r--r-- | library/qt_override.cpp | 40 |
3 files changed, 37 insertions, 19 deletions
diff --git a/library/library.pro b/library/library.pro index 80a0f62..ab1f451 100644 --- a/library/library.pro +++ b/library/library.pro | |||
@@ -57,95 +57,101 @@ HEADERS = calendar.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 | 63 | ||
64 | SOURCES= calendar.cpp \ | 64 | SOURCES= calendar.cpp \ |
65 | global.cpp \ | 65 | global.cpp \ |
66 | xmlreader.cpp \ | 66 | xmlreader.cpp \ |
67 | mimetype.cpp \ | 67 | mimetype.cpp \ |
68 | menubutton.cpp \ | 68 | menubutton.cpp \ |
69 | network.cpp \ | 69 | network.cpp \ |
70 | networkinterface.cpp \ | 70 | networkinterface.cpp \ |
71 | filemanager.cpp \ | 71 | filemanager.cpp \ |
72 | fontmanager.cpp \ | 72 | fontmanager.cpp \ |
73 | qdawg.cpp \ | 73 | qdawg.cpp \ |
74 | datebookmonth.cpp \ | 74 | datebookmonth.cpp \ |
75 | fileselector.cpp \ | 75 | fileselector.cpp \ |
76 | imageedit.cpp \ | 76 | imageedit.cpp \ |
77 | resource.cpp \ | 77 | resource.cpp \ |
78 | qpedecoration_qws.cpp \ | 78 | qpedecoration_qws.cpp \ |
79 | qcopenvelope_qws.cpp \ | 79 | qcopenvelope_qws.cpp \ |
80 | qpeapplication.cpp \ | 80 | qpeapplication.cpp \ |
81 | qpestyle.cpp \ | 81 | qpestyle.cpp \ |
82 | qpedialog.cpp \ | 82 | qpedialog.cpp \ |
83 | lightstyle.cpp \ | 83 | lightstyle.cpp \ |
84 | config.cpp \ | 84 | config.cpp \ |
85 | applnk.cpp \ | 85 | applnk.cpp \ |
86 | sound.cpp \ | 86 | sound.cpp \ |
87 | tzselect.cpp \ | 87 | tzselect.cpp \ |
88 | qmath.c \ | 88 | qmath.c \ |
89 | datebookdb.cpp \ | 89 | datebookdb.cpp \ |
90 | alarmserver.cpp \ | 90 | alarmserver.cpp \ |
91 | password.cpp \ | 91 | password.cpp \ |
92 | process.cpp \ | 92 | process.cpp \ |
93 | process_unix.cpp \ | 93 | process_unix.cpp \ |
94 | timestring.cpp \ | 94 | timestring.cpp \ |
95 | fontdatabase.cpp \ | 95 | fontdatabase.cpp \ |
96 | power.cpp \ | 96 | power.cpp \ |
97 | storage.cpp \ | 97 | storage.cpp \ |
98 | qpemessagebox.cpp \ | 98 | qpemessagebox.cpp \ |
99 | backend/timeconversion.cpp \ | 99 | backend/timeconversion.cpp \ |
100 | qpedebug.cpp \ | 100 | qpedebug.cpp \ |
101 | qpemenubar.cpp \ | 101 | qpemenubar.cpp \ |
102 | qpetoolbar.cpp \ | 102 | qpetoolbar.cpp \ |
103 | backend/categories.cpp \ | 103 | backend/categories.cpp \ |
104 | backend/stringutil.cpp \ | 104 | backend/stringutil.cpp \ |
105 | backend/palmtoprecord.cpp \ | 105 | backend/palmtoprecord.cpp \ |
106 | backend/task.cpp \ | 106 | backend/task.cpp \ |
107 | backend/event.cpp \ | 107 | backend/event.cpp \ |
108 | backend/contact.cpp \ | 108 | backend/contact.cpp \ |
109 | categorymenu.cpp \ | 109 | categorymenu.cpp \ |
110 | categoryedit_p.cpp \ | 110 | categoryedit_p.cpp \ |
111 | categoryselect.cpp \ | 111 | categoryselect.cpp \ |
112 | categorywidget.cpp \ | 112 | categorywidget.cpp \ |
113 | ir.cpp \ | 113 | ir.cpp \ |
114 | backend/vcc_yacc.cpp \ | 114 | backend/vcc_yacc.cpp \ |
115 | backend/vobject.cpp \ | 115 | backend/vobject.cpp \ |
116 | findwidget_p.cpp \ | 116 | findwidget_p.cpp \ |
117 | finddialog.cpp \ | 117 | finddialog.cpp \ |
118 | lnkproperties.cpp \ | 118 | lnkproperties.cpp \ |
119 | qt_override.cpp | 119 | qt_override.cpp |
120 | 120 | ||
121 | |||
122 | |||
121 | # Qt 3 compatibility | 123 | # Qt 3 compatibility |
122 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h | 124 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h |
123 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp | 125 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp |
124 | INCLUDEPATH += $(OPIEDIR)/include backend | 126 | INCLUDEPATH += $(OPIEDIR)/include backend |
125 | LIBS += -ldl -lcrypt -lm | 127 | LIBS += -ldl -lcrypt -lm |
126 | INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui | 128 | INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui |
127 | TARGET = qpe | 129 | TARGET = qpe |
128 | DESTDIR = $(OPIEDIR)/lib$(PROJMAK) | 130 | DESTDIR = $(OPIEDIR)/lib$(PROJMAK) |
129 | VERSION = 1.5.0.1 | 131 | VERSION = 1.5.0.1 |
130 | 132 | ||
131 | TRANSLATIONS = ../i18n/de/libqpe.ts \ | 133 | TRANSLATIONS = ../i18n/de/libqpe.ts \ |
132 | ../i18n/nl/libqpe.ts \ | 134 | ../i18n/nl/libqpe.ts \ |
133 | ../i18n/xx/libqpe.ts \ | 135 | ../i18n/xx/libqpe.ts \ |
134 | ../i18n/en/libqpe.ts \ | 136 | ../i18n/en/libqpe.ts \ |
135 | ../i18n/es/libqpe.ts \ | 137 | ../i18n/es/libqpe.ts \ |
136 | ../i18n/fr/libqpe.ts \ | 138 | ../i18n/fr/libqpe.ts \ |
137 | ../i18n/hu/libqpe.ts \ | 139 | ../i18n/hu/libqpe.ts \ |
138 | ../i18n/ja/libqpe.ts \ | 140 | ../i18n/ja/libqpe.ts \ |
139 | ../i18n/ko/libqpe.ts \ | 141 | ../i18n/ko/libqpe.ts \ |
140 | ../i18n/no/libqpe.ts \ | 142 | ../i18n/no/libqpe.ts \ |
141 | ../i18n/pl/libqpe.ts \ | 143 | ../i18n/pl/libqpe.ts \ |
142 | ../i18n/pt/libqpe.ts \ | 144 | ../i18n/pt/libqpe.ts \ |
143 | ../i18n/pt_BR/libqpe.ts \ | 145 | ../i18n/pt_BR/libqpe.ts \ |
144 | ../i18n/sl/libqpe.ts \ | 146 | ../i18n/sl/libqpe.ts \ |
145 | ../i18n/zh_CN/libqpe.ts \ | 147 | ../i18n/zh_CN/libqpe.ts \ |
146 | ../i18n/it/libqpe.ts \ | 148 | ../i18n/it/libqpe.ts \ |
147 | ../i18n/zh_TW/libqpe.ts \ | 149 | ../i18n/zh_TW/libqpe.ts \ |
148 | ../i18n/da/libqpe.ts | 150 | ../i18n/da/libqpe.ts |
149 | 151 | ||
150 | 152 | ||
151 | include ( $(OPIEDIR)/include.pro ) | 153 | include ( $(OPIEDIR)/include.pro ) |
154 | |||
155 | contains( CONFIG, no-override ){ | ||
156 | DEFINES += OPIE_NO_OVERRIDE_QT | ||
157 | } | ||
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 28fb13a..feba8b6 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1063,202 +1063,208 @@ int QPEApplication::defaultRotation() | |||
1063 | /*! | 1063 | /*! |
1064 | \internal | 1064 | \internal |
1065 | */ | 1065 | */ |
1066 | void QPEApplication::setDefaultRotation( int r ) | 1066 | void QPEApplication::setDefaultRotation( int r ) |
1067 | { | 1067 | { |
1068 | if ( qApp->type() == GuiServer ) { | 1068 | if ( qApp->type() == GuiServer ) { |
1069 | deforient = r; | 1069 | deforient = r; |
1070 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 1070 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
1071 | Config config("qpe"); | 1071 | Config config("qpe"); |
1072 | config.setGroup( "Rotation" ); | 1072 | config.setGroup( "Rotation" ); |
1073 | config.writeEntry( "Rot", r ); | 1073 | config.writeEntry( "Rot", r ); |
1074 | } | 1074 | } |
1075 | else { | 1075 | else { |
1076 | #ifndef QT_NO_COP | 1076 | #ifndef QT_NO_COP |
1077 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 1077 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
1078 | e << r; | 1078 | e << r; |
1079 | } | 1079 | } |
1080 | #endif | 1080 | #endif |
1081 | 1081 | ||
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | #include <qgfx_qws.h> | 1085 | #include <qgfx_qws.h> |
1086 | #include <qwindowsystem_qws.h> | 1086 | #include <qwindowsystem_qws.h> |
1087 | #include <qpixmapcache.h> | 1087 | #include <qpixmapcache.h> |
1088 | 1088 | ||
1089 | extern void qws_clearLoadedFonts(); | 1089 | extern void qws_clearLoadedFonts(); |
1090 | 1090 | ||
1091 | void QPEApplication::setCurrentMode( int x, int y, int depth ) | 1091 | void QPEApplication::setCurrentMode( int x, int y, int depth ) |
1092 | { | 1092 | { |
1093 | // Reset the caches | 1093 | // Reset the caches |
1094 | qws_clearLoadedFonts(); | 1094 | qws_clearLoadedFonts(); |
1095 | QPixmapCache::clear(); | 1095 | QPixmapCache::clear(); |
1096 | 1096 | ||
1097 | // Change the screen mode | 1097 | // Change the screen mode |
1098 | qt_screen->setMode(x, y, depth); | 1098 | qt_screen->setMode(x, y, depth); |
1099 | 1099 | ||
1100 | if ( qApp->type() == GuiServer ) { | 1100 | if ( qApp->type() == GuiServer ) { |
1101 | // Reconfigure the GuiServer | 1101 | // Reconfigure the GuiServer |
1102 | qwsServer->beginDisplayReconfigure(); | 1102 | qwsServer->beginDisplayReconfigure(); |
1103 | qwsServer->endDisplayReconfigure(); | 1103 | qwsServer->endDisplayReconfigure(); |
1104 | 1104 | ||
1105 | // Get all the running apps to reset | 1105 | // Get all the running apps to reset |
1106 | QCopEnvelope env( "QPE/System", "reset()" ); | 1106 | QCopEnvelope env( "QPE/System", "reset()" ); |
1107 | } | 1107 | } |
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | void QPEApplication::reset() { | 1110 | void QPEApplication::reset() { |
1111 | // Reconnect to the screen | 1111 | // Reconnect to the screen |
1112 | qt_screen->disconnect(); | 1112 | qt_screen->disconnect(); |
1113 | qt_screen->connect( QString::null ); | 1113 | qt_screen->connect( QString::null ); |
1114 | 1114 | ||
1115 | // Redraw everything | 1115 | // Redraw everything |
1116 | applyStyle(); | 1116 | applyStyle(); |
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | /*! | 1119 | /*! |
1120 | \internal | 1120 | \internal |
1121 | */ | 1121 | */ |
1122 | void QPEApplication::applyStyle() | 1122 | void QPEApplication::applyStyle() |
1123 | { | 1123 | { |
1124 | Config config( "qpe" ); | 1124 | Config config( "qpe" ); |
1125 | config.setGroup( "Appearance" ); | 1125 | config.setGroup( "Appearance" ); |
1126 | 1126 | ||
1127 | #if QT_VERSION > 233 | 1127 | #if QT_VERSION > 233 |
1128 | #if !defined(OPIE_NO_OVERRIDE_QT) | ||
1128 | // don't block ourselves ... | 1129 | // don't block ourselves ... |
1129 | Opie::force_appearance = 0; | 1130 | Opie::force_appearance = 0; |
1130 | 1131 | ||
1131 | static QString appname = Opie::binaryName ( ); | 1132 | static QString appname = Opie::binaryName ( ); |
1132 | 1133 | ||
1133 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 1134 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
1134 | int nostyle = 0; | 1135 | int nostyle = 0; |
1135 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 1136 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
1136 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 1137 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
1137 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 1138 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
1138 | break; | 1139 | break; |
1139 | } | 1140 | } |
1140 | } | 1141 | } |
1142 | #else | ||
1143 | int nostyle = 0; | ||
1144 | #endif | ||
1141 | 1145 | ||
1142 | // Widget style | 1146 | // Widget style |
1143 | QString style = config.readEntry( "Style", "FlatStyle" ); | 1147 | QString style = config.readEntry( "Style", "FlatStyle" ); |
1144 | 1148 | ||
1145 | // don't set a custom style | 1149 | // don't set a custom style |
1146 | if ( nostyle & Opie::Force_Style ) | 1150 | if ( nostyle & Opie::Force_Style ) |
1147 | style = "FlatStyle"; | 1151 | style = "FlatStyle"; |
1148 | 1152 | ||
1149 | internalSetStyle ( style ); | 1153 | internalSetStyle ( style ); |
1150 | 1154 | ||
1151 | // Colors - from /etc/colors/Liquid.scheme | 1155 | // Colors - from /etc/colors/Liquid.scheme |
1152 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); | 1156 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); |
1153 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); | 1157 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); |
1154 | QPalette pal( btncolor, bgcolor ); | 1158 | QPalette pal( btncolor, bgcolor ); |
1155 | QString color = config.readEntry( "Highlight", "#73adef" ); | 1159 | QString color = config.readEntry( "Highlight", "#73adef" ); |
1156 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1160 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1157 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1161 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1158 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1162 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
1159 | color = config.readEntry( "Text", "#000000" ); | 1163 | color = config.readEntry( "Text", "#000000" ); |
1160 | pal.setColor( QColorGroup::Text, QColor( color ) ); | 1164 | pal.setColor( QColorGroup::Text, QColor( color ) ); |
1161 | color = config.readEntry( "ButtonText", "#000000" ); | 1165 | color = config.readEntry( "ButtonText", "#000000" ); |
1162 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); | 1166 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); |
1163 | color = config.readEntry( "Base", "#FFFFFF" ); | 1167 | color = config.readEntry( "Base", "#FFFFFF" ); |
1164 | pal.setColor( QColorGroup::Base, QColor( color ) ); | 1168 | pal.setColor( QColorGroup::Base, QColor( color ) ); |
1165 | 1169 | ||
1166 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 1170 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
1167 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); | 1171 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); |
1168 | 1172 | ||
1169 | setPalette( pal, TRUE ); | 1173 | setPalette( pal, TRUE ); |
1170 | 1174 | ||
1171 | // Window Decoration | 1175 | // Window Decoration |
1172 | QString dec = config.readEntry( "Decoration", "Flat" ); | 1176 | QString dec = config.readEntry( "Decoration", "Flat" ); |
1173 | 1177 | ||
1174 | // don't set a custom deco | 1178 | // don't set a custom deco |
1175 | if ( nostyle & Opie::Force_Decoration ) | 1179 | if ( nostyle & Opie::Force_Decoration ) |
1176 | dec = ""; | 1180 | dec = ""; |
1177 | 1181 | ||
1178 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); | 1182 | //qDebug ( "Setting Deco: %s -- old %s (%d)", dec.latin1(), d-> decorationName.latin1(), nostyle); |
1179 | 1183 | ||
1180 | if ( dec != d->decorationName ) { | 1184 | if ( dec != d->decorationName ) { |
1181 | qwsSetDecoration( new QPEDecoration( dec ) ); | 1185 | qwsSetDecoration( new QPEDecoration( dec ) ); |
1182 | d->decorationName = dec; | 1186 | d->decorationName = dec; |
1183 | } | 1187 | } |
1184 | 1188 | ||
1185 | // Font | 1189 | // Font |
1186 | QString ff = config.readEntry( "FontFamily", font().family() ); | 1190 | QString ff = config.readEntry( "FontFamily", font().family() ); |
1187 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 1191 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
1188 | 1192 | ||
1189 | // don't set a custom font | 1193 | // don't set a custom font |
1190 | if ( nostyle & Opie::Force_Font ) { | 1194 | if ( nostyle & Opie::Force_Font ) { |
1191 | ff = "Vera"; | 1195 | ff = "Vera"; |
1192 | fs = 10; | 1196 | fs = 10; |
1193 | } | 1197 | } |
1194 | 1198 | ||
1195 | setFont ( QFont ( ff, fs ), true ); | 1199 | setFont ( QFont ( ff, fs ), true ); |
1196 | 1200 | ||
1201 | #if !defined(OPIE_NO_OVERRIDE_QT) | ||
1197 | // revert to global blocking policy ... | 1202 | // revert to global blocking policy ... |
1198 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; | 1203 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; |
1199 | Opie::force_appearance &= ~nostyle; | 1204 | Opie::force_appearance &= ~nostyle; |
1200 | #endif | 1205 | #endif |
1206 | #endif | ||
1201 | } | 1207 | } |
1202 | 1208 | ||
1203 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) | 1209 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) |
1204 | { | 1210 | { |
1205 | #ifdef Q_WS_QWS | 1211 | #ifdef Q_WS_QWS |
1206 | QDataStream stream( data, IO_ReadOnly ); | 1212 | QDataStream stream( data, IO_ReadOnly ); |
1207 | if ( msg == "applyStyle()" ) { | 1213 | if ( msg == "applyStyle()" ) { |
1208 | applyStyle(); | 1214 | applyStyle(); |
1209 | } | 1215 | } |
1210 | else if ( msg == "toggleApplicationMenu()" ) { | 1216 | else if ( msg == "toggleApplicationMenu()" ) { |
1211 | QWidget *active = activeWindow ( ); | 1217 | QWidget *active = activeWindow ( ); |
1212 | 1218 | ||
1213 | if ( active ) { | 1219 | if ( active ) { |
1214 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); | 1220 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); |
1215 | bool oldactive = man-> isActive ( ); | 1221 | bool oldactive = man-> isActive ( ); |
1216 | 1222 | ||
1217 | man-> setActive( !man-> isActive() ); | 1223 | man-> setActive( !man-> isActive() ); |
1218 | 1224 | ||
1219 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu | 1225 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu |
1220 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); | 1226 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); |
1221 | } | 1227 | } |
1222 | } | 1228 | } |
1223 | } | 1229 | } |
1224 | else if ( msg == "setDefaultRotation(int)" ) { | 1230 | else if ( msg == "setDefaultRotation(int)" ) { |
1225 | if ( type() == GuiServer ) { | 1231 | if ( type() == GuiServer ) { |
1226 | int r; | 1232 | int r; |
1227 | stream >> r; | 1233 | stream >> r; |
1228 | setDefaultRotation( r ); | 1234 | setDefaultRotation( r ); |
1229 | } | 1235 | } |
1230 | } | 1236 | } |
1231 | else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net> | 1237 | else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net> |
1232 | if ( type() == GuiServer ) { | 1238 | if ( type() == GuiServer ) { |
1233 | int x, y, depth; | 1239 | int x, y, depth; |
1234 | stream >> x; | 1240 | stream >> x; |
1235 | stream >> y; | 1241 | stream >> y; |
1236 | stream >> depth; | 1242 | stream >> depth; |
1237 | setCurrentMode( x, y, depth ); | 1243 | setCurrentMode( x, y, depth ); |
1238 | } | 1244 | } |
1239 | } | 1245 | } |
1240 | else if ( msg == "reset()" ) { | 1246 | else if ( msg == "reset()" ) { |
1241 | if ( type() != GuiServer ) | 1247 | if ( type() != GuiServer ) |
1242 | reset(); | 1248 | reset(); |
1243 | } | 1249 | } |
1244 | else if ( msg == "setCurrentRotation(int)" ) { | 1250 | else if ( msg == "setCurrentRotation(int)" ) { |
1245 | int r; | 1251 | int r; |
1246 | stream >> r; | 1252 | stream >> r; |
1247 | setCurrentRotation( r ); | 1253 | setCurrentRotation( r ); |
1248 | } | 1254 | } |
1249 | else if ( msg == "shutdown()" ) { | 1255 | else if ( msg == "shutdown()" ) { |
1250 | if ( type() == GuiServer ) | 1256 | if ( type() == GuiServer ) |
1251 | shutdown(); | 1257 | shutdown(); |
1252 | } | 1258 | } |
1253 | else if ( msg == "quit()" ) { | 1259 | else if ( msg == "quit()" ) { |
1254 | if ( type() != GuiServer ) | 1260 | if ( type() != GuiServer ) |
1255 | tryQuit(); | 1261 | tryQuit(); |
1256 | } | 1262 | } |
1257 | else if ( msg == "forceQuit()" ) { | 1263 | else if ( msg == "forceQuit()" ) { |
1258 | if ( type() != GuiServer ) | 1264 | if ( type() != GuiServer ) |
1259 | quit(); | 1265 | quit(); |
1260 | } | 1266 | } |
1261 | else if ( msg == "restart()" ) { | 1267 | else if ( msg == "restart()" ) { |
1262 | if ( type() == GuiServer ) | 1268 | if ( type() == GuiServer ) |
1263 | restart(); | 1269 | restart(); |
1264 | } | 1270 | } |
diff --git a/library/qt_override.cpp b/library/qt_override.cpp index edda874..df5a419 100644 --- a/library/qt_override.cpp +++ b/library/qt_override.cpp | |||
@@ -1,171 +1,177 @@ | |||
1 | 1 | ||
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qwsdecoration_qws.h> | 3 | #include <qwsdecoration_qws.h> |
4 | #include <qcommonstyle.h> | 4 | #include <qcommonstyle.h> |
5 | #include <qfontdatabase.h> | 5 | #include <qfontdatabase.h> |
6 | 6 | ||
7 | #include <unistd.h> | 7 | #include <unistd.h> |
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <stdio.h> | 9 | #include <stdio.h> |
10 | #include <limits.h> | 10 | #include <limits.h> |
11 | #include <sys/param.h> // for toolchains with old libc headers | 11 | #include <sys/param.h> // for toolchains with old libc headers |
12 | 12 | ||
13 | #include "qt_override_p.h" | 13 | #include "qt_override_p.h" |
14 | 14 | ||
15 | #if QT_VERSION > 233 | 15 | #if QT_VERSION > 233 |
16 | 16 | ||
17 | struct color_fix_t { | 17 | struct color_fix_t { |
18 | char *m_app; | 18 | char *m_app; |
19 | char *m_class; | 19 | char *m_class; |
20 | char *m_name; | 20 | char *m_name; |
21 | QColorGroup::ColorRole m_set; | 21 | QColorGroup::ColorRole m_set; |
22 | QColorGroup::ColorRole m_get; | 22 | QColorGroup::ColorRole m_get; |
23 | }; | 23 | }; |
24 | 24 | ||
25 | 25 | #ifndef OPIE_NO_OVERRIDE_QT | |
26 | 26 | ||
27 | static const color_fix_t apps_that_need_special_colors [] = { | 27 | static const color_fix_t apps_that_need_special_colors [] = { |
28 | { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, | 28 | { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, |
29 | { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, | 29 | { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, |
30 | 30 | ||
31 | { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } | 31 | { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } |
32 | }; | 32 | }; |
33 | 33 | ||
34 | static const char * const apps_that_need_pointsizes_times_10 [] = { | 34 | static const char * const apps_that_need_pointsizes_times_10 [] = { |
35 | "HancomMobileWord", | 35 | "HancomMobileWord", |
36 | "hancomsheet", | 36 | "hancomsheet", |
37 | "HancomPresenterViewer", | 37 | "HancomPresenterViewer", |
38 | 38 | ||
39 | 0 | 39 | 0 |
40 | }; | 40 | }; |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | int Opie::force_appearance = 0; | 45 | int Opie::force_appearance = 0; |
46 | 46 | ||
47 | 47 | ||
48 | // Return the *real* name of the binary - not just a quick guess | 48 | // Return the *real* name of the binary - not just a quick guess |
49 | // by looking at argv [0] (which could be anything) | 49 | // by looking at argv [0] (which could be anything) |
50 | 50 | ||
51 | static void binaryNameFree ( ) | 51 | static void binaryNameFree ( ) |
52 | { | 52 | { |
53 | ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here | 53 | ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here |
54 | } | 54 | } |
55 | 55 | ||
56 | const char *Opie::binaryName ( ) | 56 | const char *Opie::binaryName ( ) |
57 | { | 57 | { |
58 | static const char *appname = 0; | 58 | static const char *appname = 0; |
59 | 59 | ||
60 | if ( !appname ) { | 60 | if ( !appname ) { |
61 | char dst [PATH_MAX + 1]; | 61 | char dst [PATH_MAX + 1]; |
62 | int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); | 62 | int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); |
63 | 63 | ||
64 | if ( l <= 0 ) | 64 | if ( l <= 0 ) |
65 | l = 0; | 65 | l = 0; |
66 | 66 | ||
67 | dst [l] = 0; | 67 | dst [l] = 0; |
68 | const char *b = ::strrchr ( dst, '/' ); | 68 | const char *b = ::strrchr ( dst, '/' ); |
69 | appname = ::strdup ( b ? b + 1 : dst ); | 69 | appname = ::strdup ( b ? b + 1 : dst ); |
70 | 70 | ||
71 | ::atexit ( binaryNameFree ); | 71 | ::atexit ( binaryNameFree ); |
72 | } | 72 | } |
73 | return appname; | 73 | return appname; |
74 | } | 74 | } |
75 | 75 | ||
76 | #else | ||
77 | int Opie::force_appearance = 0; | ||
78 | #endif | ||
76 | 79 | ||
77 | // Fix for a toolchain incompatibility (binaries compiled with | 80 | // Fix for a toolchain incompatibility (binaries compiled with |
78 | // old tcs using shared libs compiled with newer tcs) | 81 | // old tcs using shared libs compiled with newer tcs) |
79 | 82 | ||
80 | extern "C" { | 83 | extern "C" { |
81 | 84 | ||
82 | extern void __gmon_start__ ( ) __attribute__(( weak )); | 85 | extern void __gmon_start__ ( ) __attribute__(( weak )); |
83 | 86 | ||
84 | extern void __gmon_start__ ( ) | 87 | extern void __gmon_start__ ( ) |
85 | { | 88 | { |
86 | } | 89 | } |
87 | 90 | ||
88 | } | 91 | } |
89 | 92 | ||
90 | 93 | ||
91 | // Fix for apps, that use QPainter::eraseRect() which doesn't work with styles | 94 | // Fix for apps, that use QPainter::eraseRect() which doesn't work with styles |
92 | // that set a background pixmap (it would be easier to fix eraseRect(), but | 95 | // that set a background pixmap (it would be easier to fix eraseRect(), but |
93 | // TT made it an inline ...) | 96 | // TT made it an inline ...) |
94 | 97 | ||
95 | void QPEApplication::polish ( QWidget *w ) | 98 | void QPEApplication::polish ( QWidget *w ) |
96 | { | 99 | { |
100 | #ifndef OPIE_NO_OVERRIDE_QT | ||
97 | //qDebug ( "QPEApplication::polish()" ); | 101 | //qDebug ( "QPEApplication::polish()" ); |
98 | 102 | ||
99 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { | 103 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { |
100 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && | 104 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && |
101 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && | 105 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && |
102 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { | 106 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { |
103 | QPalette pal = w-> palette ( ); | 107 | QPalette pal = w-> palette ( ); |
104 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); | 108 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); |
105 | w-> setPalette ( pal ); | 109 | w-> setPalette ( pal ); |
106 | } | 110 | } |
107 | } | 111 | } |
112 | #endif | ||
108 | QApplication::polish ( w ); | 113 | QApplication::polish ( w ); |
109 | } | 114 | } |
110 | 115 | ||
111 | 116 | ||
117 | #ifndef OPIE_NO_OVERRIDE_QT | ||
112 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes | 118 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes |
113 | // were multiplied by 10 (which was incorrect) | 119 | // were multiplied by 10 (which was incorrect) |
114 | 120 | ||
115 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) | 121 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) |
116 | { | 122 | { |
117 | //qDebug ( "QFontDatabase::pointSizes()" ); | 123 | //qDebug ( "QFontDatabase::pointSizes()" ); |
118 | 124 | ||
119 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); | 125 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); |
120 | 126 | ||
121 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { | 127 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { |
122 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { | 128 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { |
123 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | 129 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) |
124 | *it *= 10; | 130 | *it *= 10; |
125 | } | 131 | } |
126 | } | 132 | } |
127 | return sl; | 133 | return sl; |
128 | } | 134 | } |
129 | 135 | ||
130 | 136 | ||
131 | // Various style/font/color related overrides for weak symbols in Qt/E, | 137 | // Various style/font/color related overrides for weak symbols in Qt/E, |
132 | // which allows us to force the usage of the global Opie appearance. | 138 | // which allows us to force the usage of the global Opie appearance. |
133 | 139 | ||
134 | void QApplication::setStyle ( QStyle *style ) | 140 | void QApplication::setStyle ( QStyle *style ) |
135 | { | 141 | { |
136 | //qDebug ( "QApplication::setStyle()" ); | 142 | //qDebug ( "QApplication::setStyle()" ); |
137 | 143 | ||
138 | if ( Opie::force_appearance & Opie::Force_Style ) | 144 | if ( Opie::force_appearance & Opie::Force_Style ) |
139 | delete style; | 145 | delete style; |
140 | else | 146 | else |
141 | QApplication::setStyle_NonWeak ( style ); | 147 | QApplication::setStyle_NonWeak ( style ); |
142 | } | 148 | } |
143 | 149 | ||
144 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) | 150 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) |
145 | { | 151 | { |
146 | //qDebug ( "QApplication::setPalette()" ); | 152 | //qDebug ( "QApplication::setPalette()" ); |
147 | 153 | ||
148 | if (!( Opie::force_appearance & Opie::Force_Style )) | 154 | if (!( Opie::force_appearance & Opie::Force_Style )) |
149 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); | 155 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); |
150 | } | 156 | } |
151 | 157 | ||
152 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) | 158 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) |
153 | { | 159 | { |
154 | //qDebug ( "QApplication::setFont()" ); | 160 | //qDebug ( "QApplication::setFont()" ); |
155 | 161 | ||
156 | if (!( Opie::force_appearance & Opie::Force_Font )) | 162 | if (!( Opie::force_appearance & Opie::Force_Font )) |
157 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); | 163 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); |
158 | } | 164 | } |
159 | 165 | ||
160 | 166 | ||
161 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) | 167 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) |
162 | { | 168 | { |
163 | //qDebug ( "QApplication::qwsSetDecoration()" ); | 169 | //qDebug ( "QApplication::qwsSetDecoration()" ); |
164 | 170 | ||
165 | if ( Opie::force_appearance & Opie::Force_Decoration ) | 171 | if ( Opie::force_appearance & Opie::Force_Decoration ) |
166 | delete deco; | 172 | delete deco; |
167 | else | 173 | else |
168 | QApplication::qwsSetDecoration_NonWeak ( deco ); | 174 | QApplication::qwsSetDecoration_NonWeak ( deco ); |
169 | } | 175 | } |
170 | 176 | #endif | |
171 | #endif \ No newline at end of file | 177 | #endif |