summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--x11/libqpe-x11/qpe/qpeapplication.cpp26
-rw-r--r--x11/libqpe-x11/qpe/qpeapplication.h9
-rw-r--r--x11/libqpe-x11/qt/qwindowsystem_qws.h19
3 files changed, 53 insertions, 1 deletions
diff --git a/x11/libqpe-x11/qpe/qpeapplication.cpp b/x11/libqpe-x11/qpe/qpeapplication.cpp
index 6e4a96c..8785c74 100644
--- a/x11/libqpe-x11/qpe/qpeapplication.cpp
+++ b/x11/libqpe-x11/qpe/qpeapplication.cpp
@@ -611,48 +611,74 @@ void QPEApplication::tryQuit() {
611 } 611 }
612 processEvents(); 612 processEvents();
613 613
614 quit(); 614 quit();
615} 615}
616void QPEApplication::hideOrQuit() { 616void QPEApplication::hideOrQuit() {
617 qWarning("hide or close"); 617 qWarning("hide or close");
618 processEvents(); 618 processEvents();
619 qWarning("past processing"); 619 qWarning("past processing");
620 620
621 // If we are a preloaded application we don't actually quit, so emit 621 // If we are a preloaded application we don't actually quit, so emit
622 // a System message indicating we're quasi-closing. 622 // a System message indicating we're quasi-closing.
623 if ( d->preloaded && d->qpe_main_widget ) 623 if ( d->preloaded && d->qpe_main_widget )
624 624
625 { 625 {
626 qWarning("hiding"); 626 qWarning("hiding");
627 QCopEnvelope e("QPE/System", "fastAppHiding(QString)" ); 627 QCopEnvelope e("QPE/System", "fastAppHiding(QString)" );
628 e << d->appName; 628 e << d->appName;
629 d->qpe_main_widget->hide(); 629 d->qpe_main_widget->hide();
630 } 630 }
631 else 631 else
632 quit(); 632 quit();
633} 633}
634 634
635/*!
636 \internal
637*/
638void QPEApplication::prepareForTermination( bool willrestart )
639{
640 if ( willrestart ) {
641 // Draw a big wait icon, the image can be altered in later revisions
642 // QWidget *d = QApplication::desktop();
643 QImage img = Resource::loadImage( "launcher/new_wait" );
644 QPixmap pix;
645 pix.convertFromImage( img.smoothScale( 1 * img.width(), 1 * img.height() ) );
646 QLabel *lblWait = new QLabel( 0, "wait hack!", QWidget::WStyle_Customize |
647 QWidget::WStyle_NoBorder | QWidget::WStyle_Tool );
648 lblWait->setPixmap( pix );
649 lblWait->setAlignment( QWidget::AlignCenter );
650 lblWait->show();
651 lblWait->showMaximized();
652 }
653#ifndef SINGLE_APP
654 { QCopEnvelope envelope( "QPE/System", "forceQuit()" );
655 }
656 processEvents(); // ensure the message goes out.
657 sleep( 1 ); // You have 1 second to comply.
658#endif
659}
660
635#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) 661#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
636 662
637// The libraries with the skiff package (and possibly others) have 663// The libraries with the skiff package (and possibly others) have
638// completely useless implementations of builtin new and delete that 664// completely useless implementations of builtin new and delete that
639// use about 50% of your CPU. Here we revert to the simple libc 665// use about 50% of your CPU. Here we revert to the simple libc
640// functions. 666// functions.
641 667
642void* operator new[]( size_t size ) 668void* operator new[]( size_t size )
643{ 669{
644 return malloc( size ); 670 return malloc( size );
645} 671}
646 672
647void* operator new( size_t size ) 673void* operator new( size_t size )
648{ 674{
649 return malloc( size ); 675 return malloc( size );
650} 676}
651 677
652void operator delete[]( void* p ) 678void operator delete[]( void* p )
653{ 679{
654 free( p ); 680 free( p );
655} 681}
656 682
657void operator delete[]( void* p, size_t /*size*/ ) 683void operator delete[]( void* p, size_t /*size*/ )
658{ 684{
diff --git a/x11/libqpe-x11/qpe/qpeapplication.h b/x11/libqpe-x11/qpe/qpeapplication.h
index 2af1c66..333f331 100644
--- a/x11/libqpe-x11/qpe/qpeapplication.h
+++ b/x11/libqpe-x11/qpe/qpeapplication.h
@@ -33,61 +33,70 @@ public:
33 }; 33 };
34 static void setStylusOperation( QWidget*, StylusMode ); 34 static void setStylusOperation( QWidget*, StylusMode );
35 static StylusMode stylusOperation( QWidget* ); 35 static StylusMode stylusOperation( QWidget* );
36 36
37 enum InputMethodHint { 37 enum InputMethodHint {
38 Normal, 38 Normal,
39 AlwaysOff, 39 AlwaysOff,
40 AlwaysOn 40 AlwaysOn
41 }; 41 };
42 static void setInputMethodHint( QWidget*, InputMethodHint ); 42 static void setInputMethodHint( QWidget*, InputMethodHint );
43 static InputMethodHint inputMethodHint( QWidget* ); 43 static InputMethodHint inputMethodHint( QWidget* );
44 44
45 void showMainWidget( QWidget*, bool nomax = FALSE ); 45 void showMainWidget( QWidget*, bool nomax = FALSE );
46 void showMainDocumentWidget( QWidget*, bool nomax = FALSE ); 46 void showMainDocumentWidget( QWidget*, bool nomax = FALSE );
47 47
48 static void showDialog( QDialog*, bool nomax = FALSE ); 48 static void showDialog( QDialog*, bool nomax = FALSE );
49 static int execDialog( QDialog*, bool nomax = FALSE ); 49 static int execDialog( QDialog*, bool nomax = FALSE );
50 50
51 static void setKeepRunning(); 51 static void setKeepRunning();
52 bool keepRunning()const; 52 bool keepRunning()const;
53 53
54 bool keyboardGrabbed()const; 54 bool keyboardGrabbed()const;
55 int exec(); 55 int exec();
56 56
57// QWS bits
58 enum screenSaverHint {
59 Disable = 0,
60 DisableLightOff = 1,
61 DisableSuspend = 2,
62 Enable = 100
63 };
64
57signals: 65signals:
58 void clientMoused(); 66 void clientMoused();
59 void timeChanged(); 67 void timeChanged();
60 void clockChanged( bool pm ); 68 void clockChanged( bool pm );
61 void micChanged( bool muted ); 69 void micChanged( bool muted );
62 void volumeChanged( bool muted ); 70 void volumeChanged( bool muted );
63 void appMessage( const QCString& msg, const QByteArray& data); 71 void appMessage( const QCString& msg, const QByteArray& data);
64 void weekChanged( bool startOnMonday ); 72 void weekChanged( bool startOnMonday );
65 void dateFormatChanged( DateFormat ); 73 void dateFormatChanged( DateFormat );
66 void flush(); 74 void flush();
67 void reload(); 75 void reload();
68 76
69private: 77private:
70 void initTranslations(); 78 void initTranslations();
71 void internalSetStyle(const QString&); 79 void internalSetStyle(const QString&);
72 80
73private slots: 81private slots:
74 void hideOrQuit(); 82 void hideOrQuit();
75 void systemMessage( const QCString&, const QByteArray& ); 83 void systemMessage( const QCString&, const QByteArray& );
76 void pidMessage( const QCString&, const QByteArray& ); 84 void pidMessage( const QCString&, const QByteArray& );
77 void removeSenderFromStylusDict(); 85 void removeSenderFromStylusDict();
78protected: 86protected:
79 virtual void restart(); 87 virtual void restart();
80 virtual void shutdown(); 88 virtual void shutdown();
89 void prepareForTermination(bool willrestart);
81 bool eventFilter( QObject*, QEvent* ); 90 bool eventFilter( QObject*, QEvent* );
82 void timerEvent( QTimerEvent* ); 91 void timerEvent( QTimerEvent* );
83 void raiseAppropriateWindow(); 92 void raiseAppropriateWindow();
84 virtual void tryQuit(); 93 virtual void tryQuit();
85 94
86private: 95private:
87 class Private; 96 class Private;
88 Private* d; 97 Private* d;
89 QCopChannel *m_sys; 98 QCopChannel *m_sys;
90 QCopChannel *m_pid; 99 QCopChannel *m_pid;
91}; 100};
92 101
93#endif 102#endif
diff --git a/x11/libqpe-x11/qt/qwindowsystem_qws.h b/x11/libqpe-x11/qt/qwindowsystem_qws.h
index 7bc43c5..2652f5f 100644
--- a/x11/libqpe-x11/qt/qwindowsystem_qws.h
+++ b/x11/libqpe-x11/qt/qwindowsystem_qws.h
@@ -1,18 +1,35 @@
1#ifndef OPIE_QWINDOWSYSTEM_H 1#ifndef OPIE_QWINDOWSYSTEM_H
2#define OPIE_QWINDOWSYSTEM_H 2#define OPIE_QWINDOWSYSTEM_H
3 3
4class QWSScreenSaver;
4class QWSServer { 5class QWSServer {
5public: 6public:
6QWSServer(){} 7QWSServer(){}
7~QWSServer(){} 8~QWSServer(){}
8 static void sendKeyEvent(int, int, int, bool, bool ) { } 9 static void sendKeyEvent(int, int, int, bool, bool ) { }
9 struct KeyboardFilter { 10 struct KeyboardFilter {
10 }; 11 };
11 static void setKeyboardFilter( KeyboardFilter* ) { 12 static void setKeyboardFilter( KeyboardFilter* ) {
12 13
13 } 14 }
15 static void setScreenSaver( QWSScreenSaver* ) {
14 16
15}; 17 }
18 static void setScreenSaverInterval( int ) {
19
20 }
21 static void setScreenSaverIntervals( int[] ) {
22
23 }
24 static void screenSaverActivate( bool ) {
16 25
26 }
27 static void setDesktopBackground( const QImage& ) {
28
29 }
30
31};
32struct QWSScreenSaver {
33};
17 34
18#endif 35#endif