author | sandman <sandman> | 2002-06-27 01:39:00 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-06-27 01:39:00 (UTC) |
commit | ed8d1696ca8f0407cb7e6b91cc8d410dede5ccdc (patch) (unidiff) | |
tree | ac60a3f150442a35d13fbe90733a70f891c81a28 /library/qpeapplication.cpp | |
parent | a86c09e8a12b504471ffeb8966e34a79dd8518b5 (diff) | |
download | opie-ed8d1696ca8f0407cb7e6b91cc8d410dede5ccdc.zip opie-ed8d1696ca8f0407cb7e6b91cc8d410dede5ccdc.tar.gz opie-ed8d1696ca8f0407cb7e6b91cc8d410dede5ccdc.tar.bz2 |
Including kernel headers in user space apps is bad .. just copy the defines
(There were problems with some toolchain configurations)
-rw-r--r-- | library/qpeapplication.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 87a9739..76d62ef 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1,147 +1,158 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of 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 | ** $Id$ | 19 | ** $Id$ |
20 | ** | 20 | ** |
21 | **********************************************************************/ | 21 | **********************************************************************/ |
22 | #define QTOPIA_INTERNAL_LANGLIST | 22 | #define QTOPIA_INTERNAL_LANGLIST |
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | #include <qfile.h> | 25 | #include <qfile.h> |
26 | #ifdef Q_WS_QWS | 26 | #ifdef Q_WS_QWS |
27 | #ifndef QT_NO_COP | 27 | #ifndef QT_NO_COP |
28 | #if QT_VERSION <= 231 | 28 | #if QT_VERSION <= 231 |
29 | #define private public | 29 | #define private public |
30 | #define sendLocally processEvent | 30 | #define sendLocally processEvent |
31 | #include "qcopenvelope_qws.h" | 31 | #include "qcopenvelope_qws.h" |
32 | #undef private | 32 | #undef private |
33 | #else | 33 | #else |
34 | #include "qcopenvelope_qws.h" | 34 | #include "qcopenvelope_qws.h" |
35 | #endif | 35 | #endif |
36 | #endif | 36 | #endif |
37 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
38 | #endif | 38 | #endif |
39 | #include <qtextstream.h> | 39 | #include <qtextstream.h> |
40 | #include <qpalette.h> | 40 | #include <qpalette.h> |
41 | #include <qbuffer.h> | 41 | #include <qbuffer.h> |
42 | #include <qptrdict.h> | 42 | #include <qptrdict.h> |
43 | #include <qregexp.h> | 43 | #include <qregexp.h> |
44 | #include <qdir.h> | 44 | #include <qdir.h> |
45 | #include <qlabel.h> | 45 | #include <qlabel.h> |
46 | #include <qdialog.h> | 46 | #include <qdialog.h> |
47 | #include <qdragobject.h> | 47 | #include <qdragobject.h> |
48 | #include <qevent.h> | 48 | #include <qevent.h> |
49 | #include <qtooltip.h> | 49 | #include <qtooltip.h> |
50 | #include <qsignal.h> | 50 | #include <qsignal.h> |
51 | #include <linux/fb.h> | 51 | |
52 | |||
53 | //#include <linux/fb.h> better not rely on kernel headers in userspace ... | ||
54 | |||
55 | /* VESA Blanking Levels */ | ||
56 | #define VESA_NO_BLANKING 0 | ||
57 | #define VESA_VSYNC_SUSPEND 1 | ||
58 | #define VESA_HSYNC_SUSPEND 2 | ||
59 | #define VESA_POWERDOWN 3 | ||
60 | |||
61 | #define FBIOBLANK 0x4611 | ||
62 | |||
52 | 63 | ||
53 | #include <qsignal.h> | 64 | #include <qsignal.h> |
54 | #include "qpeapplication.h" | 65 | #include "qpeapplication.h" |
55 | #include "qpestyle.h" | 66 | #include "qpestyle.h" |
56 | #if QT_VERSION >= 300 | 67 | #if QT_VERSION >= 300 |
57 | #include <qstylefactory.h> | 68 | #include <qstylefactory.h> |
58 | #else | 69 | #else |
59 | #include <qplatinumstyle.h> | 70 | #include <qplatinumstyle.h> |
60 | #include <qwindowsstyle.h> | 71 | #include <qwindowsstyle.h> |
61 | #include <qmotifstyle.h> | 72 | #include <qmotifstyle.h> |
62 | #include <qmotifplusstyle.h> | 73 | #include <qmotifplusstyle.h> |
63 | #include "lightstyle.h" | 74 | #include "lightstyle.h" |
64 | #endif | 75 | #endif |
65 | #include "global.h" | 76 | #include "global.h" |
66 | #include "resource.h" | 77 | #include "resource.h" |
67 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 78 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
68 | #include "qutfcodec.h" | 79 | #include "qutfcodec.h" |
69 | #endif | 80 | #endif |
70 | #include "config.h" | 81 | #include "config.h" |
71 | #include "network.h" | 82 | #include "network.h" |
72 | #include "fontmanager.h" | 83 | #include "fontmanager.h" |
73 | #include "fontdatabase.h" | 84 | #include "fontdatabase.h" |
74 | 85 | ||
75 | #include "power.h" | 86 | #include "power.h" |
76 | #include "alarmserver.h" | 87 | #include "alarmserver.h" |
77 | #include "applnk.h" | 88 | #include "applnk.h" |
78 | #include "qpemenubar.h" | 89 | #include "qpemenubar.h" |
79 | 90 | ||
80 | #include <unistd.h> | 91 | #include <unistd.h> |
81 | #include <sys/file.h> | 92 | #include <sys/file.h> |
82 | #include <sys/ioctl.h> | 93 | #include <sys/ioctl.h> |
83 | #include <sys/soundcard.h> | 94 | #include <sys/soundcard.h> |
84 | 95 | ||
85 | // for setBacklight() | 96 | // for setBacklight() |
86 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) | 97 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) |
87 | #include <linux/fb.h> | 98 | #include <linux/fb.h> |
88 | #include <sys/types.h> | 99 | #include <sys/types.h> |
89 | #include <sys/stat.h> | 100 | #include <sys/stat.h> |
90 | #endif | 101 | #endif |
91 | #include <stdlib.h> | 102 | #include <stdlib.h> |
92 | 103 | ||
93 | #include <dlfcn.h> // for Liquid HACK | 104 | #include <dlfcn.h> // for Liquid HACK |
94 | 105 | ||
95 | class QPEApplicationData { | 106 | class QPEApplicationData { |
96 | public: | 107 | public: |
97 | QPEApplicationData() : presstimer(0), presswidget(0), rightpressed(FALSE), | 108 | QPEApplicationData() : presstimer(0), presswidget(0), rightpressed(FALSE), |
98 | kbgrabber(0), kbregrab(FALSE), notbusysent(FALSE), preloaded(FALSE), | 109 | kbgrabber(0), kbregrab(FALSE), notbusysent(FALSE), preloaded(FALSE), |
99 | forceshow(FALSE), nomaximize(FALSE), qpe_main_widget(0), | 110 | forceshow(FALSE), nomaximize(FALSE), qpe_main_widget(0), |
100 | keep_running(TRUE) | 111 | keep_running(TRUE) |
101 | { | 112 | { |
102 | qcopq.setAutoDelete(TRUE); | 113 | qcopq.setAutoDelete(TRUE); |
103 | } | 114 | } |
104 | 115 | ||
105 | int presstimer; | 116 | int presstimer; |
106 | QWidget* presswidget; | 117 | QWidget* presswidget; |
107 | QPoint presspos; | 118 | QPoint presspos; |
108 | bool rightpressed; | 119 | bool rightpressed; |
109 | int kbgrabber; | 120 | int kbgrabber; |
110 | bool kbregrab; | 121 | bool kbregrab; |
111 | bool notbusysent; | 122 | bool notbusysent; |
112 | QString appName; | 123 | QString appName; |
113 | struct QCopRec { | 124 | struct QCopRec { |
114 | QCopRec(const QCString &ch, const QCString &msg, | 125 | QCopRec(const QCString &ch, const QCString &msg, |
115 | const QByteArray &d) : | 126 | const QByteArray &d) : |
116 | channel(ch), message(msg), data(d) { } | 127 | channel(ch), message(msg), data(d) { } |
117 | 128 | ||
118 | QCString channel; | 129 | QCString channel; |
119 | QCString message; | 130 | QCString message; |
120 | QByteArray data; | 131 | QByteArray data; |
121 | }; | 132 | }; |
122 | bool preloaded; | 133 | bool preloaded; |
123 | bool forceshow; | 134 | bool forceshow; |
124 | bool nomaximize; | 135 | bool nomaximize; |
125 | QWidget* qpe_main_widget; | 136 | QWidget* qpe_main_widget; |
126 | bool keep_running; | 137 | bool keep_running; |
127 | QList<QCopRec> qcopq; | 138 | QList<QCopRec> qcopq; |
128 | 139 | ||
129 | void enqueueQCop(const QCString &ch, const QCString &msg, | 140 | void enqueueQCop(const QCString &ch, const QCString &msg, |
130 | const QByteArray &data) | 141 | const QByteArray &data) |
131 | { | 142 | { |
132 | qcopq.append(new QCopRec(ch,msg,data)); | 143 | qcopq.append(new QCopRec(ch,msg,data)); |
133 | } | 144 | } |
134 | void sendQCopQ() | 145 | void sendQCopQ() |
135 | { | 146 | { |
136 | QCopRec* r; | 147 | QCopRec* r; |
137 | for (QListIterator<QCopRec> it(qcopq); (r=it.current()); ++it) | 148 | for (QListIterator<QCopRec> it(qcopq); (r=it.current()); ++it) |
138 | QCopChannel::sendLocally(r->channel,r->message,r->data); | 149 | QCopChannel::sendLocally(r->channel,r->message,r->data); |
139 | qcopq.clear(); | 150 | qcopq.clear(); |
140 | } | 151 | } |
141 | }; | 152 | }; |
142 | 153 | ||
143 | class ResourceMimeFactory : public QMimeSourceFactory { | 154 | class ResourceMimeFactory : public QMimeSourceFactory { |
144 | public: | 155 | public: |
145 | ResourceMimeFactory() | 156 | ResourceMimeFactory() |
146 | { | 157 | { |
147 | setFilePath( Global::helpPath() ); | 158 | setFilePath( Global::helpPath() ); |