summaryrefslogtreecommitdiff
path: root/library
authormickeyl <mickeyl>2005-01-02 15:20:41 (UTC)
committer mickeyl <mickeyl>2005-01-02 15:20:41 (UTC)
commit71232a4e45f78041c2ab138edf45903bbf2b34ce (patch) (unidiff)
tree6c51dc86163e656c7ac6a3cd6ea7e7e0f1ab89c0 /library
parent226a83c4b4334648de408249dba61bd1f7e6dba3 (diff)
downloadopie-71232a4e45f78041c2ab138edf45903bbf2b34ce.zip
opie-71232a4e45f78041c2ab138edf45903bbf2b34ce.tar.gz
opie-71232a4e45f78041c2ab138edf45903bbf2b34ce.tar.bz2
Add the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 00d3d31..849d5b3 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -127,105 +127,118 @@ public:
127 static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; 127 static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
128 /* Merge setTempScreenSaverMode */ 128 /* Merge setTempScreenSaverMode */
129#ifdef QTOPIA_INTERNAL_INITAPP 129#ifdef QTOPIA_INTERNAL_INITAPP
130 void initApp( int argv, char **argv ); 130 void initApp( int argv, char **argv );
131#endif 131#endif
132 132
133 static void setKeepRunning(); 133 static void setKeepRunning();
134 bool keepRunning() const; 134 bool keepRunning() const;
135 135
136 bool keyboardGrabbed() const; 136 bool keyboardGrabbed() const;
137 137
138 int exec(); 138 int exec();
139 139
140signals: 140signals:
141 void clientMoused(); 141 void clientMoused();
142 void timeChanged(); 142 void timeChanged();
143 void clockChanged( bool pm ); 143 void clockChanged( bool pm );
144 void micChanged( bool muted ); 144 void micChanged( bool muted );
145 void volumeChanged( bool muted ); 145 void volumeChanged( bool muted );
146 void appMessage( const QCString& msg, const QByteArray& data); 146 void appMessage( const QCString& msg, const QByteArray& data);
147 void weekChanged( bool startOnMonday ); 147 void weekChanged( bool startOnMonday );
148 void dateFormatChanged( DateFormat ); 148 void dateFormatChanged( DateFormat );
149 void flush(); 149 void flush();
150 void reload(); 150 void reload();
151 /* linkChanged signal */ 151 /* linkChanged signal */
152 152
153private slots: 153private slots:
154 void systemMessage( const QCString &msg, const QByteArray &data ); 154 void systemMessage( const QCString &msg, const QByteArray &data );
155 void pidMessage( const QCString &msg, const QByteArray &data ); 155 void pidMessage( const QCString &msg, const QByteArray &data );
156 void removeSenderFromStylusDict(); 156 void removeSenderFromStylusDict();
157 void hideOrQuit(); 157 void hideOrQuit();
158 158
159protected: 159protected:
160 bool qwsEventFilter( QWSEvent * ); 160 bool qwsEventFilter( QWSEvent * );
161 void internalSetStyle( const QString &style ); 161 void internalSetStyle( const QString &style );
162 void prepareForTermination(bool willrestart); 162 void prepareForTermination(bool willrestart);
163 virtual void restart(); 163 virtual void restart();
164 virtual void shutdown(); 164 virtual void shutdown();
165 bool eventFilter( QObject *, QEvent * ); 165 bool eventFilter( QObject *, QEvent * );
166 void timerEvent( QTimerEvent * ); 166 void timerEvent( QTimerEvent * );
167 bool raiseAppropriateWindow(); 167 bool raiseAppropriateWindow();
168 virtual void tryQuit(); 168 virtual void tryQuit();
169#ifndef OPIE_NO_ERASE_RECT_HACKFIX 169#ifndef OPIE_NO_ERASE_RECT_HACKFIX
170 #if QT_VERSION > 233 170 #if QT_VERSION > 233
171 virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) 171 virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!)
172 #endif 172 #endif
173#endif 173#endif
174private: 174private:
175 void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); 175 void mapToDefaultAction( QWSKeyEvent *ke, int defKey );
176 void processQCopFile(); 176 void processQCopFile();
177 177
178#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 178#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
179 QCopChannel *sysChannel; 179 QCopChannel *sysChannel;
180 QCopChannel *pidChannel; 180 QCopChannel *pidChannel;
181#endif 181#endif
182 QPEApplicationData *d; 182 QPEApplicationData *d;
183 183
184 bool reserved_sh; 184 bool reserved_sh;
185 185
186}; 186};
187 187
188 188
189 189
190enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ 190enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */
191 191
192inline int TransToDeg ( Transformation t ) 192inline int TransToDeg ( Transformation t )
193{ 193{
194 int d = static_cast<int>( t ); 194 int d = static_cast<int>( t );
195 return d * 90; 195 return d * 90;
196} 196}
197 197
198inline Transformation DegToTrans ( int d ) 198inline Transformation DegToTrans ( int d )
199{ 199{
200 Transformation t = static_cast<Transformation>( d / 90 ); 200 Transformation t = static_cast<Transformation>( d / 90 );
201 return t; 201 return t;
202} 202}
203 203
204/* 204/*
205 * Set current rotation of Opie, and rotation for newly started apps. 205 * Set current rotation of Opie, and rotation for newly started apps.
206 * Differs from setDefaultRotation in that 1) it rotates currently running apps, 206 * Differs from setDefaultRotation in that 1) it rotates currently running apps,
207 * and 2) does not set deforient or save orientation to qpe.conf. 207 * and 2) does not set deforient or save orientation to qpe.conf.
208 */ 208 */
209 209
210inline void QPEApplication::setCurrentRotation( int r ) 210inline void QPEApplication::setCurrentRotation( int r )
211{ 211{
212 // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots 212 // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots
213 // for compatibility with the SharpROM use fallback to setDefaultTransformation() 213 // for compatibility with the SharpROM use fallback to setDefaultTransformation()
214#if QT_VERSION > 233 214#if QT_VERSION > 233
215 Transformation e = DegToTrans( r ); 215 Transformation e = DegToTrans( r );
216 ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); 216 ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
217 qApp->desktop()->qwsDisplay()->setTransformation( e ); 217 qApp->desktop()->qwsDisplay()->setTransformation( e );
218#else 218#else
219 setDefaultRotation( r ); 219 setDefaultRotation( r );
220#endif 220#endif
221} 221}
222 222
223/*
224 * Qtopia 1.7 SDK compatibility macros
225 * FIXME: Support Opie Quicklaunch Interface
226 */
227 #define QTOPIA_ADD_APPLICATION(NAME,IMPLEMENTATION) \
228 int main( int argc, char** argv ) \
229 { \
230 QPEApplication app = QPEApplication( argc, argv );\
231 IMPLEMENTATION* mw = new IMPLEMENTATION(); \
232 app.showMainWidget( mw ); \
233 app.exec(); \
234 }
235#define QTOPIA_MAIN // Bee-Bop-Alula
223 236
224/* 237/*
225 * -remove me 238 * -remove me
226 */ 239 */
227#ifdef Q_WS_QWS 240#ifdef Q_WS_QWS
228extern Q_EXPORT QRect qt_maxWindowRect; 241extern Q_EXPORT QRect qt_maxWindowRect;
229#endif 242#endif
230 243
231#endif 244#endif