-rw-r--r-- | library/qpedecoration_qws.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/library/qpedecoration_qws.h b/library/qpedecoration_qws.h index b8afd05..691c6f6 100644 --- a/library/qpedecoration_qws.h +++ b/library/qpedecoration_qws.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of 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. |
@@ -16,54 +16,58 @@ | |||
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 | #ifndef QPE_DECORATION_QWS_H__ | 20 | #ifndef QPE_DECORATION_QWS_H__ |
21 | #define QPE_DECORATION_QWS_H__ | 21 | #define QPE_DECORATION_QWS_H__ |
22 | 22 | ||
23 | 23 | ||
24 | #ifdef QWS | ||
24 | #include <qwsdefaultdecoration_qws.h> | 25 | #include <qwsdefaultdecoration_qws.h> |
25 | #include <qimage.h> | 26 | #include <qimage.h> |
26 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
27 | #include <qguardedptr.h> | 28 | #include <qguardedptr.h> |
29 | #include "windowdecorationinterface.h" | ||
28 | 30 | ||
29 | 31 | ||
30 | #ifndef QT_NO_QWS_QPE_WM_STYLE | 32 | #ifndef QT_NO_QWS_QPE_WM_STYLE |
31 | 33 | ||
32 | class QPEManager; | 34 | class QPEManager; |
33 | class QTimer; | 35 | class QTimer; |
34 | 36 | ||
35 | class QPEDecoration : public QWSDefaultDecoration | 37 | class QPEDecoration : public QWSDefaultDecoration |
36 | { | 38 | { |
37 | public: | 39 | public: |
38 | QPEDecoration(); | 40 | QPEDecoration(); |
41 | QPEDecoration( const QString &plugin ); | ||
39 | virtual ~QPEDecoration(); | 42 | virtual ~QPEDecoration(); |
40 | 43 | ||
41 | virtual QRegion region(const QWidget *, const QRect &rect, Region); | 44 | virtual QRegion region(const QWidget *, const QRect &rect, Region); |
42 | virtual void paint(QPainter *, const QWidget *); | 45 | virtual void paint(QPainter *, const QWidget *); |
43 | virtual void paintButton(QPainter *, const QWidget *, Region, int state); | 46 | virtual void paintButton(QPainter *, const QWidget *, Region, int state); |
44 | 47 | ||
45 | void maximize( QWidget * ); | 48 | void maximize( QWidget * ); |
46 | void minimize( QWidget * ); | 49 | void minimize( QWidget * ); |
47 | virtual void help( QWidget * ); | 50 | virtual void help( QWidget * ); |
48 | 51 | ||
49 | enum QPERegion { Help=LastRegion+1 }; | 52 | enum QPERegion { Help=LastRegion+1 }; |
50 | void buttonClicked( QPERegion r ); | 53 | void buttonClicked( QPERegion r ); |
51 | 54 | ||
52 | protected: | 55 | protected: |
53 | void fillTitle( QPainter *p, const QWidget *w, int x, int y, int w, int h ); | ||
54 | // virtual int getTitleWidth(const QWidget *); | ||
55 | virtual int getTitleHeight(const QWidget *); | 56 | virtual int getTitleHeight(const QWidget *); |
56 | virtual const char **menuPixmap(); | 57 | virtual const char **menuPixmap(); |
57 | virtual const char **closePixmap(); | 58 | virtual const char **closePixmap(); |
58 | virtual const char **minimizePixmap(); | 59 | virtual const char **minimizePixmap(); |
59 | virtual const char **maximizePixmap(); | 60 | virtual const char **maximizePixmap(); |
60 | virtual const char **normalizePixmap(); | 61 | virtual const char **normalizePixmap(); |
61 | 62 | ||
63 | private: | ||
64 | void windowData( const QWidget *w, WindowDecorationInterface::WindowData &wd ) const; | ||
65 | |||
62 | protected: | 66 | protected: |
63 | QImage imageOk; | 67 | QImage imageOk; |
64 | QImage imageClose; | 68 | QImage imageClose; |
65 | QImage imageHelp; | 69 | QImage imageHelp; |
66 | QString helpFile; | 70 | QString helpFile; |
67 | bool helpExists; | 71 | bool helpExists; |
68 | QPEManager *qpeManager; | 72 | QPEManager *qpeManager; |
69 | }; | 73 | }; |
@@ -72,30 +76,36 @@ protected: | |||
72 | class QPEManager : public QObject | 76 | class QPEManager : public QObject |
73 | { | 77 | { |
74 | Q_OBJECT | 78 | Q_OBJECT |
75 | friend class QPEDecoration; | 79 | friend class QPEDecoration; |
76 | public: | 80 | public: |
77 | QPEManager( QPEDecoration *d, QObject *parent=0 ); | 81 | QPEManager( QPEDecoration *d, QObject *parent=0 ); |
78 | 82 | ||
79 | void updateActive(); | 83 | void updateActive(); |
84 | const QWidget *activeWidget() const { return (const QWidget *)active; } | ||
85 | const QWidget *whatsThisWidget() const { return (const QWidget *)whatsThis; } | ||
80 | 86 | ||
81 | protected: | 87 | protected: |
82 | int pointInQpeRegion( QWidget *w, const QPoint &p ); | 88 | int pointInQpeRegion( QWidget *w, const QPoint &p ); |
83 | virtual bool eventFilter( QObject *, QEvent * ); | 89 | virtual bool eventFilter( QObject *, QEvent * ); |
84 | void drawButton( QWidget *w, QPEDecoration::QPERegion r, int state ); | 90 | void drawButton( QWidget *w, QPEDecoration::QPERegion r, int state ); |
91 | void drawTitle( QWidget *w ); | ||
85 | 92 | ||
86 | protected slots: | 93 | protected slots: |
87 | void whatsThisTimeout(); | 94 | void whatsThisTimeout(); |
88 | 95 | ||
89 | protected: | 96 | protected: |
90 | QPEDecoration *decoration; | 97 | QPEDecoration *decoration; |
91 | QGuardedPtr<QWidget> active; | 98 | QGuardedPtr<QWidget> active; |
92 | int helpState; | 99 | int helpState; |
93 | QTime pressTime; | 100 | QTime pressTime; |
94 | QTimer *wtTimer; | 101 | QTimer *wtTimer; |
102 | bool inWhatsThis; | ||
103 | QGuardedPtr<QWidget> whatsThis; | ||
95 | }; | 104 | }; |
96 | 105 | ||
97 | 106 | ||
98 | #endif // QT_NO_QWS_QPE_WM_STYLE | 107 | #endif // QT_NO_QWS_QPE_WM_STYLE |
99 | 108 | ||
100 | 109 | ||
101 | #endif // QPE_DECORATION_QWS_H__ | 110 | #endif // QPE_DECORATION_QWS_H__ |
111 | #endif // QWS | ||