author | zecke <zecke> | 2004-11-03 22:35:36 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-03 22:35:36 (UTC) |
commit | 9a753348fd31dfb5309408c469cce8ea5eadf8ea (patch) (unidiff) | |
tree | 4945b66e2ff79c5961f29b53906edff644ad6f5e | |
parent | da3c9206558e9b03be2270ab5e9b3406d9c3cad8 (diff) | |
download | opie-9a753348fd31dfb5309408c469cce8ea5eadf8ea.zip opie-9a753348fd31dfb5309408c469cce8ea5eadf8ea.tar.gz opie-9a753348fd31dfb5309408c469cce8ea5eadf8ea.tar.bz2 |
Switch to OApplication
-rw-r--r-- | core/launcher/serverapp.cpp | 2 | ||||
-rw-r--r-- | core/launcher/serverapp.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index be6b972..75d4ac1 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -251,97 +251,97 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe | |||
251 | } | 251 | } |
252 | 252 | ||
253 | if ( keycode == Key_NumLock ) | 253 | if ( keycode == Key_NumLock ) |
254 | if ( press ) emit numLockStateToggle(); | 254 | if ( press ) emit numLockStateToggle(); |
255 | 255 | ||
256 | if ( keycode == Key_CapsLock ) | 256 | if ( keycode == Key_CapsLock ) |
257 | if ( press ) emit capsLockStateToggle(); | 257 | if ( press ) emit capsLockStateToggle(); |
258 | 258 | ||
259 | if ( serverApp ) | 259 | if ( serverApp ) |
260 | serverApp->keyClick(keycode,press,autoRepeat); | 260 | serverApp->keyClick(keycode,press,autoRepeat); |
261 | 261 | ||
262 | return FALSE; | 262 | return FALSE; |
263 | } | 263 | } |
264 | 264 | ||
265 | enum MemState { MemUnknown, MemVeryLow, MemLow, MemNormal } memstate=MemUnknown; | 265 | enum MemState { MemUnknown, MemVeryLow, MemLow, MemNormal } memstate=MemUnknown; |
266 | 266 | ||
267 | #if defined(QPE_HAVE_MEMALERTER) | 267 | #if defined(QPE_HAVE_MEMALERTER) |
268 | QPE_MEMALERTER_IMPL | 268 | QPE_MEMALERTER_IMPL |
269 | #endif | 269 | #endif |
270 | 270 | ||
271 | 271 | ||
272 | 272 | ||
273 | //--------------------------------------------------------------------------- | 273 | //--------------------------------------------------------------------------- |
274 | 274 | ||
275 | bool ServerApplication::doRestart = FALSE; | 275 | bool ServerApplication::doRestart = FALSE; |
276 | bool ServerApplication::allowRestart = TRUE; | 276 | bool ServerApplication::allowRestart = TRUE; |
277 | bool ServerApplication::ms_is_starting = TRUE; | 277 | bool ServerApplication::ms_is_starting = TRUE; |
278 | 278 | ||
279 | void ServerApplication::switchLCD( bool on ) | 279 | void ServerApplication::switchLCD( bool on ) |
280 | { | 280 | { |
281 | if ( !qApp ) | 281 | if ( !qApp ) |
282 | return; | 282 | return; |
283 | 283 | ||
284 | ServerApplication *dapp = ServerApplication::me() ; | 284 | ServerApplication *dapp = ServerApplication::me() ; |
285 | 285 | ||
286 | if ( !dapp-> m_screensaver ) | 286 | if ( !dapp-> m_screensaver ) |
287 | return; | 287 | return; |
288 | 288 | ||
289 | if ( on ) { | 289 | if ( on ) { |
290 | dapp-> m_screensaver-> setDisplayState ( true ); | 290 | dapp-> m_screensaver-> setDisplayState ( true ); |
291 | dapp-> m_screensaver-> setBacklight ( -3 ); | 291 | dapp-> m_screensaver-> setBacklight ( -3 ); |
292 | } else | 292 | } else |
293 | dapp-> m_screensaver-> setDisplayState ( false ); | 293 | dapp-> m_screensaver-> setDisplayState ( false ); |
294 | 294 | ||
295 | 295 | ||
296 | } | 296 | } |
297 | 297 | ||
298 | ServerApplication::ServerApplication( int& argc, char **argv, Type t ) | 298 | ServerApplication::ServerApplication( int& argc, char **argv, Type t ) |
299 | : QPEApplication( argc, argv, t ) | 299 | : Opie::Core::OApplication( argc, argv, t ) |
300 | { | 300 | { |
301 | ms_is_starting = true; | 301 | ms_is_starting = true; |
302 | 302 | ||
303 | // We know we'll have lots of cached pixmaps due to App/DocLnks | 303 | // We know we'll have lots of cached pixmaps due to App/DocLnks |
304 | QPixmapCache::setCacheLimit(512); | 304 | QPixmapCache::setCacheLimit(512); |
305 | 305 | ||
306 | m_ps = new PowerStatus; | 306 | m_ps = new PowerStatus; |
307 | m_ps_last = new PowerStatus; | 307 | m_ps_last = new PowerStatus; |
308 | pa = new DesktopPowerAlerter( 0 ); | 308 | pa = new DesktopPowerAlerter( 0 ); |
309 | 309 | ||
310 | m_apm_timer = new QTimer( this ); | 310 | m_apm_timer = new QTimer( this ); |
311 | connect(m_apm_timer, SIGNAL( timeout() ), | 311 | connect(m_apm_timer, SIGNAL( timeout() ), |
312 | this, SLOT( apmTimeout() ) ); | 312 | this, SLOT( apmTimeout() ) ); |
313 | 313 | ||
314 | reloadPowerWarnSettings(); | 314 | reloadPowerWarnSettings(); |
315 | 315 | ||
316 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); | 316 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); |
317 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), | 317 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), |
318 | this, SLOT(systemMessage(const QCString&,const QByteArray&) ) ); | 318 | this, SLOT(systemMessage(const QCString&,const QByteArray&) ) ); |
319 | 319 | ||
320 | channel = new QCopChannel("QPE/Launcher", this ); | 320 | channel = new QCopChannel("QPE/Launcher", this ); |
321 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), | 321 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), |
322 | this, SLOT(launcherMessage(const QCString&,const QByteArray&) ) ); | 322 | this, SLOT(launcherMessage(const QCString&,const QByteArray&) ) ); |
323 | 323 | ||
324 | m_screensaver = new OpieScreenSaver(); | 324 | m_screensaver = new OpieScreenSaver(); |
325 | m_screensaver->setInterval( -1 ); | 325 | m_screensaver->setInterval( -1 ); |
326 | QWSServer::setScreenSaver( m_screensaver ); | 326 | QWSServer::setScreenSaver( m_screensaver ); |
327 | 327 | ||
328 | connect( qApp, SIGNAL( volumeChanged(bool) ), | 328 | connect( qApp, SIGNAL( volumeChanged(bool) ), |
329 | this, SLOT( rereadVolumes() ) ); | 329 | this, SLOT( rereadVolumes() ) ); |
330 | 330 | ||
331 | 331 | ||
332 | /* ### PluginLoader libqtopia SafeMode */ | 332 | /* ### PluginLoader libqtopia SafeMode */ |
333 | #if 0 | 333 | #if 0 |
334 | if ( PluginLoader::inSafeMode() ) | 334 | if ( PluginLoader::inSafeMode() ) |
335 | QTimer::singleShot(500, this, SLOT(showSafeMode()) ); | 335 | QTimer::singleShot(500, this, SLOT(showSafeMode()) ); |
336 | QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) ); | 336 | QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) ); |
337 | #endif | 337 | #endif |
338 | 338 | ||
339 | kf = new KeyFilter(this); | 339 | kf = new KeyFilter(this); |
340 | 340 | ||
341 | connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) ); | 341 | connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) ); |
342 | connect( kf, SIGNAL(power()), this, SIGNAL(power()) ); | 342 | connect( kf, SIGNAL(power()), this, SIGNAL(power()) ); |
343 | connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) ); | 343 | connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) ); |
344 | connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol())); | 344 | connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol())); |
345 | connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle())); | 345 | connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle())); |
346 | connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle())); | 346 | connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle())); |
347 | connect( kf, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), | 347 | connect( kf, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), |
diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h index 916d83c..27be28b 100644 --- a/core/launcher/serverapp.h +++ b/core/launcher/serverapp.h | |||
@@ -1,136 +1,136 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2003 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 | #ifndef SERVERAPP_H | 21 | #ifndef SERVERAPP_H |
22 | #define SERVERAPP_H | 22 | #define SERVERAPP_H |
23 | 23 | ||
24 | #include <qtopia/qpeapplication.h> | 24 | #include <opie2/oapplication.h> |
25 | 25 | ||
26 | #include <qwidget.h> | 26 | #include <qwidget.h> |
27 | #ifdef QWS | 27 | #ifdef QWS |
28 | #include <qwindowsystem_qws.h> | 28 | #include <qwindowsystem_qws.h> |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #include "shutdownimpl.h" | 31 | #include "shutdownimpl.h" |
32 | 32 | ||
33 | class PowerStatus; | 33 | class PowerStatus; |
34 | class DesktopPowerAlerter; | 34 | class DesktopPowerAlerter; |
35 | 35 | ||
36 | class OpieScreenSaver; | 36 | class OpieScreenSaver; |
37 | namespace Opie { | 37 | namespace Opie { |
38 | namespace Core { | 38 | namespace Core { |
39 | class ODeviceButton; | 39 | class ODeviceButton; |
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
43 | struct QCopKeyRegister { | 43 | struct QCopKeyRegister { |
44 | QCopKeyRegister(); | 44 | QCopKeyRegister(); |
45 | QCopKeyRegister( int k, const QCString&, const QCString& ); | 45 | QCopKeyRegister( int k, const QCString&, const QCString& ); |
46 | int keyCode()const; | 46 | int keyCode()const; |
47 | QCString channel()const; | 47 | QCString channel()const; |
48 | QCString message()const; | 48 | QCString message()const; |
49 | inline bool send(); | 49 | inline bool send(); |
50 | 50 | ||
51 | private: | 51 | private: |
52 | int m_keyCode; | 52 | int m_keyCode; |
53 | QCString m_channel, m_message; | 53 | QCString m_channel, m_message; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | typedef QMap<int, QCopKeyRegister> KeyRegisterList; | 56 | typedef QMap<int, QCopKeyRegister> KeyRegisterList; |
57 | 57 | ||
58 | class KeyFilter : public QObject { | 58 | class KeyFilter : public QObject { |
59 | Q_OBJECT | 59 | Q_OBJECT |
60 | public: | 60 | public: |
61 | KeyFilter(QObject* parent); | 61 | KeyFilter(QObject* parent); |
62 | void registerKey( const QCopKeyRegister& ); | 62 | void registerKey( const QCopKeyRegister& ); |
63 | void unregisterKey( const QCopKeyRegister& ); | 63 | void unregisterKey( const QCopKeyRegister& ); |
64 | bool checkButtonAction( bool, int, int, int ); | 64 | bool checkButtonAction( bool, int, int, int ); |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | protected: | 68 | protected: |
69 | void timerEvent(QTimerEvent*); | 69 | void timerEvent(QTimerEvent*); |
70 | 70 | ||
71 | signals: | 71 | signals: |
72 | void launch(); | 72 | void launch(); |
73 | void power(); | 73 | void power(); |
74 | void backlight(); | 74 | void backlight(); |
75 | void symbol(); | 75 | void symbol(); |
76 | void numLockStateToggle(); | 76 | void numLockStateToggle(); |
77 | void capsLockStateToggle(); | 77 | void capsLockStateToggle(); |
78 | void activate(const Opie::Core::ODeviceButton*,bool); | 78 | void activate(const Opie::Core::ODeviceButton*,bool); |
79 | 79 | ||
80 | 80 | ||
81 | private: | 81 | private: |
82 | bool keyRegistered( int key ); | 82 | bool keyRegistered( int key ); |
83 | int held_tid; | 83 | int held_tid; |
84 | const Opie::Core::ODeviceButton* heldButton; | 84 | const Opie::Core::ODeviceButton* heldButton; |
85 | KeyRegisterList m_keys; | 85 | KeyRegisterList m_keys; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | class ServerApplication : public QPEApplication | 88 | class ServerApplication : public Opie::Core::OApplication |
89 | { | 89 | { |
90 | Q_OBJECT | 90 | Q_OBJECT |
91 | public: | 91 | public: |
92 | ServerApplication( int& argc, char **argv, Type t ); | 92 | ServerApplication( int& argc, char **argv, Type t ); |
93 | ~ServerApplication(); | 93 | ~ServerApplication(); |
94 | 94 | ||
95 | static bool doRestart; | 95 | static bool doRestart; |
96 | static bool allowRestart; | 96 | static bool allowRestart; |
97 | static bool screenLocked(); | 97 | static bool screenLocked(); |
98 | static void login(bool at_poweron); | 98 | static void login(bool at_poweron); |
99 | 99 | ||
100 | static bool isStarting(); | 100 | static bool isStarting(); |
101 | 101 | ||
102 | static void switchLCD ( bool on ); // only for togglePower in Desktop | 102 | static void switchLCD ( bool on ); // only for togglePower in Desktop |
103 | static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar | 103 | static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar |
104 | 104 | ||
105 | void restart(); | 105 | void restart(); |
106 | int exec(); | 106 | int exec(); |
107 | 107 | ||
108 | signals: | 108 | signals: |
109 | void menu(); | 109 | void menu(); |
110 | void home(); | 110 | void home(); |
111 | void launch(); | 111 | void launch(); |
112 | void power(); | 112 | void power(); |
113 | void backlight(); | 113 | void backlight(); |
114 | void symbol(); | 114 | void symbol(); |
115 | void numLockStateToggle(); | 115 | void numLockStateToggle(); |
116 | void capsLockStateToggle(); | 116 | void capsLockStateToggle(); |
117 | void prepareForRestart(); | 117 | void prepareForRestart(); |
118 | void activate(const Opie::Core::ODeviceButton*,bool); | 118 | void activate(const Opie::Core::ODeviceButton*,bool); |
119 | 119 | ||
120 | public slots: | 120 | public slots: |
121 | virtual void systemMessage( const QCString& msg, const QByteArray& ); | 121 | virtual void systemMessage( const QCString& msg, const QByteArray& ); |
122 | virtual void launcherMessage( const QCString& msg, const QByteArray& ); | 122 | virtual void launcherMessage( const QCString& msg, const QByteArray& ); |
123 | void rereadVolumes(); | 123 | void rereadVolumes(); |
124 | 124 | ||
125 | protected: | 125 | protected: |
126 | bool eventFilter( QObject*, QEvent* ); | 126 | bool eventFilter( QObject*, QEvent* ); |
127 | #ifdef Q_WS_QWS | 127 | #ifdef Q_WS_QWS |
128 | bool qwsEventFilter( QWSEvent * ); | 128 | bool qwsEventFilter( QWSEvent * ); |
129 | #endif | 129 | #endif |
130 | void shutdown(); | 130 | void shutdown(); |
131 | void checkMemory(); | 131 | void checkMemory(); |
132 | bool recoverMemory(); | 132 | bool recoverMemory(); |
133 | void keyClick(int keycode, bool press, bool repeat); | 133 | void keyClick(int keycode, bool press, bool repeat); |
134 | void screenClick(bool press); | 134 | void screenClick(bool press); |
135 | 135 | ||
136 | protected slots: | 136 | protected slots: |