summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-05-16 19:07:01 (UTC)
committer mickeyl <mickeyl>2003-05-16 19:07:01 (UTC)
commit1ac65aca5d1219e537238330501bc441dd2a3324 (patch) (unidiff)
treef60f613028dbef184e4b2fd31c5499d1e07c6e6b
parente7dc14955879dfabf5093b06784402c4525eed2a (diff)
downloadopie-1ac65aca5d1219e537238330501bc441dd2a3324.zip
opie-1ac65aca5d1219e537238330501bc441dd2a3324.tar.gz
opie-1ac65aca5d1219e537238330501bc441dd2a3324.tar.bz2
enable opie to compile against a non-patched qt 2.3.2
to prepare the possibility of building an opie 1.0 feed for the sharp rom
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp2
-rw-r--r--library/qpeapplication.h11
-rw-r--r--library/qt_override.cpp3
-rw-r--r--library/qt_override_p.h10
4 files changed, 19 insertions, 7 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index f4db1ab..19adb00 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -956,16 +956,17 @@ void QPEApplication::setDefaultRotation( int r )
956/*! 956/*!
957 \internal 957 \internal
958*/ 958*/
959void QPEApplication::applyStyle() 959void QPEApplication::applyStyle()
960{ 960{
961 Config config( "qpe" ); 961 Config config( "qpe" );
962 config.setGroup( "Appearance" ); 962 config.setGroup( "Appearance" );
963 963
964 #if QT_VERSION > 233
964 // don't block ourselves ... 965 // don't block ourselves ...
965 Opie::force_appearance = 0; 966 Opie::force_appearance = 0;
966 967
967 static QString appname = Opie::binaryName ( ); 968 static QString appname = Opie::binaryName ( );
968 969
969 QStringList ex = config. readListEntry ( "NoStyle", ';' ); 970 QStringList ex = config. readListEntry ( "NoStyle", ';' );
970 int nostyle = 0; 971 int nostyle = 0;
971 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { 972 for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) {
@@ -1028,16 +1029,17 @@ void QPEApplication::applyStyle()
1028 fs = 10; 1029 fs = 10;
1029 } 1030 }
1030 1031
1031 setFont ( QFont ( ff, fs ), true ); 1032 setFont ( QFont ( ff, fs ), true );
1032 1033
1033 // revert to global blocking policy ... 1034 // revert to global blocking policy ...
1034 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; 1035 Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None;
1035 Opie::force_appearance &= ~nostyle; 1036 Opie::force_appearance &= ~nostyle;
1037 #endif
1036} 1038}
1037 1039
1038void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) 1040void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data )
1039{ 1041{
1040#ifdef Q_WS_QWS 1042#ifdef Q_WS_QWS
1041 QDataStream stream( data, IO_ReadOnly ); 1043 QDataStream stream( data, IO_ReadOnly );
1042 if ( msg == "applyStyle()" ) { 1044 if ( msg == "applyStyle()" ) {
1043 applyStyle(); 1045 applyStyle();
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index e35c008..65a6d33 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -113,19 +113,19 @@ protected:
113 void internalSetStyle( const QString &style ); 113 void internalSetStyle( const QString &style );
114 void prepareForTermination(bool willrestart); 114 void prepareForTermination(bool willrestart);
115 virtual void restart(); 115 virtual void restart();
116 virtual void shutdown(); 116 virtual void shutdown();
117 bool eventFilter( QObject *, QEvent * ); 117 bool eventFilter( QObject *, QEvent * );
118 void timerEvent( QTimerEvent * ); 118 void timerEvent( QTimerEvent * );
119 bool raiseAppropriateWindow(); 119 bool raiseAppropriateWindow();
120 virtual void tryQuit(); 120 virtual void tryQuit();
121 121#if QT_VERSION > 233
122 virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) 122 virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!)
123 123#endif
124private: 124private:
125#ifndef QT_NO_TRANSLATION 125#ifndef QT_NO_TRANSLATION
126 void installTranslation( const QString& baseName ); 126 void installTranslation( const QString& baseName );
127#endif 127#endif
128 void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); 128 void mapToDefaultAction( QWSKeyEvent *ke, int defKey );
129 129
130#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 130#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
131 QCopChannel *sysChannel; 131 QCopChannel *sysChannel;
@@ -178,16 +178,21 @@ inline Transformation DegToTrans ( int d )
178/* 178/*
179 * Set current rotation of Opie, and rotation for newly started apps. 179 * Set current rotation of Opie, and rotation for newly started apps.
180 * Differs from setDefaultRotation in that 1) it rotates currently running apps, 180 * Differs from setDefaultRotation in that 1) it rotates currently running apps,
181 * and 2) does not set deforient or save orientation to qpe.conf. 181 * and 2) does not set deforient or save orientation to qpe.conf.
182 */ 182 */
183 183
184inline void QPEApplication::setCurrentRotation( int r ) 184inline void QPEApplication::setCurrentRotation( int r )
185{ 185{
186 // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots
187 // for compatibility with the SharpROM use fallback to setDefaultTransformation()
188 #if QT_VERSION > 233
186 Transformation e = DegToTrans( r ); 189 Transformation e = DegToTrans( r );
187
188 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); 190 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
189 qApp->desktop()->qwsDisplay()->setTransformation( e ); 191 qApp->desktop()->qwsDisplay()->setTransformation( e );
192 #else
193 setDefaultRotation( r );
194 #endif
190} 195}
191 196
192 197
193#endif 198#endif
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index 02c48a0..edda874 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -7,17 +7,17 @@
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 15#if QT_VERSION > 233
16 16
17struct color_fix_t { 17struct 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};
@@ -163,8 +163,9 @@ void QApplication::qwsSetDecoration ( QWSDecoration *deco )
163 //qDebug ( "QApplication::qwsSetDecoration()" ); 163 //qDebug ( "QApplication::qwsSetDecoration()" );
164 164
165 if ( Opie::force_appearance & Opie::Force_Decoration ) 165 if ( Opie::force_appearance & Opie::Force_Decoration )
166 delete deco; 166 delete deco;
167 else 167 else
168 QApplication::qwsSetDecoration_NonWeak ( deco ); 168 QApplication::qwsSetDecoration_NonWeak ( deco );
169} 169}
170 170
171#endif \ No newline at end of file
diff --git a/library/qt_override_p.h b/library/qt_override_p.h
index d11917c..cb05d15 100644
--- a/library/qt_override_p.h
+++ b/library/qt_override_p.h
@@ -1,21 +1,25 @@
1#ifndef __QT_OVERRIDE_H__ 1#ifndef __QT_OVERRIDE_H__
2#define __QT_OVERRIDE_H__ 2#define __QT_OVERRIDE_H__
3 3
4#if QT_VERSION > 233
5
4namespace Opie { 6namespace Opie {
5 7
6enum ForceAppearance { 8enum ForceAppearance {
7 Force_Style = 0x01, 9 Force_Style = 0x01,
8 Force_Font = 0x02, 10 Force_Font = 0x02,
9 Force_Decoration = 0x04, 11 Force_Decoration = 0x04,
10 12
11 Force_All = 0xff, 13 Force_All = 0xff,
12 Force_None = 0x00, 14 Force_None = 0x00,
13}; 15};
14 16
15extern const char *binaryName ( ); 17extern const char *binaryName ( );
16 18
17extern int force_appearance; 19extern int force_appearance;
18 20
19} 21}
20 22
23#endif // (QT_VERSION >233)
24
21#endif 25#endif