author | eilers <eilers> | 2003-09-01 12:22:09 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-09-01 12:22:09 (UTC) |
commit | 68a308e1166ec4462dea188c3141c7f884f5d6b5 (patch) (unidiff) | |
tree | c999c2b0af1f5f2339582c9609d1cb9168d08bcf /library | |
parent | 45a479040238764f97eed267c74aed6cf27eece8 (diff) | |
download | opie-68a308e1166ec4462dea188c3141c7f884f5d6b5.zip opie-68a308e1166ec4462dea188c3141c7f884f5d6b5.tar.gz opie-68a308e1166ec4462dea188c3141c7f884f5d6b5.tar.bz2 |
Fix to compile..
-rw-r--r-- | library/qpeapplication.cpp | 4 | ||||
-rw-r--r-- | library/qpeapplication.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 71ec5b3..bf353d4 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1028,116 +1028,116 @@ static int deforient = -1; | |||
1028 | int QPEApplication::defaultRotation() | 1028 | int QPEApplication::defaultRotation() |
1029 | { | 1029 | { |
1030 | if ( deforient < 0 ) { | 1030 | if ( deforient < 0 ) { |
1031 | QString d = getenv( "QWS_DISPLAY" ); | 1031 | QString d = getenv( "QWS_DISPLAY" ); |
1032 | if ( d.contains( "Rot90" ) ) { | 1032 | if ( d.contains( "Rot90" ) ) { |
1033 | deforient = 90; | 1033 | deforient = 90; |
1034 | } | 1034 | } |
1035 | else if ( d.contains( "Rot180" ) ) { | 1035 | else if ( d.contains( "Rot180" ) ) { |
1036 | deforient = 180; | 1036 | deforient = 180; |
1037 | } | 1037 | } |
1038 | else if ( d.contains( "Rot270" ) ) { | 1038 | else if ( d.contains( "Rot270" ) ) { |
1039 | deforient = 270; | 1039 | deforient = 270; |
1040 | } | 1040 | } |
1041 | else { | 1041 | else { |
1042 | deforient = 0; | 1042 | deforient = 0; |
1043 | } | 1043 | } |
1044 | } | 1044 | } |
1045 | return deforient; | 1045 | return deforient; |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | /*! | 1048 | /*! |
1049 | \internal | 1049 | \internal |
1050 | */ | 1050 | */ |
1051 | void QPEApplication::setDefaultRotation( int r ) | 1051 | void QPEApplication::setDefaultRotation( int r ) |
1052 | { | 1052 | { |
1053 | if ( qApp->type() == GuiServer ) { | 1053 | if ( qApp->type() == GuiServer ) { |
1054 | deforient = r; | 1054 | deforient = r; |
1055 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 1055 | setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
1056 | Config config("qpe"); | 1056 | Config config("qpe"); |
1057 | config.setGroup( "Rotation" ); | 1057 | config.setGroup( "Rotation" ); |
1058 | config.writeEntry( "Rot", r ); | 1058 | config.writeEntry( "Rot", r ); |
1059 | } | 1059 | } |
1060 | else { | 1060 | else { |
1061 | #ifndef QT_NO_COP | 1061 | #ifndef QT_NO_COP |
1062 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 1062 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
1063 | e << r; | 1063 | e << r; |
1064 | } | 1064 | } |
1065 | #endif | 1065 | #endif |
1066 | 1066 | ||
1067 | } | 1067 | } |
1068 | } | 1068 | } |
1069 | 1069 | ||
1070 | #include <qgfx_qws.h> | 1070 | #include <qgfx_qws.h> |
1071 | #include <qwindowsystem_qws.h> | 1071 | #include <qwindowsystem_qws.h> |
1072 | #include <qpixmapcache.h> | 1072 | #include <qpixmapcache.h> |
1073 | 1073 | ||
1074 | extern void qws_clearLoadedFonts(); | 1074 | extern void qws_clearLoadedFonts(); |
1075 | 1075 | ||
1076 | inline void QPEApplication::setCurrentMode( int x, int y, int depth ) | 1076 | void QPEApplication::setCurrentMode( int x, int y, int depth ) |
1077 | { | 1077 | { |
1078 | // Reset the caches | 1078 | // Reset the caches |
1079 | qws_clearLoadedFonts(); | 1079 | qws_clearLoadedFonts(); |
1080 | QPixmapCache::clear(); | 1080 | QPixmapCache::clear(); |
1081 | 1081 | ||
1082 | // Change the screen mode | 1082 | // Change the screen mode |
1083 | qt_screen->setMode(x, y, depth); | 1083 | qt_screen->setMode(x, y, depth); |
1084 | 1084 | ||
1085 | if ( qApp->type() == GuiServer ) { | 1085 | if ( qApp->type() == GuiServer ) { |
1086 | // Reconfigure the GuiServer | 1086 | // Reconfigure the GuiServer |
1087 | qwsServer->beginDisplayReconfigure(); | 1087 | qwsServer->beginDisplayReconfigure(); |
1088 | qwsServer->endDisplayReconfigure(); | 1088 | qwsServer->endDisplayReconfigure(); |
1089 | 1089 | ||
1090 | // Get all the running apps to reset | 1090 | // Get all the running apps to reset |
1091 | QCopEnvelope env( "QPE/System", "reset()" ); | 1091 | QCopEnvelope env( "QPE/System", "reset()" ); |
1092 | } | 1092 | } |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | inline void QPEApplication::reset() { | 1095 | void QPEApplication::reset() { |
1096 | // Reconnect to the screen | 1096 | // Reconnect to the screen |
1097 | qt_screen->disconnect(); | 1097 | qt_screen->disconnect(); |
1098 | qt_screen->connect( QString::null ); | 1098 | qt_screen->connect( QString::null ); |
1099 | 1099 | ||
1100 | // Redraw everything | 1100 | // Redraw everything |
1101 | applyStyle(); | 1101 | applyStyle(); |
1102 | } | 1102 | } |
1103 | 1103 | ||
1104 | /*! | 1104 | /*! |
1105 | \internal | 1105 | \internal |
1106 | */ | 1106 | */ |
1107 | void QPEApplication::applyStyle() | 1107 | void QPEApplication::applyStyle() |
1108 | { | 1108 | { |
1109 | Config config( "qpe" ); | 1109 | Config config( "qpe" ); |
1110 | config.setGroup( "Appearance" ); | 1110 | config.setGroup( "Appearance" ); |
1111 | 1111 | ||
1112 | #if QT_VERSION > 233 | 1112 | #if QT_VERSION > 233 |
1113 | // don't block ourselves ... | 1113 | // don't block ourselves ... |
1114 | Opie::force_appearance = 0; | 1114 | Opie::force_appearance = 0; |
1115 | 1115 | ||
1116 | static QString appname = Opie::binaryName ( ); | 1116 | static QString appname = Opie::binaryName ( ); |
1117 | 1117 | ||
1118 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 1118 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
1119 | int nostyle = 0; | 1119 | int nostyle = 0; |
1120 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 1120 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
1121 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 1121 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
1122 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 1122 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
1123 | break; | 1123 | break; |
1124 | } | 1124 | } |
1125 | } | 1125 | } |
1126 | 1126 | ||
1127 | // Widget style | 1127 | // Widget style |
1128 | QString style = config.readEntry( "Style", "FlatStyle" ); | 1128 | QString style = config.readEntry( "Style", "FlatStyle" ); |
1129 | 1129 | ||
1130 | // don't set a custom style | 1130 | // don't set a custom style |
1131 | if ( nostyle & Opie::Force_Style ) | 1131 | if ( nostyle & Opie::Force_Style ) |
1132 | style = "FlatStyle"; | 1132 | style = "FlatStyle"; |
1133 | 1133 | ||
1134 | internalSetStyle ( style ); | 1134 | internalSetStyle ( style ); |
1135 | 1135 | ||
1136 | // Colors - from /etc/colors/Liquid.scheme | 1136 | // Colors - from /etc/colors/Liquid.scheme |
1137 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); | 1137 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); |
1138 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); | 1138 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); |
1139 | QPalette pal( btncolor, bgcolor ); | 1139 | QPalette pal( btncolor, bgcolor ); |
1140 | QString color = config.readEntry( "Highlight", "#73adef" ); | 1140 | QString color = config.readEntry( "Highlight", "#73adef" ); |
1141 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1141 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1142 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1142 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1143 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1143 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 42810e8..69e0058 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -71,97 +71,97 @@ public: | |||
71 | }; | 71 | }; |
72 | 72 | ||
73 | enum screenSaverHint { | 73 | enum screenSaverHint { |
74 | Disable = 0, | 74 | Disable = 0, |
75 | DisableLightOff = 1, | 75 | DisableLightOff = 1, |
76 | DisableSuspend = 2, | 76 | DisableSuspend = 2, |
77 | Enable = 100 | 77 | Enable = 100 |
78 | }; | 78 | }; |
79 | 79 | ||
80 | static void setInputMethodHint( QWidget *, InputMethodHint ); | 80 | static void setInputMethodHint( QWidget *, InputMethodHint ); |
81 | static InputMethodHint inputMethodHint( QWidget * ); | 81 | static InputMethodHint inputMethodHint( QWidget * ); |
82 | 82 | ||
83 | void showMainWidget( QWidget*, bool nomax=FALSE ); | 83 | void showMainWidget( QWidget*, bool nomax=FALSE ); |
84 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); | 84 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); |
85 | static void showDialog( QDialog*, bool nomax=FALSE ); | 85 | static void showDialog( QDialog*, bool nomax=FALSE ); |
86 | static int execDialog( QDialog*, bool nomax=FALSE ); | 86 | static int execDialog( QDialog*, bool nomax=FALSE ); |
87 | /* Merge setTempScreenSaverMode */ | 87 | /* Merge setTempScreenSaverMode */ |
88 | #ifdef QTOPIA_INTERNAL_INITAPP | 88 | #ifdef QTOPIA_INTERNAL_INITAPP |
89 | void initApp( int argv, char **argv ); | 89 | void initApp( int argv, char **argv ); |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | static void setKeepRunning(); | 92 | static void setKeepRunning(); |
93 | bool keepRunning() const; | 93 | bool keepRunning() const; |
94 | 94 | ||
95 | bool keyboardGrabbed() const; | 95 | bool keyboardGrabbed() const; |
96 | 96 | ||
97 | int exec(); | 97 | int exec(); |
98 | 98 | ||
99 | signals: | 99 | signals: |
100 | void clientMoused(); | 100 | void clientMoused(); |
101 | void timeChanged(); | 101 | void timeChanged(); |
102 | void clockChanged( bool pm ); | 102 | void clockChanged( bool pm ); |
103 | void micChanged( bool muted ); | 103 | void micChanged( bool muted ); |
104 | void volumeChanged( bool muted ); | 104 | void volumeChanged( bool muted ); |
105 | void appMessage( const QCString& msg, const QByteArray& data); | 105 | void appMessage( const QCString& msg, const QByteArray& data); |
106 | void weekChanged( bool startOnMonday ); | 106 | void weekChanged( bool startOnMonday ); |
107 | void dateFormatChanged( DateFormat ); | 107 | void dateFormatChanged( DateFormat ); |
108 | void flush(); | 108 | void flush(); |
109 | void reload(); | 109 | void reload(); |
110 | /* linkChanged signal */ | 110 | /* linkChanged signal */ |
111 | 111 | ||
112 | private slots: | 112 | private slots: |
113 | void systemMessage( const QCString &msg, const QByteArray &data ); | 113 | void systemMessage( const QCString &msg, const QByteArray &data ); |
114 | void pidMessage( const QCString &msg, const QByteArray &data ); | 114 | void pidMessage( const QCString &msg, const QByteArray &data ); |
115 | void removeSenderFromStylusDict(); | 115 | void removeSenderFromStylusDict(); |
116 | void hideOrQuit(); | 116 | void hideOrQuit(); |
117 | 117 | ||
118 | private: | 118 | private: |
119 | inline QWidget *nextWidget( QWidgetList*, QWidget* ); | 119 | QWidget *nextWidget( QWidgetList*, QWidget* ); |
120 | 120 | ||
121 | protected: | 121 | protected: |
122 | bool qwsEventFilter( QWSEvent * ); | 122 | bool qwsEventFilter( QWSEvent * ); |
123 | void internalSetStyle( const QString &style ); | 123 | void internalSetStyle( const QString &style ); |
124 | void prepareForTermination(bool willrestart); | 124 | void prepareForTermination(bool willrestart); |
125 | virtual void restart(); | 125 | virtual void restart(); |
126 | virtual void shutdown(); | 126 | virtual void shutdown(); |
127 | bool eventFilter( QObject *, QEvent * ); | 127 | bool eventFilter( QObject *, QEvent * ); |
128 | void timerEvent( QTimerEvent * ); | 128 | void timerEvent( QTimerEvent * ); |
129 | bool raiseAppropriateWindow(); | 129 | bool raiseAppropriateWindow(); |
130 | virtual void tryQuit(); | 130 | virtual void tryQuit(); |
131 | #if QT_VERSION > 233 | 131 | #if QT_VERSION > 233 |
132 | virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) | 132 | virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) |
133 | #endif | 133 | #endif |
134 | private: | 134 | private: |
135 | #ifndef QT_NO_TRANSLATION | 135 | #ifndef QT_NO_TRANSLATION |
136 | void installTranslation( const QString& baseName ); | 136 | void installTranslation( const QString& baseName ); |
137 | #endif | 137 | #endif |
138 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); | 138 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); |
139 | void processQCopFile(); | 139 | void processQCopFile(); |
140 | 140 | ||
141 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 141 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
142 | QCopChannel *sysChannel; | 142 | QCopChannel *sysChannel; |
143 | QCopChannel *pidChannel; | 143 | QCopChannel *pidChannel; |
144 | #endif | 144 | #endif |
145 | QPEApplicationData *d; | 145 | QPEApplicationData *d; |
146 | 146 | ||
147 | bool reserved_sh; | 147 | bool reserved_sh; |
148 | 148 | ||
149 | 149 | ||
150 | 150 | ||
151 | }; | 151 | }; |
152 | 152 | ||
153 | inline void QPEApplication::showDialog( QDialog* d, bool nomax ) | 153 | inline void QPEApplication::showDialog( QDialog* d, bool nomax ) |
154 | { | 154 | { |
155 | QSize sh = d->sizeHint(); | 155 | QSize sh = d->sizeHint(); |
156 | int w = QMAX(sh.width(),d->width()); | 156 | int w = QMAX(sh.width(),d->width()); |
157 | int h = QMAX(sh.height(),d->height()); | 157 | int h = QMAX(sh.height(),d->height()); |
158 | if ( !nomax | 158 | if ( !nomax |
159 | && ( w > qApp->desktop()->width()*3/4 | 159 | && ( w > qApp->desktop()->width()*3/4 |
160 | || h > qApp->desktop()->height()*3/4 ) ) | 160 | || h > qApp->desktop()->height()*3/4 ) ) |
161 | { | 161 | { |
162 | d->showMaximized(); | 162 | d->showMaximized(); |
163 | } else { | 163 | } else { |
164 | d->resize(w,h); | 164 | d->resize(w,h); |
165 | d->show(); | 165 | d->show(); |
166 | } | 166 | } |
167 | } | 167 | } |