summaryrefslogtreecommitdiff
path: root/qmake/include
Unidiff
Diffstat (limited to 'qmake/include') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qapplication_p.h87
-rw-r--r--qmake/include/private/qcolor_p.h63
-rw-r--r--qmake/include/private/qcom_p.h337
-rw-r--r--qmake/include/private/qcomlibrary_p.h79
-rw-r--r--qmake/include/private/qcomplextext_p.h123
-rw-r--r--qmake/include/private/qcomponentfactory_p.h73
-rw-r--r--qmake/include/private/qcriticalsection_p.h80
-rw-r--r--qmake/include/private/qdir_p.h78
-rw-r--r--qmake/include/private/qeffects_p.h78
-rw-r--r--qmake/include/private/qeventloop_p.h74
-rw-r--r--qmake/include/private/qfiledefs_p.h64
-rw-r--r--qmake/include/private/qfontcodecs_p.h368
-rw-r--r--qmake/include/private/qfontdata_p.h479
-rw-r--r--qmake/include/private/qgfxdriverinterface_p.h56
-rw-r--r--qmake/include/private/qgpluginmanager_p.h107
-rw-r--r--qmake/include/private/qimageformatinterface_p.h75
-rw-r--r--qmake/include/private/qinputcontext_p.h121
-rw-r--r--qmake/include/private/qinternal_p.h157
-rw-r--r--qmake/include/private/qkbddriverinterface_p.h56
-rw-r--r--qmake/include/private/qlayoutengine_p.h128
-rw-r--r--qmake/include/private/qlibrary_p.h84
-rw-r--r--qmake/include/private/qmousedriverinterface_p.h56
-rw-r--r--qmake/include/private/qmutex_p.h70
-rw-r--r--qmake/include/private/qmutexpool_p.h39
-rw-r--r--qmake/include/private/qpainter_p.h63
-rw-r--r--qmake/include/private/qpluginmanager_p.h73
-rw-r--r--qmake/include/private/qpsprinter_p.h89
-rw-r--r--qmake/include/private/qrichtext_p.h2133
-rw-r--r--qmake/include/private/qsettings_p.h133
-rw-r--r--qmake/include/private/qsharedmemory_p.h84
-rw-r--r--qmake/include/private/qsqldriverinterface_p.h69
-rw-r--r--qmake/include/private/qsqlextension_p.h101
-rw-r--r--qmake/include/private/qsqlmanager_p.h159
-rw-r--r--qmake/include/private/qstyleinterface_p.h61
-rw-r--r--qmake/include/private/qsvgdevice_p.h134
-rw-r--r--qmake/include/private/qtextcodecinterface_p.h79
-rw-r--r--qmake/include/private/qtitlebar_p.h136
-rw-r--r--qmake/include/private/qucom_p.h499
-rw-r--r--qmake/include/private/qucomextra_p.h93
-rw-r--r--qmake/include/private/qwidget_p.h61
-rw-r--r--qmake/include/private/qwidgetinterface_p.h111
-rw-r--r--qmake/include/private/qwidgetresizehandler_p.h113
-rw-r--r--qmake/include/qasciidict.h118
-rw-r--r--qmake/include/qbitarray.h166
-rw-r--r--qmake/include/qbuffer.h100
-rw-r--r--qmake/include/qcache.h118
-rw-r--r--qmake/include/qcleanuphandler.h127
-rw-r--r--qmake/include/qcstring.h391
-rw-r--r--qmake/include/qdatastream.h173
-rw-r--r--qmake/include/qdatetime.h250
-rw-r--r--qmake/include/qdict.h118
-rw-r--r--qmake/include/qdir.h241
-rw-r--r--qmake/include/qfeatures.h959
-rw-r--r--qmake/include/qfile.h124
-rw-r--r--qmake/include/qfileinfo.h150
-rw-r--r--qmake/include/qgarray.h121
-rw-r--r--qmake/include/qgcache.h128
-rw-r--r--qmake/include/qgdict.h222
-rw-r--r--qmake/include/qglist.h252
-rw-r--r--qmake/include/qglobal.h1006
-rw-r--r--qmake/include/qgvector.h121
-rw-r--r--qmake/include/qintdict.h114
-rw-r--r--qmake/include/qiodevice.h161
-rw-r--r--qmake/include/qmap.h883
-rw-r--r--qmake/include/qmemarray.h122
-rw-r--r--qmake/include/qnamespace.h843
-rw-r--r--qmake/include/qpair.h96
-rw-r--r--qmake/include/qptrcollection.h76
-rw-r--r--qmake/include/qptrlist.h160
-rw-r--r--qmake/include/qptrvector.h113
-rw-r--r--qmake/include/qregexp.h115
-rw-r--r--qmake/include/qshared.h55
-rw-r--r--qmake/include/qstring.h950
-rw-r--r--qmake/include/qstringlist.h86
-rw-r--r--qmake/include/qstrlist.h112
-rw-r--r--qmake/include/qtextcodec.h114
-rw-r--r--qmake/include/qtextstream.h335
-rw-r--r--qmake/include/qtl.h321
-rw-r--r--qmake/include/quuid.h168
-rw-r--r--qmake/include/qvaluelist.h665
-rw-r--r--qmake/include/qvaluestack.h64
81 files changed, 17561 insertions, 0 deletions
diff --git a/qmake/include/private/qapplication_p.h b/qmake/include/private/qapplication_p.h
new file mode 100644
index 0000000..6fab6b3
--- a/dev/null
+++ b/qmake/include/private/qapplication_p.h
@@ -0,0 +1,87 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of some Qt private functions.
5**
6** Created : 000228
7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QAPPLICATION_P_H
39#define QAPPLICATION_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qapplication_*.cpp, qwidget*.cpp, qcolor_x11.cpp, qfiledialog.cpp
48// and many other. This header file may change from version to version
49// without notice, or even be removed.
50//
51// We mean it.
52//
53//
54
55#ifndef QT_H
56#endif // QT_H
57
58class QWidget;
59class QObject;
60class QClipboard;
61class QKeyEvent;
62class QMouseEvent;
63class QWheelEvent;
64
65extern Q_EXPORT bool qt_modal_state();
66extern Q_EXPORT void qt_enter_modal( QWidget* );
67extern Q_EXPORT void qt_leave_modal( QWidget* );
68
69extern bool qt_is_gui_used;
70#ifndef QT_NO_CLIPBOARD
71extern QClipboard *qt_clipboard;
72#endif
73
74#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN)
75extern Qt::WindowsVersion qt_winver;
76#endif
77
78#if defined (Q_WS_X11)
79extern int qt_ncols_option;
80#endif
81
82
83extern void qt_dispatchEnterLeave( QWidget*, QWidget* );
84
85
86
87#endif
diff --git a/qmake/include/private/qcolor_p.h b/qmake/include/private/qcolor_p.h
new file mode 100644
index 0000000..942a803
--- a/dev/null
+++ b/qmake/include/private/qcolor_p.h
@@ -0,0 +1,63 @@
1/****************************************************************************
2** $Id$
3**
4** Named color support for non-X platforms.
5** The color names have been borrowed from X.
6**
7** Created : 000228
8**
9** Copyright (C) 2000 Trolltech AS. All rights reserved.
10**
11** This file is part of the kernel module of the Qt GUI Toolkit.
12**
13** This file may be distributed under the terms of the Q Public License
14** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file.
16**
17** This file may be distributed and/or modified under the terms of the
18** GNU General Public License version 2 as published by the Free Software
19** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file.
21**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software.
25**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
27** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information.
33**
34** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you.
36**
37**********************************************************************/
38
39#ifndef QCOLOR_P_H
40#define QCOLOR_P_H
41
42
43//
44// W A R N I N G
45// -------------
46//
47// This file is not part of the Qt API. It exists for the convenience
48// of qmenudata.cpp, qmenubar.cpp, qmenubar.cpp, qpopupmenu.cpp,
49// qmotifstyle.cpp and qwindowssstyle.cpp. This header file may change
50// from version to version without notice, or even be removed.
51//
52// We mean it.
53//
54//
55
56#ifndef QT_H
57#endif // QT_H
58
59extern uint qt_get_rgb_val( const char *name );
60extern bool qt_get_named_rgb( const char *, QRgb* );
61extern void qt_reset_color_avail();
62
63#endif
diff --git a/qmake/include/private/qcom_p.h b/qmake/include/private/qcom_p.h
new file mode 100644
index 0000000..6e7e1c8
--- a/dev/null
+++ b/qmake/include/private/qcom_p.h
@@ -0,0 +1,337 @@
1/****************************************************************************
2** $Id$
3**
4** ...
5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QCOM_H
37#define QCOM_H
38
39//
40// W A R N I N G
41// -------------
42//
43// This file is not part of the Qt API. It exists for the convenience
44// of a number of Qt sources files. This header file may change from
45// version to version without notice, or even be removed.
46//
47// We mean it.
48//
49//
50
51#ifndef QT_H
52#include "qstringlist.h"
53#include "quuid.h"
54#endif // QT_H
55
56#ifndef QT_NO_COMPONENT
57
58class QObject;
59struct QUInterfaceDescription;
60struct QUObject;
61
62 #define QRESULT unsigned long
63 #define QS_OK (QRESULT)0x00000000
64 #define QS_FALSE(QRESULT)0x00000001
65
66#define QE_NOTIMPL (QRESULT)0x80000001
67#define QE_OUTOFMEMORY (QRESULT)0x80000002
68 #define QE_INVALIDARG(QRESULT)0x80000003
69 #define QE_NOINTERFACE(QRESULT)0x80000004
70 #define QE_NOCOMPONENT(QRESULT)0x80000005
71
72
73// {1D8518CD-E8F5-4366-99E8-879FD7E482DE}
74#ifndef IID_QUnknown
75#define IID_QUnknown QUuid(0x1d8518cd, 0xe8f5, 0x4366, 0x99, 0xe8, 0x87, 0x9f, 0xd7, 0xe4, 0x82, 0xde)
76#endif
77
78struct Q_EXPORT QUnknownInterface
79{
80 virtual QRESULT queryInterface( const QUuid&, QUnknownInterface** ) = 0;
81 virtual ulong addRef() = 0;
82 virtual ulong release() = 0;
83};
84
85// {FBAC965E-A441-413F-935E-CDF582573FAB}
86#ifndef IID_QDispatch
87#define IID_QDispatch QUuid( 0xfbac965e, 0xa441, 0x413f, 0x93, 0x5e, 0xcd, 0xf5, 0x82, 0x57, 0x3f, 0xab)
88#endif
89
90// the dispatch interface that inherits the unknown interface.. It is
91// used to explore interfaces during runtime and to do dynamic calls.
92struct Q_EXPORT QDispatchInterface : public QUnknownInterface
93{
94 // returns the interface description of this dispatch interface.
95 virtual const QUInterfaceDescription* interfaceDescription() const = 0;
96
97 // returns the event description of this dispatch interface.
98 virtual const QUInterfaceDescription* eventsDescription() const = 0;
99
100 // invokes method id with parameters V*. Returns some sort of
101 // exception code.
102 virtual QRESULT invoke( int id, QUObject* o ) = 0;
103
104 // installs listener as event listener
105 virtual void installListener( QDispatchInterface* listener ) = 0;
106
107 // remove listener as event listener
108 virtual void removeListener( QDispatchInterface* listener ) = 0;
109};
110
111template <class T>
112class QInterfacePtr
113{
114public:
115 QInterfacePtr():iface(0){}
116
117 QInterfacePtr( T* i) {
118 if ( (iface = i) )
119 iface->addRef();
120 }
121
122 QInterfacePtr(const QInterfacePtr<T> &p) {
123 if ( (iface = p.iface) )
124 iface->addRef();
125 }
126
127 ~QInterfacePtr() {
128 if ( iface )
129 iface->release();
130 }
131
132 QInterfacePtr<T> &operator=(const QInterfacePtr<T> &p) {
133 if ( iface != p.iface ) {
134 if ( iface )
135 iface->release();
136 if ( (iface = p.iface) )
137 iface->addRef();
138 }
139 return *this;
140 }
141
142 QInterfacePtr<T> &operator=(T* i) {
143 if (iface != i ) {
144 if ( iface )
145 iface->release();
146 if ( (iface = i) )
147 iface->addRef();
148 }
149 return *this;
150 }
151
152 bool operator==( const QInterfacePtr<T> &p ) const { return iface == p.iface; }
153
154 bool operator!= ( const QInterfacePtr<T>& p ) const { return !( *this == p ); }
155
156 bool isNull() const { return !iface; }
157
158 T* operator->() const { return iface; }
159
160 T& operator*() const { return *iface; }
161
162 operator T*() const { return iface; }
163
164 QUnknownInterface** operator &() const {
165 if( iface )
166 iface->release();
167 return (QUnknownInterface**)&iface;
168 }
169
170 T** operator &() {
171 if ( iface )
172 iface->release();
173 return &iface;
174 }
175
176private:
177 T* iface;
178};
179
180// {10A1501B-4C5F-4914-95DD-C400486CF900}
181#ifndef IID_QObject
182#define IID_QObject QUuid( 0x10a1501b, 0x4c5f, 0x4914, 0x95, 0xdd, 0xc4, 0x00, 0x48, 0x6c, 0xf9, 0x00)
183#endif
184
185struct Q_EXPORT QObjectInterface
186{
187 virtual QObject* qObject() = 0;
188};
189
190// {5F3968A5-F451-45b1-96FB-061AD98F926E}
191#ifndef IID_QComponentInformation
192#define IID_QComponentInformation QUuid(0x5f3968a5, 0xf451, 0x45b1, 0x96, 0xfb, 0x6, 0x1a, 0xd9, 0x8f, 0x92, 0x6e)
193#endif
194
195struct Q_EXPORT QComponentInformationInterface : public QUnknownInterface
196{
197 virtual QString name() const = 0;
198 virtual QString description() const = 0;
199 virtual QString author() const = 0;
200 virtual QString version() const = 0;
201};
202
203// {6CAA771B-17BB-4988-9E78-BA5CDDAAC31E}
204#ifndef IID_QComponentFactory
205#define IID_QComponentFactory QUuid( 0x6caa771b, 0x17bb, 0x4988, 0x9e, 0x78, 0xba, 0x5c, 0xdd, 0xaa, 0xc3, 0x1e)
206#endif
207
208struct Q_EXPORT QComponentFactoryInterface : public QUnknownInterface
209{
210 virtual QRESULT createInstance( const QUuid &cid, const QUuid &iid, QUnknownInterface** instance, QUnknownInterface *outer ) = 0;
211};
212
213// {D16111D4-E1E7-4C47-8599-24483DAE2E07}
214#ifndef IID_QLibrary
215#define IID_QLibrary QUuid( 0xd16111d4, 0xe1e7, 0x4c47, 0x85, 0x99, 0x24, 0x48, 0x3d, 0xae, 0x2e, 0x07)
216#endif
217
218struct Q_EXPORT QLibraryInterface : public QUnknownInterface
219{
220 virtual bool init() = 0;
221 virtual void cleanup() = 0;
222 virtual bool canUnload() const = 0;
223};
224
225// {3F8FDC44-3015-4f3e-B6D6-E4AAAABDEAAD}
226#ifndef IID_QFeatureList
227#define IID_QFeatureList QUuid(0x3f8fdc44, 0x3015, 0x4f3e, 0xb6, 0xd6, 0xe4, 0xaa, 0xaa, 0xbd, 0xea, 0xad)
228#endif
229
230struct Q_EXPORT QFeatureListInterface : public QUnknownInterface
231{
232 virtual QStringListfeatureList() const = 0;
233};
234
235// {B5FEB5DE-E0CD-4E37-B0EB-8A812499A0C1}
236#ifndef IID_QComponentRegistration
237#define IID_QComponentRegistration QUuid( 0xb5feb5de, 0xe0cd, 0x4e37, 0xb0, 0xeb, 0x8a, 0x81, 0x24, 0x99, 0xa0, 0xc1)
238#endif
239
240struct Q_EXPORT QComponentRegistrationInterface : public QUnknownInterface
241{
242 virtual bool registerComponents( const QString &filepath ) const = 0;
243 virtual bool unregisterComponents() const = 0;
244};
245
246// internal class that wraps an initialized ulong
247struct Q_EXPORT QtULong
248{
249 QtULong() : ref( 0 ) { }
250 operator unsigned long () const { return ref; }
251 unsigned long& operator++() { return ++ref; }
252 unsigned long operator++( int ) { return ref++; }
253 unsigned long& operator--() { return --ref; }
254 unsigned long operator--( int ) { return ref--; }
255
256 unsigned long ref;
257};
258// default implementation of ref counting. A variable "ulong ref" has to be a member
259
260
261#define Q_REFCOUNT \
262 private: \
263 QtULong qtrefcount; \
264 public: \
265 ulong addRef() {return qtrefcount++;} \
266 ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;}
267
268#ifndef Q_EXPORT_COMPONENT
269#if defined(QT_THREAD_SUPPORT)
270#define QT_THREADED_BUILD 1
271#define Q_UCM_FLAGS_STRING "11"
272#else
273#define QT_THREADED_BUILD 0
274#define Q_UCM_FLAGS_STRING "01"
275#endif
276
277#ifndef Q_EXTERN_C
278#ifdef __cplusplus
279#define Q_EXTERN_C extern "C"
280#else
281#define Q_EXTERN_C extern
282#endif
283#endif
284
285// this is duplicated at Q_PLUGIN_VERIFICATION_DATA in qgplugin.h
286// NOTE: if you change pattern, you MUST change the pattern in
287// qcomlibrary.cpp as well. changing the pattern will break all
288// backwards compatibility as well (no old plugins will be loaded).
289#ifndef Q_UCM_VERIFICATION_DATA
290# define Q_UCM_VERIFICATION_DATA \
291 static const char *qt_ucm_verification_data = \
292 "pattern=""QT_UCM_VERIFICATION_DATA""\n" \
293 "version="QT_VERSION_STR"\n" \
294 "flags="Q_UCM_FLAGS_STRING"\n" \
295 "buildkey="QT_BUILD_KEY"\0";
296#endif // Q_UCM_VERIFICATION_DATA
297
298// This macro expands to the default implementation of ucm_instantiate.
299#ifndef Q_CREATE_INSTANCE
300 # define Q_CREATE_INSTANCE( IMPLEMENTATION ) \
301 IMPLEMENTATION *i = new IMPLEMENTATION; \
302 QUnknownInterface* iface = 0; \
303 i->queryInterface( IID_QUnknown, &iface );\
304 return iface;
305#endif // Q_CREATE_INSTANCE
306
307# ifdef Q_WS_WIN
308 #ifdef Q_CC_BOR
309 # define Q_EXPORT_COMPONENT() \
310 Q_UCM_VERIFICATION_DATA \
311 Q_EXTERN_C __declspec(dllexport) \
312 const char * __stdcall qt_ucm_query_verification_data() \
313 { return qt_ucm_verification_data; } \
314 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \
315 __stdcall ucm_instantiate()
316 #else
317 # define Q_EXPORT_COMPONENT() \
318 Q_UCM_VERIFICATION_DATA \
319 Q_EXTERN_C __declspec(dllexport) \
320 const char *qt_ucm_query_verification_data() \
321 { return qt_ucm_verification_data; } \
322 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate()
323 #endif
324# else
325 #define Q_EXPORT_COMPONENT() \
326 Q_UCM_VERIFICATION_DATA \
327 Q_EXTERN_C \
328 const char *qt_ucm_query_verification_data() \
329 { return qt_ucm_verification_data; } \
330 Q_EXTERN_C QUnknownInterface* ucm_instantiate()
331# endif
332# define Q_EXPORT_INTERFACE() Q_EXPORT_COMPONENT()
333#endif
334
335#endif //QT_NO_COMPONENT
336
337#endif //QCOM_H
diff --git a/qmake/include/private/qcomlibrary_p.h b/qmake/include/private/qcomlibrary_p.h
new file mode 100644
index 0000000..f52f679
--- a/dev/null
+++ b/qmake/include/private/qcomlibrary_p.h
@@ -0,0 +1,79 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QComLibrary class
5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QUCOMLIBRARY_H
37#define QUCOMLIBRARY_H
38
39//
40// W A R N I N G
41// -------------
42//
43// This file is not part of the Qt API. It exists for the convenience
44// of a number of Qt sources files. This header file may change from
45// version to version without notice, or even be removed.
46//
47// We mean it.
48//
49//
50
51#ifndef QT_H
52#include "qcom_p.h"
53#include "qlibrary.h"
54#endif // QT_H
55
56#ifndef QT_NO_COMPONENT
57
58class Q_EXPORT QComLibrary : public QLibrary
59{
60public:
61 QComLibrary( const QString &filename );
62 ~QComLibrary();
63
64 bool unload();
65 QRESULT queryInterface( const QUuid &iid, QUnknownInterface **iface );
66 uint qtVersion();
67
68private:
69 void createInstanceInternal();
70
71 QUnknownInterface *entry;
72 QLibraryInterface *libiface;
73 uint qt_version;
74
75};
76
77#endif //QT_NO_COMPONENT
78
79#endif // QUCOMLIBRARY_H
diff --git a/qmake/include/private/qcomplextext_p.h b/qmake/include/private/qcomplextext_p.h
new file mode 100644
index 0000000..2132522
--- a/dev/null
+++ b/qmake/include/private/qcomplextext_p.h
@@ -0,0 +1,123 @@
1/****************************************************************************
2** $Id$
3**
4** Internal header file.
5**
6** Created :
7**
8** Copyright (C) 2001 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QCOMPLEXTEXT_H
39#define QCOMPLEXTEXT_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of Qt Remote Control. This header file may change from version to
47// version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53#ifndef QT_H
54#include <qstring.h>
55#include <qpointarray.h>
56#include <qfont.h>
57#include <qpainter.h>
58#include <qptrlist.h>
59#include <qshared.h>
60#endif // QT_H
61
62#ifndef QT_NO_COMPLEXTEXT
63
64// bidi helper classes. Internal to Qt
65struct Q_EXPORT QBidiStatus {
66 QBidiStatus() {
67 eor = QChar::DirON;
68 lastStrong = QChar::DirON;
69 last = QChar:: DirON;
70 }
71 QChar::Direction eor;
72 QChar::Direction lastStrong;
73 QChar::Direction last;
74};
75
76struct Q_EXPORT QBidiContext : public QShared {
77 // ### ref and deref parent?
78 QBidiContext( uchar level, QChar::Direction embedding, QBidiContext *parent = 0, bool override = FALSE );
79 ~QBidiContext();
80
81 unsigned char level;
82 bool override : 1;
83 QChar::Direction dir : 5;
84
85 QBidiContext *parent;
86};
87
88struct Q_EXPORT QBidiControl {
89 QBidiControl() { context = 0; }
90 QBidiControl( QBidiContext *c, QBidiStatus s)
91 { context = c; if( context ) context->ref(); status = s; }
92 ~QBidiControl() { if ( context && context->deref() ) delete context; }
93 void setContext( QBidiContext *c ) { if ( context == c ) return; if ( context && context->deref() ) delete context; context = c; context->ref(); }
94 QBidiContext *context;
95 QBidiStatus status;
96};
97
98struct Q_EXPORT QTextRun {
99 QTextRun(int _start, int _stop, QBidiContext *context, QChar::Direction dir);
100
101 int start;
102 int stop;
103 // explicit + implicit levels here
104 uchar level;
105};
106
107class Q_EXPORT QComplexText {
108public:
109 static QString shapedString( const QString &str, int from = 0, int len = -1, QPainter::TextDirection dir = QPainter::Auto, const QFontMetrics *fm = 0);
110 static QChar shapedCharacter(const QString &str, int pos, const QFontMetrics *fm = 0);
111
112 // positions non spacing marks relative to the base character at position pos.
113 static QPointArray positionMarks( QFontPrivate *f, const QString &str, int pos, QRect *boundingRect = 0 );
114
115 static QPtrList<QTextRun> *bidiReorderLine( QBidiControl *control, const QString &str, int start, int len,
116 QChar::Direction basicDir = QChar::DirON );
117 static QString bidiReorderString( const QString &str, QChar::Direction basicDir = QChar::DirON );
118};
119
120
121#endif //QT_NO_COMPLEXTEXT
122
123#endif
diff --git a/qmake/include/private/qcomponentfactory_p.h b/qmake/include/private/qcomponentfactory_p.h
new file mode 100644
index 0000000..1ac973f
--- a/dev/null
+++ b/qmake/include/private/qcomponentfactory_p.h
@@ -0,0 +1,73 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of the QComponentFactory class
5**
6** Created : 990101
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QCOMPONENTFACTORY_H
39#define QCOMPONENTFACTORY_H
40
41#ifndef QT_H
42#include "qcom_p.h"
43#endif // QT_H
44
45//
46// W A R N I N G
47// -------------
48//
49// This file is not part of the Qt API. It exists for the convenience
50// of a number of Qt sources files. This header file may change from
51// version to version without notice, or even be removed.
52//
53// We mean it.
54//
55//
56
57#ifndef QT_NO_COMPONENT
58
59class Q_EXPORT QComponentFactory
60{
61public:
62 static QRESULT createInstance( const QString &cid, const QUuid &iid, QUnknownInterface** instance, QUnknownInterface *outer = 0 );
63 static QRESULT registerServer( const QString &filename );
64 static QRESULT unregisterServer( const QString &filename );
65
66 static bool registerComponent( const QUuid &cid, const QString &filename, const QString &name = QString::null,
67 int version = 0, const QString &description = QString::null );
68 static bool unregisterComponent( const QUuid &cid );
69};
70
71#endif // QT_NO_COMPONENT
72
73#endif // QCOMPONENTFACTORY_H
diff --git a/qmake/include/private/qcriticalsection_p.h b/qmake/include/private/qcriticalsection_p.h
new file mode 100644
index 0000000..7d9feca
--- a/dev/null
+++ b/qmake/include/private/qcriticalsection_p.h
@@ -0,0 +1,80 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QCriticalSection class
5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QCRITICALSECTION_H
37#define QCRITICALSECTION_H
38
39#ifndef QT_H
40#endif // QT_H
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of Qt Remote Control. This header file may change from version to
48// version without notice, or even be removed.
49//
50// We mean it.
51//
52//
53
54#if defined(QT_THREAD_SUPPORT)
55
56#if defined(Q_WS_WIN)
57
58/*
59 QCriticalSection
60*/
61
62class QCriticalSectionPrivate;
63
64class QCriticalSection
65{
66public:
67 QCriticalSection();
68 ~QCriticalSection();
69 void enter();
70 void leave();
71
72private:
73 QCriticalSectionPrivate *d;
74};
75
76#endif
77
78#endif
79
80#endif
diff --git a/qmake/include/private/qdir_p.h b/qmake/include/private/qdir_p.h
new file mode 100644
index 0000000..35dba28
--- a/dev/null
+++ b/qmake/include/private/qdir_p.h
@@ -0,0 +1,78 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of some private QDir functions.
5**
6** Created : 2000.11.06
7**
8** Copyright (C) 2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QDIR_P_H
39#define QDIR_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qdir.cpp and qdir_*.cpp.
48// This header file may change from version to version without notice,
49// or even be removed.
50//
51// We mean it.
52//
53//
54
55#ifndef QT_H
56#endif // QT_H
57
58extern QStringList qt_makeFilterList( const QString & );
59
60
61extern int qt_cmp_si_sortSpec;
62
63#if defined(Q_C_CALLBACKS)
64extern "C" {
65#endif
66
67#ifdef Q_OS_TEMP
68extern int __cdecl qt_cmp_si( const void *, const void * );
69#else
70extern int qt_cmp_si( const void *, const void * );
71#endif
72
73#if defined(Q_C_CALLBACKS)
74}
75#endif
76
77
78#endif // QDIR_P_H
diff --git a/qmake/include/private/qeffects_p.h b/qmake/include/private/qeffects_p.h
new file mode 100644
index 0000000..4178b6f
--- a/dev/null
+++ b/qmake/include/private/qeffects_p.h
@@ -0,0 +1,78 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QEffects functions
5**
6** Created : 2000.06.21
7**
8** Copyright (C) 2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the widgets module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QEFFECTS_P_H
39#define QEFFECTS_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qeffects.cpp, qcombobox.cpp, qpopupmenu.cpp and qtooltip.cpp.
48// This header file may change from version to version without notice,
49// or even be removed.
50//
51// We mean it.
52//
53//
54
55#ifndef QT_H
56#include "qnamespace.h"
57#endif // QT_H
58
59#ifndef QT_NO_EFFECTS
60class QWidget;
61
62struct QEffects
63{
64 enum Direction {
65 LeftScroll= 0x0001,
66 RightScroll= 0x0002,
67 UpScroll= 0x0004,
68 DownScroll= 0x0008
69 };
70
71 typedef uint DirFlags;
72};
73
74extern void Q_EXPORT qScrollEffect( QWidget*, QEffects::DirFlags dir = QEffects::DownScroll, int time = -1 );
75extern void Q_EXPORT qFadeEffect( QWidget*, int time = -1 );
76#endif // QT_NO_EFFECTS
77
78#endif // QEFFECTS_P_H
diff --git a/qmake/include/private/qeventloop_p.h b/qmake/include/private/qeventloop_p.h
new file mode 100644
index 0000000..b64d0df
--- a/dev/null
+++ b/qmake/include/private/qeventloop_p.h
@@ -0,0 +1,74 @@
1#ifndef QEVENTLOOP_P_H
2#define QEVENTLOOP_P_H
3
4#include "qplatformdefs.h"
5#include "qwindowdefs.h"
6
7class QSocketNotifier;
8
9#if defined(Q_OS_UNIX)
10#include <qptrlist.h>
11
12struct QSockNot
13{
14 QSocketNotifier *obj;
15 int fd;
16 fd_set *queue;
17};
18
19class QSockNotType
20{
21public:
22 QSockNotType();
23 ~QSockNotType();
24
25 QPtrList<QSockNot> *list;
26 fd_set select_fds;
27 fd_set enabled_fds;
28 fd_set pending_fds;
29
30};
31#endif // Q_OS_UNIX
32
33
34class QEventLoopPrivate
35{
36public:
37 QEventLoopPrivate()
38 {
39 reset();
40 }
41
42 void reset() {
43 looplevel = 0;
44 quitcode = 0;
45 quitnow = FALSE;
46 exitloop = FALSE;
47 }
48
49 int looplevel;
50 int quitcode;
51 bool quitnow;
52 bool exitloop;
53
54#if defined(Q_WS_MAC)
55 EventLoopTimerRef select_timer;
56#endif
57
58#if defined(Q_WS_X11)
59 int xfd;
60#endif // Q_WS_X11
61
62#if defined(Q_OS_UNIX)
63 int thread_pipe[2];
64
65 // pending socket notifiers list
66 QPtrList<QSockNot> sn_pending_list;
67 // highest fd for all socket notifiers
68 int sn_highest;
69 // 3 socket notifier types - read, write and exception
70 QSockNotType sn_vec[3];
71#endif
72};
73
74#endif // QEVENTLOOP_P_H
diff --git a/qmake/include/private/qfiledefs_p.h b/qmake/include/private/qfiledefs_p.h
new file mode 100644
index 0000000..627717f
--- a/dev/null
+++ b/qmake/include/private/qfiledefs_p.h
@@ -0,0 +1,64 @@
1/****************************************************************************
2** $Id$
3**
4** Common macros and system include files for QFile, QFileInfo and QDir.
5**
6** Created : 930812
7**
8** Copyright (C) 1992-2001 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QFILEDEFS_P_H
39#define QFILEDEFS_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of qfileinfo*.cpp. This header file may change from version to version
47// without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53// Be sure to include qplatformdefs.h first!
54struct QFileInfoCache
55{
56#if defined(Q_WS_WIN)
57 QT_STATBUF st;
58#else
59 struct stat st;
60#endif
61};
62
63
64#endif
diff --git a/qmake/include/private/qfontcodecs_p.h b/qmake/include/private/qfontcodecs_p.h
new file mode 100644
index 0000000..8222f98
--- a/dev/null
+++ b/qmake/include/private/qfontcodecs_p.h
@@ -0,0 +1,368 @@
1/****************************************************************************
2** $Id$
3**
4** Font utilities for X11
5**
6** Created : 20001101
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QFONTCODECS_P_H
39#define QFONTCODECS_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of qfontencodings_x11.cpp and qfont_x11.cpp. This header file may
47// change from version to version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53#ifndef QT_H
54#include <qglobal.h>
55#include <qtextcodec.h>
56#endif // QT_H
57
58
59#ifndef QT_NO_CODECS
60#ifndef QT_NO_BIG_CODECS
61
62
63class QJpUnicodeConv;
64
65
66class QFontJis0201Codec : public QTextCodec
67{
68public:
69 QFontJis0201Codec();
70
71 const char *name() const;
72
73 int mibEnum() const;
74
75#if !defined(Q_NO_USING_KEYWORD)
76 using QTextCodec::fromUnicode;
77#endif
78 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
79
80 int heuristicContentMatch(const char *, int) const;
81 int heuristicNameMatch(const char* hint) const;
82
83#if !defined(Q_NO_USING_KEYWORD)
84 using QTextCodec::canEncode;
85#endif
86 bool canEncode( QChar ) const;
87};
88
89
90class QFontJis0208Codec : public QTextCodec
91{
92public:
93 QFontJis0208Codec();
94 ~QFontJis0208Codec();
95
96 // Return the official name for the encoding.
97 const char* name() const ;
98
99 // Return the MIB enum for the encoding if it is listed in the
100 // IANA character-sets encoding file.
101 int mibEnum() const ;
102
103 // Converts len characters from chars to Unicode.
104 QString toUnicode(const char* chars, int len) const ;
105
106 // Converts lenInOut characters (of type QChar) from the start of
107 // the string uc, returning a QCString result, and also returning
108 // the length of the result in lenInOut.
109#if !defined(Q_NO_USING_KEYWORD)
110 using QTextCodec::fromUnicode;
111#endif
112 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
113
114 int heuristicContentMatch(const char *, int) const;
115 int heuristicNameMatch(const char* hint) const;
116
117#if !defined(Q_NO_USING_KEYWORD)
118 using QTextCodec::canEncode;
119#endif
120 bool canEncode( QChar ) const;
121
122private:
123 QJpUnicodeConv *convJP;
124};
125
126
127
128
129class QFontKsc5601Codec : public QTextCodec
130{
131public:
132 QFontKsc5601Codec();
133
134 // Return the official name for the encoding.
135 const char* name() const ;
136
137 // Return the MIB enum for the encoding if it is listed in the
138 // IANA character-sets encoding file.
139 int mibEnum() const ;
140
141 // Converts len characters from chars to Unicode.
142 QString toUnicode(const char* chars, int len) const ;
143
144 // Converts lenInOut characters (of type QChar) from the start of
145 // the string uc, returning a QCString result, and also returning
146 // the length of the result in lenInOut.
147#if !defined(Q_NO_USING_KEYWORD)
148 using QTextCodec::fromUnicode;
149#endif
150 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
151
152 int heuristicContentMatch(const char *, int) const;
153#if !defined(Q_NO_USING_KEYWORD)
154 using QTextCodec::canEncode;
155#endif
156 bool canEncode( QChar ) const;
157};
158
159
160
161
162class QFontGb2312Codec : public QTextCodec
163{
164public:
165 QFontGb2312Codec();
166
167 // Return the official name for the encoding.
168 const char* name() const ;
169
170 // Return the MIB enum for the encoding if it is listed in the
171 // IANA character-sets encoding file.
172 int mibEnum() const ;
173
174 // Converts len characters from chars to Unicode.
175 QString toUnicode(const char* chars, int len) const ;
176
177 // Converts lenInOut characters (of type QChar) from the start of
178 // the string uc, returning a QCString result, and also returning
179 // the length of the result in lenInOut.
180 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
181
182 int heuristicContentMatch(const char *, int) const;
183 bool canEncode( QChar ) const;
184};
185
186
187
188
189class QFontGbkCodec : public QTextCodec
190{
191public:
192 QFontGbkCodec();
193
194 // Return the official name for the encoding.
195 const char* name() const ;
196
197 // Return the MIB enum for the encoding if it is listed in the
198 // IANA character-sets encoding file.
199 int mibEnum() const ;
200
201 // Converts len characters from chars to Unicode.
202 QString toUnicode(const char* chars, int len) const ;
203
204 // Converts lenInOut characters (of type QChar) from the start of
205 // the string uc, returning a QCString result, and also returning
206 // the length of the result in lenInOut.
207 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
208
209 int heuristicContentMatch(const char *, int) const;
210 int heuristicNameMatch(const char* hint) const;
211 bool canEncode( QChar ) const;
212};
213
214
215
216
217class QFontGb18030_0Codec : public QTextCodec
218{
219public:
220 QFontGb18030_0Codec();
221
222 // Return the official name for the encoding.
223 const char* name() const ;
224
225 // Return the MIB enum for the encoding if it is listed in the
226 // IANA character-sets encoding file.
227 int mibEnum() const ;
228
229 // Converts len characters from chars to Unicode.
230 QString toUnicode(const char* chars, int len) const ;
231
232 // Converts lenInOut characters (of type QChar) from the start of
233 // the string uc, returning a QCString result, and also returning
234 // the length of the result in lenInOut.
235#if !defined(Q_NO_USING_KEYWORD)
236 using QTextCodec::fromUnicode;
237#endif
238 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
239
240 int heuristicContentMatch(const char *, int) const;
241#if !defined(Q_NO_USING_KEYWORD)
242 using QTextCodec::canEncode;
243#endif
244 bool canEncode( QChar ) const;
245};
246
247
248
249
250class QFontBig5Codec : public QTextCodec
251{
252public:
253 QFontBig5Codec();
254
255 // Return the official name for the encoding.
256 const char* name() const ;
257
258 // Return the MIB enum for the encoding if it is listed in the
259 // IANA character-sets encoding file.
260 int mibEnum() const ;
261
262 // Converts len characters from chars to Unicode.
263 QString toUnicode(const char* chars, int len) const ;
264
265 // Converts lenInOut characters (of type QChar) from the start of
266 // the string uc, returning a QCString result, and also returning
267 // the length of the result in lenInOut.
268#if !defined(Q_NO_USING_KEYWORD)
269 using QTextCodec::fromUnicode;
270#endif
271 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
272
273 int heuristicContentMatch(const char *, int) const;
274#if !defined(Q_NO_USING_KEYWORD)
275 using QTextCodec::canEncode;
276#endif
277 int heuristicNameMatch(const char* hint) const;
278 bool canEncode( QChar ) const;
279};
280
281
282
283class QFontBig5hkscsCodec : public QTextCodec
284{
285public:
286 QFontBig5hkscsCodec();
287
288 // Return the official name for the encoding.
289 const char* name() const ;
290
291 // Return the MIB enum for the encoding if it is listed in the
292 // IANA character-sets encoding file.
293 int mibEnum() const ;
294
295 // Converts len characters from chars to Unicode.
296 QString toUnicode(const char* chars, int len) const ;
297
298 // Converts lenInOut characters (of type QChar) from the start of
299 // the string uc, returning a QCString result, and also returning
300 // the length of the result in lenInOut.
301 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
302
303 int heuristicContentMatch(const char *, int) const;
304 int heuristicNameMatch(const char* hint) const;
305#if !defined(Q_NO_USING_KEYWORD)
306 using QTextCodec::canEncode;
307#endif
308 bool canEncode( QChar ) const;
309};
310
311
312
313
314// ------------------------------------------------------------------
315// the shaping codec for iso8859-6.8x fonts (see www.langbox.com)
316
317class QFontArabic68Codec : public QTextCodec
318{
319public:
320 QFontArabic68Codec();
321
322 // Return the official name for the encoding.
323 const char* name() const ;
324
325 // Return the MIB enum for the encoding if it is listed in the
326 // IANA character-sets encoding file.
327 int mibEnum() const ;
328
329 // Converts len characters from chars to Unicode.
330 QString toUnicode(const char* chars, int len) const ;
331
332 // Converts lenInOut characters (of type QChar) from the start of
333 // the string uc, returning a QCString result, and also returning
334 // the length of the result in lenInOut.
335 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
336
337 int heuristicContentMatch(const char *, int) const;
338 QByteArray fromUnicode( const QString &str, int from, int len ) const;
339 unsigned short characterFromUnicode(const QString &str, int pos) const;
340};
341
342
343class QFontLaoCodec : public QTextCodec
344{
345public:
346 QFontLaoCodec();
347
348 const char *name() const;
349
350 int mibEnum() const;
351
352#if !defined(Q_NO_USING_KEYWORD)
353 using QTextCodec::fromUnicode;
354#endif
355 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
356
357 int heuristicContentMatch(const char *, int) const;
358
359#if !defined(Q_NO_USING_KEYWORD)
360 using QTextCodec::canEncode;
361#endif
362 bool canEncode( QChar ) const;
363};
364
365#endif // QT_NO_BIG_CODECS
366#endif // QT_NO_CODECS
367
368#endif // QFONTCODECS_P_H
diff --git a/qmake/include/private/qfontdata_p.h b/qmake/include/private/qfontdata_p.h
new file mode 100644
index 0000000..917d14f
--- a/dev/null
+++ b/qmake/include/private/qfontdata_p.h
@@ -0,0 +1,479 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of internal QFontData struct
5**
6** Created : 941229
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QFONTDATA_P_H
39#define QFONTDATA_P_H
40
41#ifndef QT_H
42#include <qcache.h>
43#include <qobject.h>
44#include <qpaintdevice.h>
45#endif // QT_H
46#include <limits.h>
47
48//
49// W A R N I N G
50// -------------
51//
52// This file is not part of the Qt API. It exists for the convenience
53// of internal files. This header file may change from version to version
54// without notice, or even be removed.
55//
56// We mean it.
57//
58//
59
60class QPaintDevice;
61
62#ifdef Q_WS_WIN
63#include <qt_windows.h>
64#endif
65
66#ifdef Q_WS_X11
67#include <qt_x11.h>
68
69class QCharStruct;
70#endif
71
72// font description
73struct QFontDef {
74 QFontDef()
75 : pixelSize(0), pointSize(0), lbearing(SHRT_MIN), rbearing(SHRT_MIN),
76 styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
77 weight(0), italic(FALSE), underline(FALSE), strikeOut(FALSE),
78 fixedPitch(FALSE), hintSetByUser(FALSE), rawMode(FALSE), dirty(TRUE)
79 { ; }
80
81 QString family;
82 QString addStyle;
83
84 int pixelSize;
85 int pointSize;
86 short lbearing;
87 short rbearing;
88
89 ushort styleStrategy;
90 uchar styleHint;
91 uchar weight;
92
93 bool italic;
94 bool underline;
95 bool strikeOut;
96 bool fixedPitch;
97 bool hintSetByUser;
98 bool rawMode;
99
100 bool dirty;
101};
102
103
104class QTextCodec;
105
106#ifdef Q_WS_X11
107
108// this is a shared wrapper for XFontStruct (to prevent a font being freed by
109// the cache while it's being used)
110class QFontStruct : public QShared
111{
112public:
113 QFontStruct(Qt::HANDLE h, Qt::HANDLE xfth, Qt::HANDLE xftp,
114 QCString n, QTextCodec *c, int a) :
115 QShared(), handle(h), xfthandle(xfth), xftpattern(xftp),
116 name(n), codec(c), cache_cost(a), scale( 1. )
117 { ; }
118
119 ~QFontStruct();
120
121 Qt::HANDLE handle, xfthandle, xftpattern;
122 QCString name;
123 QTextCodec *codec;
124 int cache_cost;
125 float scale; // needed for printing, to correctly scale font metrics for bitmap fonts
126};
127
128enum { widthCacheSize = 0x500 };
129
130class QFontX11Data // used as a QFontPrivate member
131{
132public:
133 // X fontstruct handles for each character set
134 QFontStruct *fontstruct[QFont::LastPrivateScript];
135
136 uchar widthCache[widthCacheSize];
137
138 QFontX11Data();
139 ~QFontX11Data();
140};
141
142#endif // Q_WS_X11
143
144
145#ifdef Q_WS_WIN
146
147class QFontStruct : public QShared
148{
149public:
150 QFontStruct( const QString &key );
151 ~QFontStruct() { reset(); }
152 bool dirty() const { return hfont == 0; }
153 HDC dc() const;
154 HFONT font() const { return hfont; }
155 const TEXTMETRICA *textMetricA() const { return &tm.a; }
156 const TEXTMETRICW *textMetricW() const { return &tm.w; }
157 QString key() const { return k; }
158 void reset();
159
160 QStringk;
161 HDC hdc;
162 HFONThfont;
163 uintstockFont:1;
164 uintpaintDevice:1;
165 union {
166 TEXTMETRICWw;
167 TEXTMETRICAa;
168 } tm;
169 int lw;
170 int cache_cost;
171// friend void QFont::initFontInfo() const;
172};
173
174#endif // Q_WS_WIN
175
176#if defined( Q_WS_MAC )
177
178#if defined( Q_WS_MACX )
179# define QMAC_FONT_ATSUI
180#endif
181#include "qt_mac.h"
182class QMacFontInfo;
183
184class QFontStruct : public QShared
185{
186public:
187 inline QFontStruct() : QShared(), info(NULL), fnum(-1), cache_cost(0), internal_fi(NULL) { }
188#if defined( QMAC_FONT_ATSUI ) && 0
189 ATSFontMetrics *info;
190 int maxWidth() const { return (int)info->maxAdvanceWidth; }
191#else
192 FontInfo *info;
193 int maxWidth() const { return info->widMax; }
194#endif
195 int ascent() const { return (int)info->ascent; }
196 int descent() const { return (int)info->descent; }
197 int leading() const { return (int)info->leading; }
198 int minLeftBearing() const { return 0; }
199 int minRightBearing() const { return 0; }
200
201 short fnum;
202 int psize, cache_cost;
203 QMacFontInfo *internal_fi;
204};
205
206#endif
207
208#ifdef Q_WS_QWS
209class QFontStruct;
210class QGfx;
211#endif
212
213typedef QCacheIterator<QFontStruct> QFontCacheIterator;
214class QFontCache : public QObject, public QCache<QFontStruct>
215{
216public:
217 QFontCache();
218 ~QFontCache();
219
220 bool insert(const QString &, const QFontStruct *, int c);
221#ifndef Q_WS_MAC
222 void deleteItem(Item d);
223#endif
224 void timerEvent(QTimerEvent *);
225
226
227protected:
228
229
230private:
231 int timer_id;
232 bool fast;
233};
234
235
236// QFontPrivate - holds all data on which a font operates
237class QFontPrivate : public QShared
238{
239public:
240 static QFontCache *fontCache;
241
242
243public:
244
245 QFontPrivate();
246 QFontPrivate(const QFontPrivate &fp);
247 QFontPrivate( const QFontPrivate &fp, QPaintDevice *pd );
248 ~QFontPrivate();
249
250 // requested font
251 QFontDef request;
252 // actual font
253 QFontDef actual;
254
255 bool exactMatch;
256 int lineWidth;
257
258 // common functions
259 QString defaultFamily() const;
260 QString lastResortFamily() const;
261 QString lastResortFont() const;
262 QString key() const;
263
264 static int getFontWeight(const QCString &, bool = FALSE);
265 QRect boundingRect( const QChar &ch );
266
267 struct TextRun {
268 TextRun()
269 {
270 xoff = 0;
271 yoff = 0;
272 x2off = 0;
273 script = QFont::NoScript;
274 string = 0;
275 length = 0;
276 next = 0;
277 }
278
279 ~TextRun()
280 {
281 if ( next )
282 delete next;
283 }
284
285 void setParams( int x, int y, int x2, const QChar *s, int len,
286 QFont::Script sc = QFont::NoScript ) {
287 xoff = x;
288 yoff = y;
289 x2off = x2;
290 string = s;
291 length = len;
292 script = sc;
293 }
294 int xoff;
295 int yoff;
296 int x2off;
297 QFont::Script script;
298 const QChar *string;
299 int length;
300 TextRun *next;
301#ifdef Q_WS_X11
302 QByteArray mapped;
303#endif
304 };
305
306 // some replacement functions for native calls. This is needed, because shaping and
307 // non spacing marks can change the extents of a string to draw. At the same time
308 // drawing needs to take care to correctly position non spacing marks.
309 int textWidth( const QString &str, int pos, int len );
310
311 // returns the script a certain character is in. Needed to separate the string
312 // into runs of different scripts as required for X11 and opentype.
313 QFont::Script scriptForChar(const QChar &c);
314
315#ifdef Q_WS_X11
316 QFont::Script hanHack( const QChar & c );
317 static char **getXFontNames(const char *, int *);
318 static bool fontExists(const QString &);
319 static bool parseXFontName(char *, char **);
320 static QCString fixXLFD( const QCString & );
321 static bool fillFontDef(XFontStruct *, QFontDef *, int);
322 static bool fillFontDef(const QCString &, QFontDef *, int);
323
324 static inline bool isZero(char *x)
325 {
326 return (x[0] == '0' && x[1] == 0);
327 }
328
329 static inline bool isScalable( char **tokens )
330 {
331 return (isZero(tokens[PixelSize]) &&
332 isZero(tokens[PointSize]) &&
333 isZero(tokens[AverageWidth]));
334 }
335
336 static inline bool isSmoothlyScalable( char **tokens )
337 {
338 return (isZero(tokens[ResolutionX]) && isZero(tokens[ResolutionY]));
339 }
340
341 static inline bool isFixedPitch( char **tokens )
342 {
343 return (tokens[Spacing][0] == 'm' ||
344 tokens[Spacing][0] == 'c' ||
345 tokens[Spacing][0] == 'M' ||
346 tokens[Spacing][0] == 'C');
347 }
348
349 // XLFD fields
350 enum FontFieldNames {
351 Foundry,
352 Family,
353 Weight,
354 Slant,
355 Width,
356 AddStyle,
357 PixelSize,
358 PointSize,
359 ResolutionX,
360 ResolutionY,
361 Spacing,
362 AverageWidth,
363 CharsetRegistry,
364 CharsetEncoding,
365 NFontFields
366 };
367
368#ifndef QT_NO_XFTFREETYPE
369 XftPattern *findXftFont(const QChar &, bool *, double *scale) const;
370 XftPattern *bestXftPattern(const QString &, const QString &, const QChar &, double *scale) const;
371#endif // QT_NO_XFTFREETYPE
372 QCString findFont(QFont::Script, bool *, double *) const;
373 QCString bestFamilyMember(QFont::Script, const QString &, const QString &,
374 const QString &, int *, double *) const;
375 QCString bestMatch(const char *, int *, QFont::Script, double *) const;
376 int fontMatchScore(const char *, QCString &, float *, int *, bool *,
377 bool *, QFont::Script, double *) const;
378 void initFontInfo(QFont::Script, double scale);
379 void load(QFont::Script = QFont::NoScript, bool = TRUE);
380 bool loadUnicode(QFont::Script, const QChar &);
381 void computeLineWidth();
382
383 int textWidth( const QString &str, int pos, int len, TextRun *cache );
384 void textExtents( const QString &str, int pos, int len, QCharStruct *overall );
385 void drawText( Display *dpy, int screen, Qt::HANDLE hd, Qt::HANDLE rendhd,
386 GC gc, const QColor &pen, Qt::BGMode, const QColor &bgcolor,
387 int x, int y, const TextRun *cache, int pdWidth );
388 bool inFont( const QChar &ch );
389
390 QFontX11Data x11data;
391 static QFont::Script defaultScript;
392 int x11Screen;
393#endif // Q_WS_X11
394
395 QPaintDevice *paintdevice;
396
397#ifdef Q_WS_WIN
398 void load();
399 void initFontInfo();
400 HFONT create( bool *stockFont, HDC hdc = 0, bool compatMode = FALSE );
401 QFontStruct *fin;
402
403 void buildCache( HDC hdc, const QString &str, int pos, int len, TextRun *cache );
404 void drawText( HDC hdc, int x, int y, TextRun *cache );
405#endif // Q_WS_WIN
406
407#ifdef Q_WS_QWS
408 void load();
409 QFontStruct *fin;
410 int textWidth( const QString &str, int pos, int len, TextRun *cache );
411 void drawText( QGfx *gfx, int x, int y, const TextRun *cache );
412#endif
413
414#if defined( Q_WS_MAC )
415 void macSetFont(QPaintDevice *);
416 void drawText(int x, int y, QString s, int len, QPaintDevice *dev, const QRegion *rgn);
417 void computeLineWidth();
418 void load();
419 QFontStruct *fin;
420#endif
421
422};
423
424inline QFontPrivate::QFontPrivate()
425 : QShared(), exactMatch(FALSE), lineWidth(1)
426{
427
428#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC)
429 fin = 0;
430#endif // Q_WS_WIN || Q_WS_QWS
431#if defined(Q_WS_X11)
432 x11Screen = QPaintDevice::x11AppScreen();
433#endif // Q_WS_X11
434 paintdevice = 0;
435}
436
437inline QFontPrivate::QFontPrivate(const QFontPrivate &fp)
438 : QShared(), request(fp.request), actual(fp.actual),
439exactMatch(fp.exactMatch), lineWidth(1)
440{
441 Q_ASSERT(!fp.paintdevice);
442#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC)
443 fin = 0;
444#endif // Q_WS_WIN || Q_WS_QWS
445#if defined(Q_WS_X11)
446 x11Screen = fp.x11Screen;
447#endif // Q_WS_X11
448 paintdevice = 0;
449}
450
451inline QFontPrivate::QFontPrivate( const QFontPrivate &fp, QPaintDevice *pd )
452 : QShared(), request(fp.request), actual(fp.actual),
453exactMatch(fp.exactMatch), lineWidth(1)
454{
455
456#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC)
457 fin = 0;
458#endif // Q_WS_WIN || Q_WS_QWS
459#if defined(Q_WS_X11)
460 x11Screen = pd->x11Screen();
461#endif // Q_WS_X11
462 paintdevice = pd;
463}
464
465#ifndef Q_WS_QWS
466inline QFontPrivate::~QFontPrivate()
467{
468#if defined(Q_WS_WIN)
469 if( fin )
470 fin->deref();
471#endif
472#if defined(Q_WS_MAC)
473 if( fin && fin->deref() )
474 delete fin;
475#endif
476}
477#endif
478
479#endif // QFONTDATA_P_H
diff --git a/qmake/include/private/qgfxdriverinterface_p.h b/qmake/include/private/qgfxdriverinterface_p.h
new file mode 100644
index 0000000..1782ed4
--- a/dev/null
+++ b/qmake/include/private/qgfxdriverinterface_p.h
@@ -0,0 +1,56 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of Qt/Embedded Graphics Driver Interface
5**
6** Created : 20020211
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file.
16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software.
20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27**
28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you.
30**
31**********************************************************************/
32
33#ifndef QGFXDRIVERINTERFACE_H
34#define QGFXDRIVERINTERFACE_H
35
36#ifndef QT_H
37#include <private/qcom_p.h>
38#endif // QT_H
39
40#ifndef QT_NO_COMPONENT
41
42// {449EC6C6-DF3E-43E3-9E57-354A3D05AB34}
43#ifndef IID_QGfxDriver
44#define IID_QGfxDriver QUuid( 0x449ec6c6, 0xdf3e, 0x43e3, 0x9e, 0x57, 0x35, 0x4a, 0x3d, 0x05, 0xab, 0x34)
45#endif
46
47class QScreen;
48
49struct Q_EXPORT QGfxDriverInterface : public QFeatureListInterface
50{
51 virtual QScreen* create( const QString& driver, int displayId ) = 0;
52};
53
54#endif // QT_NO_COMPONENT
55
56#endif // QGFXDRIVERINTERFACE_H
diff --git a/qmake/include/private/qgpluginmanager_p.h b/qmake/include/private/qgpluginmanager_p.h
new file mode 100644
index 0000000..e0c0e78
--- a/dev/null
+++ b/qmake/include/private/qgpluginmanager_p.h
@@ -0,0 +1,107 @@
1/**********************************************************************
2** $Id$
3**
4** Definition of QGPluginManager class
5**
6** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QGPLUGINMANAGER_H
37#define QGPLUGINMANAGER_H
38
39#ifndef QT_H
40#include "qdict.h"
41#include "qlibrary.h"
42#include "quuid.h"
43#include "qstringlist.h"
44#include "qcom_p.h"
45#endif // QT_H
46
47//
48// W A R N I N G
49// -------------
50//
51// This file is not part of the Qt API. It exists for the convenience
52// of a number of Qt sources files. This header file may change from
53// version to version without notice, or even be removed.
54//
55// We mean it.
56//
57//
58
59#ifndef QT_NO_COMPONENT
60
61#if defined(Q_TEMPLATEDLL)
62// MOC_SKIP_BEGIN
63Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QLibrary>;
64// MOC_SKIP_END
65#endif
66
67class Q_EXPORT QGPluginManager
68{
69public:
70 QGPluginManager( const QUuid& id, const QStringList& paths = QString::null, const QString &suffix = QString::null, bool cs = TRUE );
71 ~QGPluginManager();
72
73 void addLibraryPath( const QString& path );
74 const QLibrary* library( const QString& feature ) const;
75 QStringList featureList() const;
76
77 bool autoUnload() const;
78 void setAutoUnload( bool );
79
80protected:
81 bool enabled() const;
82 bool addLibrary( QLibrary* plugin );
83
84 QRESULT queryUnknownInterface(const QString& feature, QUnknownInterface** iface) const;
85
86 QUuid interfaceId;
87 QDict<QLibrary> plugDict; // Dict to match feature with library
88 QDict<QLibrary> libDict; // Dict to match library file with library
89 QStringList libList;
90
91 uint casesens : 1;
92 uint autounload : 1;
93};
94
95inline void QGPluginManager::setAutoUnload( bool unload )
96{
97 autounload = unload;
98}
99
100inline bool QGPluginManager::autoUnload() const
101{
102 return autounload;
103}
104
105#endif
106
107#endif //QGPLUGINMANAGER_H
diff --git a/qmake/include/private/qimageformatinterface_p.h b/qmake/include/private/qimageformatinterface_p.h
new file mode 100644
index 0000000..5f7601c
--- a/dev/null
+++ b/qmake/include/private/qimageformatinterface_p.h
@@ -0,0 +1,75 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of ???
5**
6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the kernel module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QIMAGEFORMATINTERFACE_H
37#define QIMAGEFORMATINTERFACE_H
38
39#ifndef QT_H
40#include <private/qcom_p.h>
41#endif // QT_H
42
43
44//
45// W A R N I N G
46// -------------
47//
48// This file is not part of the Qt API. It exists for the convenience
49// of internal files. This header file may change from version to version
50// without notice, or even be removed.
51//
52// We mean it.
53//
54//
55
56#ifndef QT_NO_COMPONENT
57
58// {04903F05-54B1-4726-A849-FB5CB097CA87}
59#ifndef IID_QImageFormat
60#define IID_QImageFormat QUuid( 0x04903f05, 0x54b1, 0x4726, 0xa8, 0x49, 0xfb, 0x5c, 0xb0, 0x97, 0xca, 0x87 )
61#endif
62
63class QImage;
64
65struct Q_EXPORT QImageFormatInterface : public QFeatureListInterface
66{
67 virtual QRESULT loadImage( const QString &format, const QString &filename, QImage * ) = 0;
68 virtual QRESULT saveImage( const QString &format, const QString &filename, const QImage & ) = 0;
69
70 virtual QRESULT installIOHandler( const QString & ) = 0;
71};
72
73#endif // QT_NO_COMPONENT
74
75#endif // QIMAGEFORMATINTERFACE_H
diff --git a/qmake/include/private/qinputcontext_p.h b/qmake/include/private/qinputcontext_p.h
new file mode 100644
index 0000000..9ac0d2b
--- a/dev/null
+++ b/qmake/include/private/qinputcontext_p.h
@@ -0,0 +1,121 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of ???
5**
6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the kernel module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QINPUTCONTEXT_P_H
37#define QINPUTCONTEXT_P_H
38
39
40//
41// W A R N I N G
42// -------------
43//
44// This file is not part of the Qt API. It exists for the convenience
45// of internal files. This header file may change from version to version
46// without notice, or even be removed.
47//
48// We mean it.
49//
50//
51
52#include <qglobal.h>
53
54class QKeyEvent;
55class QWidget;
56class QFont;
57class QString;
58
59
60#ifdef Q_WS_X11
61#include "qarray.h"
62#include "qwindowdefs.h"
63#include "qt_x11.h"
64#endif
65
66#ifdef Q_WS_WIN
67#include <qt_windows.h>
68#endif
69
70#ifdef Q_WS_QWS
71class QWSIMEvent;
72#endif
73
74class QInputContext
75{
76public:
77#ifdef Q_WS_X11
78 QInputContext(QWidget *); // should be a toplevel widget
79 ~QInputContext();
80
81 void setFocus();
82 void setComposePosition(int, int);
83 void setComposeArea(int, int, int, int);
84 void reset();
85
86 int lookupString(XKeyEvent *, QCString &, KeySym *, Status *) const;
87 void setXFontSet(const QFont &);
88
89 void *ic;
90 QString text, lastcompose;
91 QWidget *focusWidget;
92 bool composing;
93 QFont font;
94 XFontSet fontset;
95 QMemArray<bool> selectedChars;
96#endif // Q_WS_X11
97
98#ifdef Q_WS_QWS
99 static void translateIMEvent( QWSIMEvent *, QWidget * );
100 static void reset();
101private:
102 static QWidget* focusWidget;
103 static QString* composition;
104#endif //Q_WS_QWS
105
106#ifdef Q_WS_WIN
107 static void init();
108 static void shutdown();
109
110 static void TranslateMessage( const MSG *msg);
111 static LRESULT DefWindowProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
112
113 static void setFont( const QWidget *w, const QFont & );
114 static void setFocusHint( int x, int y, int w, int h, const QWidget *widget );
115 static bool startComposition();
116 static bool endComposition( QWidget *fw = 0 );
117 static bool composition( LPARAM lparam );
118#endif
119};
120
121#endif // QINPUTCONTEXT_P_H
diff --git a/qmake/include/private/qinternal_p.h b/qmake/include/private/qinternal_p.h
new file mode 100644
index 0000000..ae38695
--- a/dev/null
+++ b/qmake/include/private/qinternal_p.h
@@ -0,0 +1,157 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of some shared interal classes
5**
6** Created : 010427
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QINTERNAL_P_H
39#define QINTERNAL_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of a number of Qt sources files. This header file may change from
47// version to version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52#ifndef QT_H
53#include <qnamespace.h>
54#include <qrect.h>
55#endif // QT_H
56
57class QWidget;
58class QPainter;
59class QPixmap;
60
61class Q_EXPORT QSharedDoubleBuffer
62{
63public:
64 enum DoubleBufferFlags {
65 NoFlags = 0x00,
66 InitBG = 0x01,
67 Force = 0x02,
68 Default = InitBG | Force
69 };
70 typedef uint DBFlags;
71
72 QSharedDoubleBuffer( DBFlags f = Default );
73 QSharedDoubleBuffer( QWidget* widget,
74 int x = 0, int y = 0, int w = -1, int h = -1,
75 DBFlags f = Default );
76 QSharedDoubleBuffer( QPainter* painter,
77 int x = 0, int y = 0, int w = -1, int h = -1,
78 DBFlags f = Default );
79 QSharedDoubleBuffer( QWidget *widget, const QRect &r, DBFlags f = Default );
80 QSharedDoubleBuffer( QPainter *painter, const QRect &r, DBFlags f = Default );
81 ~QSharedDoubleBuffer();
82
83 bool begin( QWidget* widget, int x = 0, int y = 0, int w = -1, int h = -1 );
84 bool begin( QPainter* painter, int x = 0, int y = 0, int w = -1, int h = -1);
85 bool begin( QWidget* widget, const QRect &r );
86 bool begin( QPainter* painter, const QRect &r );
87 bool end();
88
89 QPainter* painter() const;
90
91 bool isActive() const;
92 bool isBuffered() const;
93 void flush();
94
95 static bool isDisabled() { return !dblbufr; }
96 static void setDisabled( bool off ) { dblbufr = !off; }
97
98 static void cleanup();
99
100private:
101 enum DoubleBufferState {
102 Active = 0x0100,
103 BufferActive= 0x0200,
104 ExternalPainter= 0x0400
105 };
106 typedef uint DBState;
107
108 QPixmap *getPixmap();
109 void releasePixmap();
110
111 QWidget *wid;
112 int rx, ry, rw, rh;
113 DBFlags flags;
114 DBState state;
115
116 QPainter *p, *external_p;
117 QPixmap *pix;
118
119 static bool dblbufr;
120};
121
122inline bool QSharedDoubleBuffer::begin( QWidget* widget, const QRect &r )
123{ return begin( widget, r.x(), r.y(), r.width(), r.height() ); }
124
125inline bool QSharedDoubleBuffer::begin( QPainter *painter, const QRect &r )
126{ return begin( painter, r.x(), r.y(), r.width(), r.height() ); }
127
128inline QPainter* QSharedDoubleBuffer::painter() const
129{ return p; }
130
131inline bool QSharedDoubleBuffer::isActive() const
132{ return ( state & Active ); }
133
134inline bool QSharedDoubleBuffer::isBuffered() const
135{ return ( state & BufferActive ); }
136
137
138class QVirtualDestructor {
139public:
140 virtual ~QVirtualDestructor() {}
141};
142
143template <class T>
144class QAutoDeleter : public QVirtualDestructor {
145public:
146 QAutoDeleter( T* p ) : ptr( p ) {}
147 ~QAutoDeleter() { delete ptr; }
148private:
149 T* ptr;
150};
151
152template <class T>
153QAutoDeleter<T>* qAutoDeleter( T* p )
154{
155 return new QAutoDeleter<T>( p );
156}
157#endif // QINTERNAL_P_H
diff --git a/qmake/include/private/qkbddriverinterface_p.h b/qmake/include/private/qkbddriverinterface_p.h
new file mode 100644
index 0000000..efc7ded
--- a/dev/null
+++ b/qmake/include/private/qkbddriverinterface_p.h
@@ -0,0 +1,56 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of Qt/Embedded Keyboard Driver Interface
5**
6** Created : 20020218
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file.
16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software.
20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27**
28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you.
30**
31**********************************************************************/
32
33#ifndef QKBDDRIVERINTERFACE_H
34#define QKBDDRIVERINTERFACE_H
35
36#ifndef QT_H
37#include <private/qcom_p.h>
38#endif // QT_H
39
40#ifndef QT_NO_COMPONENT
41
42// {C7C838EA-FC3E-4905-92AD-F479E81F1D02}
43#ifndef IID_QKbdDriver
44#define IID_QKbdDriver QUuid( 0xc7c838ea, 0xfc3e, 0x4905, 0x92, 0xad, 0xf4, 0x79, 0xe8, 0x1f, 0x1d, 0x02)
45#endif
46
47class QWSKeyboardHandler;
48
49struct Q_EXPORT QKbdDriverInterface : public QFeatureListInterface
50{
51 virtual QWSKeyboardHandler* create( const QString& driver, const QString& device ) = 0;
52};
53
54#endif // QT_NO_COMPONENT
55
56#endif // QKBDDRIVERINTERFACE_H
diff --git a/qmake/include/private/qlayoutengine_p.h b/qmake/include/private/qlayoutengine_p.h
new file mode 100644
index 0000000..4d88afe
--- a/dev/null
+++ b/qmake/include/private/qlayoutengine_p.h
@@ -0,0 +1,128 @@
1/****************************************************************************
2** $Id$
3**
4** Internal header file.
5**
6** Created : 981027
7**
8** Copyright (C) 1998-99 by Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QLAYOUTENGINE_P_H
39#define QLAYOUTENGINE_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qlayout.cpp, qlayoutengine.cpp, qmainwindow.cpp and qsplitter.cpp.
48// This header file may change from version to version without notice,
49// or even be removed.
50//
51// We mean it.
52//
53//
54
55
56#ifndef QT_H
57#include "qabstractlayout.h"
58#endif // QT_H
59
60#ifndef QT_NO_LAYOUT
61
62struct QLayoutStruct
63{
64 void initParameters() {
65 minimumSize = sizeHint = 0;
66 maximumSize = QLAYOUTSIZE_MAX;
67 expansive = FALSE;
68 empty = TRUE;
69 }
70 void init() {
71 stretch = 0;
72 initParameters();
73 }
74
75 QCOORD smartSizeHint() {
76 return ( stretch > 0 ) ? minimumSize : sizeHint;
77 }
78
79 // permanent storage
80 int stretch;
81
82 // parameters
83 QCOORD sizeHint;
84 QCOORD maximumSize;
85 QCOORD minimumSize;
86 bool expansive;
87 bool empty;
88
89 // temporary storage
90 bool done;
91
92 // result
93 int pos;
94 int size;
95};
96
97
98Q_EXPORT void qGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count,
99 int pos, int space, int spacer );
100Q_EXPORT QSize qSmartMinSize( const QWidgetItem *i );
101Q_EXPORT QSize qSmartMinSize( QWidget *w );
102Q_EXPORT QSize qSmartMaxSize( const QWidgetItem *i, int align = 0 );
103Q_EXPORT QSize qSmartMaxSize( QWidget *w, int align = 0 );
104
105
106/*
107 Modify total maximum (max) and total expansion (exp)
108 when adding boxmax/boxexp.
109
110 Expansive boxes win over non-expansive boxes.
111*/
112static inline void qMaxExpCalc( QCOORD & max, bool &exp,
113 QCOORD boxmax, bool boxexp )
114{
115 if ( exp ) {
116 if ( boxexp )
117 max = QMAX( max, boxmax );
118 } else {
119 if ( boxexp )
120 max = boxmax;
121 else
122 max = QMIN( max, boxmax );
123 }
124 exp = exp || boxexp;
125}
126
127#endif //QT_NO_LAYOUT
128#endif
diff --git a/qmake/include/private/qlibrary_p.h b/qmake/include/private/qlibrary_p.h
new file mode 100644
index 0000000..c4dd565
--- a/dev/null
+++ b/qmake/include/private/qlibrary_p.h
@@ -0,0 +1,84 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of an internal QLibrary class
5**
6** Created : 2000-01-01
7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QLIBRARY_P_H
39#define QLIBRARY_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of the QLibrary class. This header file may change from
47// version to version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53#include "qlibrary.h"
54
55#ifndef QT_NO_LIBRARY
56
57#ifndef QT_H
58#if defined(Q_CC_GNU)
59#warning "avoid including header file \"qwindowdefs.h\" in directory 'tools'"
60#endif
61#include "qwindowdefs.h"
62#endif // QT_H
63
64class QLibraryPrivate
65{
66public:
67 QLibraryPrivate( QLibrary *lib );
68
69#ifdef Q_WS_WIN
70 HINSTANCE pHnd;
71#else
72 void *pHnd;
73#endif
74
75 bool loadLibrary();
76 bool freeLibrary();
77 void *resolveSymbol( const char * );
78
79private:
80 QLibrary *library;
81};
82
83#endif // QT_NO_LIBRARY
84#endif // QLIBRARY_P_H
diff --git a/qmake/include/private/qmousedriverinterface_p.h b/qmake/include/private/qmousedriverinterface_p.h
new file mode 100644
index 0000000..fd76308
--- a/dev/null
+++ b/qmake/include/private/qmousedriverinterface_p.h
@@ -0,0 +1,56 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of Qt/Embedded Mouse Driver Interface
5**
6** Created : 20020220
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file.
16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software.
20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27**
28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you.
30**
31**********************************************************************/
32
33#ifndef QMOUSEDRIVERINTERFACE_H
34#define QMOUSEDRIVERINTERFACE_H
35
36#ifndef QT_H
37#include <private/qcom_p.h>
38#endif // QT_H
39
40#ifndef QT_NO_COMPONENT
41
42// {4367CF5A-F7CE-407B-8BB6-DF19AEDA2EBB}
43#ifndef IID_QMouseDriver
44#define IID_QMouseDriver QUuid( 0x4367cf5a, 0xf7ce, 0x407b, 0x8b, 0xb6, 0xdf, 0x19, 0xae, 0xda, 0x2e, 0xbb)
45#endif
46
47class QWSMouseHandler;
48
49struct Q_EXPORT QMouseDriverInterface : public QFeatureListInterface
50{
51 virtual QWSMouseHandler* create( const QString& driver, const QString &device ) = 0;
52};
53
54#endif // QT_NO_COMPONENT
55
56#endif // QMOUSEDRIVERINTERFACE_H
diff --git a/qmake/include/private/qmutex_p.h b/qmake/include/private/qmutex_p.h
new file mode 100644
index 0000000..d4ce97a
--- a/dev/null
+++ b/qmake/include/private/qmutex_p.h
@@ -0,0 +1,70 @@
1/****************************************************************************
2** $Id$
3**
4** QMutex private class declarations
5**
6** Created : 20012507
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QMUTEX_P_H
39#define QMUTEX_P_H
40
41#ifndef QT_H
42#endif // QT_H
43
44//
45// W A R N I N G
46// -------------
47//
48// This file is not part of the Qt API. It exists for the convenience
49// of qmutex_unix.cpp and qmutex_win.cpp. This header file may change
50// from version to version without notice, or even be removed.
51//
52// We mean it.
53//
54
55class QMutexPrivate {
56public:
57 // Q_MUTEX_T is defined in the various *.cpp files
58 Q_MUTEX_T handle;
59
60 virtual ~QMutexPrivate();
61
62 virtual void lock() = 0;
63 virtual void unlock() = 0;
64 virtual bool locked() = 0;
65 virtual bool trylock() = 0;
66 virtual int type() const = 0;
67};
68
69
70#endif // QMUTEX_P_H
diff --git a/qmake/include/private/qmutexpool_p.h b/qmake/include/private/qmutexpool_p.h
new file mode 100644
index 0000000..3d9fef7
--- a/dev/null
+++ b/qmake/include/private/qmutexpool_p.h
@@ -0,0 +1,39 @@
1#ifndef QMUTEXPOOL_H
2#define QMUTEXPOOL_H
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists for the convenience
9// of QSettings. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14//
15
16#ifdef QT_THREAD_SUPPORT
17
18#include "qmutex.h"
19#include "qmemarray.h"
20
21class QMutexPool
22{
23public:
24 QMutexPool( bool recursive = FALSE, int size = 17 );
25 ~QMutexPool();
26
27 QMutex *get( void *address );
28
29private:
30 QMutex mutex;
31 QMemArray<QMutex*> mutexes;
32 bool recurs;
33};
34
35extern QMutexPool *qt_global_mutexpool;
36
37#endif // QT_THREAD_SUPPORT
38
39#endif // QMUTEXPOOL_H
diff --git a/qmake/include/private/qpainter_p.h b/qmake/include/private/qpainter_p.h
new file mode 100644
index 0000000..43f454e
--- a/dev/null
+++ b/qmake/include/private/qpainter_p.h
@@ -0,0 +1,63 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of some Qt private functions.
5**
6** Created : 000909
7**
8** Copyright (C) 2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QPAINTER_P_H
39#define QPAINTER_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qpainter.cpp and qfont.cpp. This header file may change
48// from version to version without notice, or even be removed.
49//
50// We mean it.
51//
52//
53
54#ifndef QT_H
55#endif // QT_H
56
57extern void qt_format_text( const QFont& f, const QRect &r,
58 int tf, const QString& str, int len, QRect *brect,
59 int tabstops, int* tabarray, int tabarraylen,
60 QTextParag **internal, QPainter* painter );
61
62
63#endif
diff --git a/qmake/include/private/qpluginmanager_p.h b/qmake/include/private/qpluginmanager_p.h
new file mode 100644
index 0000000..4b64ba0
--- a/dev/null
+++ b/qmake/include/private/qpluginmanager_p.h
@@ -0,0 +1,73 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QPluginManager class
5**
6** Created : 2000-01-01
7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QPLUGINMANAGER_H
39#define QPLUGINMANAGER_H
40
41#ifndef QT_H
42#include "qgpluginmanager_p.h"
43#endif // QT_H
44
45//
46// W A R N I N G
47// -------------
48//
49// This file is not part of the Qt API. It exists for the convenience
50// of a number of Qt sources files. This header file may change from
51// version to version without notice, or even be removed.
52//
53// We mean it.
54//
55//
56
57#ifndef QT_NO_COMPONENT
58
59template<class Type>
60class QPluginManager : public QGPluginManager
61{
62public:
63 QPluginManager( const QUuid& id, const QStringList& paths = QString::null, const QString &suffix = QString::null, bool cs = TRUE )
64 : QGPluginManager( id, paths, suffix, cs ) {}
65 QRESULT queryInterface(const QString& feature, Type** iface) const
66 {
67 return queryUnknownInterface( feature, (QUnknownInterface**)iface );
68 }
69};
70
71#endif //QT_NO_COMPONENT
72
73#endif //QPLUGINMANAGER_H
diff --git a/qmake/include/private/qpsprinter_p.h b/qmake/include/private/qpsprinter_p.h
new file mode 100644
index 0000000..27a4968
--- a/dev/null
+++ b/qmake/include/private/qpsprinter_p.h
@@ -0,0 +1,89 @@
1/**********************************************************************
2** $Id$
3**
4** Definition of internal QPSPrinter class.
5** QPSPrinter implements PostScript (tm) output via QPrinter.
6**
7** Created : 940927
8**
9** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
10**
11** This file is part of the kernel module of the Qt GUI Toolkit.
12**
13** This file may be distributed under the terms of the Q Public License
14** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file.
16**
17** This file may be distributed and/or modified under the terms of the
18** GNU General Public License version 2 as published by the Free Software
19** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file.
21**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software.
25**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
27** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information.
33**
34** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you.
36**
37**********************************************************************/
38
39#ifndef QPSPRINTER_P_H
40#define QPSPRINTER_P_H
41
42
43//
44// W A R N I N G
45// -------------
46//
47// This file is not part of the Qt API. It exists for the convenience
48// of qpsprinter.cpp and qprinter_x11.cpp.
49// This header file may change from version to version without notice,
50// or even be removed.
51//
52// We mean it.
53//
54//
55
56
57#ifndef QT_H
58#include "qprinter.h"
59#include "qtextstream.h"
60#endif // QT_H
61
62#ifndef QT_NO_PRINTER
63
64struct QPSPrinterPrivate;
65
66class Q_EXPORT QPSPrinter : public QPaintDevice
67{
68private:
69 // QPrinter uses these
70 QPSPrinter( QPrinter *, int );
71 ~QPSPrinter();
72
73 bool cmd ( int, QPainter *, QPDevCmdParam * );
74
75 enum { NewPage = 100, AbortPrinting };
76
77 friend class QPrinter;
78private:
79 // not used by QPrinter
80 QPSPrinterPrivate *d;
81
82 // Disabled copy constructor and operator=
83 QPSPrinter( const QPSPrinter & );
84 QPSPrinter &operator=( const QPSPrinter & );
85};
86
87#endif // QT_NO_PRINTER
88
89#endif // QPSPRINTER_P_H
diff --git a/qmake/include/private/qrichtext_p.h b/qmake/include/private/qrichtext_p.h
new file mode 100644
index 0000000..8e29804
--- a/dev/null
+++ b/qmake/include/private/qrichtext_p.h
@@ -0,0 +1,2133 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of internal rich text classes
5**
6** Created : 990124
7**
8** Copyright (C) 1999-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QRICHTEXT_P_H
39#define QRICHTEXT_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of a number of Qt sources files. This header file may change from
47// version to version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53#ifndef QT_H
54#include "qstring.h"
55#include "qptrlist.h"
56#include "qrect.h"
57#include "qfontmetrics.h"
58#include "qintdict.h"
59#include "qmap.h"
60#include "qstringlist.h"
61#include "qfont.h"
62#include "qcolor.h"
63#include "qsize.h"
64#include "qvaluelist.h"
65#include "qvaluestack.h"
66#include "qobject.h"
67#include "qdict.h"
68#include "qpixmap.h"
69#include "qstylesheet.h"
70#include "qptrvector.h"
71#include "qpainter.h"
72#include "qlayout.h"
73#include "qobject.h"
74#include "private/qcomplextext_p.h"
75#include "qapplication.h"
76#endif // QT_H
77
78#ifndef QT_NO_RICHTEXT
79
80class QTextDocument;
81class QTextString;
82class QTextPreProcessor;
83class QTextFormat;
84class QTextCursor;
85class QTextParagraph;
86class QTextFormatter;
87class QTextIndent;
88class QTextFormatCollection;
89class QStyleSheetItem;
90#ifndef QT_NO_TEXTCUSTOMITEM
91class QTextCustomItem;
92#endif
93class QTextFlow;
94struct QBidiContext;
95
96// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
97
98class Q_EXPORT QTextStringChar
99{
100 friend class QTextString;
101
102public:
103 // this is never called, initialize variables in QTextString::insert()!!!
104 QTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0;}
105 ~QTextStringChar();
106
107 QChar c;
108 enum Type { Regular=0, Custom=1, Anchor=2, CustomAnchor=3 };
109 uint lineStart : 1;
110 uint rightToLeft : 1;
111 uint hasCursor : 1;
112 uint canBreak : 1;
113 Type type : 2;
114 uint startOfRun : 1;
115
116 int x;
117 int height() const;
118 int ascent() const;
119 int descent() const;
120 bool isCustom() const { return (type & Custom) != 0; }
121 QTextFormat *format() const;
122#ifndef QT_NO_TEXTCUSTOMITEM
123 QTextCustomItem *customItem() const;
124#endif
125 void setFormat( QTextFormat *f );
126#ifndef QT_NO_TEXTCUSTOMITEM
127 void setCustomItem( QTextCustomItem *i );
128#endif
129 struct CustomData
130 {
131 QTextFormat *format;
132#ifndef QT_NO_TEXTCUSTOMITEM
133 QTextCustomItem *custom;
134#endif
135 QString anchorName;
136 QString anchorHref;
137 };
138
139#ifndef QT_NO_TEXTCUSTOMITEM
140 void loseCustomItem();
141#endif
142
143 union {
144 QTextFormat* format;
145 CustomData* custom;
146 } d;
147
148 bool isAnchor() const { return ( type & Anchor) != 0; }
149 bool isLink() const { return isAnchor() && !!d.custom->anchorHref; }
150 QString anchorName() const;
151 QString anchorHref() const;
152 void setAnchor( const QString& name, const QString& href );
153
154private:
155 QTextStringChar &operator=( const QTextStringChar & ) {
156 //abort();
157 return *this;
158 }
159 friend class QComplexText;
160 friend class QTextParagraph;
161};
162
163#if defined(Q_TEMPLATEDLL)
164// MOC_SKIP_BEGIN
165Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<QTextStringChar>;
166// MOC_SKIP_END
167#endif
168
169class Q_EXPORT QTextString
170{
171public:
172
173 QTextString();
174 QTextString( const QTextString &s );
175 virtual ~QTextString();
176
177 static QString toString( const QMemArray<QTextStringChar> &data );
178 QString toString() const;
179
180 QTextStringChar &at( int i ) const;
181#if defined(Q_STRICT_INLINING_RULES)
182 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
183 // implementation to be a redefinition.
184 inline int length() const;
185#else
186 int length() const;
187#endif
188
189 int width( int idx ) const;
190
191 void insert( int index, const QString &s, QTextFormat *f );
192 void insert( int index, const QChar *unicode, int len, QTextFormat *f );
193 void insert( int index, QTextStringChar *c, bool doAddRefFormat = FALSE );
194 void truncate( int index );
195 void remove( int index, int len );
196 void clear();
197
198 void setFormat( int index, QTextFormat *f, bool useCollection );
199
200 void setBidi( bool b ) { bidi = b; }
201 bool isBidi() const;
202 bool isRightToLeft() const;
203 QChar::Direction direction() const;
204 void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; }
205
206 QMemArray<QTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const;
207 QMemArray<QTextStringChar> rawData() const { return data.copy(); }
208
209 void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); }
210 void operator+=( const QString &s ) { insert( length(), s, 0 ); }
211 void prepend( const QString &s ) { insert( 0, s, 0 ); }
212
213private:
214 void checkBidi() const;
215
216 QMemArray<QTextStringChar> data;
217 uint bidiDirty : 1;
218 uint bidi : 1; // true when the paragraph has right to left characters
219 uint rightToLeft : 1;
220 uint dir : 5;
221};
222
223inline bool QTextString::isBidi() const
224{
225 if ( bidiDirty )
226 checkBidi();
227 return bidi;
228}
229
230inline bool QTextString::isRightToLeft() const
231{
232 if ( bidiDirty )
233 checkBidi();
234 return rightToLeft;
235}
236
237inline QChar::Direction QTextString::direction() const
238{
239 return (QChar::Direction) dir;
240}
241
242// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
243
244#if defined(Q_TEMPLATEDLL)
245// MOC_SKIP_BEGIN
246Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<int>;
247Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<QTextParagraph*>;
248Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<bool>;
249// MOC_SKIP_END
250#endif
251
252class Q_EXPORT QTextCursor
253{
254public:
255 QTextCursor( QTextDocument *d = 0 );
256 QTextCursor( const QTextCursor &c );
257 QTextCursor &operator=( const QTextCursor &c );
258 virtual ~QTextCursor() {}
259
260 bool operator==( const QTextCursor &c ) const;
261 bool operator!=( const QTextCursor &c ) const { return !(*this == c); }
262
263#if defined(Q_STRICT_INLINING_RULES)
264 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
265 // implementation to be a redefinition.
266 inline QTextParagraph *paragraph() const;
267#else
268 QTextParagraph *paragraph() const;
269#endif
270
271 void setParagraph( QTextParagraph*p ) { gotoPosition(p, 0 ); }
272 QTextDocument *document() const;
273 int index() const;
274 void setIndex( int index ) { gotoPosition(paragraph(), index ); }
275
276 void gotoPosition( QTextParagraph* p, int index = 0);
277 void gotoLeft();
278 void gotoRight();
279 void gotoNextLetter();
280 void gotoPreviousLetter();
281 void gotoUp();
282 void gotoDown();
283 void gotoLineEnd();
284 void gotoLineStart();
285 void gotoHome();
286 void gotoEnd();
287 void gotoPageUp( int visibleHeight );
288 void gotoPageDown( int visibleHeight );
289 void gotoNextWord();
290 void gotoPreviousWord();
291 void gotoWordLeft();
292 void gotoWordRight();
293
294 void insert( const QString &s, bool checkNewLine, QMemArray<QTextStringChar> *formatting = 0 );
295 void splitAndInsertEmptyParagraph( bool ind = TRUE, bool updateIds = TRUE );
296 bool remove();
297 void indent();
298
299 bool atParagStart();
300 bool atParagEnd();
301
302 int x() const; // x in current paragraph
303 int y() const; // y in current paragraph
304
305 int globalX() const;
306 int globalY() const;
307
308 QTextParagraph *topParagraph() const { return paras.isEmpty() ? para : paras.first(); }
309 int offsetX() const { return ox; } // inner document offset
310 int offsetY() const { return oy; } // inner document offset
311 int totalOffsetX() const; // total document offset
312 int totalOffsetY() const; // total document offset
313
314 bool place( const QPoint &pos, QTextParagraph *s ) { return place( pos, s, FALSE ); }
315 bool place( const QPoint &pos, QTextParagraph *s, bool link );
316 void restoreState();
317
318
319 int nestedDepth() const { return (int)indices.count(); } //### size_t/int cast
320 void oneUp() { if ( !indices.isEmpty() ) pop(); }
321 void setValid( bool b ) { valid = b; }
322 bool isValid() const { return valid; }
323
324private:
325 enum Operation { EnterBegin, EnterEnd, Next, Prev, Up, Down };
326
327 void push();
328 void pop();
329 void processNesting( Operation op );
330 void invalidateNested();
331 void gotoIntoNested( const QPoint &globalPos );
332
333 QTextParagraph *para;
334 int idx, tmpIndex;
335 int ox, oy;
336 QValueStack<int> indices;
337 QValueStack<QTextParagraph*> paras;
338 QValueStack<int> xOffsets;
339 QValueStack<int> yOffsets;
340 uint valid : 1;
341
342};
343
344// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
345
346class Q_EXPORT QTextCommand
347{
348public:
349 enum Commands { Invalid, Insert, Delete, Format, Style };
350
351 QTextCommand( QTextDocument *d ) : doc( d ), cursor( d ) {}
352 virtual ~QTextCommand();
353
354 virtual Commands type() const;
355
356 virtual QTextCursor *execute( QTextCursor *c ) = 0;
357 virtual QTextCursor *unexecute( QTextCursor *c ) = 0;
358
359protected:
360 QTextDocument *doc;
361 QTextCursor cursor;
362
363};
364
365#if defined(Q_TEMPLATEDLL)
366// MOC_SKIP_BEGIN
367Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCommand>;
368// MOC_SKIP_END
369#endif
370
371class Q_EXPORT QTextCommandHistory
372{
373public:
374 QTextCommandHistory( int s ) : current( -1 ), steps( s ) { history.setAutoDelete( TRUE ); }
375 virtual ~QTextCommandHistory();
376
377 void clear() { history.clear(); current = -1; }
378
379 void addCommand( QTextCommand *cmd );
380 QTextCursor *undo( QTextCursor *c );
381 QTextCursor *redo( QTextCursor *c );
382
383 bool isUndoAvailable();
384 bool isRedoAvailable();
385
386 void setUndoDepth( int d ) { steps = d; }
387 int undoDepth() const { return steps; }
388
389 int historySize() const { return history.count(); }
390 int currentPosition() const { return current; }
391
392private:
393 QPtrList<QTextCommand> history;
394 int current, steps;
395
396};
397
398inline QTextCommandHistory::~QTextCommandHistory()
399{
400 clear();
401}
402
403// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
404
405#ifndef QT_NO_TEXTCUSTOMITEM
406class Q_EXPORT QTextCustomItem
407{
408public:
409 QTextCustomItem( QTextDocument *p )
410 : xpos(0), ypos(-1), width(-1), height(0), parent( p )
411 {}
412 virtual ~QTextCustomItem();
413 virtual void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) = 0;
414
415 virtual void adjustToPainter( QPainter* );
416
417 enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight };
418 virtual Placement placement() const;
419 bool placeInline() { return placement() == PlaceInline; }
420
421 virtual bool ownLine() const;
422 virtual void resize( int nwidth );
423 virtual void invalidate();
424 virtual int ascent() const { return height; }
425
426 virtual bool isNested() const;
427 virtual int minimumWidth() const;
428
429 virtual QString richText() const;
430
431 int xpos; // used for floating items
432 int ypos; // used for floating items
433 int width;
434 int height;
435
436 QRect geometry() const { return QRect( xpos, ypos, width, height ); }
437
438 virtual bool enter( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE );
439 virtual bool enterAt( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, const QPoint & );
440 virtual bool next( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
441 virtual bool prev( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
442 virtual bool down( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
443 virtual bool up( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
444
445 void setParagraph( QTextParagraph *p ) { parag = p; }
446 QTextParagraph *paragraph() const { return parag; }
447
448 QTextDocument *parent;
449 QTextParagraph *parag;
450
451 virtual void pageBreak( int y, QTextFlow* flow );
452};
453#endif
454
455#if defined(Q_TEMPLATEDLL)
456// MOC_SKIP_BEGIN
457Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QString, QString>;
458// MOC_SKIP_END
459#endif
460
461#ifndef QT_NO_TEXTCUSTOMITEM
462class Q_EXPORT QTextImage : public QTextCustomItem
463{
464public:
465 QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
466 QMimeSourceFactory &factory );
467 virtual ~QTextImage();
468
469 Placement placement() const { return place; }
470 void adjustToPainter( QPainter* );
471 int minimumWidth() const { return width; }
472
473 QString richText() const;
474
475 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
476
477private:
478 QRegion* reg;
479 QPixmap pm;
480 Placement place;
481 int tmpwidth, tmpheight;
482 QMap<QString, QString> attributes;
483 QString imgId;
484
485};
486#endif
487
488#ifndef QT_NO_TEXTCUSTOMITEM
489class Q_EXPORT QTextHorizontalLine : public QTextCustomItem
490{
491public:
492 QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
493 QMimeSourceFactory &factory );
494 virtual ~QTextHorizontalLine();
495
496 void adjustToPainter( QPainter* );
497 void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
498 QString richText() const;
499
500 bool ownLine() const { return TRUE; }
501
502private:
503 int tmpheight;
504 QColor color;
505 bool shade;
506
507};
508#endif
509
510#ifndef QT_NO_TEXTCUSTOMITEM
511#if defined(Q_TEMPLATEDLL)
512// MOC_SKIP_BEGIN
513Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCustomItem>;
514// MOC_SKIP_END
515#endif
516#endif
517
518class Q_EXPORT QTextFlow
519{
520 friend class QTextDocument;
521#ifndef QT_NO_TEXTCUSTOMITEM
522 friend class QTextTableCell;
523#endif
524
525public:
526 QTextFlow();
527 virtual ~QTextFlow();
528
529 virtual void setWidth( int width );
530 int width() const;
531
532 virtual void setPageSize( int ps );
533 int pageSize() const { return pagesize; }
534
535 virtual int adjustLMargin( int yp, int h, int margin, int space );
536 virtual int adjustRMargin( int yp, int h, int margin, int space );
537
538#ifndef QT_NO_TEXTCUSTOMITEM
539 virtual void registerFloatingItem( QTextCustomItem* item );
540 virtual void unregisterFloatingItem( QTextCustomItem* item );
541#endif
542 virtual QRect boundingRect() const;
543 virtual void drawFloatingItems(QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
544
545 virtual int adjustFlow( int y, int w, int h ); // adjusts y according to the defined pagesize. Returns the shift.
546
547 virtual bool isEmpty();
548
549 void clear();
550
551private:
552 int w;
553 int pagesize;
554
555#ifndef QT_NO_TEXTCUSTOMITEM
556 QPtrList<QTextCustomItem> leftItems;
557 QPtrList<QTextCustomItem> rightItems;
558#endif
559};
560
561inline int QTextFlow::width() const { return w; }
562
563#ifndef QT_NO_TEXTCUSTOMITEM
564class QTextTable;
565
566class Q_EXPORT QTextTableCell : public QLayoutItem
567{
568 friend class QTextTable;
569
570public:
571 QTextTableCell( QTextTable* table,
572 int row, int column,
573 const QMap<QString, QString> &attr,
574 const QStyleSheetItem* style,
575 const QTextFormat& fmt, const QString& context,
576 QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc );
577 virtual ~QTextTableCell();
578
579 QSize sizeHint() const ;
580 QSize minimumSize() const ;
581 QSize maximumSize() const ;
582 QSizePolicy::ExpandData expanding() const;
583 bool isEmpty() const;
584 void setGeometry( const QRect& ) ;
585 QRect geometry() const;
586
587 bool hasHeightForWidth() const;
588 int heightForWidth( int ) const;
589
590 void adjustToPainter( QPainter* );
591
592 int row() const { return row_; }
593 int column() const { return col_; }
594 int rowspan() const { return rowspan_; }
595 int colspan() const { return colspan_; }
596 int stretch() const { return stretch_; }
597
598 QTextDocument* richText() const { return richtext; }
599 QTextTable* table() const { return parent; }
600
601 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
602
603 QBrush *backGround() const { return background; }
604 virtual void invalidate();
605
606 int verticalAlignmentOffset() const;
607 int horizontalAlignmentOffset() const;
608
609private:
610 QRect geom;
611 QTextTable* parent;
612 QTextDocument* richtext;
613 int row_;
614 int col_;
615 int rowspan_;
616 int colspan_;
617 int stretch_;
618 int maxw;
619 int minw;
620 bool hasFixedWidth;
621 QBrush *background;
622 int cached_width;
623 int cached_sizehint;
624 QMap<QString, QString> attributes;
625 int align;
626};
627#endif
628
629#if defined(Q_TEMPLATEDLL)
630// MOC_SKIP_BEGIN
631Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextTableCell>;
632Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QTextCursor*, int>;
633// MOC_SKIP_END
634#endif
635
636#ifndef QT_NO_TEXTCUSTOMITEM
637class Q_EXPORT QTextTable: public QTextCustomItem
638{
639 friend class QTextTableCell;
640
641public:
642 QTextTable( QTextDocument *p, const QMap<QString, QString> &attr );
643 virtual ~QTextTable();
644
645 void adjustToPainter( QPainter *p );
646 void pageBreak( int y, QTextFlow* flow );
647 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch,
648 const QColorGroup& cg, bool selected );
649
650 bool noErase() const { return TRUE; }
651 bool ownLine() const { return TRUE; }
652 Placement placement() const { return place; }
653 bool isNested() const { return TRUE; }
654 void resize( int nwidth );
655 virtual void invalidate();
656
657 virtual bool enter( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE );
658 virtual bool enterAt( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, const QPoint &pos );
659 virtual bool next( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
660 virtual bool prev( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
661 virtual bool down( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
662 virtual bool up( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
663
664 QString richText() const;
665
666 int minimumWidth() const;
667
668 QPtrList<QTextTableCell> tableCells() const { return cells; }
669
670 bool isStretching() const { return stretch; }
671
672private:
673 void format( int w );
674 void addCell( QTextTableCell* cell );
675
676private:
677 QGridLayout* layout;
678 QPtrList<QTextTableCell> cells;
679 int cachewidth;
680 int fixwidth;
681 int cellpadding;
682 int cellspacing;
683 int border;
684 int outerborder;
685 int stretch;
686 int innerborder;
687 int us_cp, us_ib, us_b, us_ob, us_cs;
688 QMap<QString, QString> attributes;
689 QMap<QTextCursor*, int> currCell;
690 Placement place;
691 void adjustCells( int y , int shift );
692 int pageBreakFor;
693};
694#endif
695// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
696
697#ifndef QT_NO_TEXTCUSTOMITEM
698class QTextTableCell;
699class QTextParagraph;
700#endif
701
702struct Q_EXPORT QTextDocumentSelection
703{
704 QTextCursor startCursor, endCursor;
705 bool swapped;
706};
707
708#if defined(Q_TEMPLATEDLL)
709// MOC_SKIP_BEGIN
710Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>;
711Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>;
712Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextDocumentSelection>;
713Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextDocument>;
714// MOC_SKIP_END
715#endif
716
717class Q_EXPORT QTextDocument : public QObject
718{
719 Q_OBJECT
720
721#ifndef QT_NO_TEXTCUSTOMITEM
722 friend class QTextTableCell;
723#endif
724 friend class QTextCursor;
725 friend class QTextEdit;
726 friend class QTextParagraph;
727
728public:
729 enum SelectionIds {
730 Standard = 0,
731 IMSelectionText = 31998,
732 IMCompositionText= 31999, // this must be higher!
733 Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to
734 // remove multiple lines with removeSelectedText()
735 };
736
737 QTextDocument( QTextDocument *p );
738 QTextDocument( QTextDocument *d, QTextFormatCollection *f );
739 virtual ~QTextDocument();
740
741 QTextDocument *parent() const { return par; }
742 QTextParagraph *parentParagraph() const { return parentPar; }
743
744 void setText( const QString &text, const QString &context );
745 QMap<QString, QString> attributes() const { return attribs; }
746 void setAttributes( const QMap<QString, QString> &attr ) { attribs = attr; }
747
748 QString text() const;
749 QString text( int parag ) const;
750 QString originalText() const;
751
752 int x() const;
753 int y() const;
754 int width() const;
755 int widthUsed() const;
756 int visibleWidth() const;
757 int height() const;
758 void setWidth( int w );
759 int minimumWidth() const;
760 bool setMinimumWidth( int needed, int used = -1, QTextParagraph *parag = 0 );
761
762 void setY( int y );
763 int leftMargin() const;
764 void setLeftMargin( int lm );
765 int rightMargin() const;
766 void setRightMargin( int rm );
767
768 QTextParagraph *firstParagraph() const;
769 QTextParagraph *lastParagraph() const;
770 void setFirstParagraph( QTextParagraph *p );
771 void setLastParagraph( QTextParagraph *p );
772
773 void invalidate();
774
775 void setPreProcessor( QTextPreProcessor *sh );
776 QTextPreProcessor *preProcessor() const;
777
778 void setFormatter( QTextFormatter *f );
779 QTextFormatter *formatter() const;
780
781 void setIndent( QTextIndent *i );
782 QTextIndent *indent() const;
783
784 QColor selectionColor( int id ) const;
785 bool invertSelectionText( int id ) const;
786 void setSelectionColor( int id, const QColor &c );
787 void setInvertSelectionText( int id, bool b );
788 bool hasSelection( int id, bool visible = FALSE ) const;
789 void setSelectionStart( int id, const QTextCursor &cursor );
790 bool setSelectionEnd( int id, const QTextCursor &cursor );
791 void selectAll( int id );
792 bool removeSelection( int id );
793 void selectionStart( int id, int &paragId, int &index );
794 QTextCursor selectionStartCursor( int id );
795 QTextCursor selectionEndCursor( int id );
796 void selectionEnd( int id, int &paragId, int &index );
797 void setFormat( int id, QTextFormat *f, int flags );
798 int numSelections() const { return nSelections; }
799 void addSelection( int id );
800
801 QString selectedText( int id, bool asRichText = FALSE ) const;
802 void removeSelectedText( int id, QTextCursor *cursor );
803 void indentSelection( int id );
804
805 QTextParagraph *paragAt( int i ) const;
806
807 void addCommand( QTextCommand *cmd );
808 QTextCursor *undo( QTextCursor *c = 0 );
809 QTextCursor *redo( QTextCursor *c = 0 );
810 QTextCommandHistory *commands() const { return commandHistory; }
811
812 QTextFormatCollection *formatCollection() const;
813
814 bool find( QTextCursor &cursor, const QString &expr, bool cs, bool wo, bool forward);
815
816 void setTextFormat( Qt::TextFormat f );
817 Qt::TextFormat textFormat() const;
818
819 bool inSelection( int selId, const QPoint &pos ) const;
820
821 QStyleSheet *styleSheet() const { return sheet_; }
822#ifndef QT_NO_MIME
823 QMimeSourceFactory *mimeSourceFactory() const { return factory_; }
824#endif
825 QString context() const { return contxt; }
826
827 void setStyleSheet( QStyleSheet *s );
828 void setDefaultFormat( const QFont &font, const QColor &color );
829#ifndef QT_NO_MIME
830 void setMimeSourceFactory( QMimeSourceFactory *f ) { if ( f ) factory_ = f; }
831#endif
832 void setContext( const QString &c ) { if ( !c.isEmpty() ) contxt = c; }
833
834 void setUnderlineLinks( bool b );
835 bool underlineLinks() const { return underlLinks; }
836
837 void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
838 QBrush *paper() const { return backBrush; }
839
840 void doLayout( QPainter *p, int w );
841 void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
842 void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch,
843 QPixmap *&doubleBuffer, const QColorGroup &cg,
844 bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE );
845 QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg,
846 bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0,
847 bool resetChanged = TRUE );
848
849#ifndef QT_NO_TEXTCUSTOMITEM
850 void registerCustomItem( QTextCustomItem *i, QTextParagraph *p );
851 void unregisterCustomItem( QTextCustomItem *i, QTextParagraph *p );
852#endif
853
854 void setFlow( QTextFlow *f );
855 void takeFlow();
856 QTextFlow *flow() const { return flow_; }
857 bool isPageBreakEnabled() const { return pages; }
858 void setPageBreakEnabled( bool b ) { pages = b; }
859
860 void setUseFormatCollection( bool b ) { useFC = b; }
861 bool useFormatCollection() const { return useFC; }
862
863#ifndef QT_NO_TEXTCUSTOMITEM
864 QTextTableCell *tableCell() const { return tc; }
865 void setTableCell( QTextTableCell *c ) { tc = c; }
866#endif
867
868 void setPlainText( const QString &text );
869 void setRichText( const QString &text, const QString &context );
870 QString richText() const;
871 QString plainText() const;
872
873 bool focusNextPrevChild( bool next );
874
875 int alignment() const;
876 void setAlignment( int a );
877
878 int *tabArray() const;
879 int tabStopWidth() const;
880 void setTabArray( int *a );
881 void setTabStops( int tw );
882
883 void setUndoDepth( int d ) { commandHistory->setUndoDepth( d ); }
884 int undoDepth() const { return commandHistory->undoDepth(); }
885
886 int length() const;
887 void clear( bool createEmptyParag = FALSE );
888
889 virtual QTextParagraph *createParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
890 void insertChild( QObject *o ) { QObject::insertChild( o ); }
891 void removeChild( QObject *o ) { QObject::removeChild( o ); }
892 void insertChild( QTextDocument *d ) { childList.append( d ); }
893 void removeChild( QTextDocument *d ) { childList.removeRef( d ); }
894 QPtrList<QTextDocument> children() const { return childList; }
895
896 bool hasFocusParagraph() const;
897 QString focusHref() const;
898 QString focusName() const;
899
900 void invalidateOriginalText() { oTextValid = FALSE; oText = ""; }
901
902signals:
903 void minimumWidthChanged( int );
904
905private:
906 void init();
907 QPixmap *bufferPixmap( const QSize &s );
908 // HTML parser
909 bool hasPrefix(const QChar* doc, int length, int pos, QChar c);
910 bool hasPrefix(const QChar* doc, int length, int pos, const QString& s);
911#ifndef QT_NO_TEXTCUSTOMITEM
912 QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt,
913 const QChar* doc, int length, int& pos, QTextParagraph *curpar );
914#endif
915 bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE );
916 bool eat(const QChar* doc, int length, int& pos, QChar c);
917 QString parseOpenTag(const QChar* doc, int length, int& pos, QMap<QString, QString> &attr, bool& emptyTag);
918 QString parseCloseTag( const QChar* doc, int length, int& pos );
919 QChar parseHTMLSpecialChar(const QChar* doc, int length, int& pos);
920 QString parseWord(const QChar* doc, int length, int& pos, bool lower = TRUE);
921 QChar parseChar(const QChar* doc, int length, int& pos, QStyleSheetItem::WhiteSpaceMode wsm );
922 void setRichTextInternal( const QString &text, QTextCursor* cursor = 0 );
923 void setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar );
924
925private:
926 struct Q_EXPORT Focus {
927 QTextParagraph *parag;
928 int start, len;
929 QString href;
930 QString name;
931 };
932
933 int cx, cy, cw, vw;
934 QTextParagraph *fParag, *lParag;
935 QTextPreProcessor *pProcessor;
936 QMap<int, QColor> selectionColors;
937 QMap<int, QTextDocumentSelection> selections;
938 QMap<int, bool> selectionText;
939 QTextCommandHistory *commandHistory;
940 QTextFormatter *pFormatter;
941 QTextIndent *indenter;
942 QTextFormatCollection *fCollection;
943 Qt::TextFormat txtFormat;
944 uint preferRichText : 1;
945 uint pages : 1;
946 uint useFC : 1;
947 uint withoutDoubleBuffer : 1;
948 uint underlLinks : 1;
949 uint nextDoubleBuffered : 1;
950 uint oTextValid : 1;
951 uint mightHaveCustomItems : 1;
952 int align;
953 int nSelections;
954 QTextFlow *flow_;
955 QTextDocument *par;
956 QTextParagraph *parentPar;
957#ifndef QT_NO_TEXTCUSTOMITEM
958 QTextTableCell *tc;
959#endif
960 QBrush *backBrush;
961 QPixmap *buf_pixmap;
962 Focus focusIndicator;
963 int minw;
964 int wused;
965 int leftmargin;
966 int rightmargin;
967 QTextParagraph *minwParag, *curParag;
968 QStyleSheet* sheet_;
969#ifndef QT_NO_MIME
970 QMimeSourceFactory* factory_;
971#endif
972 QString contxt;
973 QMap<QString, QString> attribs;
974 int *tArray;
975 int tStopWidth;
976 int uDepth;
977 QString oText;
978 QPtrList<QTextDocument> childList;
979 QColor linkColor;
980 double scaleFontsFactor;
981
982 short list_tm,list_bm, list_lm, li_tm, li_bm, par_tm, par_bm;
983#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
984 QTextDocument( const QTextDocument & );
985 QTextDocument &operator=( const QTextDocument & );
986#endif
987};
988
989// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
990
991
992class Q_EXPORT QTextDeleteCommand : public QTextCommand
993{
994public:
995 QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str,
996 const QByteArray& oldStyle );
997 QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str );
998 virtual ~QTextDeleteCommand();
999
1000 Commands type() const { return Delete; }
1001 QTextCursor *execute( QTextCursor *c );
1002 QTextCursor *unexecute( QTextCursor *c );
1003
1004protected:
1005 int id, index;
1006 QTextParagraph *parag;
1007 QMemArray<QTextStringChar> text;
1008 QByteArray styleInformation;
1009
1010};
1011
1012class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand
1013{
1014public:
1015 QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str,
1016 const QByteArray& oldStyleInfo )
1017 : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {}
1018 QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str )
1019 : QTextDeleteCommand( p, idx, str ) {}
1020 virtual ~QTextInsertCommand() {}
1021
1022 Commands type() const { return Insert; }
1023 QTextCursor *execute( QTextCursor *c ) { return QTextDeleteCommand::unexecute( c ); }
1024 QTextCursor *unexecute( QTextCursor *c ) { return QTextDeleteCommand::execute( c ); }
1025
1026};
1027
1028class Q_EXPORT QTextFormatCommand : public QTextCommand
1029{
1030public:
1031 QTextFormatCommand( QTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<QTextStringChar> &old, QTextFormat *f, int fl );
1032 virtual ~QTextFormatCommand();
1033
1034 Commands type() const { return Format; }
1035 QTextCursor *execute( QTextCursor *c );
1036 QTextCursor *unexecute( QTextCursor *c );
1037
1038protected:
1039 int startId, startIndex, endId, endIndex;
1040 QTextFormat *format;
1041 QMemArray<QTextStringChar> oldFormats;
1042 int flags;
1043
1044};
1045
1046class Q_EXPORT QTextStyleCommand : public QTextCommand
1047{
1048public:
1049 QTextStyleCommand( QTextDocument *d, int fParag, int lParag, const QByteArray& beforeChange );
1050 virtual ~QTextStyleCommand() {}
1051
1052 Commands type() const { return Style; }
1053 QTextCursor *execute( QTextCursor *c );
1054 QTextCursor *unexecute( QTextCursor *c );
1055
1056 static QByteArray readStyleInformation( QTextDocument* d, int fParag, int lParag );
1057 static void writeStyleInformation( QTextDocument* d, int fParag, const QByteArray& style );
1058
1059private:
1060 int firstParag, lastParag;
1061 QByteArray before;
1062 QByteArray after;
1063};
1064
1065// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1066
1067struct Q_EXPORT QTextParagraphSelection
1068{
1069 int start, end;
1070};
1071
1072struct Q_EXPORT QTextLineStart
1073{
1074 QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 )
1075#ifndef QT_NO_COMPLEXTEXT
1076 , bidicontext( 0 )
1077#endif
1078 { }
1079 QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ),
1080 w( 0 )
1081#ifndef QT_NO_COMPLEXTEXT
1082 , bidicontext( 0 )
1083#endif
1084 { }
1085#ifndef QT_NO_COMPLEXTEXT
1086 QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0),
1087 status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); }
1088#endif
1089
1090 virtual ~QTextLineStart()
1091 {
1092#ifndef QT_NO_COMPLEXTEXT
1093 if ( bidicontext && bidicontext->deref() )
1094 delete bidicontext;
1095#endif
1096 }
1097
1098#ifndef QT_NO_COMPLEXTEXT
1099 void setContext( QBidiContext *c ) {
1100 if ( c == bidicontext )
1101 return;
1102 if ( bidicontext && bidicontext->deref() )
1103 delete bidicontext;
1104 bidicontext = c;
1105 if ( bidicontext )
1106 bidicontext->ref();
1107 }
1108 QBidiContext *context() const { return bidicontext; }
1109#endif
1110
1111public:
1112 ushort y, baseLine, h;
1113#ifndef QT_NO_COMPLEXTEXT
1114 QBidiStatus status;
1115#endif
1116 int w;
1117
1118private:
1119#ifndef QT_NO_COMPLEXTEXT
1120 QBidiContext *bidicontext;
1121#endif
1122};
1123
1124#if defined(Q_TEMPLATEDLL)
1125// MOC_SKIP_BEGIN
1126Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextParagraphSelection>;
1127Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextLineStart*>;
1128// MOC_SKIP_END
1129#endif
1130
1131class Q_EXPORT QTextParagraphData
1132{
1133public:
1134 QTextParagraphData() {}
1135 virtual ~QTextParagraphData();
1136 virtual void join( QTextParagraphData * );
1137};
1138
1139class Q_EXPORT QTextParagraphPseudoDocument
1140{
1141public:
1142 QTextParagraphPseudoDocument();
1143 ~QTextParagraphPseudoDocument();
1144 QRect docRect;
1145 QTextFormatter *pFormatter;
1146 QTextCommandHistory *commandHistory;
1147 int minw;
1148 int wused;
1149};
1150
1151//nase
1152class Q_EXPORT QTextParagraph
1153{
1154 friend class QTextDocument;
1155 friend class QTextCursor;
1156
1157public:
1158 QTextParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
1159 virtual ~QTextParagraph();
1160
1161 QTextString *string() const;
1162 QTextStringChar *at( int i ) const; // maybe remove later
1163 int leftGap() const;
1164 int length() const; // maybe remove later
1165
1166 void setListStyle( QStyleSheetItem::ListStyle ls ) { lstyle = ls; changed = TRUE; }
1167 QStyleSheetItem::ListStyle listStyle() const { return lstyle; }
1168 void setListItem( bool li );
1169 bool isListItem() const { return litem; }
1170 void setListValue( int v ) { list_val = v; }
1171 int listValue() const { return list_val > 0 ? list_val : -1; }
1172
1173 void setListDepth( int depth );
1174 int listDepth() const { return ldepth; }
1175
1176// void setFormat( QTextFormat *fm );
1177// QTextFormat *paragFormat() const;
1178
1179 QTextDocument *document() const;
1180 QTextParagraphPseudoDocument *pseudoDocument() const;
1181
1182 QRect rect() const;
1183 void setHeight( int h ) { r.setHeight( h ); }
1184 void show();
1185 void hide();
1186 bool isVisible() const { return visible; }
1187
1188 QTextParagraph *prev() const;
1189 QTextParagraph *next() const;
1190 void setPrev( QTextParagraph *s );
1191 void setNext( QTextParagraph *s );
1192
1193 void insert( int index, const QString &s );
1194 void insert( int index, const QChar *unicode, int len );
1195 void append( const QString &s, bool reallyAtEnd = FALSE );
1196 void truncate( int index );
1197 void remove( int index, int len );
1198 void join( QTextParagraph *s );
1199
1200 void invalidate( int chr );
1201
1202 void move( int &dy );
1203 void format( int start = -1, bool doMove = TRUE );
1204
1205 bool isValid() const;
1206 bool hasChanged() const;
1207 void setChanged( bool b, bool recursive = FALSE );
1208
1209 int lineHeightOfChar( int i, int *bl = 0, int *y = 0 ) const;
1210 QTextStringChar *lineStartOfChar( int i, int *index = 0, int *line = 0 ) const;
1211 int lines() const;
1212 QTextStringChar *lineStartOfLine( int line, int *index = 0 ) const;
1213 int lineY( int l ) const;
1214 int lineBaseLine( int l ) const;
1215 int lineHeight( int l ) const;
1216 void lineInfo( int l, int &y, int &h, int &bl ) const;
1217
1218 void setSelection( int id, int start, int end );
1219 void removeSelection( int id );
1220 int selectionStart( int id ) const;
1221 int selectionEnd( int id ) const;
1222 bool hasSelection( int id ) const;
1223 bool hasAnySelection() const;
1224 bool fullSelected( int id ) const;
1225
1226 void setEndState( int s );
1227 int endState() const;
1228
1229 void setParagId( int i );
1230 int paragId() const;
1231
1232 bool firstPreProcess() const;
1233 void setFirstPreProcess( bool b );
1234
1235 void indent( int *oldIndent = 0, int *newIndent = 0 );
1236
1237 void setExtraData( QTextParagraphData *data );
1238 QTextParagraphData *extraData() const;
1239
1240 QMap<int, QTextLineStart*> &lineStartList();
1241
1242 void setFormat( int index, int len, QTextFormat *f, bool useCollection = TRUE, int flags = -1 );
1243
1244 void setAlignment( int a );
1245 int alignment() const;
1246
1247 virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE,
1248 int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 );
1249
1250 virtual int topMargin() const;
1251 virtual int bottomMargin() const;
1252 virtual int leftMargin() const;
1253 virtual int firstLineMargin() const;
1254 virtual int rightMargin() const;
1255 virtual int lineSpacing() const;
1256
1257#ifndef QT_NO_TEXTCUSTOMITEM
1258 void registerFloatingItem( QTextCustomItem *i );
1259 void unregisterFloatingItem( QTextCustomItem *i );
1260#endif
1261
1262 void setFullWidth( bool b ) { fullWidth = b; }
1263 bool isFullWidth() const { return fullWidth; }
1264
1265#ifndef QT_NO_TEXTCUSTOMITEM
1266 QTextTableCell *tableCell() const;
1267#endif
1268
1269 QBrush *background() const;
1270
1271 int documentWidth() const;
1272 int documentVisibleWidth() const;
1273 int documentX() const;
1274 int documentY() const;
1275 QTextFormatCollection *formatCollection() const;
1276 QTextFormatter *formatter() const;
1277
1278 virtual int nextTab( int i, int x );
1279 int *tabArray() const;
1280 void setTabArray( int *a );
1281 void setTabStops( int tw );
1282
1283 void adjustToPainter( QPainter *p );
1284
1285 void setNewLinesAllowed( bool b );
1286 bool isNewLinesAllowed() const;
1287
1288 QString richText() const;
1289
1290 void addCommand( QTextCommand *cmd );
1291 QTextCursor *undo( QTextCursor *c = 0 );
1292 QTextCursor *redo( QTextCursor *c = 0 );
1293 QTextCommandHistory *commands() const;
1294 virtual void copyParagData( QTextParagraph *parag );
1295
1296 void setBreakable( bool b ) { breakable = b; }
1297 bool isBreakable() const { return breakable; }
1298
1299 void setBackgroundColor( const QColor &c );
1300 QColor *backgroundColor() const { return bgcol; }
1301 void clearBackgroundColor();
1302
1303 void setMovedDown( bool b ) { movedDown = b; }
1304 bool wasMovedDown() const { return movedDown; }
1305
1306 void setDirection( QChar::Direction d );
1307 QChar::Direction direction() const;
1308 void setPaintDevice( QPaintDevice *pd ) { paintdevice = pd; }
1309
1310 void readStyleInformation( QDataStream& stream );
1311 void writeStyleInformation( QDataStream& stream ) const;
1312
1313protected:
1314 virtual void setColorForSelection( QColor &c, QPainter &p, const QColorGroup& cg, int selection );
1315 virtual void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg );
1316 virtual void drawString( QPainter &painter, const QString &str, int start, int len, int xstart,
1317 int y, int baseLine, int w, int h, int selection,
1318 QTextStringChar *formatChar, const QColorGroup& cg,
1319 bool rightToLeft );
1320
1321private:
1322 QMap<int, QTextParagraphSelection> &selections() const;
1323#ifndef QT_NO_TEXTCUSTOMITEM
1324 QPtrList<QTextCustomItem> &floatingItems() const;
1325#endif
1326 QBrush backgroundBrush( const QColorGroup&cg ) { if ( bgcol ) return *bgcol; return cg.brush( QColorGroup::Base ); }
1327 void invalidateStyleCache();
1328
1329 QMap<int, QTextLineStart*> lineStarts;
1330 int invalid;
1331 QRect r;
1332 QTextParagraph *p, *n;
1333 void *docOrPseudo;
1334 uint changed : 1;
1335 uint firstFormat : 1;
1336 uint firstPProcess : 1;
1337 uint needPreProcess : 1;
1338 uint fullWidth : 1;
1339 uint lastInFrame : 1;
1340 uint visible : 1;
1341 uint breakable : 1;
1342 uint movedDown : 1;
1343 uint mightHaveCustomItems : 1;
1344 uint hasdoc : 1;
1345 uint litem : 1; // whether the paragraph is a list item
1346 uint rtext : 1; // whether the paragraph needs rich text margin
1347 int align : 4;
1348 int state, id;
1349 QTextString *str;
1350 QMap<int, QTextParagraphSelection> *mSelections;
1351#ifndef QT_NO_TEXTCUSTOMITEM
1352 QPtrList<QTextCustomItem> *mFloatingItems;
1353#endif
1354 QStyleSheetItem::ListStyle lstyle;
1355 short utm, ubm, ulm, urm, uflm, ulinespacing;
1356 int *tArray;
1357 short tabStopWidth;
1358 QTextParagraphData *eData;
1359 short list_val;
1360 QColor *bgcol;
1361 ushort ldepth;
1362 QPaintDevice *paintdevice;
1363};
1364
1365// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1366
1367class Q_EXPORT QTextFormatter
1368{
1369public:
1370 QTextFormatter();
1371 virtual ~QTextFormatter();
1372
1373 virtual int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ) = 0;
1374 virtual int formatVertically( QTextDocument* doc, QTextParagraph* parag );
1375
1376 bool isWrapEnabled( QTextParagraph *p ) const { if ( !wrapEnabled ) return FALSE; if ( p && !p->isBreakable() ) return FALSE; return TRUE;}
1377 int wrapAtColumn() const { return wrapColumn;}
1378 virtual void setWrapEnabled( bool b );
1379 virtual void setWrapAtColumn( int c );
1380 virtual void setAllowBreakInWords( bool b ) { biw = b; }
1381 bool allowBreakInWords() const { return biw; }
1382
1383 int minimumWidth() const { return thisminw; }
1384 int widthUsed() const { return thiswused; }
1385
1386 static bool isBreakable( QTextString *string, int pos );
1387
1388protected:
1389 virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start,
1390 QTextStringChar *last, int align = Qt::AlignAuto, int space = 0 );
1391#ifndef QT_NO_COMPLEXTEXT
1392 virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start,
1393 QTextStringChar *last, int align, int space );
1394#endif
1395 void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls );
1396
1397 int thisminw;
1398 int thiswused;
1399
1400private:
1401 bool wrapEnabled;
1402 int wrapColumn;
1403 bool biw;
1404
1405#ifdef HAVE_THAI_BREAKS
1406 static QCString *thaiCache;
1407 static QTextString *cachedString;
1408 static ThBreakIterator *thaiIt;
1409#endif
1410};
1411
1412// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1413
1414class Q_EXPORT QTextFormatterBreakInWords : public QTextFormatter
1415{
1416public:
1417 QTextFormatterBreakInWords();
1418 virtual ~QTextFormatterBreakInWords() {}
1419
1420 int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts );
1421
1422};
1423
1424// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1425
1426class Q_EXPORT QTextFormatterBreakWords : public QTextFormatter
1427{
1428public:
1429 QTextFormatterBreakWords();
1430 virtual ~QTextFormatterBreakWords() {}
1431
1432 int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts );
1433
1434};
1435
1436// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1437
1438class Q_EXPORT QTextIndent
1439{
1440public:
1441 QTextIndent();
1442 virtual ~QTextIndent() {}
1443
1444 virtual void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent = 0, int *newIndent = 0 ) = 0;
1445
1446};
1447
1448// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1449
1450class Q_EXPORT QTextPreProcessor
1451{
1452public:
1453 enum Ids {
1454 Standard = 0
1455 };
1456
1457 QTextPreProcessor();
1458 virtual ~QTextPreProcessor() {}
1459
1460 virtual void process( QTextDocument *doc, QTextParagraph *, int, bool = TRUE ) = 0;
1461 virtual QTextFormat *format( int id ) = 0;
1462
1463};
1464
1465// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1466
1467class Q_EXPORT QTextFormat
1468{
1469 friend class QTextFormatCollection;
1470 friend class QTextDocument;
1471
1472public:
1473 enum Flags {
1474 NoFlags,
1475 Bold = 1,
1476 Italic = 2,
1477 Underline = 4,
1478 Family = 8,
1479 Size = 16,
1480 Color = 32,
1481 Misspelled = 64,
1482 VAlign = 128,
1483 StrikeOut= 256,
1484 Font = Bold | Italic | Underline | Family | Size | StrikeOut,
1485 Format = Font | Color | Misspelled | VAlign
1486 };
1487
1488 enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript };
1489
1490 QTextFormat();
1491 virtual ~QTextFormat();
1492
1493 QTextFormat( const QStyleSheetItem *s );
1494 QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent = 0 );
1495 QTextFormat( const QTextFormat &fm );
1496 QTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr, double scaleFontsFactor ) const;
1497 QTextFormat& operator=( const QTextFormat &fm );
1498 QColor color() const;
1499 QFont font() const;
1500 bool isMisspelled() const;
1501 VerticalAlignment vAlign() const;
1502 int minLeftBearing() const;
1503 int minRightBearing() const;
1504 int width( const QChar &c ) const;
1505 int width( const QString &str, int pos ) const;
1506 int height() const;
1507 int ascent() const;
1508 int descent() const;
1509 int leading() const;
1510 bool useLinkColor() const;
1511
1512 void setBold( bool b );
1513 void setItalic( bool b );
1514 void setUnderline( bool b );
1515 void setStrikeOut( bool b );
1516 void setFamily( const QString &f );
1517 void setPointSize( int s );
1518 void setFont( const QFont &f );
1519 void setColor( const QColor &c );
1520 void setMisspelled( bool b );
1521 void setVAlign( VerticalAlignment a );
1522
1523 bool operator==( const QTextFormat &f ) const;
1524 QTextFormatCollection *parent() const;
1525 const QString &key() const;
1526
1527 static QString getKey( const QFont &f, const QColor &c, bool misspelled, VerticalAlignment vAlign );
1528
1529 void addRef();
1530 void removeRef();
1531
1532 QString makeFormatChangeTags( QTextFormat* defaultFormat, QTextFormat *f, const QString& oldAnchorHref, const QString& anchorHref ) const;
1533 QString makeFormatEndTags( QTextFormat* defaultFormat, const QString& anchorHref ) const;
1534
1535 static void setPainter( QPainter *p );
1536 static QPainter* painter();
1537
1538 bool fontSizesInPixels() { return usePixelSizes; }
1539
1540protected:
1541 virtual void generateKey();
1542
1543private:
1544 void update();
1545 static void applyFont( const QFont &f );
1546
1547private:
1548 QFont fn;
1549 QColor col;
1550 QFontMetrics fm;
1551 uint missp : 1;
1552 uint linkColor : 1;
1553 uint usePixelSizes : 1;
1554 int leftBearing, rightBearing;
1555 VerticalAlignment ha;
1556 uchar widths[ 256 ];
1557 int hei, asc, dsc;
1558 QTextFormatCollection *collection;
1559 int ref;
1560 QString k;
1561 int logicalFontSize;
1562 int stdSize;
1563 static QPainter *pntr;
1564 static QFontMetrics *pntr_fm;
1565 static int pntr_asc;
1566 static int pntr_hei;
1567 static int pntr_ldg;
1568 static int pntr_dsc;
1569
1570};
1571
1572// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1573
1574#if defined(Q_TEMPLATEDLL)
1575// MOC_SKIP_BEGIN
1576Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QTextFormat>;
1577// MOC_SKIP_END
1578#endif
1579
1580class Q_EXPORT QTextFormatCollection
1581{
1582 friend class QTextDocument;
1583 friend class QTextFormat;
1584
1585public:
1586 QTextFormatCollection();
1587 virtual ~QTextFormatCollection();
1588
1589 void setDefaultFormat( QTextFormat *f );
1590 QTextFormat *defaultFormat() const;
1591 virtual QTextFormat *format( QTextFormat *f );
1592 virtual QTextFormat *format( QTextFormat *of, QTextFormat *nf, int flags );
1593 virtual QTextFormat *format( const QFont &f, const QColor &c );
1594 virtual void remove( QTextFormat *f );
1595 virtual QTextFormat *createFormat( const QTextFormat &f ) { return new QTextFormat( f ); }
1596 virtual QTextFormat *createFormat( const QFont &f, const QColor &c ) { return new QTextFormat( f, c, this ); }
1597
1598 void updateDefaultFormat( const QFont &font, const QColor &c, QStyleSheet *sheet );
1599 QDict<QTextFormat> dict() const { return cKey; }
1600
1601 QPaintDevice *paintDevice() const { return paintdevice; }
1602 void setPaintDevice( QPaintDevice * );
1603
1604private:
1605 void updateKeys();
1606
1607private:
1608 QTextFormat *defFormat, *lastFormat, *cachedFormat;
1609 QDict<QTextFormat> cKey;
1610 QTextFormat *cres;
1611 QFont cfont;
1612 QColor ccol;
1613 QString kof, knf;
1614 int cflags;
1615
1616 QPaintDevice *paintdevice;
1617};
1618
1619// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1620
1621inline int QTextString::length() const
1622{
1623 return data.size();
1624}
1625
1626inline int QTextParagraph::length() const
1627{
1628 return str->length();
1629}
1630
1631inline QRect QTextParagraph::rect() const
1632{
1633 return r;
1634}
1635
1636inline QTextParagraph *QTextCursor::paragraph() const
1637{
1638 return para;
1639}
1640
1641inline int QTextCursor::index() const
1642{
1643 return idx;
1644}
1645
1646
1647// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1648
1649inline int QTextDocument::x() const
1650{
1651 return cx;
1652}
1653
1654inline int QTextDocument::y() const
1655{
1656 return cy;
1657}
1658
1659inline int QTextDocument::width() const
1660{
1661 return QMAX( cw, flow_->width() );
1662}
1663
1664inline int QTextDocument::visibleWidth() const
1665{
1666 return vw;
1667}
1668
1669inline QTextParagraph *QTextDocument::firstParagraph() const
1670{
1671 return fParag;
1672}
1673
1674inline QTextParagraph *QTextDocument::lastParagraph() const
1675{
1676 return lParag;
1677}
1678
1679inline void QTextDocument::setFirstParagraph( QTextParagraph *p )
1680{
1681 fParag = p;
1682}
1683
1684inline void QTextDocument::setLastParagraph( QTextParagraph *p )
1685{
1686 lParag = p;
1687}
1688
1689inline void QTextDocument::setWidth( int w )
1690{
1691 cw = QMAX( w, minw );
1692 flow_->setWidth( cw );
1693 vw = w;
1694}
1695
1696inline int QTextDocument::minimumWidth() const
1697{
1698 return minw;
1699}
1700
1701inline void QTextDocument::setY( int y )
1702{
1703 cy = y;
1704}
1705
1706inline int QTextDocument::leftMargin() const
1707{
1708 return leftmargin;
1709}
1710
1711inline void QTextDocument::setLeftMargin( int lm )
1712{
1713 leftmargin = lm;
1714}
1715
1716inline int QTextDocument::rightMargin() const
1717{
1718 return rightmargin;
1719}
1720
1721inline void QTextDocument::setRightMargin( int rm )
1722{
1723 rightmargin = rm;
1724}
1725
1726inline QTextPreProcessor *QTextDocument::preProcessor() const
1727{
1728 return pProcessor;
1729}
1730
1731inline void QTextDocument::setPreProcessor( QTextPreProcessor * sh )
1732{
1733 pProcessor = sh;
1734}
1735
1736inline void QTextDocument::setFormatter( QTextFormatter *f )
1737{
1738 delete pFormatter;
1739 pFormatter = f;
1740}
1741
1742inline QTextFormatter *QTextDocument::formatter() const
1743{
1744 return pFormatter;
1745}
1746
1747inline void QTextDocument::setIndent( QTextIndent *i )
1748{
1749 indenter = i;
1750}
1751
1752inline QTextIndent *QTextDocument::indent() const
1753{
1754 return indenter;
1755}
1756
1757inline QColor QTextDocument::selectionColor( int id ) const
1758{
1759 return selectionColors[ id ];
1760}
1761
1762inline bool QTextDocument::invertSelectionText( int id ) const
1763{
1764 return selectionText[ id ];
1765}
1766
1767inline void QTextDocument::setSelectionColor( int id, const QColor &c )
1768{
1769 selectionColors[ id ] = c;
1770}
1771
1772inline void QTextDocument::setInvertSelectionText( int id, bool b )
1773{
1774 selectionText[ id ] = b;
1775}
1776
1777inline QTextFormatCollection *QTextDocument::formatCollection() const
1778{
1779 return fCollection;
1780}
1781
1782inline int QTextDocument::alignment() const
1783{
1784 return align;
1785}
1786
1787inline void QTextDocument::setAlignment( int a )
1788{
1789 align = a;
1790}
1791
1792inline int *QTextDocument::tabArray() const
1793{
1794 return tArray;
1795}
1796
1797inline int QTextDocument::tabStopWidth() const
1798{
1799 return tStopWidth;
1800}
1801
1802inline void QTextDocument::setTabArray( int *a )
1803{
1804 tArray = a;
1805}
1806
1807inline void QTextDocument::setTabStops( int tw )
1808{
1809 tStopWidth = tw;
1810}
1811
1812inline QString QTextDocument::originalText() const
1813{
1814 if ( oTextValid )
1815 return oText;
1816 return text();
1817}
1818
1819inline void QTextDocument::setFlow( QTextFlow *f )
1820{
1821 if ( flow_ )
1822 delete flow_;
1823 flow_ = f;
1824}
1825
1826inline void QTextDocument::takeFlow()
1827{
1828 flow_ = 0;
1829}
1830
1831// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1832
1833inline QColor QTextFormat::color() const
1834{
1835 return col;
1836}
1837
1838inline QFont QTextFormat::font() const
1839{
1840 return fn;
1841}
1842
1843inline bool QTextFormat::isMisspelled() const
1844{
1845 return missp;
1846}
1847
1848inline QTextFormat::VerticalAlignment QTextFormat::vAlign() const
1849{
1850 return ha;
1851}
1852
1853inline bool QTextFormat::operator==( const QTextFormat &f ) const
1854{
1855 return k == f.k;
1856}
1857
1858inline QTextFormatCollection *QTextFormat::parent() const
1859{
1860 return collection;
1861}
1862
1863inline void QTextFormat::addRef()
1864{
1865 ref++;
1866}
1867
1868inline void QTextFormat::removeRef()
1869{
1870 ref--;
1871 if ( !collection )
1872 return;
1873 if ( this == collection->defFormat )
1874 return;
1875 if ( ref == 0 )
1876 collection->remove( this );
1877}
1878
1879inline const QString &QTextFormat::key() const
1880{
1881 return k;
1882}
1883
1884inline bool QTextFormat::useLinkColor() const
1885{
1886 return linkColor;
1887}
1888
1889
1890// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1891
1892inline QTextStringChar &QTextString::at( int i ) const
1893{
1894 return data[ i ];
1895}
1896
1897// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1898
1899inline QTextStringChar *QTextParagraph::at( int i ) const
1900{
1901 return &str->at( i );
1902}
1903
1904inline bool QTextParagraph::isValid() const
1905{
1906 return invalid == -1;
1907}
1908
1909inline bool QTextParagraph::hasChanged() const
1910{
1911 return changed;
1912}
1913
1914inline void QTextParagraph::setBackgroundColor( const QColor & c )
1915{
1916 delete bgcol;
1917 bgcol = new QColor( c );
1918 setChanged( TRUE );
1919}
1920
1921inline void QTextParagraph::clearBackgroundColor()
1922{
1923 delete bgcol; bgcol = 0; setChanged( TRUE );
1924}
1925
1926inline void QTextParagraph::append( const QString &s, bool reallyAtEnd )
1927{
1928 if ( reallyAtEnd )
1929 insert( str->length(), s );
1930 else
1931 insert( QMAX( str->length() - 1, 0 ), s );
1932}
1933
1934inline QTextParagraph *QTextParagraph::prev() const
1935{
1936 return p;
1937}
1938
1939inline QTextParagraph *QTextParagraph::next() const
1940{
1941 return n;
1942}
1943
1944inline bool QTextParagraph::hasAnySelection() const
1945{
1946 return mSelections ? !selections().isEmpty() : FALSE;
1947}
1948
1949inline void QTextParagraph::setEndState( int s )
1950{
1951 if ( s == state )
1952 return;
1953 state = s;
1954}
1955
1956inline int QTextParagraph::endState() const
1957{
1958 return state;
1959}
1960
1961inline void QTextParagraph::setParagId( int i )
1962{
1963 id = i;
1964}
1965
1966inline int QTextParagraph::paragId() const
1967{
1968 if ( id == -1 )
1969 qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this );
1970 return id;
1971}
1972
1973inline bool QTextParagraph::firstPreProcess() const
1974{
1975 return firstPProcess;
1976}
1977
1978inline void QTextParagraph::setFirstPreProcess( bool b )
1979{
1980 firstPProcess = b;
1981}
1982
1983inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList()
1984{
1985 return lineStarts;
1986}
1987
1988inline QTextString *QTextParagraph::string() const
1989{
1990 return str;
1991}
1992
1993inline QTextDocument *QTextParagraph::document() const
1994{
1995 if ( hasdoc )
1996 return (QTextDocument*) docOrPseudo;
1997 return 0;
1998}
1999
2000inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const
2001{
2002 if ( hasdoc )
2003 return 0;
2004 return (QTextParagraphPseudoDocument*) docOrPseudo;
2005}
2006
2007
2008#ifndef QT_NO_TEXTCUSTOMITEM
2009inline QTextTableCell *QTextParagraph::tableCell() const
2010{
2011 return hasdoc ? document()->tableCell () : 0;
2012}
2013#endif
2014
2015inline QTextCommandHistory *QTextParagraph::commands() const
2016{
2017 return hasdoc ? document()->commands() : pseudoDocument()->commandHistory;
2018}
2019
2020
2021inline int QTextParagraph::alignment() const
2022{
2023 return align;
2024}
2025
2026#ifndef QT_NO_TEXTCUSTOMITEM
2027inline void QTextParagraph::registerFloatingItem( QTextCustomItem *i )
2028{
2029 floatingItems().append( i );
2030}
2031
2032inline void QTextParagraph::unregisterFloatingItem( QTextCustomItem *i )
2033{
2034 floatingItems().removeRef( i );
2035}
2036#endif
2037
2038inline QBrush *QTextParagraph::background() const
2039{
2040#ifndef QT_NO_TEXTCUSTOMITEM
2041 return tableCell() ? tableCell()->backGround() : 0;
2042#else
2043 return 0;
2044#endif
2045}
2046
2047inline int QTextParagraph::documentWidth() const
2048{
2049 return hasdoc ? document()->width() : pseudoDocument()->docRect.width();
2050}
2051
2052inline int QTextParagraph::documentVisibleWidth() const
2053{
2054 return hasdoc ? document()->visibleWidth() : pseudoDocument()->docRect.width();
2055}
2056
2057inline int QTextParagraph::documentX() const
2058{
2059 return hasdoc ? document()->x() : pseudoDocument()->docRect.x();
2060}
2061
2062inline int QTextParagraph::documentY() const
2063{
2064 return hasdoc ? document()->y() : pseudoDocument()->docRect.y();
2065}
2066
2067inline void QTextParagraph::setExtraData( QTextParagraphData *data )
2068{
2069 eData = data;
2070}
2071
2072inline QTextParagraphData *QTextParagraph::extraData() const
2073{
2074 return eData;
2075}
2076
2077// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2078
2079inline void QTextFormatCollection::setDefaultFormat( QTextFormat *f )
2080{
2081 defFormat = f;
2082}
2083
2084inline QTextFormat *QTextFormatCollection::defaultFormat() const
2085{
2086 return defFormat;
2087}
2088
2089// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2090
2091inline QTextFormat *QTextStringChar::format() const
2092{
2093 return (type == Regular) ? d.format : d.custom->format;
2094}
2095
2096
2097#ifndef QT_NO_TEXTCUSTOMITEM
2098inline QTextCustomItem *QTextStringChar::customItem() const
2099{
2100 return isCustom() ? d.custom->custom : 0;
2101}
2102#endif
2103
2104inline int QTextStringChar::height() const
2105{
2106#ifndef QT_NO_TEXTCUSTOMITEM
2107 return !isCustom() ? format()->height() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->height : 0 );
2108#else
2109 return format()->height();
2110#endif
2111}
2112
2113inline int QTextStringChar::ascent() const
2114{
2115#ifndef QT_NO_TEXTCUSTOMITEM
2116 return !isCustom() ? format()->ascent() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->ascent() : 0 );
2117#else
2118 return format()->ascent();
2119#endif
2120}
2121
2122inline int QTextStringChar::descent() const
2123{
2124#ifndef QT_NO_TEXTCUSTOMITEM
2125 return !isCustom() ? format()->descent() : 0;
2126#else
2127 return format()->descent();
2128#endif
2129}
2130
2131#endif //QT_NO_RICHTEXT
2132
2133#endif
diff --git a/qmake/include/private/qsettings_p.h b/qmake/include/private/qsettings_p.h
new file mode 100644
index 0000000..18d118b
--- a/dev/null
+++ b/qmake/include/private/qsettings_p.h
@@ -0,0 +1,133 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QSettings related classes
5**
6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
11** licenses for Windows may use this file in accordance with the Qt Commercial
12** License Agreement provided with the Software.
13**
14** This file is not available for use under any other license without
15** express written permission from the copyright holder.
16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19**
20** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
21** information about Qt Commercial License Agreements.
22**
23** Contact info@trolltech.com if any conditions of this licensing are
24** not clear to you.
25**
26**********************************************************************/
27
28#ifndef QSETTINGS_P_H
29#define QSETTINGS_P_H
30
31//
32// W A R N I N G
33// -------------
34//
35// This file is not part of the Qt API. It exists for the convenience
36// of QSettings. This header file may change from version to
37// version without notice, or even be removed.
38//
39// We mean it.
40//
41//
42
43#ifndef QT_H
44#include "qstringlist.h"
45#include "qmap.h"
46#include "qvaluestack.h"
47#endif // QT_H
48
49class QSettingsSysPrivate;
50
51// QSettingsGroup is a map of key/value pairs
52class QSettingsGroup : public QMap<QString,QString>
53{
54public:
55 QSettingsGroup();
56
57 bool modified;
58};
59
60// QSettingsHeading is a map of heading/group pairs
61class QSettingsHeading : public QMap<QString,QSettingsGroup>
62{
63public:
64 QSettingsHeading::Iterator git;
65 void read(const QString &);
66 void parseLine(QTextStream &);
67};
68
69
70class QSettingsPrivate
71{
72public:
73 QSettingsPrivate( QSettings::Format format );
74 ~QSettingsPrivate();
75
76 QSettingsGroup readGroup();
77 void removeGroup(const QString &);
78 void writeGroup(const QString &, const QString &);
79 QDateTime modificationTime();
80
81 QStringList searchPaths;
82 QMap<QString,QSettingsHeading> headings;
83 QString group;
84 QString heading;
85
86 /*### static data brings threading trouble
87 static QString *defProduct;
88 static QString *defDomain;
89 */
90 QValueStack<QString> groupStack;
91 QString groupPrefix;
92
93 bool groupDirty :1;
94 bool modified :1;
95 bool globalScope :1;
96
97#if defined(Q_WS_WIN) || defined(Q_OS_MAC)
98 // system dependent implementations to use the
99 // system specific setting database (ie. registry on Windows)
100
101 QSettingsSysPrivate *sysd;
102 voidsysInit();
103 voidsysClear();
104
105#if !defined(Q_NO_BOOL_TYPE)
106 boolsysWriteEntry( const QString &, bool );
107#endif
108 boolsysWriteEntry( const QString &, double );
109 boolsysWriteEntry( const QString &, int );
110 boolsysWriteEntry( const QString &, const QString & );
111 boolsysWriteEntry( const QString &, const QStringList & );
112 boolsysWriteEntry( const QString &, const QStringList &, const QChar& sep );
113
114 QStringList sysEntryList(const QString &) const;
115 QStringList sysSubkeyList(const QString &) const;
116
117 QStringList sysReadListEntry( const QString &, bool * = 0 ) const;
118 QStringList sysReadListEntry( const QString &, const QChar& sep, bool * = 0 ) const;
119 QStringsysReadEntry( const QString &, const QString &def = QString::null, bool * = 0 ) const;
120 int sysReadNumEntry( const QString &, int def = 0, bool * = 0 ) const;
121 doublesysReadDoubleEntry( const QString &, double def = 0, bool * = 0 ) const;
122 boolsysReadBoolEntry( const QString &, bool def = 0, bool * = 0 ) const;
123
124 boolsysRemoveEntry( const QString & );
125
126 boolsysSync();
127
128 voidsysInsertSearchPath( QSettings::System, const QString & );
129 voidsysRemoveSearchPath( QSettings::System, const QString & );
130#endif
131};
132
133#endif // QSETTINGS_P_H
diff --git a/qmake/include/private/qsharedmemory_p.h b/qmake/include/private/qsharedmemory_p.h
new file mode 100644
index 0000000..4a8339d
--- a/dev/null
+++ b/qmake/include/private/qsharedmemory_p.h
@@ -0,0 +1,84 @@
1/****************************************************************************
2** $Id$
3**
4** Includes system files for shared memory
5**
6** Created : 020124
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file.
16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software.
20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27**
28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you.
30**
31**********************************************************************/
32
33//
34// W A R N I N G
35// -------------
36//
37// This file is not part of the Qt API. It exists for the convenience
38// of qapplication_qws.cpp and qgfxvnc_qws.cpp. This header file may
39// change from version to version without notice, or even be removed.
40//
41//
42
43#if !defined(QT_QSHM_H)
44#define QT_QSHM_H
45
46#include <qstring.h>
47
48#if !defined (QT_QWS_NO_SHM)
49
50#include <sys/types.h>
51#include <sys/ipc.h>
52
53class QSharedMemory {
54public:
55 QSharedMemory(){};
56 QSharedMemory(int, QString, char c = 'Q');
57 ~QSharedMemory(){};
58
59 bool create();
60 void destroy();
61
62 bool attach();
63 void detach();
64
65 void setPermissions(mode_t mode);
66 int size();
67 void * base() { return shmBase; };
68
69private:
70 void *shmBase;
71 int shmSize;
72 QString shmFile;
73 char character;
74#if defined(QT_POSIX_QSHM)
75 int shmFD;
76#else
77 int shmId;
78 key_t key;
79 int idInitted;
80#endif
81};
82
83#endif
84#endif
diff --git a/qmake/include/private/qsqldriverinterface_p.h b/qmake/include/private/qsqldriverinterface_p.h
new file mode 100644
index 0000000..8957b86
--- a/dev/null
+++ b/qmake/include/private/qsqldriverinterface_p.h
@@ -0,0 +1,69 @@
1/****************************************************************************
2**
3** Definition of QSqlDriverInterface class
4**
5** Created : 2000-11-03
6**
7** Copyright (C) 2000 Trolltech AS. All rights reserved.
8**
9** This file is part of the sql module of the Qt GUI Toolkit.
10**
11** This file may be distributed under the terms of the Q Public License
12** as defined by Trolltech AS of Norway and appearing in the file
13** LICENSE.QPL included in the packaging of this file.
14**
15** This file may be distributed and/or modified under the terms of the
16** GNU General Public License version 2 as published by the Free Software
17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file.
19**
20** Licensees holding valid Qt Enterprise Edition licenses may use this
21** file in accordance with the Qt Commercial License Agreement provided
22** with the Software.
23**
24** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26**
27** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
28** information about Qt Commercial License Agreements.
29** See http://www.trolltech.com/qpl/ for QPL licensing information.
30** See http://www.trolltech.com/gpl/ for GPL licensing information.
31**
32** Contact info@trolltech.com if any conditions of this licensing are
33** not clear to you.
34**
35**********************************************************************/
36
37#ifndef QSQLDRIVERINTERFACE_H
38#define QSQLDRIVERINTERFACE_H
39
40#ifndef QT_H
41#include <private/qcom_p.h>
42#endif // QT_H
43
44#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
45#define QM_EXPORT_SQL
46#else
47#define QM_EXPORT_SQL Q_EXPORT
48#endif
49
50#ifndef QT_NO_SQL
51
52#ifndef QT_NO_COMPONENT
53
54// {EDDD5AD5-DF3C-400c-A711-163B72FE5F61}
55#ifndef IID_QSqlDriverFactory
56#define IID_QSqlDriverFactory QUuid(0xeddd5ad5, 0xdf3c, 0x400c, 0xa7, 0x11, 0x16, 0x3b, 0x72, 0xfe, 0x5f, 0x61)
57#endif
58
59class QSqlDriver;
60
61struct QM_EXPORT_SQL QSqlDriverFactoryInterface : public QFeatureListInterface
62{
63 virtual QSqlDriver* create( const QString& name ) = 0;
64};
65
66#endif //QT_NO_COMPONENT
67#endif // QT_NO_SQL
68
69#endif // QSQLDRIVERINTERFACE_H
diff --git a/qmake/include/private/qsqlextension_p.h b/qmake/include/private/qsqlextension_p.h
new file mode 100644
index 0000000..597b266
--- a/dev/null
+++ b/qmake/include/private/qsqlextension_p.h
@@ -0,0 +1,101 @@
1/****************************************************************************
2**
3** Definition of the QSqlExtension class
4**
5** Created : 2002-06-03
6**
7** Copyright (C) 2002 Trolltech AS. All rights reserved.
8**
9** This file is part of the sql module of the Qt GUI Toolkit.
10**
11** This file may be distributed under the terms of the Q Public License
12** as defined by Trolltech AS of Norway and appearing in the file
13** LICENSE.QPL included in the packaging of this file.
14**
15** This file may be distributed and/or modified under the terms of the
16** GNU General Public License version 2 as published by the Free Software
17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file.
19**
20** Licensees holding valid Qt Enterprise Edition licenses may use this
21** file in accordance with the Qt Commercial License Agreement provided
22** with the Software.
23**
24** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26**
27** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
28** information about Qt Commercial License Agreements.
29** See http://www.trolltech.com/qpl/ for QPL licensing information.
30** See http://www.trolltech.com/gpl/ for GPL licensing information.
31**
32** Contact info@trolltech.com if any conditions of this licensing are
33** not clear to you.
34**
35**********************************************************************/
36
37#ifndef QSQLEXTENSION_P_H
38#define QSQLEXTENSION_P_H
39
40//
41// W A R N I N G
42// -------------
43//
44// This file is not part of the Qt API. It exists for the convenience
45// of other Qt classes. This header file may change from version to
46// version without notice, or even be removed.
47//
48// We mean it.
49//
50//
51
52#ifndef QT_H
53#include "qmap.h"
54#include "qstring.h"
55#include "qvariant.h"
56#endif // QT_H
57
58#ifndef QT_NO_SQL
59
60#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
61#define QM_EXPORT_SQL
62#else
63#define QM_EXPORT_SQL Q_EXPORT
64#endif
65
66#if defined(Q_TEMPLATEDLL)
67Q_TEMPLATE_EXTERN template class QM_EXPORT_SQL QMap<QString,QVariant>;
68Q_TEMPLATE_EXTERN template class QM_EXPORT_SQL QMap<int,QString>;
69#endif
70
71class QM_EXPORT_SQL QSqlExtension {
72public:
73 QSqlExtension();
74 virtual ~QSqlExtension();
75 virtual bool prepare( const QString& query );
76 virtual bool exec();
77 virtual void bindValue( const QString& holder, const QVariant& value );
78 virtual void bindValue( int pos, const QVariant& value );
79 virtual void addBindValue( const QVariant& value );
80 void clearValues();
81 void clearIndex();
82
83 enum BindMethod { BindByPosition, BindByName };
84 BindMethod bindMethod();
85 BindMethod bindm;
86 int bindCount;
87
88 QMap<int, QString> index;
89 QMap<QString, QVariant> values;
90};
91
92class QM_EXPORT_SQL QSqlDriverExtension
93{
94public:
95 QSqlDriverExtension();
96 virtual ~QSqlDriverExtension();
97 virtual bool isOpen() const = 0;
98};
99
100#endif
101#endif
diff --git a/qmake/include/private/qsqlmanager_p.h b/qmake/include/private/qsqlmanager_p.h
new file mode 100644
index 0000000..e5f45b8
--- a/dev/null
+++ b/qmake/include/private/qsqlmanager_p.h
@@ -0,0 +1,159 @@
1/****************************************************************************
2**
3** Definition of QSqlManager class
4**
5** Created : 2000-11-03
6**
7** Copyright (C) 2000 Trolltech AS. All rights reserved.
8**
9** This file is part of the sql module of the Qt GUI Toolkit.
10**
11** This file may be distributed under the terms of the Q Public License
12** as defined by Trolltech AS of Norway and appearing in the file
13** LICENSE.QPL included in the packaging of this file.
14**
15** This file may be distributed and/or modified under the terms of the
16** GNU General Public License version 2 as published by the Free Software
17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file.
19**
20** Licensees holding valid Qt Enterprise Edition licenses may use this
21** file in accordance with the Qt Commercial License Agreement provided
22** with the Software.
23**
24** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26**
27** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
28** information about Qt Commercial License Agreements.
29** See http://www.trolltech.com/qpl/ for QPL licensing information.
30** See http://www.trolltech.com/gpl/ for GPL licensing information.
31**
32** Contact info@trolltech.com if any conditions of this licensing are
33** not clear to you.
34**
35**********************************************************************/
36
37#ifndef QSQLMANAGER_P_H
38#define QSQLMANAGER_P_H
39
40//
41// W A R N I N G
42// -------------
43//
44// This file is not part of the Qt API. It exists for the convenience
45// of other Qt classes. This header file may change from version to
46// version without notice, or even be removed.
47//
48// We mean it.
49//
50//
51
52#ifndef QT_H
53#include "qglobal.h"
54#include "qstring.h"
55#include "qstringlist.h"
56#include "qsql.h"
57#include "qsqlerror.h"
58#include "qsqlindex.h"
59#include "qsqlcursor.h"
60#endif // QT_H
61
62#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
63#define QM_EXPORT_SQL
64#else
65#define QM_EXPORT_SQL Q_EXPORT
66#endif
67
68#ifndef QT_NO_SQL
69
70class QSqlCursor;
71class QSqlForm;
72class QSqlCursorManagerPrivate;
73
74class QM_EXPORT_SQL QSqlCursorManager
75{
76public:
77 QSqlCursorManager();
78 virtual ~QSqlCursorManager();
79
80 virtual void setSort( const QSqlIndex& sort );
81 virtual void setSort( const QStringList& sort );
82 QStringList sort() const;
83 virtual void setFilter( const QString& filter );
84 QString filter() const;
85 virtual void setCursor( QSqlCursor* cursor, bool autoDelete = FALSE );
86 QSqlCursor* cursor() const;
87
88 virtual void setAutoDelete( bool enable );
89 bool autoDelete() const;
90
91 virtual bool refresh();
92 virtual bool findBuffer( const QSqlIndex& idx, int atHint = 0 );
93
94private:
95 QSqlCursorManagerPrivate* d;
96};
97
98#ifndef QT_NO_SQL_FORM
99
100class QSqlFormManagerPrivate;
101
102class QM_EXPORT_SQL QSqlFormManager
103{
104public:
105 QSqlFormManager();
106 virtual ~QSqlFormManager();
107
108 virtual void setForm( QSqlForm* form );
109 QSqlForm* form();
110 virtual void setRecord( QSqlRecord* record );
111 QSqlRecord* record();
112
113 virtual void clearValues();
114 virtual void readFields();
115 virtual void writeFields();
116
117private:
118 QSqlFormManagerPrivate* d;
119};
120
121#endif
122
123class QWidget;
124class QDataManagerPrivate;
125
126class QM_EXPORT_SQL QDataManager
127{
128public:
129 QDataManager();
130 virtual ~QDataManager();
131
132 virtual void setMode( QSql::Op m );
133 QSql::Op mode() const;
134 virtual void setAutoEdit( bool autoEdit );
135 bool autoEdit() const;
136
137 virtual void handleError( QWidget* parent, const QSqlError& error );
138 virtual QSql::Confirm confirmEdit( QWidget* parent, QSql::Op m );
139 virtual QSql::Confirm confirmCancel( QWidget* parent, QSql::Op m );
140
141 virtual void setConfirmEdits( bool confirm );
142 virtual void setConfirmInsert( bool confirm );
143 virtual void setConfirmUpdate( bool confirm );
144 virtual void setConfirmDelete( bool confirm );
145 virtual void setConfirmCancels( bool confirm );
146
147 bool confirmEdits() const;
148 bool confirmInsert() const;
149 bool confirmUpdate() const;
150 bool confirmDelete() const;
151 bool confirmCancels() const;
152
153private:
154 QDataManagerPrivate* d;
155};
156
157
158#endif
159#endif
diff --git a/qmake/include/private/qstyleinterface_p.h b/qmake/include/private/qstyleinterface_p.h
new file mode 100644
index 0000000..4aaedc7
--- a/dev/null
+++ b/qmake/include/private/qstyleinterface_p.h
@@ -0,0 +1,61 @@
1/****************************************************************************
2** $Id$
3**
4** ...
5**
6** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the widgets module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QSTYLEINTERFACE_H
37#define QSTYLEINTERFACE_H
38
39#ifndef QT_H
40#include <private/qcom_p.h>
41#endif // QT_H
42
43#ifndef QT_NO_STYLE
44#ifndef QT_NO_COMPONENT
45
46class QStyle;
47
48// {FC1B6EBE-053C-49c1-A483-C377739AB9A5}
49#ifndef IID_QStyleFactory
50#define IID_QStyleFactory QUuid(0xfc1b6ebe, 0x53c, 0x49c1, 0xa4, 0x83, 0xc3, 0x77, 0x73, 0x9a, 0xb9, 0xa5)
51#endif
52
53struct Q_EXPORT QStyleFactoryInterface : public QFeatureListInterface
54{
55 virtual QStyle* create( const QString& style ) = 0;
56};
57
58#endif //QT_NO_COMPONENT
59#endif //QT_NO_STYLE
60
61#endif //QSTYLEINTERFACE_H
diff --git a/qmake/include/private/qsvgdevice_p.h b/qmake/include/private/qsvgdevice_p.h
new file mode 100644
index 0000000..c1cc389
--- a/dev/null
+++ b/qmake/include/private/qsvgdevice_p.h
@@ -0,0 +1,134 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of the QSvgDevice class
5**
6** Created : 20001024
7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the xml module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition licenses may use this
22** file in accordance with the Qt Commercial License Agreement provided
23** with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36*****************************************************************************/
37
38#ifndef QSVGDEVICE_H
39#define QSVGDEVICE_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. It exists for the convenience
46// of the QPicture class. This header file may change from
47// version to version without notice, or even be removed.
48//
49// We mean it.
50//
51//
52
53#ifndef QT_H
54#include "qpaintdevice.h"
55#include "qrect.h"
56#include "qdom.h"
57#endif // QT_H
58
59#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML )
60#define QM_EXPORT_SVG
61#else
62#define QM_EXPORT_SVG Q_EXPORT
63#endif
64
65#ifndef QT_NO_SVG
66
67class QPainter;
68class QDomNode;
69class QDomNamedNodeMap;
70struct QSvgDeviceState;
71class QSvgDevicePrivate;
72
73class QM_EXPORT_SVG QSvgDevice : public QPaintDevice
74{
75public:
76 QSvgDevice();
77 ~QSvgDevice();
78
79 bool play( QPainter *p );
80
81 QString toString() const;
82
83 bool load( QIODevice *dev );
84 bool save( QIODevice *dev );
85 bool save( const QString &fileName );
86
87 QRect boundingRect() const;
88 void setBoundingRect( const QRect &r );
89
90protected:
91 virtual bool cmd ( int, QPainter*, QPDevCmdParam* );
92 virtual int metric( int ) const;
93
94private:
95 // reading
96 bool play( const QDomNode &node );
97 void saveAttributes();
98 void restoreAttributes();
99 QColor parseColor( const QString &col );
100 double parseLen( const QString &str, bool *ok=0, bool horiz=TRUE ) const;
101 int lenToInt( const QDomNamedNodeMap &map, const QString &attr,
102 int def=0 ) const;
103 void setStyleProperty( const QString &prop, const QString &val,
104 QPen *pen, QFont *font, int *talign );
105 void setStyle( const QString &s );
106 void setTransform( const QString &tr );
107 void drawPath( const QString &data );
108
109 // writing
110 void applyStyle( QDomElement *e, int c ) const;
111 void applyTransform( QDomElement *e ) const;
112
113 // reading
114 QRect brect; // bounding rectangle
115 QDomDocument doc; // document tree
116 QDomNode current;
117 QPoint curPt;
118 QSvgDeviceState *curr;
119 QPainter *pt; // used by play() et al
120
121 // writing
122 bool dirtyTransform, dirtyStyle;
123
124 QSvgDevicePrivate *d;
125};
126
127inline QRect QSvgDevice::boundingRect() const
128{
129 return brect;
130}
131
132#endif // QT_NO_SVG
133
134#endif // QSVGDEVICE_H
diff --git a/qmake/include/private/qtextcodecinterface_p.h b/qmake/include/private/qtextcodecinterface_p.h
new file mode 100644
index 0000000..d2a2cb9
--- a/dev/null
+++ b/qmake/include/private/qtextcodecinterface_p.h
@@ -0,0 +1,79 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QTextCodecFactoryInterface interface
5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QTEXTCODECINTERFACE_P_H
37#define QTEXTCODECINTERFACE_P_H
38
39
40//
41// W A R N I N G
42// -------------
43//
44// This file is not part of the Qt API. It exists for the convenience
45// of qpsprinter.cpp and qprinter_x11.cpp.
46// This header file may change from version to version without notice,
47// or even be removed.
48//
49// We mean it.
50//
51//
52
53
54#ifndef QT_H
55#include <private/qcom_p.h>
56#endif // QT_H
57
58#ifndef QT_NO_TEXTCODEC
59#ifndef QT_NO_COMPONENT
60
61class QTextCodec;
62
63
64// {F55BFA60-F695-11D4-823E-009027DC0F37}
65#ifndef IID_QTextCodecFactory
66#define IID_QTextCodecFactory QUuid( 0xf55bfa60, 0xf695, 0x11d4, 0x82, 0x3e, 0x00, 0x90, 0x27, 0xdc, 0x0f, 0x37)
67#endif
68
69
70struct Q_EXPORT QTextCodecFactoryInterface : public QFeatureListInterface
71{
72 virtual QTextCodec *createForMib( int mib ) = 0;
73 virtual QTextCodec *createForName( const QString &name ) = 0;
74};
75
76#endif // QT_NO_COMPONENT
77#endif // QT_NO_TEXTCODEC
78
79#endif // QTEXTCODECINTERFACE_P_H
diff --git a/qmake/include/private/qtitlebar_p.h b/qmake/include/private/qtitlebar_p.h
new file mode 100644
index 0000000..dabb6bf
--- a/dev/null
+++ b/qmake/include/private/qtitlebar_p.h
@@ -0,0 +1,136 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of some Qt private functions.
5**
6** Created : 2000-01-01
7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the widgets module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QTITLEBAR_P_H
39#define QTITLEBAR_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qworkspace.cpp and qdockwindow.cpp. This header file may change
48// from version to version without notice, or even be removed.
49//
50// We mean it.
51//
52//
53
54
55#ifndef QT_H
56#include "qbutton.h"
57#include "qlabel.h"
58#endif // QT_H
59
60#if !defined(QT_NO_TITLEBAR)
61
62class QToolTip;
63class QTitleBarPrivate;
64class QPixmap;
65
66class Q_EXPORT QTitleBar : public QWidget
67{
68 Q_OBJECT
69 Q_PROPERTY( bool autoRaise READ autoRaise WRITE setAutoRaise )
70 Q_PROPERTY( bool movable READ isMovable WRITE setMovable )
71
72public:
73 QTitleBar (QWidget* w, QWidget* parent, const char* name=0);
74 ~QTitleBar();
75
76 bool isActive() const;
77 bool usesActiveColor() const;
78 virtual QString visibleText() const;
79
80 bool isMovable() const;
81 void setMovable(bool);
82
83 bool autoRaise() const;
84 void setAutoRaise(bool);
85
86 QWidget *window() const;
87
88 QSize sizeHint() const;
89
90#ifdef QT_NO_WIDGET_TOPEXTRA
91 // We provide one, since titlebar is useless otherwise.
92 QString caption() const;
93#endif
94
95public slots:
96 void setActive( bool );
97 void setCaption( const QString& title );
98 void setIcon( const QPixmap& icon );
99
100signals:
101 void doActivate();
102 void doNormal();
103 void doClose();
104 void doMaximize();
105 void doMinimize();
106 void doShade();
107 void showOperationMenu();
108 void popupOperationMenu( const QPoint& );
109 void doubleClicked();
110
111protected:
112 bool event( QEvent *);
113 void resizeEvent( QResizeEvent *);
114 void contextMenuEvent( QContextMenuEvent * );
115 void mousePressEvent( QMouseEvent * );
116 void mouseDoubleClickEvent( QMouseEvent * );
117 void mouseReleaseEvent( QMouseEvent * );
118 void mouseMoveEvent( QMouseEvent * );
119 void enterEvent( QEvent *e );
120 void leaveEvent( QEvent *e );
121 void paintEvent( QPaintEvent *p );
122
123 virtual void cutText();
124
125private:
126 void readColors();
127
128 QTitleBarPrivate *d;
129#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
130 QTitleBar( const QTitleBar & );
131 QTitleBar &operator=( const QTitleBar & );
132#endif
133};
134
135#endif
136#endif //QTITLEBAR_P_H
diff --git a/qmake/include/private/qucom_p.h b/qmake/include/private/qucom_p.h
new file mode 100644
index 0000000..d2ff48e
--- a/dev/null
+++ b/qmake/include/private/qucom_p.h
@@ -0,0 +1,499 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of the QUcom interfaces
5**
6** Created : 990101
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QUCOM_H
39#define QUCOM_H
40
41#ifndef QT_H
42#include <qstring.h>
43#include "quuid.h"
44#endif // QT_H
45
46//
47// W A R N I N G
48// -------------
49//
50// This file is not part of the Qt API. It exists for the convenience
51// of a number of Qt sources files. This header file may change from
52// version to version without notice, or even be removed.
53//
54// We mean it.
55//
56//
57
58#ifdef check
59#undef check
60#endif
61
62struct QUObject;
63struct QUInterfaceDescription;
64struct QUnknownInterface;
65struct QDispatchInterface;
66
67
68struct Q_EXPORT QUBuffer
69{
70 virtual long read( char *data, ulong maxlen ) = 0;
71 virtual long write( const char *data, ulong len ) = 0;
72};
73
74
75// A type for a QUObject
76struct Q_EXPORT QUType
77{
78 virtual const QUuid *uuid() const = 0;
79 virtual const char *desc() const = 0;
80
81
82 virtual bool canConvertFrom( QUObject *, QUType * ) = 0;
83 // virtual private, only called by canConvertFrom
84 virtual bool canConvertTo( QUObject *, QUType * ) = 0;
85
86
87 virtual bool convertFrom( QUObject *, QUType * ) = 0;
88 // virtual private, only called by convertFrom
89 virtual bool convertTo( QUObject *, QUType * ) = 0;
90
91 virtual void clear( QUObject * ) = 0;
92
93 virtual int serializeTo( QUObject *, QUBuffer * ) = 0;
94 virtual int serializeFrom( QUObject *, QUBuffer * ) = 0;
95
96 static bool isEqual( const QUType *t1, const QUType *t2 );
97 static bool check( QUObject* o, QUType* t );
98};
99
100
101// {DE56510E-4E9F-4b76-A3C2-D1E2EF42F1AC}
102extern Q_EXPORT const QUuid TID_QUType_Null;
103struct Q_EXPORT QUType_Null : public QUType
104{
105 const QUuid *uuid() const;
106 const char *desc() const;
107
108 bool canConvertFrom( QUObject *, QUType * );
109 bool canConvertTo( QUObject *, QUType * );
110 bool convertFrom( QUObject *, QUType * );
111 bool convertTo( QUObject *, QUType * );
112 void clear( QUObject * );
113 int serializeTo( QUObject *, QUBuffer * );
114 int serializeFrom( QUObject *, QUBuffer * );
115};
116extern Q_EXPORT QUType_Null static_QUType_Null;
117
118
119// The magic QUObject
120struct Q_EXPORT QUObject
121{
122public: // scary MSVC bug makes this necessary
123 QUObject() : type( &static_QUType_Null ) {}
124 ~QUObject() { type->clear( this ); }
125
126 QUType *type;
127
128 // the unavoidable union
129 union
130 {
131 bool b;
132
133 char c;
134 short s;
135 int i;
136 long l;
137
138 unsigned char uc;
139 unsigned short us;
140 unsigned int ui;
141 unsigned long ul;
142
143 float f;
144 double d;
145
146 char byte[16];
147
148 struct {
149 char* data;
150 unsigned long size;
151 } bytearray;
152
153 void* ptr;
154
155 struct {
156 void *ptr;
157 bool owner;
158 } voidstar;
159
160 struct {
161 char *ptr;
162 bool owner;
163 } charstar;
164
165 struct {
166 char *ptr;
167 bool owner;
168 } utf8;
169
170 struct {
171 char *ptr;
172 bool owner;
173 } local8bit;
174
175 QUnknownInterface* iface;
176 QDispatchInterface* idisp;
177
178 } payload;
179
180};
181
182
183// A parameter description describes one method parameters. A
184// parameter has a name, a type and a flag describing whether it's an
185// in parameter, an out parameter, or both ways
186struct Q_EXPORT QUParameter
187{
188 const char* name;
189 QUType *type;
190 const void* typeExtra; //Usually 0, UEnum* for QUType_enum, const char* for QUType_ptr, int* for QUType_varptr
191 enum { In = 1, Out = 2, InOut = In | Out };
192 int inOut;
193};
194
195// A method description describes one method. A method has a name and
196// an array of parameters.
197struct Q_EXPORT QUMethod
198{
199 const char* name;
200 int count;
201 const QUParameter* parameters;
202};
203
204// A Property description. Not used yet in the example.
205struct Q_EXPORT QUProperty
206{
207 const char* name;
208 QUType* type;
209 const void* typeExtra; //type dependend. Usually 0, but UEnum for QUTypeenum or const char* for QUTypeptr
210
211 int set; // -1 undefined
212 int get; // -1 undefined
213
214 int designable; // -1 FALSE, -2 TRUE, else method
215 int stored; // -1 FALSE, -2 TRUE, else method
216};
217
218// An interface description describes one interface, that is all its
219// methods and properties.
220struct Q_EXPORT QUInterfaceDescription
221{
222 int methodCount;
223 const QUMethod* methods;
224 int propertyCount;
225 const QUProperty* properties;
226};
227
228
229// A component description describe one component, that is its name,
230// vendor, release, info, its component uuid and all its interface
231// uuids.
232struct Q_EXPORT QUComponentDescription
233{
234 const char* name;
235 const char* vendor;
236 const char* release;
237 const char* info;
238 QUuid cid;
239 int count;
240 const QUuid* interfaces;
241};
242
243
244// A component server description describe one component server, that
245// is its name, vendor, release, info and the descriptions of all
246// components it can instantiate.
247struct Q_EXPORT QUComponentServerDescription
248{
249 const char* name;
250 const char* vendor;
251 const char* release;
252 const char* info;
253 int count;
254 const QUComponentDescription* components;
255};
256
257
258
259 struct Q_EXPORT QUEnumItem // - a name/value pair
260{
261 const char *key;
262 int value;
263};
264
265struct Q_EXPORT QUEnum
266 {
267 const char *name; // - enumerator name
268 unsigned int count; // - number of values
269 const QUEnumItem *items; // - the name/value pairs
270 bool set; // whether enum has to be treated as a set
271};
272
273inline bool QUType::isEqual( const QUType *t1, const QUType *t2 ) {
274 return t1 == t2 || t1->uuid() == t2->uuid() ||
275 *(t1->uuid()) == *(t2->uuid());
276}
277
278inline bool QUType::check( QUObject* o, QUType* t ) {
279 return isEqual( o->type, t ) || t->convertFrom( o, o->type );
280}
281
282
283
284// {7EE17B08-5419-47e2-9776-8EEA112DCAEC}
285extern Q_EXPORT const QUuid TID_QUType_enum;
286struct Q_EXPORT QUType_enum : public QUType
287{
288 const QUuid *uuid() const;
289 const char *desc() const;
290
291 void set( QUObject *, int );
292 int &get( QUObject * o ) { return o->payload.i; }
293 bool canConvertFrom( QUObject *, QUType * );
294 bool canConvertTo( QUObject *, QUType * );
295 bool convertFrom( QUObject *, QUType * );
296 bool convertTo( QUObject *, QUType * );
297 void clear( QUObject * ) {}
298 int serializeTo( QUObject *, QUBuffer * );
299 int serializeFrom( QUObject *, QUBuffer * );
300};
301extern Q_EXPORT QUType_enum static_QUType_enum;
302
303
304// {8AC26448-5AB4-49eb-968C-8F30AB13D732}
305extern Q_EXPORT const QUuid TID_QUType_ptr;
306struct Q_EXPORT QUType_ptr : public QUType
307{
308 const QUuid *uuid() const;
309 const char *desc() const;
310
311 void set( QUObject *, const void* );
312 void* &get( QUObject * o ) { return o->payload.ptr; }
313 bool canConvertFrom( QUObject *, QUType * );
314 bool canConvertTo( QUObject *, QUType * );
315 bool convertFrom( QUObject *, QUType * );
316 bool convertTo( QUObject *, QUType * );
317 void clear( QUObject * ) {}
318 int serializeTo( QUObject *, QUBuffer * );
319 int serializeFrom( QUObject *, QUBuffer * );
320};
321extern Q_EXPORT QUType_ptr static_QUType_ptr;
322
323// {97A2594D-6496-4402-A11E-55AEF2D4D25C}
324extern Q_EXPORT const QUuid TID_QUType_iface;
325struct Q_EXPORT QUType_iface : public QUType
326{
327 const QUuid *uuid() const;
328 const char *desc() const;
329
330 void set( QUObject *, QUnknownInterface* );
331 QUnknownInterface* &get( QUObject *o ){ return o->payload.iface; }
332 bool canConvertFrom( QUObject *, QUType * );
333 bool canConvertTo( QUObject *, QUType * );
334 bool convertFrom( QUObject *, QUType * );
335 bool convertTo( QUObject *, QUType * );
336 void clear( QUObject * ) {}
337 int serializeTo( QUObject *, QUBuffer * );
338 int serializeFrom( QUObject *, QUBuffer * );
339};
340extern Q_EXPORT QUType_iface static_QUType_iface;
341
342// {2F358164-E28F-4bf4-9FA9-4E0CDCABA50B}
343extern Q_EXPORT const QUuid TID_QUType_idisp;
344struct Q_EXPORT QUType_idisp : public QUType
345{
346 const QUuid *uuid() const;
347 const char *desc() const;
348
349 void set( QUObject *, QDispatchInterface* );
350 QDispatchInterface* &get( QUObject *o ){ return o->payload.idisp; }
351 bool canConvertFrom( QUObject *, QUType * );
352 bool canConvertTo( QUObject *, QUType * );
353 bool convertFrom( QUObject *, QUType * );
354 bool convertTo( QUObject *, QUType * );
355 void clear( QUObject * ) {}
356 int serializeTo( QUObject *, QUBuffer * );
357 int serializeFrom( QUObject *, QUBuffer * );
358};
359extern Q_EXPORT QUType_idisp static_QUType_idisp;
360
361// {CA42115D-13D0-456c-82B5-FC10187F313E}
362extern Q_EXPORT const QUuid TID_QUType_bool;
363struct Q_EXPORT QUType_bool : public QUType
364{
365 const QUuid *uuid() const;
366 const char *desc() const;
367
368 void set( QUObject *, bool );
369 bool &get( QUObject *o ) { return o->payload.b; }
370 bool canConvertFrom( QUObject *, QUType * );
371 bool canConvertTo( QUObject *, QUType * );
372 bool convertFrom( QUObject *, QUType * );
373 bool convertTo( QUObject *, QUType * );
374 void clear( QUObject * ) {}
375 int serializeTo( QUObject *, QUBuffer * );
376 int serializeFrom( QUObject *, QUBuffer * );
377};
378extern Q_EXPORT QUType_bool static_QUType_bool;
379
380// {53C1F3BE-73C3-4c7d-9E05-CCF09EB676B5}
381extern Q_EXPORT const QUuid TID_QUType_int;
382struct Q_EXPORT QUType_int : public QUType
383{
384 const QUuid *uuid() const;
385 const char *desc() const;
386
387 void set( QUObject *, int );
388 int &get( QUObject *o ) { return o->payload.i; }
389 bool canConvertFrom( QUObject *, QUType * );
390 bool canConvertTo( QUObject *, QUType * );
391 bool convertFrom( QUObject *, QUType * );
392 bool convertTo( QUObject *, QUType * );
393 void clear( QUObject * ) {}
394 int serializeTo( QUObject *, QUBuffer * );
395 int serializeFrom( QUObject *, QUBuffer * );
396};
397extern Q_EXPORT QUType_int static_QUType_int;
398
399// {5938712A-C496-11D5-8CB2-00C0F03BC0F3}
400extern Q_EXPORT const QUuid TID_QUType_uint;
401struct Q_EXPORT QUType_uint : public QUType
402{
403 const QUuid *uuid() const;
404 const char *desc() const;
405
406 void set( QUObject *, uint );
407 uint &get( QUObject *o ) { return o->payload.ui; }
408 bool canConvertFrom( QUObject *, QUType * );
409 bool canConvertTo( QUObject *, QUType * );
410 bool convertFrom( QUObject *, QUType * );
411 bool convertTo( QUObject *, QUType * );
412 void clear( QUObject * ) {}
413 int serializeTo( QUObject *, QUBuffer * );
414 int serializeFrom( QUObject *, QUBuffer * );
415};
416extern Q_EXPORT QUType_uint static_QUType_uint;
417
418// {2D0974E5-0BA6-4ec2-8837-C198972CB48C}
419extern Q_EXPORT const QUuid TID_QUType_double;
420struct Q_EXPORT QUType_double : public QUType
421{
422 const QUuid *uuid() const;
423 const char *desc() const;
424
425 void set( QUObject *, double );
426 double &get( QUObject *o ) { return o->payload.d; }
427 bool canConvertFrom( QUObject *, QUType * );
428 bool canConvertTo( QUObject *, QUType * );
429 bool convertFrom( QUObject *, QUType * );
430 bool convertTo( QUObject *, QUType * );
431 void clear( QUObject * ) {}
432 int serializeTo( QUObject *, QUBuffer * );
433 int serializeFrom( QUObject *, QUBuffer * );
434};
435extern Q_EXPORT QUType_double static_QUType_double;
436
437// {544C5175-6993-4486-B04D-CEC4D21BF4B9 }
438extern Q_EXPORT const QUuid TID_QUType_float;
439struct Q_EXPORT QUType_float : public QUType
440{
441 const QUuid *uuid() const;
442 const char *desc() const;
443
444 void set( QUObject *, float );
445 float &get( QUObject *o ) { return o->payload.f; }
446 bool canConvertFrom( QUObject *, QUType * );
447 bool canConvertTo( QUObject *, QUType * );
448 bool convertFrom( QUObject *, QUType * );
449 bool convertTo( QUObject *, QUType * );
450 void clear( QUObject * ) {}
451 int serializeTo( QUObject *, QUBuffer * );
452 int serializeFrom( QUObject *, QUBuffer * );
453};
454extern Q_EXPORT QUType_float static_QUType_float;
455
456// {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9}
457extern Q_EXPORT const QUuid TID_QUType_charstar;
458struct Q_EXPORT QUType_charstar : public QUType
459{
460 const QUuid *uuid() const;
461 const char *desc() const;
462
463 void set( QUObject *, const char*, bool take = FALSE );
464 char* get( QUObject *o ){ return o->payload.charstar.ptr; }
465 bool canConvertFrom( QUObject *, QUType * );
466 bool canConvertTo( QUObject *, QUType * );
467 bool convertFrom( QUObject *, QUType * );
468 bool convertTo( QUObject *, QUType * );
469 void clear( QUObject * );
470 int serializeTo( QUObject *, QUBuffer * );
471 int serializeFrom( QUObject *, QUBuffer * );
472
473};
474extern Q_EXPORT QUType_charstar static_QUType_charstar;
475
476// {44C2A547-01E7-4e56-8559-35AF9D2F42B7}
477extern const QUuid TID_QUType_QString;
478
479struct Q_EXPORT QUType_QString : public QUType
480{
481 const QUuid *uuid() const;
482 const char *desc() const;
483
484 void set( QUObject *, const QString & );
485 QString &get( QUObject * o ) { return *(QString*)o->payload.ptr; }
486
487 bool canConvertFrom( QUObject *, QUType * );
488 bool canConvertTo( QUObject *, QUType * );
489 bool convertFrom( QUObject *, QUType * );
490 bool convertTo( QUObject *, QUType * );
491 void clear( QUObject * );
492 int serializeTo( QUObject *, QUBuffer * );
493 int serializeFrom( QUObject *, QUBuffer * );
494
495};
496extern Q_EXPORT QUType_QString static_QUType_QString;
497
498
499#endif // QUCOM_H
diff --git a/qmake/include/private/qucomextra_p.h b/qmake/include/private/qucomextra_p.h
new file mode 100644
index 0000000..3de6104
--- a/dev/null
+++ b/qmake/include/private/qucomextra_p.h
@@ -0,0 +1,93 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of extra QUcom classes
5**
6** Created : 990101
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QUCOMEXTRA_H
39#define QUCOMEXTRA_H
40
41#ifndef QT_H
42#include <private/qucom_p.h>
43#endif // QT_H
44
45
46class QVariant;
47
48#ifndef QT_NO_VARIANT
49// 6dc75d58-a1d9-4417-b591-d45c63a3a4ea
50extern const QUuid TID_QUType_QVariant;
51
52struct Q_EXPORT QUType_QVariant : public QUType
53{
54 const QUuid *uuid() const;
55 const char *desc() const;
56
57 void set( QUObject *, const QVariant & );
58 QVariant &get( QUObject * o );
59
60 bool canConvertFrom( QUObject *, QUType * );
61 bool canConvertTo( QUObject *, QUType * );
62 bool convertFrom( QUObject *, QUType * );
63 bool convertTo( QUObject *, QUType * );
64 void clear( QUObject * );
65 int serializeTo( QUObject *, QUBuffer * );
66 int serializeFrom( QUObject *, QUBuffer * );
67};
68extern Q_EXPORT QUType_QVariant static_QUType_QVariant;
69#endif //QT_NO_VARIANT
70
71
72// {0x8d48b3a8, 0xbd7f, 0x11d5, 0x8d, 0x74, 0x00, 0xc0, 0xf0, 0x3b, 0xc0, 0xf3 }
73extern Q_EXPORT const QUuid TID_QUType_varptr;
74struct Q_EXPORT QUType_varptr : public QUType
75{
76 const QUuid *uuid() const;
77 const char *desc() const;
78
79 void set( QUObject *, const void* );
80 void* &get( QUObject * o ) { return o->payload.ptr; }
81 bool canConvertFrom( QUObject *, QUType * );
82 bool canConvertTo( QUObject *, QUType * );
83 bool convertFrom( QUObject *, QUType * );
84 bool convertTo( QUObject *, QUType * );
85 void clear( QUObject * ) {}
86 int serializeTo( QUObject *, QUBuffer * );
87 int serializeFrom( QUObject *, QUBuffer * );
88};
89extern Q_EXPORT QUType_varptr static_QUType_varptr;
90
91
92#endif // QUCOMEXTRA_H
93
diff --git a/qmake/include/private/qwidget_p.h b/qmake/include/private/qwidget_p.h
new file mode 100644
index 0000000..80368d0
--- a/dev/null
+++ b/qmake/include/private/qwidget_p.h
@@ -0,0 +1,61 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of some Qt private functions.
5**
6** Created : 000903
7**
8** Copyright (C) 2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QWIDGET_P_H
39#define QWIDGET_P_H
40
41
42//
43// W A R N I N G
44// -------------
45//
46// This file is not part of the Qt API. It exists for the convenience
47// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
48// file may change from version to version without notice, or even be removed.
49//
50// We mean it.
51//
52//
53
54#ifndef QT_H
55#endif // QT_H
56
57#if defined (Q_WS_X11) || defined (Q_WS_QWS)
58extern int qt_widget_tlw_gravity;
59#endif
60
61#endif
diff --git a/qmake/include/private/qwidgetinterface_p.h b/qmake/include/private/qwidgetinterface_p.h
new file mode 100644
index 0000000..5b5776b
--- a/dev/null
+++ b/qmake/include/private/qwidgetinterface_p.h
@@ -0,0 +1,111 @@
1 /**********************************************************************
2** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
3**
4** This file is part of Qt Designer.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#ifndef QWIDGETINTERFACE_H
22#define QWIDGETINTERFACE_H
23
24
25#ifndef QT_H
26#include <private/qcom_p.h>
27#include <qiconset.h>
28#endif // QT_H
29
30#ifndef QT_NO_WIDGETPLUGIN
31
32//
33// W A R N I N G
34// -------------
35//
36// This file is not part of the Qt API. It exists for the convenience
37// of a number of Qt sources files. This header file may change from
38// version to version without notice, or even be removed.
39//
40// We mean it.
41//
42//
43
44class QWidget;
45
46// {55184143-f18f-42c0-a8eb-71c01516019a}
47#ifndef IID_QWidgetFactory
48#define IID_QWidgetFactory QUuid( 0x55184143, 0xf18f, 0x42c0, 0xa8, 0xeb, 0x71, 0xc0, 0x15, 0x16, 0x1, 0x9a )
49#endif
50
51/*! To add custom widgets to the Qt Designer, implement that interface
52 in your custom widget plugin.
53
54 You also have to implement the function featureList() (\sa
55 QFeatureListInterface) and return there all widgets (names of it)
56 which this interface provides.
57*/
58
59struct QWidgetFactoryInterface : public QFeatureListInterface
60{
61public:
62
63 /*! In the implementation create and return the widget \a widget
64 here, use \a parent and \a name when creating the widget */
65 virtual QWidget* create( const QString &widget, QWidget* parent = 0, const char* name = 0 ) = 0;
66
67 /*! In the implementation return the name of the group of the
68 widget \a widget */
69 virtual QString group( const QString &widget ) const = 0;
70
71 /*! In the implementation return the iconset, which should be used
72 in the Qt Designer menubar and toolbar to represent the widget
73 \a widget */
74 virtual QIconSet iconSet( const QString &widget ) const = 0;
75
76 /*! In the implementation return the include file which is needed
77 for the widget \a widget in the generated code which uic
78 generates. */
79 virtual QString includeFile( const QString &widget ) const = 0;
80
81 /*! In the implementation return the text which should be
82 displayed as tooltip for the widget \a widget */
83 virtual QString toolTip( const QString &widget ) const = 0;
84
85 /*! In the implementation return the text which should be used for
86 what's this help for the widget \a widget. */
87 virtual QString whatsThis( const QString &widget ) const = 0;
88
89 /*! In the implementation return TRUE here, of the \a widget
90 should be able to contain other widget in the Qt Designer, else
91 FALSE. */
92 virtual bool isContainer( const QString &widget ) const = 0;
93};
94
95#if CONTAINER_CUSTOM_WIDGETS
96// {15976628-e3c3-47f4-b525-d124a3caf30e}
97#ifndef IID_QWidgetContainer
98#define IID_QWidgetContainer QUuid( 0x15976628, 0xe3c3, 0x47f4, 0xb5, 0x25, 0xd1, 0x24, 0xa3, 0xca, 0xf3, 0x0e )
99#endif
100
101struct QWidgetContainerInterfacePrivate : public QUnknownInterface
102{
103public:
104 virtual QWidget *containerOfWidget( QWidget *widget ) const = 0;
105 virtual QWidgetList containersOf( QWidget *widget ) const = 0;
106 virtual bool isPassiveInteractor( QWidget *widget ) const = 0;
107};
108#endif
109
110#endif // QT_NO_WIDGETPLUGIN
111#endif // QWIDGETINTERFACE_H
diff --git a/qmake/include/private/qwidgetresizehandler_p.h b/qmake/include/private/qwidgetresizehandler_p.h
new file mode 100644
index 0000000..ca229db
--- a/dev/null
+++ b/qmake/include/private/qwidgetresizehandler_p.h
@@ -0,0 +1,113 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of the QWidgetResizeHandler class
5**
6** Created : 001010
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the workspace module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition licenses may use this
22** file in accordance with the Qt Commercial License Agreement provided
23** with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QWIDGETRESIZEHANDLER_H
39#define QWIDGETRESIZEHANDLER_H
40
41#ifndef QT_H
42#include "qobject.h"
43#endif // QT_H
44#ifndef QT_NO_RESIZEHANDLER
45class QMouseEvent;
46class QKeyEvent;
47
48class Q_EXPORT QWidgetResizeHandler : public QObject
49{
50 Q_OBJECT
51
52public:
53 QWidgetResizeHandler( QWidget *parent, QWidget *cw = 0, const char *name = 0 );
54 void setActive( bool b ) { active = b; if ( !active ) setMouseCursor( Nowhere ); }
55 bool isActive() const { return active; }
56 void setMovingEnabled( bool b ) { moving = b; }
57 bool isMovingEnabled() const { return moving; }
58
59 bool isButtonDown() const { return buttonDown; }
60
61 void setExtraHeight( int h ) { extrahei = h; }
62 void setSizeProtection( bool b ) { sizeprotect = b; }
63
64 void doResize();
65 void doMove();
66
67signals:
68 void activate();
69
70protected:
71 bool eventFilter( QObject *o, QEvent *e );
72 void mouseMoveEvent( QMouseEvent *e );
73 void keyPressEvent( QKeyEvent *e );
74
75private:
76 enum MousePosition {
77 Nowhere,
78 TopLeft, BottomRight, BottomLeft, TopRight,
79 Top, Bottom, Left, Right,
80 Center
81 };
82
83 QWidget *widget;
84 QWidget *childWidget;
85 QPoint moveOffset;
86 QPoint invertedMoveOffset;
87 MousePosition mode;
88 int extrahei;
89 int range;
90 uint buttonDown :1;
91 uint moveResizeMode :1;
92 uint active :1;
93 uint sizeprotect :1;
94 uint moving :1;
95
96 void setMouseCursor( MousePosition m );
97 bool isMove() const {
98 return moveResizeMode && mode == Center;
99 }
100 bool isResize() const {
101 return moveResizeMode && !isMove();
102 }
103
104 private:// Disabled copy constructor and operator=
105#if defined(Q_DISABLE_COPY)
106 QWidgetResizeHandler( const QWidgetResizeHandler & );
107 QWidgetResizeHandler& operator=( const QWidgetResizeHandler & );
108#endif
109
110};
111
112#endif //QT_NO_RESIZEHANDLER
113#endif
diff --git a/qmake/include/qasciidict.h b/qmake/include/qasciidict.h
new file mode 100644
index 0000000..8f344cd
--- a/dev/null
+++ b/qmake/include/qasciidict.h
@@ -0,0 +1,118 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QAsciiDict template class
5**
6** Created : 920821
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QASCIIDICT_H
39#define QASCIIDICT_H
40
41#ifndef QT_H
42#include "qgdict.h"
43#endif // QT_H
44
45template<class type>
46class QAsciiDict
47#ifdef Q_QDOC
48 : public QPtrCollection
49#else
50 : public QGDict
51#endif
52{
53public:
54 QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE )
55 : QGDict(size,AsciiKey,caseSensitive,copyKeys) {}
56 QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {}
57 ~QAsciiDict() { clear(); }
58 QAsciiDict<type> &operator=(const QAsciiDict<type> &d)
59 { return (QAsciiDict<type>&)QGDict::operator=(d); }
60 uint count() const { return QGDict::count(); }
61 uint size() const { return QGDict::size(); }
62 bool isEmpty() const { return QGDict::count() == 0; }
63
64 void insert( const char *k, const type *d )
65 { QGDict::look_ascii(k,(Item)d,1); }
66 void replace( const char *k, const type *d )
67 { QGDict::look_ascii(k,(Item)d,2); }
68 bool remove( const char *k ){ return QGDict::remove_ascii(k); }
69 type *take( const char *k ) { return (type *)QGDict::take_ascii(k); }
70 type *find( const char *k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
72 type *operator[]( const char *k ) const
73 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
74
75 void clear() { QGDict::clear(); }
76 void resize( uint n ) { QGDict::resize(n); }
77 void statistics() const { QGDict::statistics(); }
78
79#ifdef Q_QDOC
80protected:
81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
83#endif
84
85private:
86 void deleteItem( Item d );
87};
88
89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
90template<> inline void QAsciiDict<void>::deleteItem( QPtrCollection::Item )
91{
92}
93#endif
94
95template<class type> inline void QAsciiDict<type>::deleteItem( QPtrCollection::Item d )
96{
97 if ( del_item ) delete (type *)d;
98}
99
100template<class type>
101class QAsciiDictIterator : public QGDictIterator
102{
103public:
104 QAsciiDictIterator(const QAsciiDict<type> &d)
105 : QGDictIterator((QGDict &)d) {}
106 ~QAsciiDictIterator() {}
107 uint count() const { return dict->count(); }
108 bool isEmpty() const { return dict->count() == 0; }
109 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
110 operator type *() const { return (type *)QGDictIterator::get(); }
111 type *current() const { return (type *)QGDictIterator::get(); }
112 const char *currentKey() const { return QGDictIterator::getKeyAscii(); }
113 type *operator()() { return (type *)QGDictIterator::operator()(); }
114 type *operator++() { return (type *)QGDictIterator::operator++(); }
115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
116};
117
118#endif // QASCIIDICT_H
diff --git a/qmake/include/qbitarray.h b/qmake/include/qbitarray.h
new file mode 100644
index 0000000..65c5cd3
--- a/dev/null
+++ b/qmake/include/qbitarray.h
@@ -0,0 +1,166 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QBitArray class
5**
6** Created : 940118
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QBITARRAY_H
39#define QBITARRAY_H
40
41#ifndef QT_H
42#include "qstring.h"
43#endif // QT_H
44
45
46/*****************************************************************************
47 QBitVal class; a context class for QBitArray::operator[]
48 *****************************************************************************/
49
50class QBitArray;
51
52class Q_EXPORT QBitVal
53{
54private:
55 QBitArray *array;
56 uint index;
57public:
58 QBitVal( QBitArray *a, uint i ) : array(a), index(i) {}
59 operator int();
60 QBitVal &operator=( const QBitVal &v );
61 QBitVal &operator=( bool v );
62};
63
64
65/*****************************************************************************
66 QBitArray class
67 *****************************************************************************/
68
69class Q_EXPORT QBitArray : public QByteArray
70{
71public:
72 QBitArray();
73 QBitArray( uint size );
74 QBitArray( const QBitArray &a ) : QByteArray( a ) {}
75
76 QBitArray &operator=( const QBitArray & );
77
78 uint size() const;
79 bool resize( uint size );
80
81 bool fill( bool v, int size = -1 );
82
83 void detach();
84 QBitArray copy() const;
85
86 bool testBit( uint index ) const;
87 void setBit( uint index );
88 void setBit( uint index, bool value );
89 void clearBit( uint index );
90 bool toggleBit( uint index );
91
92 bool at( uint index ) const;
93 QBitVal operator[]( int index );
94 bool operator[]( int index ) const;
95
96 QBitArray &operator&=( const QBitArray & );
97 QBitArray &operator|=( const QBitArray & );
98 QBitArray &operator^=( const QBitArray & );
99 QBitArray operator~() const;
100
101protected:
102 struct bitarr_data : public QGArray::array_data {
103 uint nbits;
104 };
105 array_data *newData() { return new bitarr_data; }
106 voiddeleteData( array_data *d ) { delete (bitarr_data*)d; }
107private:
108 void pad0();
109};
110
111
112inline QBitArray &QBitArray::operator=( const QBitArray &a )
113{ return (QBitArray&)assign( a ); }
114
115inline uint QBitArray::size() const
116{ return ((bitarr_data*)sharedBlock())->nbits; }
117
118inline void QBitArray::setBit( uint index, bool value )
119{ if ( value ) setBit(index); else clearBit(index); }
120
121inline bool QBitArray::at( uint index ) const
122{ return testBit(index); }
123
124inline QBitVal QBitArray::operator[]( int index )
125{ return QBitVal( (QBitArray*)this, index ); }
126
127inline bool QBitArray::operator[]( int index ) const
128{ return testBit( index ); }
129
130
131/*****************************************************************************
132 Misc. QBitArray operator functions
133 *****************************************************************************/
134
135Q_EXPORT QBitArray operator&( const QBitArray &, const QBitArray & );
136Q_EXPORT QBitArray operator|( const QBitArray &, const QBitArray & );
137Q_EXPORT QBitArray operator^( const QBitArray &, const QBitArray & );
138
139
140inline QBitVal::operator int()
141{
142 return array->testBit( index );
143}
144
145inline QBitVal &QBitVal::operator=( const QBitVal &v )
146{
147 array->setBit( index, v.array->testBit(v.index) );
148 return *this;
149}
150
151inline QBitVal &QBitVal::operator=( bool v )
152{
153 array->setBit( index, v );
154 return *this;
155}
156
157
158/*****************************************************************************
159 QBitArray stream functions
160 *****************************************************************************/
161#ifndef QT_NO_DATASTREAM
162Q_EXPORT QDataStream &operator<<( QDataStream &, const QBitArray & );
163Q_EXPORT QDataStream &operator>>( QDataStream &, QBitArray & );
164#endif
165
166#endif // QBITARRAY_H
diff --git a/qmake/include/qbuffer.h b/qmake/include/qbuffer.h
new file mode 100644
index 0000000..f1b869b
--- a/dev/null
+++ b/qmake/include/qbuffer.h
@@ -0,0 +1,100 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QBuffer class
5**
6** Created : 930812
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QBUFFER_H
39#define QBUFFER_H
40
41#ifndef QT_H
42#include "qiodevice.h"
43#include "qstring.h"
44#endif // QT_H
45
46
47class Q_EXPORT QBuffer : public QIODevice
48{
49public:
50 QBuffer();
51 QBuffer( QByteArray );
52 ~QBuffer();
53
54 QByteArray buffer() const;
55 bool setBuffer( QByteArray );
56
57 bool open( int );
58 void close();
59 void flush();
60
61 Offset size() const;
62 Offset at() const;
63 bool at( Offset );
64
65 Q_LONG readBlock( char *p, Q_ULONG );
66 Q_LONG writeBlock( const char *p, Q_ULONG );
67 Q_LONG writeBlock( const QByteArray& data )
68 { return QIODevice::writeBlock(data); }
69 Q_LONG readLine( char *p, Q_ULONG );
70
71 int getch();
72 int putch( int );
73 int ungetch( int );
74
75protected:
76 QByteArray a;
77
78private:
79 uint a_len;
80 uint a_inc;
81
82 private:// Disabled copy constructor and operator=
83#if defined(Q_DISABLE_COPY)
84 QBuffer( const QBuffer & );
85 QBuffer &operator=( const QBuffer & );
86#endif
87};
88
89
90inline QByteArray QBuffer::buffer() const
91{ return a; }
92
93inline QIODevice::Offset QBuffer::size() const
94{ return (Offset)a.size(); }
95
96inline QIODevice::Offset QBuffer::at() const
97{ return ioIndex; }
98
99
100#endif // QBUFFER_H
diff --git a/qmake/include/qcache.h b/qmake/include/qcache.h
new file mode 100644
index 0000000..94ba323
--- a/dev/null
+++ b/qmake/include/qcache.h
@@ -0,0 +1,118 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QCache template class
5**
6** Created : 950209
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QCACHE_H
39#define QCACHE_H
40
41#ifndef QT_H
42#include "qgcache.h"
43#endif // QT_H
44
45template<class type>
46class QCache
47#ifdef Q_QDOC
48 : public QPtrCollection
49#else
50 : public QGCache
51#endif
52{
53public:
54 QCache( const QCache<type> &c ) : QGCache(c) {}
55 QCache( int maxCost=100, int size=17, bool caseSensitive=TRUE )
56 : QGCache( maxCost, size, StringKey, caseSensitive, FALSE ) {}
57 ~QCache() { clear(); }
58 QCache<type> &operator=( const QCache<type> &c )
59 { return (QCache<type>&)QGCache::operator=(c); }
60 int maxCost() const { return QGCache::maxCost(); }
61 int totalCost() const { return QGCache::totalCost(); }
62 void setMaxCost( int m ) { QGCache::setMaxCost(m); }
63 uint count() const { return QGCache::count(); }
64 uint size() const { return QGCache::size(); }
65 bool isEmpty() const { return QGCache::count() == 0; }
66 void clear() { QGCache::clear(); }
67 bool insert( const QString &k, const type *d, int c=1, int p=0 )
68 { return QGCache::insert_string(k,(Item)d,c,p);}
69 bool remove( const QString &k )
70 { return QGCache::remove_string(k); }
71 type *take( const QString &k )
72 { return (type *)QGCache::take_string(k); }
73 type *find( const QString &k, bool ref=TRUE ) const
74 { return (type *)QGCache::find_string(k,ref);}
75 type *operator[]( const QString &k ) const
76 { return (type *)QGCache::find_string(k);}
77 void statistics() const { QGCache::statistics(); }
78private:
79 void deleteItem( Item d );
80};
81
82#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
83template<> inline void QCache<void>::deleteItem( QPtrCollection::Item )
84{
85}
86#endif
87
88template<class type> inline void QCache<type>::deleteItem( QPtrCollection::Item d )
89{
90 if ( del_item ) delete (type *)d;
91}
92
93template<class type>
94class QCacheIterator : public QGCacheIterator
95{
96public:
97 QCacheIterator( const QCache<type> &c ):QGCacheIterator((QGCache &)c) {}
98 QCacheIterator( const QCacheIterator<type> &ci)
99 : QGCacheIterator( (QGCacheIterator &)ci ) {}
100 QCacheIterator<type> &operator=(const QCacheIterator<type>&ci)
101 { return ( QCacheIterator<type>&)QGCacheIterator::operator=( ci ); }
102 uint count() const { return QGCacheIterator::count(); }
103 bool isEmpty() const { return QGCacheIterator::count() == 0; }
104 bool atFirst() const { return QGCacheIterator::atFirst(); }
105 bool atLast() const { return QGCacheIterator::atLast(); }
106 type *toFirst() { return (type *)QGCacheIterator::toFirst(); }
107 type *toLast() { return (type *)QGCacheIterator::toLast(); }
108 operator type *() const { return (type *)QGCacheIterator::get(); }
109 type *current() const { return (type *)QGCacheIterator::get(); }
110 QString currentKey() const{ return QGCacheIterator::getKeyString(); }
111 type *operator()() { return (type *)QGCacheIterator::operator()();}
112 type *operator++() { return (type *)QGCacheIterator::operator++(); }
113 type *operator+=(uint j) { return (type *)QGCacheIterator::operator+=(j);}
114 type *operator--() { return (type *)QGCacheIterator::operator--(); }
115 type *operator-=(uint j) { return (type *)QGCacheIterator::operator-=(j);}
116};
117
118#endif // QCACHE_H
diff --git a/qmake/include/qcleanuphandler.h b/qmake/include/qcleanuphandler.h
new file mode 100644
index 0000000..471dc7b
--- a/dev/null
+++ b/qmake/include/qcleanuphandler.h
@@ -0,0 +1,127 @@
1/****************************************************************************
2** $Id$
3**
4** ...
5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QCLEANUPHANDLER_H
37#define QCLEANUPHANDLER_H
38
39#ifndef QT_H
40#include <qptrlist.h>
41#endif // QT_H
42
43template<class Type>
44class QCleanupHandler
45{
46public:
47 QCleanupHandler() : cleanupObjects( 0 ) {}
48 ~QCleanupHandler() { clear(); }
49
50 Type* add( Type **object ) {
51 if ( !cleanupObjects )
52 cleanupObjects = new QPtrList<Type*>;
53 cleanupObjects->insert( 0, object );
54 return *object;
55 }
56
57 void remove( Type **object ) {
58 if ( !cleanupObjects )
59 return;
60 if ( cleanupObjects->findRef( object ) >= 0 )
61 (void) cleanupObjects->take();
62 }
63
64 bool isEmpty() const {
65 return cleanupObjects ? cleanupObjects->isEmpty() : TRUE;
66 }
67
68 void clear() {
69 if ( !cleanupObjects )
70 return;
71 QPtrListIterator<Type*> it( *cleanupObjects );
72 Type **object;
73 while ( ( object = it.current() ) ) {
74 delete *object;
75 *object = 0;
76 cleanupObjects->remove( object );
77 }
78 delete cleanupObjects;
79 cleanupObjects = 0;
80 }
81
82private:
83 QPtrList<Type*> *cleanupObjects;
84};
85
86template<class Type>
87class QSingleCleanupHandler
88{
89public:
90 QSingleCleanupHandler() : object( 0 ) {}
91 ~QSingleCleanupHandler() {
92 if ( object ) {
93 delete *object;
94 *object = 0;
95 }
96 }
97 Type* set( Type **o ) {
98 object = o;
99 return *object;
100 }
101 void reset() { object = 0; }
102private:
103 Type **object;
104};
105
106template<class Type>
107class QSharedCleanupHandler
108{
109public:
110 QSharedCleanupHandler() : object( 0 ) {}
111 ~QSharedCleanupHandler() {
112 if ( object ) {
113 if ( (*object)->deref() )
114 delete *object;
115 *object = 0;
116 }
117 }
118 Type* set( Type **o ) {
119 object = o;
120 return *object;
121 }
122 void reset() { object = 0; }
123private:
124 Type **object;
125};
126
127#endif //QCLEANUPHANDLER_H
diff --git a/qmake/include/qcstring.h b/qmake/include/qcstring.h
new file mode 100644
index 0000000..004bb3b
--- a/dev/null
+++ b/qmake/include/qcstring.h
@@ -0,0 +1,391 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of the extended char array operations,
5** and QByteArray and QCString classes
6**
7** Created : 920609
8**
9** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
10**
11** This file is part of the tools module of the Qt GUI Toolkit.
12**
13** This file may be distributed under the terms of the Q Public License
14** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file.
16**
17** This file may be distributed and/or modified under the terms of the
18** GNU General Public License version 2 as published by the Free Software
19** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file.
21**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software.
25**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
27** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information.
33**
34** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you.
36**
37**********************************************************************/
38
39#ifndef QCSTRING_H
40#define QCSTRING_H
41
42#ifndef QT_H
43#include "qmemarray.h"
44#endif // QT_H
45
46#include <string.h>
47
48
49/*****************************************************************************
50 Safe and portable C string functions; extensions to standard string.h
51 *****************************************************************************/
52
53Q_EXPORT void *qmemmove( void *dst, const void *src, uint len );
54
55Q_EXPORT char *qstrdup( const char * );
56
57Q_EXPORT inline uint qstrlen( const char *str )
58{ return str ? (uint)strlen(str) : 0; }
59
60Q_EXPORT inline char *qstrcpy( char *dst, const char *src )
61{ return src ? strcpy(dst, src) : 0; }
62
63Q_EXPORT char *qstrncpy( char *dst, const char *src, uint len );
64
65Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 )
66{
67 return ( str1 && str2 ) ? strcmp( str1, str2 )
68 : ( str1 ? 1 : ( str2 ? -1 : 0 ) );
69}
70
71Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len )
72{
73 return ( str1 && str2 ) ? strncmp( str1, str2, len )
74 : ( str1 ? 1 : ( str2 ? -1 : 0 ) );
75}
76
77Q_EXPORT int qstricmp( const char *, const char * );
78
79Q_EXPORT int qstrnicmp( const char *, const char *, uint len );
80
81#ifndef QT_CLEAN_NAMESPACE
82Q_EXPORT inline uint cstrlen( const char *str )
83{ return (uint)strlen(str); }
84
85Q_EXPORT inline char *cstrcpy( char *dst, const char *src )
86{ return strcpy(dst,src); }
87
88Q_EXPORT inline int cstrcmp( const char *str1, const char *str2 )
89{ return strcmp(str1,str2); }
90
91Q_EXPORT inline int cstrncmp( const char *str1, const char *str2, uint len )
92{ return strncmp(str1,str2,len); }
93#endif
94
95
96// qChecksum: Internet checksum
97
98Q_EXPORT Q_UINT16 qChecksum( const char *s, uint len );
99
100/*****************************************************************************
101 QByteArray class
102 *****************************************************************************/
103
104#if defined(Q_TEMPLATEDLL)
105Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<char>;
106#endif
107
108#if defined(Q_QDOC)
109/*
110 We want qdoc to document QByteArray as a real class that inherits
111 QMemArray<char> and that is inherited by QBitArray.
112*/
113class QByteArray : public QMemArray<char>
114{
115public:
116 QByteArray();
117 QByteArray( int size );
118};
119#else
120typedef QMemArray<char> QByteArray;
121#endif
122
123#ifndef QT_NO_COMPRESS
124Q_EXPORT QByteArray qCompress( const uchar* data, int nbytes );
125Q_EXPORT QByteArray qUncompress( const uchar* data, int nbytes );
126Q_EXPORT inline QByteArray qCompress( const QByteArray& data)
127{ return qCompress( (const uchar*)data.data(), data.size() ); }
128Q_EXPORT inline QByteArray qUncompress( const QByteArray& data )
129{ return qUncompress( (const uchar*)data.data(), data.size() ); }
130#endif
131
132/*****************************************************************************
133 QByteArray stream functions
134 *****************************************************************************/
135#ifndef QT_NO_DATASTREAM
136Q_EXPORT QDataStream &operator<<( QDataStream &, const QByteArray & );
137Q_EXPORT QDataStream &operator>>( QDataStream &, QByteArray & );
138#endif
139
140/*****************************************************************************
141 QCString class
142 *****************************************************************************/
143
144class QRegExp;
145
146 class Q_EXPORT QCString : public QByteArray// C string class
147{
148public:
149 QCString() {} // make null string
150 QCString( int size ); // allocate size incl. \0
151 QCString( const QCString &s ) : QByteArray( s ) {}
152 QCString( const char *str ); // deep copy
153 QCString( const char *str, uint maxlen );// deep copy, max length
154 ~QCString();
155
156 QCString &operator=( const QCString &s );// shallow copy
157 QCString &operator=( const char *str );// deep copy
158
159 bool isNull()const;
160 bool isEmpty()const;
161 uint length()const;
162 boolresize( uint newlen );
163 booltruncate( uint pos );
164 boolfill( char c, int len = -1 );
165
166 QCString copy()const;
167
168 QCString &sprintf( const char *format, ... );
169
170 int find( char c, int index=0, bool cs=TRUE ) const;
171 int find( const char *str, int index=0, bool cs=TRUE ) const;
172#ifndef QT_NO_REGEXP
173 int find( const QRegExp &, int index=0 ) const;
174#endif
175 int findRev( char c, int index=-1, bool cs=TRUE) const;
176 int findRev( const char *str, int index=-1, bool cs=TRUE) const;
177#ifndef QT_NO_REGEXP_CAPTURE
178 int findRev( const QRegExp &, int index=-1 ) const;
179#endif
180 int contains( char c, bool cs=TRUE ) const;
181 int contains( const char *str, bool cs=TRUE ) const;
182#ifndef QT_NO_REGEXP
183 int contains( const QRegExp & ) const;
184#endif
185 QCStringleft( uint len ) const;
186 QCStringright( uint len ) const;
187 QCStringmid( uint index, uint len=0xffffffff) const;
188
189 QCStringleftJustify( uint width, char fill=' ', bool trunc=FALSE)const;
190 QCStringrightJustify( uint width, char fill=' ',bool trunc=FALSE)const;
191
192 QCStringlower() const;
193 QCStringupper() const;
194
195 QCString stripWhiteSpace()const;
196 QCString simplifyWhiteSpace()const;
197
198 QCString &insert( uint index, const char * );
199 QCString &insert( uint index, char );
200 QCString &append( const char * );
201 QCString &prepend( const char * );
202 QCString &remove( uint index, uint len );
203 QCString &replace( uint index, uint len, const char * );
204#ifndef QT_NO_REGEXP
205 QCString &replace( const QRegExp &, const char * );
206#endif
207 QCString &replace( char c, const char *after );
208 QCString &replace( const char *, const char * );
209 QCString &replace( char, char );
210
211 short toShort( bool *ok=0 )const;
212 ushort toUShort( bool *ok=0 )const;
213 int toInt( bool *ok=0 )const;
214 uint toUInt( bool *ok=0 )const;
215 long toLong( bool *ok=0 )const;
216 ulong toULong( bool *ok=0 )const;
217 float toFloat( bool *ok=0 )const;
218 double toDouble( bool *ok=0 )const;
219
220 QCString &setStr( const char *s );
221 QCString &setNum( short );
222 QCString &setNum( ushort );
223 QCString &setNum( int );
224 QCString &setNum( uint );
225 QCString &setNum( long );
226 QCString &setNum( ulong );
227 QCString &setNum( float, char f='g', int prec=6 );
228 QCString &setNum( double, char f='g', int prec=6 );
229
230 boolsetExpand( uint index, char c );
231
232 operator const char *() const;
233 QCString &operator+=( const char *str );
234 QCString &operator+=( char c );
235};
236
237
238/*****************************************************************************
239 QCString stream functions
240 *****************************************************************************/
241#ifndef QT_NO_DATASTREAM
242Q_EXPORT QDataStream &operator<<( QDataStream &, const QCString & );
243Q_EXPORT QDataStream &operator>>( QDataStream &, QCString & );
244#endif
245
246/*****************************************************************************
247 QCString inline functions
248 *****************************************************************************/
249
250inline QCString &QCString::operator=( const QCString &s )
251{ return (QCString&)assign( s ); }
252
253inline QCString &QCString::operator=( const char *str )
254{ return (QCString&)duplicate( str, qstrlen(str)+1 ); }
255
256inline bool QCString::isNull() const
257{ return data() == 0; }
258
259inline bool QCString::isEmpty() const
260{ return data() == 0 || *data() == '\0'; }
261
262inline uint QCString::length() const
263{ return qstrlen( data() ); }
264
265inline bool QCString::truncate( uint pos )
266{ return resize(pos+1); }
267
268inline QCString QCString::copy() const
269{ return QCString( data() ); }
270
271inline QCString &QCString::prepend( const char *s )
272{ return insert(0,s); }
273
274inline QCString &QCString::append( const char *s )
275{ return operator+=(s); }
276
277inline QCString &QCString::setNum( short n )
278{ return setNum((long)n); }
279
280inline QCString &QCString::setNum( ushort n )
281{ return setNum((ulong)n); }
282
283inline QCString &QCString::setNum( int n )
284{ return setNum((long)n); }
285
286inline QCString &QCString::setNum( uint n )
287{ return setNum((ulong)n); }
288
289inline QCString &QCString::setNum( float n, char f, int prec )
290{ return setNum((double)n,f,prec); }
291
292inline QCString::operator const char *() const
293{ return (const char *)data(); }
294
295
296/*****************************************************************************
297 QCString non-member operators
298 *****************************************************************************/
299
300Q_EXPORT inline bool operator==( const QCString &s1, const QCString &s2 )
301{ return qstrcmp( s1.data(), s2.data() ) == 0; }
302
303Q_EXPORT inline bool operator==( const QCString &s1, const char *s2 )
304{ return qstrcmp( s1.data(), s2 ) == 0; }
305
306Q_EXPORT inline bool operator==( const char *s1, const QCString &s2 )
307{ return qstrcmp( s1, s2.data() ) == 0; }
308
309Q_EXPORT inline bool operator!=( const QCString &s1, const QCString &s2 )
310{ return qstrcmp( s1.data(), s2.data() ) != 0; }
311
312Q_EXPORT inline bool operator!=( const QCString &s1, const char *s2 )
313{ return qstrcmp( s1.data(), s2 ) != 0; }
314
315Q_EXPORT inline bool operator!=( const char *s1, const QCString &s2 )
316{ return qstrcmp( s1, s2.data() ) != 0; }
317
318Q_EXPORT inline bool operator<( const QCString &s1, const QCString& s2 )
319{ return qstrcmp( s1.data(), s2.data() ) < 0; }
320
321Q_EXPORT inline bool operator<( const QCString &s1, const char *s2 )
322{ return qstrcmp( s1.data(), s2 ) < 0; }
323
324Q_EXPORT inline bool operator<( const char *s1, const QCString &s2 )
325{ return qstrcmp( s1, s2.data() ) < 0; }
326
327Q_EXPORT inline bool operator<=( const QCString &s1, const QCString &s2 )
328{ return qstrcmp( s1.data(), s2.data() ) <= 0; }
329
330Q_EXPORT inline bool operator<=( const QCString &s1, const char *s2 )
331{ return qstrcmp( s1.data(), s2 ) <= 0; }
332
333Q_EXPORT inline bool operator<=( const char *s1, const QCString &s2 )
334{ return qstrcmp( s1, s2.data() ) <= 0; }
335
336Q_EXPORT inline bool operator>( const QCString &s1, const QCString &s2 )
337{ return qstrcmp( s1.data(), s2.data() ) > 0; }
338
339Q_EXPORT inline bool operator>( const QCString &s1, const char *s2 )
340{ return qstrcmp( s1.data(), s2 ) > 0; }
341
342Q_EXPORT inline bool operator>( const char *s1, const QCString &s2 )
343{ return qstrcmp( s1, s2.data() ) > 0; }
344
345Q_EXPORT inline bool operator>=( const QCString &s1, const QCString& s2 )
346{ return qstrcmp( s1.data(), s2.data() ) >= 0; }
347
348Q_EXPORT inline bool operator>=( const QCString &s1, const char *s2 )
349{ return qstrcmp( s1.data(), s2 ) >= 0; }
350
351Q_EXPORT inline bool operator>=( const char *s1, const QCString &s2 )
352{ return qstrcmp( s1, s2.data() ) >= 0; }
353
354Q_EXPORT inline const QCString operator+( const QCString &s1,
355 const QCString &s2 )
356{
357 QCString tmp( s1.data() );
358 tmp += s2;
359 return tmp;
360}
361
362Q_EXPORT inline const QCString operator+( const QCString &s1, const char *s2 )
363{
364 QCString tmp( s1.data() );
365 tmp += s2;
366 return tmp;
367}
368
369Q_EXPORT inline const QCString operator+( const char *s1, const QCString &s2 )
370{
371 QCString tmp( s1 );
372 tmp += s2;
373 return tmp;
374}
375
376Q_EXPORT inline const QCString operator+( const QCString &s1, char c2 )
377{
378 QCString tmp( s1.data() );
379 tmp += c2;
380 return tmp;
381}
382
383Q_EXPORT inline const QCString operator+( char c1, const QCString &s2 )
384{
385 QCString tmp;
386 tmp += c1;
387 tmp += s2;
388 return tmp;
389}
390
391#endif // QCSTRING_H
diff --git a/qmake/include/qdatastream.h b/qmake/include/qdatastream.h
new file mode 100644
index 0000000..09d7bef
--- a/dev/null
+++ b/qmake/include/qdatastream.h
@@ -0,0 +1,173 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QDataStream class
5**
6** Created : 930831
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QDATASTREAM_H
39#define QDATASTREAM_H
40
41#ifndef QT_H
42#include "qiodevice.h"
43#include "qstring.h"
44#endif // QT_H
45
46#ifndef QT_NO_DATASTREAM
47 class Q_EXPORT QDataStream // data stream class
48{
49public:
50 QDataStream();
51 QDataStream( QIODevice * );
52 QDataStream( QByteArray, int mode );
53 virtual ~QDataStream();
54
55 QIODevice*device() const;
56 void setDevice( QIODevice * );
57 void unsetDevice();
58
59 bool atEnd() const;
60 bool eof() const;
61
62 enum ByteOrder { BigEndian, LittleEndian };
63 int byteOrder()const;
64 void setByteOrder( int );
65
66 bool isPrintableData() const;
67 void setPrintableData( bool );
68
69 int version() const;
70 void setVersion( int );
71
72 QDataStream &operator>>( Q_INT8 &i );
73 QDataStream &operator>>( Q_UINT8 &i );
74 QDataStream &operator>>( Q_INT16 &i );
75 QDataStream &operator>>( Q_UINT16 &i );
76 QDataStream &operator>>( Q_INT32 &i );
77 QDataStream &operator>>( Q_UINT32 &i );
78 QDataStream &operator>>( Q_LONG &i );
79 QDataStream &operator>>( Q_ULONG &i );
80
81 QDataStream &operator>>( float &f );
82 QDataStream &operator>>( double &f );
83 QDataStream &operator>>( char *&str );
84
85 QDataStream &operator<<( Q_INT8 i );
86 QDataStream &operator<<( Q_UINT8 i );
87 QDataStream &operator<<( Q_INT16 i );
88 QDataStream &operator<<( Q_UINT16 i );
89 QDataStream &operator<<( Q_INT32 i );
90 QDataStream &operator<<( Q_UINT32 i );
91 QDataStream &operator<<( Q_LONG i );
92 QDataStream &operator<<( Q_ULONG i );
93 QDataStream &operator<<( float f );
94 QDataStream &operator<<( double f );
95 QDataStream &operator<<( const char *str );
96
97 QDataStream &readBytes( char *&, uint &len );
98 QDataStream &readRawBytes( char *, uint len );
99
100 QDataStream &writeBytes( const char *, uint len );
101 QDataStream &writeRawBytes( const char *, uint len );
102
103private:
104 QIODevice*dev;
105 bool owndev;
106 int byteorder;
107 bool printable;
108 bool noswap;
109 int ver;
110
111 private:// Disabled copy constructor and operator=
112#if defined(Q_DISABLE_COPY)
113 QDataStream( const QDataStream & );
114 QDataStream &operator=( const QDataStream & );
115#endif
116};
117
118
119/*****************************************************************************
120 QDataStream inline functions
121 *****************************************************************************/
122
123inline QIODevice *QDataStream::device() const
124{ return dev; }
125
126inline bool QDataStream::atEnd() const
127{ return dev ? dev->atEnd() : TRUE; }
128
129inline bool QDataStream::eof() const
130{ return atEnd(); }
131
132inline int QDataStream::byteOrder() const
133{ return byteorder; }
134
135inline bool QDataStream::isPrintableData() const
136{ return printable; }
137
138inline void QDataStream::setPrintableData( bool p )
139{ printable = p; }
140
141inline int QDataStream::version() const
142{ return ver; }
143
144inline void QDataStream::setVersion( int v )
145{ ver = v; }
146
147inline QDataStream &QDataStream::operator>>( Q_UINT8 &i )
148{ return *this >> (Q_INT8&)i; }
149
150inline QDataStream &QDataStream::operator>>( Q_UINT16 &i )
151{ return *this >> (Q_INT16&)i; }
152
153inline QDataStream &QDataStream::operator>>( Q_UINT32 &i )
154{ return *this >> (Q_INT32&)i; }
155
156inline QDataStream &QDataStream::operator>>( Q_ULONG &i )
157{ return *this >> (Q_LONG&)i; }
158
159inline QDataStream &QDataStream::operator<<( Q_UINT8 i )
160{ return *this << (Q_INT8)i; }
161
162inline QDataStream &QDataStream::operator<<( Q_UINT16 i )
163{ return *this << (Q_INT16)i; }
164
165inline QDataStream &QDataStream::operator<<( Q_UINT32 i )
166{ return *this << (Q_INT32)i; }
167
168inline QDataStream &QDataStream::operator<<( Q_ULONG i )
169{ return *this << (Q_LONG)i; }
170
171
172#endif // QT_NO_DATASTREAM
173#endif // QDATASTREAM_H
diff --git a/qmake/include/qdatetime.h b/qmake/include/qdatetime.h
new file mode 100644
index 0000000..4f01760
--- a/dev/null
+++ b/qmake/include/qdatetime.h
@@ -0,0 +1,250 @@
1/*************************************************************************
2** $Id$
3**
4** Definition of date and time classes
5**
6** Created : 940124
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QDATETIME_H
39#define QDATETIME_H
40
41#ifndef QT_H
42#include "qstring.h"
43#include "qnamespace.h"
44#endif // QT_H
45
46
47/*****************************************************************************
48 QDate class
49 *****************************************************************************/
50
51class Q_EXPORT QDate
52{
53public:
54 QDate() { jd = 0; }
55 QDate( int y, int m, int d );
56
57 bool isNull() const { return jd == 0; }
58 bool isValid() const;
59
60 int year() const;
61 int month() const;
62 int day() const;
63 int dayOfWeek() const;
64 int dayOfYear() const;
65 int daysInMonth() const;
66 int daysInYear() const;
67 int weekNumber( int *yearNum = 0 ) const;
68
69#ifndef QT_NO_TEXTDATE
70#ifndef QT_NO_COMPAT
71 static QString monthName( int month ) { return shortMonthName( month ); }
72 static QString dayName( int weekday ) { return shortDayName( weekday ); }
73#endif
74 static QString shortMonthName( int month );
75 static QString shortDayName( int weekday );
76 static QString longMonthName( int month );
77 static QString longDayName( int weekday );
78#endif //QT_NO_TEXTDATE
79#ifndef QT_NO_TEXTSTRING
80#if !defined(QT_NO_SPRINTF)
81 QString toString( Qt::DateFormat f = Qt::TextDate ) const;
82#endif
83 QString toString( const QString& format ) const;
84#endif
85 bool setYMD( int y, int m, int d );
86
87 QDate addDays( int days ) const;
88 QDate addMonths( int months ) const;
89 QDate addYears( int years ) const;
90 int daysTo( const QDate & )const;
91
92 bool operator==( const QDate &d ) const { return jd == d.jd; }
93 bool operator!=( const QDate &d ) const { return jd != d.jd; }
94 bool operator<( const QDate &d )const { return jd < d.jd; }
95 bool operator<=( const QDate &d ) const { return jd <= d.jd; }
96 bool operator>( const QDate &d )const { return jd > d.jd; }
97 bool operator>=( const QDate &d ) const { return jd >= d.jd; }
98
99 static QDate currentDate();
100 static QDate currentDate( Qt::TimeSpec );
101#ifndef QT_NO_DATESTRING
102 static QDate fromString( const QString& s, Qt::DateFormat f = Qt::TextDate );
103#endif
104 static bool isValid( int y, int m, int d );
105 static bool leapYear( int year );
106
107 static uint gregorianToJulian( int y, int m, int d );
108 static void julianToGregorian( uint jd, int &y, int &m, int &d );
109private:
110 uint jd;
111 friend class QDateTime;
112#ifndef QT_NO_DATASTREAM
113 friend Q_EXPORT QDataStream &operator<<( QDataStream &, const QDate & );
114 friend Q_EXPORT QDataStream &operator>>( QDataStream &, QDate & );
115#endif
116};
117
118
119/*****************************************************************************
120 QTime class
121 *****************************************************************************/
122
123class Q_EXPORT QTime
124{
125public:
126 QTime() { ds=0; } // set null time
127 QTime( int h, int m, int s=0, int ms=0 );// set time
128
129 bool isNull() const { return ds == 0; }
130 bool isValid() const; // valid time
131
132 int hour() const; // 0..23
133 int minute() const; // 0..59
134 int second() const; // 0..59
135 int msec() const; // 0..999
136#ifndef QT_NO_DATESTRING
137#ifndef QT_NO_SPRINTF
138 QString toString( Qt::DateFormat f = Qt::TextDate ) const;
139#endif
140 QString toString( const QString& format ) const;
141#endif
142 bool setHMS( int h, int m, int s, int ms=0 );
143
144 QTime addSecs( int secs ) const;
145 int secsTo( const QTime & )const;
146 QTime addMSecs( int ms ) const;
147 int msecsTo( const QTime & )const;
148
149 bool operator==( const QTime &d ) const { return ds == d.ds; }
150 bool operator!=( const QTime &d ) const { return ds != d.ds; }
151 bool operator<( const QTime &d )const { return ds < d.ds; }
152 bool operator<=( const QTime &d ) const { return ds <= d.ds; }
153 bool operator>( const QTime &d )const { return ds > d.ds; }
154 bool operator>=( const QTime &d ) const { return ds >= d.ds; }
155
156 static QTime currentTime();
157 static QTime currentTime( Qt::TimeSpec );
158#ifndef QT_NO_DATESTRING
159 static QTime fromString( const QString& s, Qt::DateFormat f = Qt::TextDate );
160#endif
161 static bool isValid( int h, int m, int s, int ms=0 );
162
163 void start();
164 int restart();
165 int elapsed() const;
166
167private:
168 static bool currentTime( QTime * );
169 static bool currentTime( QTime *, Qt::TimeSpec );
170
171 uint ds;
172 friend class QDateTime;
173#ifndef QT_NO_DATASTREAM
174 friend Q_EXPORT QDataStream &operator<<( QDataStream &, const QTime & );
175 friend Q_EXPORT QDataStream &operator>>( QDataStream &, QTime & );
176#endif
177};
178
179
180/*****************************************************************************
181 QDateTime class
182 *****************************************************************************/
183
184class Q_EXPORT QDateTime
185{
186public:
187 QDateTime() {} // set null date and null time
188 QDateTime( const QDate & );
189 QDateTime( const QDate &, const QTime & );
190
191 bool isNull() const { return d.isNull() && t.isNull(); }
192 bool isValid() const { return d.isValid() && t.isValid(); }
193
194 QDate date() const { return d; }
195 QTime time() const { return t; }
196 uint toTime_t()const;
197 void setDate( const QDate &date ) { d = date; }
198 void setTime( const QTime &time ) { t = time; }
199 void setTime_t( uint secsSince1Jan1970UTC );
200 void setTime_t( uint secsSince1Jan1970UTC, Qt::TimeSpec );
201#ifndef QT_NO_DATESTRING
202#ifndef QT_NO_SPRINTF
203 QString toString( Qt::DateFormat f = Qt::TextDate )const;
204#endif
205 QString toString( const QString& format ) const;
206#endif
207 QDateTime addDays( int days )const;
208 QDateTime addMonths( int months ) const;
209 QDateTime addYears( int years ) const;
210 QDateTime addSecs( int secs )const;
211 int daysTo( const QDateTime & )const;
212 int secsTo( const QDateTime & )const;
213
214 bool operator==( const QDateTime &dt ) const;
215 bool operator!=( const QDateTime &dt ) const;
216 bool operator<( const QDateTime &dt ) const;
217 bool operator<=( const QDateTime &dt ) const;
218 bool operator>( const QDateTime &dt ) const;
219 bool operator>=( const QDateTime &dt ) const;
220
221 static QDateTime currentDateTime();
222 static QDateTime currentDateTime( Qt::TimeSpec );
223#ifndef QT_NO_DATESTRING
224 static QDateTime fromString( const QString& s, Qt::DateFormat f = Qt::TextDate );
225#endif
226private:
227 QDate d;
228 QTime t;
229#ifndef QT_NO_DATASTREAM
230 friend Q_EXPORT QDataStream &operator<<( QDataStream &, const QDateTime &);
231 friend Q_EXPORT QDataStream &operator>>( QDataStream &, QDateTime & );
232#endif
233};
234
235
236/*****************************************************************************
237 Date and time stream functions
238 *****************************************************************************/
239
240#ifndef QT_NO_DATASTREAM
241Q_EXPORT QDataStream &operator<<( QDataStream &, const QDate & );
242Q_EXPORT QDataStream &operator>>( QDataStream &, QDate & );
243Q_EXPORT QDataStream &operator<<( QDataStream &, const QTime & );
244Q_EXPORT QDataStream &operator>>( QDataStream &, QTime & );
245Q_EXPORT QDataStream &operator<<( QDataStream &, const QDateTime & );
246Q_EXPORT QDataStream &operator>>( QDataStream &, QDateTime & );
247#endif // QT_NO_DATASTREAM
248
249#endif // QDATETIME_H
250
diff --git a/qmake/include/qdict.h b/qmake/include/qdict.h
new file mode 100644
index 0000000..04ae7bf
--- a/dev/null
+++ b/qmake/include/qdict.h
@@ -0,0 +1,118 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QDict template class
5**
6** Created : 920821
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QDICT_H
39#define QDICT_H
40
41#ifndef QT_H
42#include "qgdict.h"
43#endif // QT_H
44
45template<class type>
46class QDict
47#ifdef Q_QDOC
48 : public QPtrCollection
49#else
50 : public QGDict
51#endif
52{
53public:
54 QDict( int size = 17, bool caseSensitive = TRUE )
55 : QGDict( size, StringKey, caseSensitive, FALSE ) { }
56 QDict( const QDict<type> &d ) : QGDict( d ) { }
57 ~QDict() { clear(); }
58 QDict<type> &operator=(const QDict<type> &d)
59 { return (QDict<type>&)QGDict::operator=(d); }
60 uint count() const { return QGDict::count(); }
61 uint size() const { return QGDict::size(); }
62 bool isEmpty() const { return QGDict::count() == 0; }
63
64 void insert( const QString &k, const type *d )
65 { QGDict::look_string(k,(Item)d,1); }
66 void replace( const QString &k, const type *d )
67 { QGDict::look_string(k,(Item)d,2); }
68 bool remove( const QString &k ){ return QGDict::remove_string(k); }
69 type *take( const QString &k ){ return (type *)QGDict::take_string(k); }
70 type *find( const QString &k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
72 type *operator[]( const QString &k ) const
73 { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
74
75 void clear() { QGDict::clear(); }
76 void resize( uint n ) { QGDict::resize(n); }
77 void statistics() const { QGDict::statistics(); }
78
79#ifdef Q_QDOC
80protected:
81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
83#endif
84
85private:
86 void deleteItem( Item d );
87};
88
89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
90template<> inline void QDict<void>::deleteItem( Item )
91{
92}
93#endif
94
95template<class type> inline void QDict<type>::deleteItem( QPtrCollection::Item d )
96{
97 if ( del_item ) delete (type *)d;
98}
99
100template<class type>
101class QDictIterator : public QGDictIterator
102{
103public:
104 QDictIterator(const QDict<type> &d) : QGDictIterator((QGDict &)d) { }
105 ~QDictIterator() {}
106 uint count() const { return dict->count(); }
107 bool isEmpty() const { return dict->count() == 0; }
108 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
109 operator type *() const { return (type *)QGDictIterator::get(); }
110 type *operator*() { return (type *)QGDictIterator::get(); }
111 type *current() const { return (type *)QGDictIterator::get(); }
112 QString currentKey() const{ return QGDictIterator::getKeyString(); }
113 type *operator()() { return (type *)QGDictIterator::operator()(); }
114 type *operator++() { return (type *)QGDictIterator::operator++(); }
115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j); }
116};
117
118#endif // QDICT_H
diff --git a/qmake/include/qdir.h b/qmake/include/qdir.h
new file mode 100644
index 0000000..6e9f1ab
--- a/dev/null
+++ b/qmake/include/qdir.h
@@ -0,0 +1,241 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QDir class
5**
6** Created : 950427
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QDIR_H
39#define QDIR_H
40
41#ifndef QT_H
42#include "qglobal.h"
43#include "qstrlist.h"
44#include "qfileinfo.h"
45#endif // QT_H
46
47
48#ifndef QT_NO_DIR
49typedef QPtrList<QFileInfo> QFileInfoList;
50typedef QPtrListIterator<QFileInfo> QFileInfoListIterator;
51class QStringList;
52
53
54class Q_EXPORT QDir
55{
56public:
57 enum FilterSpec { Dirs = 0x001,
58 Files = 0x002,
59 Drives = 0x004,
60 NoSymLinks = 0x008,
61 All = 0x007,
62 TypeMask = 0x00F,
63
64 Readable = 0x010,
65 Writable = 0x020,
66 Executable = 0x040,
67 RWEMask = 0x070,
68
69 Modified = 0x080,
70 Hidden = 0x100,
71 System = 0x200,
72 AccessMask = 0x3F0,
73
74 DefaultFilter = -1 };
75
76 enum SortSpec { Name = 0x00,
77 Time = 0x01,
78 Size = 0x02,
79 Unsorted = 0x03,
80 SortByMask = 0x03,
81
82 DirsFirst = 0x04,
83 Reversed = 0x08,
84 IgnoreCase = 0x10,
85 DefaultSort = -1 };
86
87 QDir();
88 QDir( const QString &path, const QString &nameFilter = QString::null,
89 int sortSpec = Name | IgnoreCase, int filterSpec = All );
90 QDir( const QDir & );
91
92 virtual ~QDir();
93
94 QDir &operator=( const QDir & );
95 QDir &operator=( const QString &path );
96
97 virtual void setPath( const QString &path );
98 virtual QString path() const;
99 virtual QString absPath()const;
100 virtual QString canonicalPath()const;
101
102 virtual QString dirName() const;
103 virtual QString filePath( const QString &fileName,
104 bool acceptAbsPath = TRUE ) const;
105 virtual QString absFilePath( const QString &fileName,
106 bool acceptAbsPath = TRUE ) const;
107
108 static QString convertSeparators( const QString &pathName );
109
110 virtual bool cd( const QString &dirName, bool acceptAbsPath = TRUE );
111 virtual bool cdUp();
112
113 QStringnameFilter() const;
114 virtual void setNameFilter( const QString &nameFilter );
115 FilterSpec filter() const;
116 virtual void setFilter( int filterSpec );
117 SortSpec sorting() const;
118 virtual void setSorting( int sortSpec );
119
120 boolmatchAllDirs() const;
121 virtual void setMatchAllDirs( bool );
122
123 uint count() const;
124 QStringoperator[]( int ) const;
125
126 virtual QStrList encodedEntryList( int filterSpec = DefaultFilter,
127 int sortSpec = DefaultSort ) const;
128 virtual QStrList encodedEntryList( const QString &nameFilter,
129 int filterSpec = DefaultFilter,
130 int sortSpec = DefaultSort ) const;
131 virtual QStringList entryList( int filterSpec = DefaultFilter,
132 int sortSpec = DefaultSort ) const;
133 virtual QStringList entryList( const QString &nameFilter,
134 int filterSpec = DefaultFilter,
135 int sortSpec = DefaultSort ) const;
136
137 virtual const QFileInfoList *entryInfoList( int filterSpec = DefaultFilter,
138 int sortSpec = DefaultSort ) const;
139 virtual const QFileInfoList *entryInfoList( const QString &nameFilter,
140 int filterSpec = DefaultFilter,
141 int sortSpec = DefaultSort ) const;
142
143 static const QFileInfoList *drives();
144
145 virtual bool mkdir( const QString &dirName,
146 bool acceptAbsPath = TRUE ) const;
147 virtual bool rmdir( const QString &dirName,
148 bool acceptAbsPath = TRUE ) const;
149
150 virtual bool isReadable() const;
151 virtual bool exists() const;
152 virtual bool isRoot() const;
153
154 virtual bool isRelative() const;
155 virtual void convertToAbs();
156
157 virtual bool operator==( const QDir & ) const;
158 virtual bool operator!=( const QDir & ) const;
159
160 virtual bool remove( const QString &fileName,
161 bool acceptAbsPath = TRUE );
162 virtual bool rename( const QString &name, const QString &newName,
163 bool acceptAbsPaths = TRUE );
164 virtual bool exists( const QString &name,
165 bool acceptAbsPath = TRUE );
166
167 static char separator();
168
169 static bool setCurrent( const QString &path );
170 static QDir current();
171 static QDir home();
172 static QDir root();
173 static QString currentDirPath();
174 static QString homeDirPath();
175 static QString rootDirPath();
176
177 static bool match( const QStringList &filters, const QString &fileName );
178 static bool match( const QString &filter, const QString &fileName );
179 static QString cleanDirPath( const QString &dirPath );
180 static bool isRelativePath( const QString &path );
181
182private:
183#ifdef Q_OS_MAC
184 typedef struct FSSpec FSSpec;
185 static FSSpec *make_spec(const QString &);
186#endif
187 void init();
188 virtual bool readDirEntries( const QString &nameFilter,
189 int FilterSpec, int SortSpec );
190
191 static void slashify ( QString &);
192
193 QStringdPath;
194 QStringList *fList;
195 QFileInfoList *fiList;
196 QStringnameFilt;
197 FilterSpecfiltS;
198 SortSpecsortS;
199 uint dirty: 1;
200 uintallDirs : 1;
201};
202
203
204inline QString QDir::path() const
205{
206 return dPath;
207}
208
209inline QString QDir::nameFilter() const
210{
211 return nameFilt;
212}
213
214inline QDir::FilterSpec QDir::filter() const
215{
216 return filtS;
217}
218
219inline QDir::SortSpec QDir::sorting() const
220{
221 return sortS;
222}
223
224inline bool QDir::matchAllDirs() const
225{
226 return allDirs;
227}
228
229inline bool QDir::operator!=( const QDir &d ) const
230{
231 return !(*this == d);
232}
233
234
235struct QDirSortItem {
236 QString filename_cache;
237 QFileInfo* item;
238};
239
240#endif // QT_NO_DIR
241#endif // QDIR_H
diff --git a/qmake/include/qfeatures.h b/qmake/include/qfeatures.h
new file mode 100644
index 0000000..57502f9
--- a/dev/null
+++ b/qmake/include/qfeatures.h
@@ -0,0 +1,959 @@
1// All feature and their dependencies
2//
3// This list is generated from $QTDIR/src/tools/qfeatures.txt
4//
5// Asynchronous I/O
6//#define QT_NO_ASYNC_IO
7
8// Bezier curves
9//#define QT_NO_BEZIER
10
11// Buttons
12//#define QT_NO_BUTTON
13
14// Named colors
15//#define QT_NO_COLORNAMES
16
17// Cursors
18//#define QT_NO_CURSOR
19
20// QDataStream
21//#define QT_NO_DATASTREAM
22
23// QDate/QTime/QDateTime toString() and fromString()
24//#define QT_NO_DATESTRING
25
26// Dialogs
27//#define QT_NO_DIALOG
28
29// QDirectPainter
30//#define QT_NO_DIRECTPAINTER
31
32// Special widget effects (fading, scrolling)
33//#define QT_NO_EFFECTS
34
35// Freetype font engine
36//#define QT_NO_FREETYPE
37
38// Dither QImage to 1-bit image
39//#define QT_NO_IMAGE_DITHER_TO_1
40
41// QImage::createHeuristicMask()
42//#define QT_NO_IMAGE_HEURISTIC_MASK
43
44// QImage mirroring
45//#define QT_NO_IMAGE_MIRROR
46
47// Smooth QImage scaling
48//#define QT_NO_IMAGE_SMOOTHSCALE
49
50// TrueColor QImage
51//#define QT_NO_IMAGE_TRUECOLOR
52
53// Automatic widget layout
54//#define QT_NO_LAYOUT
55
56// Networking
57//#define QT_NO_NETWORK
58
59// Palettes
60//#define QT_NO_PALETTE
61
62// Alpha-blended cursor
63//#define QT_NO_QWS_ALPHA_CURSOR
64
65// 1-bit monochrome
66//#define QT_NO_QWS_DEPTH_1
67
68// 15 or 16-bit color
69//#define QT_NO_QWS_DEPTH_16
70
71// 24-bit color
72//#define QT_NO_QWS_DEPTH_24
73
74// 32-bit color
75//#define QT_NO_QWS_DEPTH_32
76
77// 4-bit greyscale
78//#define QT_NO_QWS_DEPTH_4
79
80// 8-bit color
81//#define QT_NO_QWS_DEPTH_8
82
83// 8-bit grayscale
84//#define QT_NO_QWS_DEPTH_8GRAYSCALE
85
86// Favour code size over graphics speed
87//#define QT_NO_QWS_GFX_SPEED
88
89// Console keyboard
90//#define QT_NO_QWS_KEYBOARD
91
92// Linux framebuffer
93//#define QT_NO_QWS_LINUXFB
94
95// Mach64 acceleration
96//#define QT_NO_QWS_MACH64
97
98// Window Manager
99//#define QT_NO_QWS_MANAGER
100
101// Matrox MGA acceleration
102//#define QT_NO_QWS_MATROX
103
104// Autodetecting mouse driver
105//#define QT_NO_QWS_MOUSE_AUTO
106
107// Non-autodetecting mouse driver
108//#define QT_NO_QWS_MOUSE_MANUAL
109
110// Qt/Embedded window system properties.
111//#define QT_NO_QWS_PROPERTIES
112
113// Repeater display
114//#define QT_NO_QWS_REPEATER
115
116// Saving of fonts
117//#define QT_NO_QWS_SAVEFONTS
118
119// Shadow frame buffer
120//#define QT_NO_QWS_SHADOWFB
121
122// Virtual frame buffer
123//#define QT_NO_QWS_VFB
124
125// 4-bit VGA
126//#define QT_NO_QWS_VGA_16
127
128// Voodoo3 acceleration
129//#define QT_NO_QWS_VOODOO3
130
131// Range-control widgets
132//#define QT_NO_RANGECONTROL
133
134// Regular expression capture
135//#define QT_NO_REGEXP
136
137// QSignalMapper
138//#define QT_NO_SIGNALMAPPER
139
140// Playing sounds
141//#define QT_NO_SOUND
142
143// Standard template library compatiblity
144//#define QT_NO_STL
145
146// QStringList
147//#define QT_NO_STRINGLIST
148
149// Character set conversions
150//#define QT_NO_TEXTCODEC
151
152// QTextStream
153//#define QT_NO_TEXTSTREAM
154
155// Unicode property tables
156//#define QT_NO_UNICODETABLES
157
158// Input validators
159//#define QT_NO_VALIDATOR
160
161// QVariant
162//#define QT_NO_VARIANT
163
164// Wheel-mouse events
165//#define QT_NO_WHEELEVENT
166
167// QWMatrix
168//#define QT_NO_WMATRIX
169
170// Non-Unicode text conversions
171#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC))
172#define QT_NO_CODECS
173#endif
174
175// QCop IPC
176#if !defined(QT_NO_COP) && (defined(QT_NO_DATASTREAM))
177#define QT_NO_COP
178#endif
179
180// QFontDatabase
181#if !defined(QT_NO_FONTDATABASE) && (defined(QT_NO_STRINGLIST))
182#define QT_NO_FONTDATABASE
183#endif
184
185// Image formats
186#if !defined(QT_NO_IMAGEIO) && (defined(QT_NO_REGEXP))
187#define QT_NO_IMAGEIO
188#endif
189
190// 16-bit QImage
191#if !defined(QT_NO_IMAGE_16_BIT) && (defined(QT_NO_IMAGE_TRUECOLOR))
192#define QT_NO_IMAGE_16_BIT
193#endif
194
195// Image file text strings
196#if !defined(QT_NO_IMAGE_TEXT) && (defined(QT_NO_STRINGLIST))
197#define QT_NO_IMAGE_TEXT
198#endif
199
200// Shared library wrapper
201#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_REGEXP))
202#define QT_NO_LIBRARY
203#endif
204
205// Pixmap transformations
206#if !defined(QT_NO_PIXMAP_TRANSFORMATION) && (defined(QT_NO_WMATRIX))
207#define QT_NO_PIXMAP_TRANSFORMATION
208#endif
209
210// Convert UUID to/from string
211#if !defined(QT_NO_QUUID_STRING) && (defined(QT_NO_STRINGLIST))
212#define QT_NO_QUUID_STRING
213#endif
214
215// The "BeOS" style
216#if !defined(QT_NO_QWS_BEOS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
217#define QT_NO_QWS_BEOS_WM_STYLE
218#endif
219
220// Visible cursor
221#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR))
222#define QT_NO_QWS_CURSOR
223#endif
224
225// 32-bit color, BGR order
226#if !defined(QT_NO_QWS_DEPTH_32_BGR) && (defined(QT_NO_QWS_DEPTH_32))
227#define QT_NO_QWS_DEPTH_32_BGR
228#endif
229
230// The "Hydro" style
231#if !defined(QT_NO_QWS_HYDRO_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
232#define QT_NO_QWS_HYDRO_WM_STYLE
233#endif
234
235// The "KDE2" style
236#if !defined(QT_NO_QWS_KDE2_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
237#define QT_NO_QWS_KDE2_WM_STYLE
238#endif
239
240// The "KDE" style
241#if !defined(QT_NO_QWS_KDE_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
242#define QT_NO_QWS_KDE_WM_STYLE
243#endif
244
245// Multi-process architecture
246#if !defined(QT_NO_QWS_MULTIPROCESS) && (defined(QT_NO_NETWORK))
247#define QT_NO_QWS_MULTIPROCESS
248#endif
249
250// Transformed frame buffer
251#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_LINUXFB))
252#define QT_NO_QWS_TRANSFORMED
253#endif
254
255// Remote frame buffer (VNC)
256#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_NETWORK))
257#define QT_NO_QWS_VNC
258#endif
259
260// The "Windows" style
261#if !defined(QT_NO_QWS_WINDOWS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
262#define QT_NO_QWS_WINDOWS_WM_STYLE
263#endif
264
265// Regular expression anchors
266#if !defined(QT_NO_REGEXP_ANCHOR_ALT) && (defined(QT_NO_REGEXP))
267#define QT_NO_REGEXP_ANCHOR_ALT
268#endif
269
270// Regular expression back-reference
271#if !defined(QT_NO_REGEXP_BACKREF) && (defined(QT_NO_REGEXP))
272#define QT_NO_REGEXP_BACKREF
273#endif
274
275// Regular expression character-class
276#if !defined(QT_NO_REGEXP_CCLASS) && (defined(QT_NO_REGEXP))
277#define QT_NO_REGEXP_CCLASS
278#endif
279
280// Regular expression escape
281#if !defined(QT_NO_REGEXP_ESCAPE) && (defined(QT_NO_REGEXP))
282#define QT_NO_REGEXP_ESCAPE
283#endif
284
285// Regular expression interval
286#if !defined(QT_NO_REGEXP_INTERVAL) && (defined(QT_NO_REGEXP))
287#define QT_NO_REGEXP_INTERVAL
288#endif
289
290// Regular expression lookahead
291#if !defined(QT_NO_REGEXP_LOOKAHEAD) && (defined(QT_NO_REGEXP))
292#define QT_NO_REGEXP_LOOKAHEAD
293#endif
294
295// Regular expression optimization
296#if !defined(QT_NO_REGEXP_OPTIM) && (defined(QT_NO_REGEXP))
297#define QT_NO_REGEXP_OPTIM
298#endif
299
300// Regular expression wildcard
301#if !defined(QT_NO_REGEXP_WILDCARD) && (defined(QT_NO_REGEXP))
302#define QT_NO_REGEXP_WILDCARD
303#endif
304
305// Semi-modal dialogs
306#if !defined(QT_NO_SEMIMODAL) && (defined(QT_NO_DIALOG))
307#define QT_NO_SEMIMODAL
308#endif
309
310// Session management
311#if !defined(QT_NO_SESSIONMANAGER) && (defined(QT_NO_STRINGLIST))
312#define QT_NO_SESSIONMANAGER
313#endif
314
315// QString::sprintf()
316#if !defined(QT_NO_SPRINTF) && (defined(QT_NO_REGEXP))
317#define QT_NO_SPRINTF
318#endif
319
320// Scaling and rotation
321#if !defined(QT_NO_TRANSFORMATIONS) && (defined(QT_NO_WMATRIX))
322#define QT_NO_TRANSFORMATIONS
323#endif
324
325// Translations via QObject::tr()
326#if !defined(QT_NO_TRANSLATION) && (defined(QT_NO_DATASTREAM))
327#define QT_NO_TRANSLATION
328#endif
329
330// Window icon and caption
331#if !defined(QT_NO_WIDGET_TOPEXTRA) && (defined(QT_NO_IMAGE_HEURISTIC_MASK))
332#define QT_NO_WIDGET_TOPEXTRA
333#endif
334
335// Keyboard accelerators and shortcuts
336#if !defined(QT_NO_ACCEL) && (defined(QT_NO_SPRINTF))
337#define QT_NO_ACCEL
338#endif
339
340// Asynchronous image I/O
341#if !defined(QT_NO_ASYNC_IMAGE_IO) && (defined(QT_NO_IMAGEIO))
342#define QT_NO_ASYNC_IMAGE_IO
343#endif
344
345// BDF font files
346#if !defined(QT_NO_BDF) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_STRINGLIST))
347#define QT_NO_BDF
348#endif
349
350// QDir
351#if !defined(QT_NO_DIR) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP))
352#define QT_NO_DIR
353#endif
354
355// JPEG image I/O
356#if !defined(QT_NO_IMAGEIO_JPEG) && (defined(QT_NO_IMAGEIO))
357#define QT_NO_IMAGEIO_JPEG
358#endif
359
360// MNG image I/O
361#if !defined(QT_NO_IMAGEIO_MNG) && (defined(QT_NO_IMAGEIO))
362#define QT_NO_IMAGEIO_MNG
363#endif
364
365// PNG image I/O
366#if !defined(QT_NO_IMAGEIO_PNG) && (defined(QT_NO_IMAGEIO))
367#define QT_NO_IMAGEIO_PNG
368#endif
369
370// PPM image I/O
371#if !defined(QT_NO_IMAGEIO_PPM) && (defined(QT_NO_IMAGEIO))
372#define QT_NO_IMAGEIO_PPM
373#endif
374
375// XBM image I/O
376#if !defined(QT_NO_IMAGEIO_XBM) && (defined(QT_NO_IMAGEIO))
377#define QT_NO_IMAGEIO_XBM
378#endif
379
380// Image transformations
381#if !defined(QT_NO_IMAGE_TRANSFORMATION) && (defined(QT_NO_PIXMAP_TRANSFORMATION))
382#define QT_NO_IMAGE_TRANSFORMATION
383#endif
384
385// External process invocation.
386#if !defined(QT_NO_PROCESS) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP))
387#define QT_NO_PROCESS
388#endif
389
390// Regular expression capture
391#if !defined(QT_NO_REGEXP_CAPTURE) && (defined(QT_NO_REGEXP) || defined(QT_NO_STRINGLIST))
392#define QT_NO_REGEXP_CAPTURE
393#endif
394
395// Template classes in QVariant
396#if !defined(QT_NO_TEMPLATE_VARIANT) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST))
397#define QT_NO_TEMPLATE_VARIANT
398#endif
399
400// Month and day names in dates
401#if !defined(QT_NO_TEXTDATE) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_DATESTRING))
402#define QT_NO_TEXTDATE
403#endif
404
405// Drawing utility functions
406#if !defined(QT_NO_DRAWUTIL) && (defined(QT_NO_SPRINTF) || defined(QT_NO_PALETTE))
407#define QT_NO_DRAWUTIL
408#endif
409
410// BMP image I/O
411#if !defined(QT_NO_IMAGEIO_BMP) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_DATASTREAM))
412#define QT_NO_IMAGEIO_BMP
413#endif
414
415// QPicture
416#if !defined(QT_NO_PICTURE) && (defined(QT_NO_DATASTREAM) || defined(QT_NO_IMAGEIO))
417#define QT_NO_PICTURE
418#endif
419
420// Translations via QObject::trUtf8()
421#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC))
422#define QT_NO_TRANSLATION_UTF8
423#endif
424
425// URL parser
426#if !defined(QT_NO_URL) && (defined(QT_NO_DIR))
427#define QT_NO_URL
428#endif
429
430// Animated images
431#if !defined(QT_NO_MOVIE) && (defined(QT_NO_ASYNC_IO) || defined(QT_NO_ASYNC_IMAGE_IO))
432#define QT_NO_MOVIE
433#endif
434
435// Persistent application settings
436#if !defined(QT_NO_SETTINGS) && (defined(QT_NO_DIR) || defined(QT_NO_TEXTSTREAM))
437#define QT_NO_SETTINGS
438#endif
439
440// QStyle
441#if !defined(QT_NO_STYLE) && (defined(QT_NO_DRAWUTIL))
442#define QT_NO_STYLE
443#endif
444
445// DNS
446#if !defined(QT_NO_DNS) && (defined(QT_NO_NETWORK) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF))
447#define QT_NO_DNS
448#endif
449
450// Framed widgets
451#if !defined(QT_NO_FRAME) && (defined(QT_NO_STYLE))
452#define QT_NO_FRAME
453#endif
454
455// QIconSet
456#if !defined(QT_NO_ICONSET) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_IMAGE_SMOOTHSCALE) || defined(QT_NO_PALETTE) || defined(QT_NO_IMAGE_HEURISTIC_MASK))
457#define QT_NO_ICONSET
458#endif
459
460// XPM image I/O
461#if !defined(QT_NO_IMAGEIO_XPM) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_SPRINTF) || defined(QT_NO_TEXTSTREAM))
462#define QT_NO_IMAGEIO_XPM
463#endif
464
465// QSizeGrip
466#if !defined(QT_NO_SIZEGRIP) && (defined(QT_NO_STYLE))
467#define QT_NO_SIZEGRIP
468#endif
469
470// Motif style
471#if !defined(QT_NO_STYLE_MOTIF) && (defined(QT_NO_STYLE))
472#define QT_NO_STYLE_MOTIF
473#endif
474
475// Windows style
476#if !defined(QT_NO_STYLE_WINDOWS) && (defined(QT_NO_STYLE))
477#define QT_NO_STYLE_WINDOWS
478#endif
479
480// Internal titlebar widget
481#if !defined(QT_NO_TITLEBAR) && (defined(QT_NO_STYLE))
482#define QT_NO_TITLEBAR
483#endif
484
485// XML
486#if !defined(QT_NO_XML) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC) || defined(QT_NO_REGEXP_CAPTURE))
487#define QT_NO_XML
488#endif
489
490// Check-boxes
491#if !defined(QT_NO_CHECKBOX) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE))
492#define QT_NO_CHECKBOX
493#endif
494
495// Dials
496#if !defined(QT_NO_DIAL) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE))
497#define QT_NO_DIAL
498#endif
499
500// QLabel
501#if !defined(QT_NO_LABEL) && (defined(QT_NO_FRAME))
502#define QT_NO_LABEL
503#endif
504
505// QLCDNumber
506#if !defined(QT_NO_LCDNUMBER) && (defined(QT_NO_FRAME))
507#define QT_NO_LCDNUMBER
508#endif
509
510// MIME
511#if !defined(QT_NO_MIME) && (defined(QT_NO_DIR) || defined(QT_NO_IMAGEIO) || defined(QT_NO_TEXTCODEC))
512#define QT_NO_MIME
513#endif
514
515// Printing
516#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_DATESTRING))
517#define QT_NO_PRINTER
518#endif
519
520// Progress bars
521#if !defined(QT_NO_PROGRESSBAR) && (defined(QT_NO_FRAME))
522#define QT_NO_PROGRESSBAR
523#endif
524
525// Radio-buttons
526#if !defined(QT_NO_RADIOBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE))
527#define QT_NO_RADIOBUTTON
528#endif
529
530// Internal resize handler
531#if !defined(QT_NO_RESIZEHANDLER) && (defined(QT_NO_FRAME))
532#define QT_NO_RESIZEHANDLER
533#endif
534
535// Scroll bars
536#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE))
537#define QT_NO_SCROLLBAR
538#endif
539
540// Sliders
541#if !defined(QT_NO_SLIDER) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE))
542#define QT_NO_SLIDER
543#endif
544
545// Spinbox control widget
546#if !defined(QT_NO_SPINWIDGET) && (defined(QT_NO_FRAME))
547#define QT_NO_SPINWIDGET
548#endif
549
550// Status bars
551#if !defined(QT_NO_STATUSBAR) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE))
552#define QT_NO_STATUSBAR
553#endif
554
555// Compact Windows style
556#if !defined(QT_NO_STYLE_COMPACT) && (defined(QT_NO_STYLE_WINDOWS))
557#define QT_NO_STYLE_COMPACT
558#endif
559
560// Interlace-friendly style
561#if !defined(QT_NO_STYLE_INTERLACE) && (defined(QT_NO_STYLE_MOTIF))
562#define QT_NO_STYLE_INTERLACE
563#endif
564
565// Platinum style
566#if !defined(QT_NO_STYLE_PLATINUM) && (defined(QT_NO_STYLE_WINDOWS))
567#define QT_NO_STYLE_PLATINUM
568#endif
569
570// Widget stacks
571#if !defined(QT_NO_WIDGETSTACK) && (defined(QT_NO_FRAME))
572#define QT_NO_WIDGETSTACK
573#endif
574
575// Grid layout widgets
576#if !defined(QT_NO_GRID) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME))
577#define QT_NO_GRID
578#endif
579
580// Group boxes
581#if !defined(QT_NO_GROUPBOX) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT))
582#define QT_NO_GROUPBOX
583#endif
584
585// Horizonal box layout widgets
586#if !defined(QT_NO_HBOX) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME))
587#define QT_NO_HBOX
588#endif
589
590// Menu-oriented widgets
591#if !defined(QT_NO_MENUDATA) && (defined(QT_NO_ICONSET) || defined(QT_NO_VARIANT))
592#define QT_NO_MENUDATA
593#endif
594
595// RichText (HTML) display
596#if !defined(QT_NO_RICHTEXT) && (defined(QT_NO_DRAWUTIL) || defined(QT_NO_LAYOUT) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM))
597#define QT_NO_RICHTEXT
598#endif
599
600// Splitters
601#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT))
602#define QT_NO_SPLITTER
603#endif
604
605// Table-like widgets
606#if !defined(QT_NO_TABLEVIEW) && (defined(QT_NO_SCROLLBAR))
607#define QT_NO_TABLEVIEW
608#endif
609
610// Tool tips
611#if !defined(QT_NO_TOOLTIP) && (defined(QT_NO_LABEL))
612#define QT_NO_TOOLTIP
613#endif
614
615// Cut and paste
616#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_MIME))
617#define QT_NO_CLIPBOARD
618#endif
619
620// Complex scripts (eg. BiDi)
621#if !defined(QT_NO_COMPLEXTEXT) && (defined(QT_NO_RICHTEXT))
622#define QT_NO_COMPLEXTEXT
623#endif
624
625// Horizontal group boxes
626#if !defined(QT_NO_HGROUPBOX) && (defined(QT_NO_GROUPBOX))
627#define QT_NO_HGROUPBOX
628#endif
629
630// Network file access
631#if !defined(QT_NO_NETWORKPROTOCOL) && (defined(QT_NO_DIR) || defined(QT_NO_TEXTCODEC) || defined(QT_NO_URL))
632#define QT_NO_NETWORKPROTOCOL
633#endif
634
635// Properties
636#if !defined(QT_NO_PROPERTIES) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST) || defined(QT_NO_ICONSET))
637#define QT_NO_PROPERTIES
638#endif
639
640// CDE style
641#if !defined(QT_NO_STYLE_CDE) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS))
642#define QT_NO_STYLE_CDE
643#endif
644
645// Motif-plus style
646#if !defined(QT_NO_STYLE_MOTIFPLUS) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS))
647#define QT_NO_STYLE_MOTIFPLUS
648#endif
649
650// SGI style
651#if !defined(QT_NO_STYLE_SGI) && (defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS))
652#define QT_NO_STYLE_SGI
653#endif
654
655// Vertical box layout widgets
656#if !defined(QT_NO_VBOX) && (defined(QT_NO_HBOX))
657#define QT_NO_VBOX
658#endif
659
660// Button groups
661#if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX) || defined(QT_NO_BUTTON))
662#define QT_NO_BUTTONGROUP
663#endif
664
665// Cut and paste non-text
666#if !defined(QT_NO_MIMECLIPBOARD) && (defined(QT_NO_CLIPBOARD))
667#define QT_NO_MIMECLIPBOARD
668#endif
669
670// Aqua style
671#if !defined(QT_NO_STYLE_AQUA) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGE_TRANSFORMATION))
672#define QT_NO_STYLE_AQUA
673#endif
674
675// Vertical group boxes
676#if !defined(QT_NO_VGROUPBOX) && (defined(QT_NO_HGROUPBOX))
677#define QT_NO_VGROUPBOX
678#endif
679
680// Horizontal button groups
681#if !defined(QT_NO_HBUTTONGROUP) && (defined(QT_NO_BUTTONGROUP))
682#define QT_NO_HBUTTONGROUP
683#endif
684
685// Server to play sound
686#if !defined(QT_NO_QWS_SOUNDSERVER) && (defined(QT_NO_SOUND) || defined(QT_NO_DIR) || defined(QT_NO_DNS))
687#define QT_NO_QWS_SOUNDSERVER
688#endif
689
690// Hebrew Codec
691#if !defined(QT_NO_CODEC_HEBREW) && (defined(QT_NO_CODECS) || defined(QT_NO_COMPLEXTEXT))
692#define QT_NO_CODEC_HEBREW
693#endif
694
695// Dynamic module linking
696#if !defined(QT_NO_COMPONENT) && (defined(QT_NO_QUUID_STRING) || defined(QT_NO_SETTINGS) || defined(QT_NO_SPRINTF) || defined(QT_NO_LIBRARY))
697#define QT_NO_COMPONENT
698#endif
699
700// QHeader
701#if !defined(QT_NO_HEADER) && (defined(QT_NO_STYLE) || defined(QT_NO_ICONSET))
702#define QT_NO_HEADER
703#endif
704
705// Vertical button groups
706#if !defined(QT_NO_VBUTTONGROUP) && (defined(QT_NO_HBUTTONGROUP))
707#define QT_NO_VBUTTONGROUP
708#endif
709
710// Big Codecs (eg. CJK)
711#if !defined(QT_NO_BIG_CODECS) && (defined(QT_NO_CODEC_HEBREW))
712#define QT_NO_BIG_CODECS
713#endif
714
715// Tool-buttons
716#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_ICONSET) || defined(QT_NO_STYLE))
717#define QT_NO_TOOLBUTTON
718#endif
719
720// Document Object Model
721#if !defined(QT_NO_DOM) && (defined(QT_NO_XML) || defined(QT_NO_MIME))
722#define QT_NO_DOM
723#endif
724
725// Scrollable view widgets
726#if !defined(QT_NO_SCROLLVIEW) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_FRAME))
727#define QT_NO_SCROLLVIEW
728#endif
729
730// Tab-bars
731#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON))
732#define QT_NO_TABBAR
733#endif
734
735// QTextCodecPlugin
736#if !defined(QT_NO_TEXTCODECPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_TEXTCODEC))
737#define QT_NO_TEXTCODECPLUGIN
738#endif
739
740// Drag and drop
741#if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_MIME) || defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_IMAGEIO_XPM))
742#define QT_NO_DRAGANDDROP
743#endif
744
745// QGridView
746#if !defined(QT_NO_GRIDVIEW) && (defined(QT_NO_SCROLLVIEW))
747#define QT_NO_GRIDVIEW
748#endif
749
750// QImageFormatPlugin
751#if !defined(QT_NO_IMAGEFORMATPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_IMAGEIO))
752#define QT_NO_IMAGEFORMATPLUGIN
753#endif
754
755// Single-line edits
756#if !defined(QT_NO_LINEEDIT) && (defined(QT_NO_FRAME) || defined(QT_NO_RICHTEXT))
757#define QT_NO_LINEEDIT
758#endif
759
760// Popup-menus
761#if !defined(QT_NO_POPUPMENU) && (defined(QT_NO_MENUDATA) || defined(QT_NO_FRAME))
762#define QT_NO_POPUPMENU
763#endif
764
765// QCanvas
766#if !defined(QT_NO_CANVAS) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_BEZIER))
767#define QT_NO_CANVAS
768#endif
769
770// QListBox
771#if !defined(QT_NO_LISTBOX) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_STRINGLIST))
772#define QT_NO_LISTBOX
773#endif
774
775// Menu bars
776#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_POPUPMENU))
777#define QT_NO_MENUBAR
778#endif
779
780// HTTP file access
781#if !defined(QT_NO_NETWORKPROTOCOL_HTTP) && (defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS))
782#define QT_NO_NETWORKPROTOCOL_HTTP
783#endif
784
785// RichText (HTML) tables and images
786#if !defined(QT_NO_TEXTCUSTOMITEM) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_MIME))
787#define QT_NO_TEXTCUSTOMITEM
788#endif
789
790// QDateTimeEdit
791#if !defined(QT_NO_DATETIMEEDIT) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_SPINWIDGET) || defined(QT_NO_DATESTRING))
792#define QT_NO_DATETIMEEDIT
793#endif
794
795// Push-buttons
796#if !defined(QT_NO_PUSHBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_POPUPMENU))
797#define QT_NO_PUSHBUTTON
798#endif
799
800// FTP file access
801#if !defined(QT_NO_NETWORKPROTOCOL_FTP) && (defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS) || defined(QT_NO_TEXTDATE))
802#define QT_NO_NETWORKPROTOCOL_FTP
803#endif
804
805// Scalable Vector Graphics (SVG)
806#if !defined(QT_NO_SVG) && (defined(QT_NO_DOM) || defined(QT_NO_TRANSFORMATIONS) || defined(QT_NO_SPRINTF))
807#define QT_NO_SVG
808#endif
809
810// QWidgetPlugin
811#if !defined(QT_NO_WIDGETPLUGIN) && (defined(QT_NO_COMPONENT) || defined(QT_NO_ICONSET))
812#define QT_NO_WIDGETPLUGIN
813#endif
814
815// QIconView
816#if !defined(QT_NO_ICONVIEW) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_IMAGEIO_XPM) || defined(QT_NO_IMAGE_HEURISTIC_MASK))
817#define QT_NO_ICONVIEW
818#endif
819
820// Tab widgets
821#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_WIDGETSTACK))
822#define QT_NO_TABWIDGET
823#endif
824
825// "What's this" help
826#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLTIP) || defined(QT_NO_TOOLBUTTON))
827#define QT_NO_WHATSTHIS
828#endif
829
830// Rich text edit
831#if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_RICHTEXT) || defined(QT_NO_SCROLLVIEW))
832#define QT_NO_TEXTEDIT
833#endif
834
835// Multi-line edits
836#if !defined(QT_NO_MULTILINEEDIT) && (defined(QT_NO_TEXTEDIT))
837#define QT_NO_MULTILINEEDIT
838#endif
839
840// QTextView
841#if !defined(QT_NO_TEXTVIEW) && (defined(QT_NO_TEXTEDIT))
842#define QT_NO_TEXTVIEW
843#endif
844
845// Spin boxes
846#if !defined(QT_NO_SPINBOX) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR))
847#define QT_NO_SPINBOX
848#endif
849
850// QMessageBox
851#if !defined(QT_NO_MESSAGEBOX) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LABEL))
852#define QT_NO_MESSAGEBOX
853#endif
854
855// SQL classes
856#if !defined(QT_NO_SQL) && (defined(QT_NO_MESSAGEBOX))
857#define QT_NO_SQL
858#endif
859
860// QTextBrowser
861#if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTVIEW) || defined(QT_NO_MIME))
862#define QT_NO_TEXTBROWSER
863#endif
864
865// QProgressDialog
866#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_SEMIMODAL) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_PROGRESSBAR))
867#define QT_NO_PROGRESSDIALOG
868#endif
869
870// QWizard
871#if !defined(QT_NO_WIZARD) && (defined(QT_NO_DIALOG) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL))
872#define QT_NO_WIZARD
873#endif
874
875// QSqlForm
876#if !defined(QT_NO_SQL_FORM) && (defined(QT_NO_SQL) || defined(QT_NO_PROPERTIES))
877#define QT_NO_SQL_FORM
878#endif
879
880// QListView
881#if !defined(QT_NO_LISTVIEW) && (defined(QT_NO_SCROLLVIEW) || defined(QT_NO_HEADER) || defined(QT_NO_LINEEDIT))
882#define QT_NO_LISTVIEW
883#endif
884
885// QTabDialog
886#if !defined(QT_NO_TABDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LAYOUT) || defined(QT_NO_TABWIDGET))
887#define QT_NO_TABDIALOG
888#endif
889
890// QComboBox
891#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LISTBOX) || defined(QT_NO_LINEEDIT) || defined(QT_NO_POPUPMENU))
892#define QT_NO_COMBOBOX
893#endif
894
895// Main-windows
896#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_POPUPMENU) || defined(QT_NO_TITLEBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_STATUSBAR))
897#define QT_NO_MAINWINDOW
898#endif
899
900// Toolbars
901#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW))
902#define QT_NO_TOOLBAR
903#endif
904
905// QColorDialog
906#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR) || defined(QT_NO_GRIDVIEW))
907#define QT_NO_COLORDIALOG
908#endif
909
910// QErrorMessage
911#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_DIALOG) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_LABEL) || defined(QT_NO_CHECKBOX) || defined(QT_NO_TEXTVIEW))
912#define QT_NO_ERRORMESSAGE
913#endif
914
915// QAction
916#if !defined(QT_NO_ACTION) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_COMBOBOX))
917#define QT_NO_ACTION
918#endif
919
920// QWorkSpace
921#if !defined(QT_NO_WORKSPACE) && (defined(QT_NO_SCROLLBAR) || defined(QT_NO_VBOX) || defined(QT_NO_TITLEBAR) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_POPUPMENU) || defined(QT_NO_LABEL) || defined(QT_NO_TOOLBUTTON))
922#define QT_NO_WORKSPACE
923#endif
924
925// QTable
926#if !defined(QT_NO_TABLE) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_HEADER) || defined(QT_NO_CHECKBOX))
927#define QT_NO_TABLE
928#endif
929
930// QFontDialog
931#if !defined(QT_NO_FONTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_CHECKBOX) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_VGROUPBOX))
932#define QT_NO_FONTDIALOG
933#endif
934
935// QInputDialog
936#if !defined(QT_NO_INPUTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_SPINBOX) || defined(QT_NO_WIDGETSTACK))
937#define QT_NO_INPUTDIALOG
938#endif
939
940// SQL value editor widgets
941#if !defined(QT_NO_SQL_EDIT_WIDGETS) && (defined(QT_NO_SQL) || defined(QT_NO_SPINBOX) || defined(QT_NO_COMBOBOX) || defined(QT_NO_CHECKBOX) || defined(QT_NO_DATETIMEEDIT))
942#define QT_NO_SQL_EDIT_WIDGETS
943#endif
944
945// QPrintDialog
946#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_LABEL) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_RADIOBUTTON) || defined(QT_NO_PUSHBUTTON))
947#define QT_NO_PRINTDIALOG
948#endif
949
950// QFileDialog
951#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_MESSAGEBOX) || defined(QT_NO_LISTVIEW) || defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_SEMIMODAL) || defined(QT_NO_REGEXP_CAPTURE) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_VBOX) || defined(QT_NO_SPLITTER) || defined(QT_NO_PROGRESSBAR) || defined(QT_NO_WIDGETSTACK) || defined(QT_NO_DATESTRING))
952#define QT_NO_FILEDIALOG
953#endif
954
955// SQL table widgets
956#if !defined(QT_NO_SQL_VIEW_WIDGETS) && (defined(QT_NO_SQL_FORM) || defined(QT_NO_SQL_EDIT_WIDGETS) || defined(QT_NO_TABLE))
957#define QT_NO_SQL_VIEW_WIDGETS
958#endif
959
diff --git a/qmake/include/qfile.h b/qmake/include/qfile.h
new file mode 100644
index 0000000..14a917b
--- a/dev/null
+++ b/qmake/include/qfile.h
@@ -0,0 +1,124 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QFile class
5**
6** Created : 930831
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QFILE_H
39#define QFILE_H
40
41#ifndef QT_H
42#include "qiodevice.h"
43#include "qstring.h"
44#include <stdio.h>
45#endif // QT_H
46
47class QDir;
48
49
50 class Q_EXPORT QFile : public QIODevice // file I/O device class
51{
52public:
53 QFile();
54 QFile( const QString &name );
55 ~QFile();
56
57 QString name()const;
58 voidsetName( const QString &name );
59
60 typedef QCString (*EncoderFn)( const QString &fileName );
61 typedef QString (*DecoderFn)( const QCString &localfileName );
62 static QCString encodeName( const QString &fileName );
63 static QString decodeName( const QCString &localFileName );
64 static void setEncodingFunction( EncoderFn );
65 static void setDecodingFunction( DecoderFn );
66
67 boolexists() const;
68 static bool exists( const QString &fileName );
69
70 boolremove();
71 static bool remove( const QString &fileName );
72
73 boolopen( int );
74 boolopen( int, FILE * );
75 boolopen( int, int );
76 voidclose();
77 voidflush();
78
79 Offsetsize() const;
80 Offsetat() const;
81 boolat( Offset );
82 boolatEnd() const;
83
84 Q_LONGreadBlock( char *data, Q_ULONG len );
85 Q_LONGwriteBlock( const char *data, Q_ULONG len );
86 Q_LONGwriteBlock( const QByteArray& data )
87 { return QIODevice::writeBlock(data); }
88 Q_LONGreadLine( char *data, Q_ULONG maxlen );
89 Q_LONGreadLine( QString &, Q_ULONG maxlen );
90
91 int getch();
92 int putch( int );
93 int ungetch( int );
94
95 int handle() const;
96
97protected:
98 QStringfn;
99 FILE *fh;
100 int fd;
101 Offsetlength;
102 boolext_f;
103 void * d;
104
105private:
106 voidinit();
107 QCStringungetchBuffer;
108
109 private:// Disabled copy constructor and operator=
110#if defined(Q_DISABLE_COPY)
111 QFile( const QFile & );
112 QFile &operator=( const QFile & );
113#endif
114};
115
116
117inline QString QFile::name() const
118{ return fn; }
119
120inline QIODevice::Offset QFile::at() const
121{ return ioIndex; }
122
123
124#endif // QFILE_H
diff --git a/qmake/include/qfileinfo.h b/qmake/include/qfileinfo.h
new file mode 100644
index 0000000..d6605b6
--- a/dev/null
+++ b/qmake/include/qfileinfo.h
@@ -0,0 +1,150 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QFileInfo class
5**
6** Created : 950628
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QFILEINFO_H
39#define QFILEINFO_H
40
41#ifndef QT_H
42#include "qfile.h"
43#include "qdatetime.h"
44#endif // QT_H
45
46
47class QDir;
48struct QFileInfoCache;
49
50
51class Q_EXPORT QFileInfo
52{
53public:
54 enum PermissionSpec {
55 ReadUser = 0400, WriteUser = 0200, ExeUser = 0100,
56 ReadGroup = 0040, WriteGroup = 0020, ExeGroup = 0010,
57 ReadOther = 0004, WriteOther = 0002, ExeOther = 0001 };
58
59 QFileInfo();
60 QFileInfo( const QString &file );
61 QFileInfo( const QFile & );
62#ifndef QT_NO_DIR
63 QFileInfo( const QDir &, const QString &fileName );
64#endif
65 QFileInfo( const QFileInfo & );
66 ~QFileInfo();
67
68 QFileInfo &operator=( const QFileInfo & );
69
70 voidsetFile( const QString &file );
71 voidsetFile( const QFile & );
72#ifndef QT_NO_DIR
73 voidsetFile( const QDir &, const QString &fileName );
74#endif
75 bool exists()const;
76 void refresh()const;
77 bool caching()const;
78 voidsetCaching( bool );
79
80 QString filePath()const;
81 QString fileName()const;
82#ifndef QT_NO_DIR //###
83 QString absFilePath()const;
84#endif
85 QStringbaseName( bool complete = FALSE ) const;
86 QStringextension( bool complete = TRUE ) const;
87
88#ifndef QT_NO_DIR //###
89 QStringdirPath( bool absPath = FALSE ) const;
90#endif
91#ifndef QT_NO_DIR
92 QDir dir( bool absPath = FALSE )const;
93#endif
94 bool isReadable()const;
95 bool isWritable()const;
96 bool isExecutable()const;
97 bool isHidden() const;
98
99#ifndef QT_NO_DIR //###
100 bool isRelative()const;
101 boolconvertToAbs();
102#endif
103
104 bool isFile()const;
105 bool isDir() const;
106 bool isSymLink()const;
107
108 QString readLink()const;
109
110 QString owner() const;
111 uint ownerId()const;
112 QString group() const;
113 uint groupId()const;
114
115 boolpermission( int permissionSpec ) const;
116
117#if (QT_VERSION-0 >= 0x040000)
118#error "QFileInfo::size() should return QIODevice::Offset instead of uint"
119#elif defined(QT_ABI_QT4)
120 QIODevice::Offset size()const;
121#else
122 uint size() const;
123#endif
124
125 QDateTime created()const;
126 QDateTime lastModified()const;
127 QDateTime lastRead()const;
128
129private:
130 voiddoStat() const;
131 static void slashify( QString & );
132 static void makeAbs( QString & );
133
134 QStringfn;
135 QFileInfoCache *fic;
136 boolcache;
137#if defined(Q_OS_UNIX)
138 bool symLink;
139#endif
140
141};
142
143
144inline bool QFileInfo::caching() const
145{
146 return cache;
147}
148
149
150#endif // QFILEINFO_H
diff --git a/qmake/include/qgarray.h b/qmake/include/qgarray.h
new file mode 100644
index 0000000..12edea6
--- a/dev/null
+++ b/qmake/include/qgarray.h
@@ -0,0 +1,121 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QGArray class
5**
6** Created : 930906
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QGARRAY_H
39#define QGARRAY_H
40
41#ifndef QT_H
42#include "qshared.h"
43#endif // QT_H
44
45
46 class Q_EXPORT QGArray // generic array
47{
48friend class QBuffer;
49public:
50 //### DO NOT USE THIS. IT IS PUBLIC BUT DO NOT USE IT IN NEW CODE.
51 struct array_data : public QShared {// shared array
52 array_data(){ data=0; len=0; }
53 char *data; // actual array data
54 uint len;
55 };
56 QGArray();
57protected:
58 QGArray( int, int ); // dummy; does not alloc
59 QGArray( int size ); // allocate 'size' bytes
60 QGArray( const QGArray &a ); // shallow copy
61 virtual ~QGArray();
62
63 QGArray &operator=( const QGArray &a ) { return assign( a ); }
64
65 virtual void detach(){ duplicate(*this); }
66
67 // ### Qt 4.0: maybe provide two versions of data(), at(), etc.
68 char *data() const{ return shd->data; }
69 uint nrefs() const{ return shd->count; }
70 uint size() const{ return shd->len; }
71 boolisEqual( const QGArray &a ) const;
72
73 boolresize( uint newsize );
74
75 boolfill( const char *d, int len, uint sz );
76
77 QGArray &assign( const QGArray &a );
78 QGArray &assign( const char *d, uint len );
79 QGArray &duplicate( const QGArray &a );
80 QGArray &duplicate( const char *d, uint len );
81 voidstore( const char *d, uint len );
82
83 array_data *sharedBlock() const { return shd; }
84 voidsetSharedBlock( array_data *p ) { shd=(array_data*)p; }
85
86 QGArray &setRawData( const char *d, uint len );
87 voidresetRawData( const char *d, uint len );
88
89 int find( const char *d, uint index, uint sz ) const;
90 int contains( const char *d, uint sz ) const;
91
92 voidsort( uint sz );
93 int bsearch( const char *d, uint sz ) const;
94
95 char *at( uint index ) const;
96
97 boolsetExpand( uint index, const char *d, uint sz );
98
99protected:
100 virtual array_data *newData();
101 virtual void deleteData( array_data *p );
102
103private:
104 static void msg_index( uint );
105 array_data *shd;
106};
107
108
109inline char *QGArray::at( uint index ) const
110{
111#if defined(QT_CHECK_RANGE)
112 if ( index >= size() ) {
113 msg_index( index );
114 index = 0;
115 }
116#endif
117 return &shd->data[index];
118}
119
120
121#endif // QGARRAY_H
diff --git a/qmake/include/qgcache.h b/qmake/include/qgcache.h
new file mode 100644
index 0000000..093f7a7
--- a/dev/null
+++ b/qmake/include/qgcache.h
@@ -0,0 +1,128 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QGCache and QGCacheIterator classes
5**
6** Created : 950208
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QGCACHE_H
39#define QGCACHE_H
40
41#ifndef QT_H
42#include "qptrcollection.h"
43#include "qglist.h"
44#include "qgdict.h"
45#endif // QT_H
46
47
48 class QCList; // internal classes
49class QCListIt;
50class QCDict;
51
52
53 class Q_EXPORT QGCache : public QPtrCollection// generic LRU cache
54{
55friend class QGCacheIterator;
56protected:
57 enum KeyType { StringKey, AsciiKey, IntKey, PtrKey };
58 // identical to QGDict's, but PtrKey is not used at the moment
59
60 QGCache( int maxCost, uint size, KeyType kt, bool caseSensitive,
61 bool copyKeys );
62 QGCache( const QGCache & ); // not allowed, calls fatal()
63 ~QGCache();
64 QGCache &operator=( const QGCache & );// not allowed, calls fatal()
65
66 uint count()const;
67 uint size()const;
68 int maxCost() const{ return mCost; }
69 int totalCost() const{ return tCost; }
70 void setMaxCost( int maxCost );
71 void clear();
72
73 bool insert_string( const QString &key, QPtrCollection::Item,
74 int cost, int priority );
75 bool insert_other( const char *key, QPtrCollection::Item,
76 int cost, int priority );
77 bool remove_string( const QString &key );
78 bool remove_other( const char *key );
79 QPtrCollection::Item take_string( const QString &key );
80 QPtrCollection::Item take_other( const char *key );
81
82 QPtrCollection::Item find_string( const QString &key, bool ref=TRUE ) const;
83 QPtrCollection::Item find_other( const char *key, bool ref=TRUE ) const;
84
85 void statistics() const;
86
87private:
88 bool makeRoomFor( int cost, int priority = -1 );
89 KeyType keytype;
90 QCList *lruList;
91 QCDict *dict;
92 int mCost;
93 int tCost;
94 bool copyk;
95};
96
97
98 class Q_EXPORT QGCacheIterator // generic cache iterator
99{
100protected:
101 QGCacheIterator( const QGCache & );
102 QGCacheIterator( const QGCacheIterator & );
103 ~QGCacheIterator();
104 QGCacheIterator &operator=( const QGCacheIterator & );
105
106 uint count() const;
107 bool atFirst() const;
108 bool atLast() const;
109 QPtrCollection::Item toFirst();
110 QPtrCollection::Item toLast();
111
112 QPtrCollection::Item get() const;
113 QString getKeyString() const;
114 const char *getKeyAscii() const;
115 long getKeyInt() const;
116
117 QPtrCollection::Item operator()();
118 QPtrCollection::Item operator++();
119 QPtrCollection::Item operator+=( uint );
120 QPtrCollection::Item operator--();
121 QPtrCollection::Item operator-=( uint );
122
123protected:
124 QCListIt *it; // iterator on cache list
125};
126
127
128#endif // QGCACHE_H
diff --git a/qmake/include/qgdict.h b/qmake/include/qgdict.h
new file mode 100644
index 0000000..40b4568
--- a/dev/null
+++ b/qmake/include/qgdict.h
@@ -0,0 +1,222 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QGDict and QGDictIterator classes
5**
6** Created : 920529
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QGDICT_H
39#define QGDICT_H
40
41#ifndef QT_H
42#include "qptrcollection.h"
43#include "qstring.h"
44#endif // QT_H
45
46class QGDictIterator;
47class QGDItList;
48
49
50 class QBaseBucket // internal dict node
51{
52public:
53 QPtrCollection::Item getData() { return data; }
54 QPtrCollection::Item setData( QPtrCollection::Item d ) { return data = d; }
55 QBaseBucket *getNext() { return next; }
56 void setNext( QBaseBucket *n){ next = n; }
57protected:
58 QBaseBucket( QPtrCollection::Item d, QBaseBucket *n ) : data(d), next(n) {}
59 QPtrCollection::Item data;
60 QBaseBucket *next;
61};
62
63class QStringBucket : public QBaseBucket
64{
65public:
66 QStringBucket( const QString &k, QPtrCollection::Item d, QBaseBucket *n )
67 : QBaseBucket(d,n), key(k) {}
68 const QString &getKey() const { return key; }
69private:
70 QString key;
71};
72
73class QAsciiBucket : public QBaseBucket
74{
75public:
76 QAsciiBucket( const char *k, QPtrCollection::Item d, QBaseBucket *n )
77 : QBaseBucket(d,n), key(k) {}
78 const char *getKey() const { return key; }
79private:
80 const char *key;
81};
82
83class QIntBucket : public QBaseBucket
84{
85public:
86 QIntBucket( long k, QPtrCollection::Item d, QBaseBucket *n )
87 : QBaseBucket(d,n), key(k) {}
88 long getKey() const { return key; }
89private:
90 long key;
91};
92
93class QPtrBucket : public QBaseBucket
94{
95public:
96 QPtrBucket( void *k, QPtrCollection::Item d, QBaseBucket *n )
97 : QBaseBucket(d,n), key(k) {}
98 void *getKey() const { return key; }
99private:
100 void *key;
101};
102
103
104 class Q_EXPORT QGDict : public QPtrCollection// generic dictionary class
105{
106public:
107 uint count() const{ return numItems; }
108 uint size() const{ return vlen; }
109 QPtrCollection::Item look_string( const QString& key, QPtrCollection::Item,
110 int );
111 QPtrCollection::Item look_ascii( const char *key, QPtrCollection::Item, int );
112 QPtrCollection::Item look_int( long key, QPtrCollection::Item, int );
113 QPtrCollection::Item look_ptr( void *key, QPtrCollection::Item, int );
114#ifndef QT_NO_DATASTREAM
115 QDataStream &read( QDataStream & );
116 QDataStream &write( QDataStream & ) const;
117#endif
118protected:
119 enum KeyType { StringKey, AsciiKey, IntKey, PtrKey };
120
121 QGDict( uint len, KeyType kt, bool cs, bool ck );
122 QGDict( const QGDict & );
123 ~QGDict();
124
125 QGDict &operator=( const QGDict & );
126
127 boolremove_string( const QString &key, QPtrCollection::Item item=0 );
128 boolremove_ascii( const char *key, QPtrCollection::Item item=0 );
129 boolremove_int( long key, QPtrCollection::Item item=0 );
130 boolremove_ptr( void *key, QPtrCollection::Item item=0 );
131 QPtrCollection::Item take_string( const QString &key );
132 QPtrCollection::Item take_ascii( const char *key );
133 QPtrCollection::Item take_int( long key );
134 QPtrCollection::Item take_ptr( void *key );
135
136 voidclear();
137 voidresize( uint );
138
139 int hashKeyString( const QString & );
140 int hashKeyAscii( const char * );
141
142 voidstatistics() const;
143
144#ifndef QT_NO_DATASTREAM
145 virtual QDataStream &read( QDataStream &, QPtrCollection::Item & );
146 virtual QDataStream &write( QDataStream &, QPtrCollection::Item ) const;
147#endif
148private:
149 QBaseBucket **vec;
150 uintvlen;
151 uintnumItems;
152 uint keytype: 2;
153 uint cases: 1;
154 uint copyk: 1;
155 QGDItList *iterators;
156 void unlink_common( int, QBaseBucket *, QBaseBucket * );
157 QStringBucket *unlink_string( const QString &,
158 QPtrCollection::Item item = 0 );
159 QAsciiBucket *unlink_ascii( const char *, QPtrCollection::Item item = 0 );
160 QIntBucket *unlink_int( long, QPtrCollection::Item item = 0 );
161 QPtrBucket *unlink_ptr( void *, QPtrCollection::Item item = 0 );
162 voidinit( uint, KeyType, bool, bool );
163 friend class QGDictIterator;
164};
165
166
167 class Q_EXPORT QGDictIterator // generic dictionary iterator
168{
169friend class QGDict;
170public:
171 QGDictIterator( const QGDict & );
172 QGDictIterator( const QGDictIterator & );
173 QGDictIterator &operator=( const QGDictIterator & );
174 ~QGDictIterator();
175
176 QPtrCollection::Item toFirst();
177
178 QPtrCollection::Item get() const;
179 QString getKeyString() const;
180 const char *getKeyAscii() const;
181 long getKeyInt() const;
182 void *getKeyPtr() const;
183
184 QPtrCollection::Item operator()();
185 QPtrCollection::Item operator++();
186 QPtrCollection::Item operator+=(uint);
187
188protected:
189 QGDict *dict;
190
191private:
192 QBaseBucket *curNode;
193 uint curIndex;
194};
195
196inline QPtrCollection::Item QGDictIterator::get() const
197{
198 return curNode ? curNode->getData() : 0;
199}
200
201inline QString QGDictIterator::getKeyString() const
202{
203 return curNode ? ((QStringBucket*)curNode)->getKey() : QString::null;
204}
205
206inline const char *QGDictIterator::getKeyAscii() const
207{
208 return curNode ? ((QAsciiBucket*)curNode)->getKey() : 0;
209}
210
211inline long QGDictIterator::getKeyInt() const
212{
213 return curNode ? ((QIntBucket*)curNode)->getKey() : 0;
214}
215
216inline void *QGDictIterator::getKeyPtr() const
217{
218 return curNode ? ((QPtrBucket*)curNode)->getKey() : 0;
219}
220
221
222#endif // QGDICT_H
diff --git a/qmake/include/qglist.h b/qmake/include/qglist.h
new file mode 100644
index 0000000..d6db3ed
--- a/dev/null
+++ b/qmake/include/qglist.h
@@ -0,0 +1,252 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QGList and QGListIterator classes
5**
6** Created : 920624
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QGLIST_H
39#define QGLIST_H
40
41#ifndef QT_H
42#include "qptrcollection.h"
43#endif // QT_H
44
45class Q_EXPORT QLNode
46{
47friend class QGList;
48friend class QGListIterator;
49public:
50 QPtrCollection::Item getData(){ return data; }
51private:
52 QPtrCollection::Item data;
53 QLNode *prev;
54 QLNode *next;
55 QLNode( QPtrCollection::Item d ) { data = d; }
56};
57
58class QGListIteratorList; // internal helper class
59
60 class Q_EXPORT QGList : public QPtrCollection// doubly linked generic list
61{
62friend class QGListIterator;
63friend class QGListIteratorList;
64 friend class QGVector; // needed by QGVector::toList
65public:
66 uint count() const; // return number of nodes
67
68#ifndef QT_NO_DATASTREAM
69 QDataStream &read( QDataStream & ); // read list from stream
70 QDataStream &write( QDataStream & ) const;// write list to stream
71#endif
72protected:
73 QGList(); // create empty list
74 QGList( const QGList & ); // make copy of other list
75 virtual ~QGList();
76
77 QGList &operator=( const QGList & );// assign from other list
78 bool operator==( const QGList& ) const;
79
80 void inSort( QPtrCollection::Item ); // add item sorted in list
81 void append( QPtrCollection::Item ); // add item at end of list
82 bool insertAt( uint index, QPtrCollection::Item ); // add item at i'th position
83 void relinkNode( QLNode * ); // relink as first item
84 bool removeNode( QLNode * ); // remove node
85 bool remove( QPtrCollection::Item = 0 );// remove item (0=current)
86 bool removeRef( QPtrCollection::Item = 0 );// remove item (0=current)
87 bool removeFirst(); // remove first item
88 bool removeLast(); // remove last item
89 bool removeAt( uint ); // remove item at i'th position
90 bool replaceAt( uint, QPtrCollection::Item ); // replace item at position i with item
91 QPtrCollection::Item takeNode( QLNode * );// take out node
92 QPtrCollection::Item take(); // take out current item
93 QPtrCollection::Item takeAt( uint index );// take out item at i'th pos
94 QPtrCollection::Item takeFirst(); // take out first item
95 QPtrCollection::Item takeLast(); // take out last item
96
97 void sort(); // sort all items;
98 void clear(); // remove all items
99
100 int findRef( QPtrCollection::Item, bool = TRUE ); // find exact item in list
101 int find( QPtrCollection::Item, bool = TRUE ); // find equal item in list
102
103 uint containsRef( QPtrCollection::Item ) const;// get number of exact matches
104 uint contains( QPtrCollection::Item ) const;// get number of equal matches
105
106 QPtrCollection::Item at( uint index );// access item at i'th pos
107 int at() const; // get current index
108 QLNode *currentNode() const; // get current node
109
110 QPtrCollection::Item get() const; // get current item
111
112 QPtrCollection::Item cfirst() const;// get ptr to first list item
113 QPtrCollection::Item clast() const;// get ptr to last list item
114 QPtrCollection::Item first(); // set first item in list curr
115 QPtrCollection::Item last(); // set last item in list curr
116 QPtrCollection::Item next(); // set next item in list curr
117 QPtrCollection::Item prev(); // set prev item in list curr
118
119 void toVector( QGVector * ) const; // put items in vector
120
121 virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item );
122
123#ifndef QT_NO_DATASTREAM
124 virtual QDataStream &read( QDataStream &, QPtrCollection::Item & );
125 virtual QDataStream &write( QDataStream &, QPtrCollection::Item ) const;
126#endif
127private:
128 void prepend( QPtrCollection::Item );// add item at start of list
129
130 void heapSortPushDown( QPtrCollection::Item* heap, int first, int last );
131
132 QLNode *firstNode; // first node
133 QLNode *lastNode; // last node
134 QLNode *curNode; // current node
135 int curIndex; // current index
136 uint numNodes; // number of nodes
137 QGListIteratorList *iterators; // list of iterators
138
139 QLNode *locate( uint ); // get node at i'th pos
140 QLNode *unlink(); // unlink node
141};
142
143
144inline uint QGList::count() const
145{
146 return numNodes;
147}
148
149inline bool QGList::removeFirst()
150{
151 first();
152 return remove();
153}
154
155inline bool QGList::removeLast()
156{
157 last();
158 return remove();
159}
160
161inline int QGList::at() const
162{
163 return curIndex;
164}
165
166inline QPtrCollection::Item QGList::at( uint index )
167{
168 QLNode *n = locate( index );
169 return n ? n->data : 0;
170}
171
172inline QLNode *QGList::currentNode() const
173{
174 return curNode;
175}
176
177inline QPtrCollection::Item QGList::get() const
178{
179 return curNode ? curNode->data : 0;
180}
181
182inline QPtrCollection::Item QGList::cfirst() const
183{
184 return firstNode ? firstNode->data : 0;
185}
186
187inline QPtrCollection::Item QGList::clast() const
188{
189 return lastNode ? lastNode->data : 0;
190}
191
192
193/*****************************************************************************
194 QGList stream functions
195 *****************************************************************************/
196
197#ifndef QT_NO_DATASTREAM
198Q_EXPORT QDataStream &operator>>( QDataStream &, QGList & );
199Q_EXPORT QDataStream &operator<<( QDataStream &, const QGList & );
200#endif
201
202/*****************************************************************************
203 QGListIterator class
204 *****************************************************************************/
205
206 class Q_EXPORT QGListIterator // QGList iterator
207{
208friend class QGList;
209friend class QGListIteratorList;
210protected:
211 QGListIterator( const QGList & );
212 QGListIterator( const QGListIterator & );
213 QGListIterator &operator=( const QGListIterator & );
214 ~QGListIterator();
215
216 bool atFirst() const; // test if at first item
217 bool atLast() const; // test if at last item
218 QPtrCollection::Item toFirst(); // move to first item
219 QPtrCollection::Item toLast(); // move to last item
220
221 QPtrCollection::Item get() const; // get current item
222 QPtrCollection::Item operator()(); // get current and move to next
223 QPtrCollection::Item operator++(); // move to next item (prefix)
224 QPtrCollection::Item operator+=(uint); // move n positions forward
225 QPtrCollection::Item operator--(); // move to prev item (prefix)
226 QPtrCollection::Item operator-=(uint); // move n positions backward
227
228protected:
229 QGList *list; // reference to list
230
231private:
232 QLNode *curNode; // current node in list
233};
234
235
236inline bool QGListIterator::atFirst() const
237{
238 return curNode == list->firstNode;
239}
240
241inline bool QGListIterator::atLast() const
242{
243 return curNode == list->lastNode;
244}
245
246inline QPtrCollection::Item QGListIterator::get() const
247{
248 return curNode ? curNode->data : 0;
249}
250
251
252 #endif// QGLIST_H
diff --git a/qmake/include/qglobal.h b/qmake/include/qglobal.h
new file mode 100644
index 0000000..13cff64
--- a/dev/null
+++ b/qmake/include/qglobal.h
@@ -0,0 +1,1006 @@
1/****************************************************************************
2** $Id$
3**
4** Global type declarations and definitions
5**
6** Created : 920529
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QGLOBAL_H
39#define QGLOBAL_H
40
41#define QT_VERSION_STR "3.1.0-b2"
42/*
43 QT_VERSION is (major << 16) + (minor << 8) + patch.
44 */
45#define QT_VERSION 0x030100
46
47/*
48 The operating system, must be one of: (Q_OS_x)
49
50 MACX- Mac OS X
51 MAC9- Mac OS 9
52 MSDOS- MS-DOS and Windows
53 OS2- OS/2
54 OS2EMX- XFree86 on OS/2 (not PM)
55 WIN32- Win32 (Windows 95/98/ME and Windows NT/2000/XP)
56 CYGWIN- Cygwin
57 SOLARIS- Sun Solaris
58 HPUX- HP-UX
59 ULTRIX- DEC Ultrix
60 LINUX- Linux
61 FREEBSD- FreeBSD
62 NETBSD- NetBSD
63 OPENBSD- OpenBSD
64 BSDI- BSD/OS
65 IRIX- SGI Irix
66 OSF- HP Tru64 UNIX
67 SCO- SCO OpenServer 5
68 UNIXWARE- UnixWare 7, Open UNIX 8
69 AIX- AIX
70 HURD- GNU Hurd
71 DGUX- DG/UX
72 RELIANT- Reliant UNIX
73 DYNIX- DYNIX/ptx
74 QNX- QNX
75 QNX6- QNX RTP 6.1
76 LYNX- LynxOS
77 BSD4- Any BSD 4.4 system
78 UNIX- Any UNIX BSD/SYSV system
79*/
80
81#if defined(__APPLE__) && defined(__GNUC__)
82# define Q_OS_MACX
83#elif defined(__MACOSX__)
84# define Q_OS_MACX
85#elif defined(macintosh)
86# define Q_OS_MAC9
87#elif defined(__CYGWIN__)
88# define Q_OS_CYGWIN
89#elif defined(MSDOS) || defined(_MSDOS)
90# define Q_OS_MSDOS
91#elif defined(__OS2__)
92# if defined(__EMX__)
93# define Q_OS_OS2EMX
94# else
95# define Q_OS_OS2
96# endif
97#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
98# define Q_OS_WIN32
99# define Q_OS_WIN64
100#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
101# define Q_OS_WIN32
102#elif defined(__MWERKS__) && defined(__INTEL__)
103# define Q_OS_WIN32
104#elif defined(__sun) || defined(sun)
105# define Q_OS_SOLARIS
106#elif defined(hpux) || defined(__hpux)
107# define Q_OS_HPUX
108#elif defined(__ultrix) || defined(ultrix)
109# define Q_OS_ULTRIX
110#elif defined(sinix)
111# define Q_OS_RELIANT
112#elif defined(__linux__) || defined(__linux)
113# define Q_OS_LINUX
114#elif defined(__FreeBSD__)
115# define Q_OS_FREEBSD
116# define Q_OS_BSD4
117#elif defined(__NetBSD__)
118# define Q_OS_NETBSD
119# define Q_OS_BSD4
120#elif defined(__OpenBSD__)
121# define Q_OS_OPENBSD
122# define Q_OS_BSD4
123#elif defined(__bsdi__)
124# define Q_OS_BSDI
125# define Q_OS_BSD4
126#elif defined(__sgi)
127# define Q_OS_IRIX
128#elif defined(__osf__)
129# define Q_OS_OSF
130#elif defined(_AIX)
131# define Q_OS_AIX
132#elif defined(__Lynx__)
133# define Q_OS_LYNX
134#elif defined(__GNU_HURD__)
135# define Q_OS_HURD
136#elif defined(__DGUX__)
137# define Q_OS_DGUX
138#elif defined(__QNXNTO__)
139# define Q_OS_QNX6
140#elif defined(__QNX__)
141# define Q_OS_QNX
142#elif defined(_SEQUENT_)
143# define Q_OS_DYNIX
144#elif defined(_SCO_DS) /* SCO OpenServer 5 */
145# define Q_OS_SCO
146#elif defined(__UNIXWARE__) /* UnixWare 7 + GCC, Open UNIX 8 + GCC */
147# define Q_OS_UNIXWARE
148# define Q_OS_UNIXWARE7
149#elif defined(__USLC__) /* UnixWare 7 + UDK, Open UNIX 8 + OUDK */
150# define Q_OS_UNIXWARE
151# define Q_OS_UNIXWARE7
152#else
153# error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
154#endif
155
156#if defined(Q_OS_MAC9) || defined(Q_OS_MACX)
157# define Q_OS_MAC
158#endif
159
160#if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
161# undef Q_OS_UNIX
162#elif !defined(Q_OS_UNIX)
163# define Q_OS_UNIX
164#endif
165
166
167/*
168 The compiler, must be one of: (Q_CC_x)
169
170 SYM- Symantec C++ for both PC and Macintosh
171 MPW- MPW C++
172 MWERKS- Metrowerks CodeWarrior
173 MSVC- Microsoft Visual C/C++
174 BOR- Borland/Turbo C++
175 WAT- Watcom C++
176 GNU- GNU C++
177 COMEAU- Comeau C++
178 EDG- Edison Design Group C++
179 OC - CenterLine C++
180 SUN- Sun WorkShop, Forte Developer, or Sun ONE Studio C++
181 MIPS- MIPSpro C++
182 DEC- DEC C++
183 HP - HPUX C++
184 HPACC- HPUX ANSI C++
185 USLC- SCO OUDK, UDK, and UnixWare 2.X C++
186 CDS- Reliant C++
187 KAI- KAI C++
188 INTEL- Intel C++
189 HIGHC- MetaWare High C/C++
190 PGI- Portland Group C++
191 GHS- Green Hills Optimizing C++ Compilers
192
193 Should be sorted most to least authoritative.
194*/
195
196/* Symantec C++ is now Digital Mars */
197#if defined(__DMC__) || defined(__SC__)
198# define Q_CC_SYM
199/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
200# if defined(__SC__) && __SC__ < 0x750
201# define Q_NO_EXPLICIT_KEYWORD
202# endif
203# define Q_NO_USING_KEYWORD
204# if !defined(_CPPUNWIND)
205# define Q_NO_EXCEPTIONS
206# endif
207
208#elif defined(applec)
209# define Q_CC_MPW
210# define Q_NO_BOOL_TYPE
211# define Q_NO_EXPLICIT_KEYWORD
212# define Q_NO_USING_KEYWORD
213
214#elif defined(__MWERKS__)
215# define Q_CC_MWERKS
216/* "explicit" recognized since 4.0d1 */
217# define QMAC_PASCAL pascal
218# define Q_NO_USING_KEYWORD /* ### check "using" status */
219
220#elif defined(_MSC_VER)
221# define Q_CC_MSVC
222/* proper support of bool for _MSC_VER >= 1100 */
223# define Q_CANNOT_DELETE_CONSTANT
224# define Q_INLINE_TEMPLATES inline
225/* Visual C++.Net issues for _MSC_VER >= 1300 */
226# if _MSC_VER >= 1300
227# define Q_CC_MSVC_NET
228# define Q_TYPENAME
229# endif
230# define Q_NO_USING_KEYWORD /* ### check "using" status */
231
232#elif defined(__BORLANDC__) || defined(__TURBOC__)
233# define Q_CC_BOR
234# if __BORLANDC__ < 0x502
235# define Q_NO_BOOL_TYPE
236# define Q_NO_EXPLICIT_KEYWORD
237# endif
238# define Q_NO_USING_KEYWORD /* ### check "using" status */
239
240#elif defined(__WATCOMC__)
241# define Q_CC_WAT
242# if defined(Q_OS_QNX4)
243/* compiler flags */
244# define Q_TYPENAME
245# define Q_NO_BOOL_TYPE
246# define Q_CANNOT_DELETE_CONSTANT
247# define mutable
248/* ??? */
249# define Q_BROKEN_TEMPLATE_SPECIALIZATION
250/* no template classes in QVariant */
251# define QT_NO_TEMPLATE_VARIANT
252/* Wcc does not fill in functions needed by valuelists, maps, and
253 valuestacks implicitly */
254# define Q_FULL_TEMPLATE_INSTANTIATION
255/* can we just compare the structures? */
256# define Q_FULL_TEMPLATE_INSTANTIATION_MEMCMP
257/* these are not useful to our customers */
258# define QT_QWS_NO_SHM
259# define QT_NO_QWS_MULTIPROCESS
260# define QT_NO_SQL
261# define QT_NO_QWS_CURSOR
262# endif
263
264#elif defined(__GNUC__)
265# define Q_CC_GNU
266# define Q_C_CALLBACKS
267# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
268# define Q_FULL_TEMPLATE_INSTANTIATION
269# endif
270/* GCC 2.95 knows "using" but does not support it correctly */
271# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
272# define Q_NO_USING_KEYWORD
273# endif
274# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
275# define Q_PACKED __attribute__ ((packed))
276# endif
277# if !defined(__EXCEPTIONS)
278# define Q_NO_EXCEPTIONS
279# endif
280
281/* IBM compiler versions are a bit messy. There are actually two products:
282 the C product, and the C++ product. The C++ compiler is always packaged
283 with the latest version of the C compiler. Version numbers do not always
284 match. This little table (I'm not sure it's accurate) should be helpful:
285
286 C++ product C product
287
288 C Set 3.1 C Compiler 3.0
289 ... ...
290 C++ Compiler 3.6.6 C Compiler 4.3
291 ... ...
292 Visual Age C++ 4.0 ...
293 ... ...
294 Visual Age C++ 5.0 C Compiler 5.0
295
296 Now:
297 __xlC__ is the version of the C compiler in hexadecimal notation
298 is only an approximation of the C++ compiler version
299 __IBMCPP__ is the version of the C++ compiler in decimal notation
300 but it is not defined on older compilers like C Set 3.1 */
301#elif defined(__xlC__)
302# define Q_CC_XLC
303# define Q_FULL_TEMPLATE_INSTANTIATION
304# if __xlC__ < 0x400
305# define Q_NO_BOOL_TYPE
306# define Q_NO_EXPLICIT_KEYWORD
307# define Q_NO_USING_KEYWORD
308# define Q_TYPENAME
309# define Q_INLINE_TEMPLATES inline
310# define Q_BROKEN_TEMPLATE_SPECIALIZATION
311# define Q_CANNOT_DELETE_CONSTANT
312# endif
313
314/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed
315 on DEC C++ V5.5-004. New versions do define __EDG__ - observed on
316 Compaq C++ V6.3-002.
317 This compiler is different enough from other EDG compilers to handle
318 it separately anyway. */
319#elif defined(__DECCXX)
320# define Q_CC_DEC
321/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
322 DEC C++ V5 compilers. */
323# if defined(__EDG__)
324# define Q_CC_EDG
325# endif
326/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead
327 - observed on Compaq C++ V6.3-002.
328 In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
329# if !defined(_BOOL_EXISTS)
330# define Q_NO_BOOL_TYPE
331# endif
332/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
333# define Q_NO_USING_KEYWORD
334/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
335 DEC C++ V5.5-004. */
336# if __DECCXX_VER < 60060000
337# define Q_TYPENAME
338# define Q_BROKEN_TEMPLATE_SPECIALIZATION
339# define Q_CANNOT_DELETE_CONSTANT
340# endif
341/* avoid undefined symbol problems with out-of-line template members */
342# define Q_INLINE_TEMPLATES inline
343
344/* Compilers with EDG front end are similar. To detect them we test:
345 __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
346 __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 */
347#elif defined(__EDG) || defined(__EDG__)
348# define Q_CC_EDG
349/* From the EDG documentation (does not seem to apply to Compaq C++):
350 _BOOL
351 Defined in C++ mode when bool is a keyword. The name of this
352 predefined macro is specified by a configuration flag. _BOOL
353 is the default.
354 __BOOL_DEFINED
355 Defined in Microsoft C++ mode when bool is a keyword. */
356# if !defined(_BOOL) && !defined(__BOOL_DEFINED)
357# define Q_NO_BOOL_TYPE
358# endif
359
360/* The Portland Group compiler is based on EDG and does define __EDG__ */
361# if defined(__COMO__)
362# define Q_CC_COMEAU
363# define Q_C_CALLBACKS
364
365/* Using the `using' keyword avoids KAI C++ warnings */
366# elif defined(__KCC)
367# define Q_CC_KAI
368# if !defined(_EXCEPTIONS)
369# define Q_NO_EXCEPTIONS
370# endif
371
372/* Using the `using' keyword avoids Intel C++ warnings */
373# elif defined(__INTEL_COMPILER)
374# define Q_CC_INTEL
375# if !defined(__EXCEPTIONS)
376# define Q_NO_EXCEPTIONS
377# endif
378
379/* The Portland Group compiler is based on EDG and does define __EDG__ */
380# elif defined(__PGI)
381# define Q_CC_PGI
382# if !defined(__EXCEPTIONS)
383# define Q_NO_EXCEPTIONS
384# endif
385
386/* Never tested! */
387# elif defined(__ghs)
388# define Q_CC_GHS
389
390/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
391# elif defined(__USLC__) && defined(__SCO_VERSION__)
392# define Q_CC_USLC
393# define Q_NO_USING_KEYWORD /* ### check "using" status */
394
395/* Never tested! */
396# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
397# define Q_CC_OC
398# define Q_NO_USING_KEYWORD
399
400/* CDS++ is not documented to define __EDG__ or __EDG in the Reliant
401 documentation but we suppose it does, in any case it does follow
402 conventions like _BOOL */
403# elif defined(sinix)
404# define Q_CC_CDS
405# define Q_NO_USING_KEYWORD
406# if defined(__cplusplus) && (__cplusplus < 2) /* Cfront C++ mode */
407# define Q_NO_EXCEPTIONS
408# endif
409
410/* The MIPSpro compiler in o32 mode is based on EDG but disables features
411 such as template specialization nevertheless */
412# elif defined(__sgi)
413# define Q_CC_MIPS
414# if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */
415# define Q_TYPENAME
416# define Q_BROKEN_TEMPLATE_SPECIALIZATION
417# define Q_STRICT_INLINING_RULES
418# elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */
419# define Q_TYPENAME
420# define Q_BROKEN_TEMPLATE_SPECIALIZATION
421# endif
422# define Q_NO_USING_KEYWORD /* ### check "using" status */
423# endif
424
425/* The older UnixWare 2.X compiler? */
426#elif defined(__USLC__) && !defined(__SCO_VERSION__)
427# define Q_CC_USLC
428# define Q_NO_BOOL_TYPE
429# define Q_NO_EXPLICIT_KEYWORD
430# define Q_NO_USING_KEYWORD
431
432/* Never tested! */
433#elif defined(__HIGHC__)
434# define Q_CC_HIGHC
435
436#elif defined(__SUNPRO_CC)
437# define Q_CC_SUN
438/* 5.0 compiler or better
439 'bool' is enabled by default but can be disabled using -features=nobool
440 in which case _BOOL is not defined
441 this is the default in 4.2 compatibility mode triggered by -compat=4 */
442# if __SUNPRO_CC >= 0x500
443# if !defined(_BOOL)
444# define Q_NO_BOOL_TYPE
445# endif
446# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
447# define Q_NO_USING_KEYWORD
448# endif
449# define Q_C_CALLBACKS
450/* 4.2 compiler or older */
451# else
452# define Q_NO_BOOL_TYPE
453# define Q_NO_EXPLICIT_KEYWORD
454# define Q_NO_USING_KEYWORD
455# endif
456
457#elif defined(Q_OS_HPUX)
458/* __HP_aCC was not defined in first aCC releases */
459# if defined(__HP_aCC) || __cplusplus >= 199707L
460# define Q_CC_HPACC
461# else
462# define Q_CC_HP
463# define Q_NO_BOOL_TYPE
464# define Q_FULL_TEMPLATE_INSTANTIATION
465# define Q_BROKEN_TEMPLATE_SPECIALIZATION
466# define Q_NO_EXPLICIT_KEYWORD
467# endif
468# define Q_NO_USING_KEYWORD /* ### check "using" status */
469
470#else
471# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
472#endif
473
474#ifndef Q_PACKED
475# define Q_PACKED
476#endif
477
478
479/*
480 The window system, must be one of: (Q_WS_x)
481
482 MACX- Mac OS X
483 MAC9- Mac OS 9
484 QWS- Qt/Embedded
485 WIN32- Windows
486 X11- X Window System
487 PM - unsupported
488 WIN16- unsupported
489*/
490
491#if defined(Q_OS_MAC9)
492# define Q_WS_MAC9
493#elif defined(Q_OS_MSDOS)
494# define Q_WS_WIN16
495# error "Qt requires Win32 and does not work with Windows 3.x"
496#elif defined(_WIN32_X11_)
497# define Q_WS_X11
498#elif defined(Q_OS_WIN32)
499# define Q_WS_WIN32
500# if defined(Q_OS_WIN64)
501# define Q_WS_WIN64
502# endif
503#elif defined(Q_OS_OS2)
504# define Q_WS_PM
505# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
506#elif defined(Q_OS_UNIX)
507# if defined(QWS)
508# define Q_WS_QWS
509# elif defined(Q_OS_MACX)
510# define Q_WS_MACX
511# else
512# define Q_WS_X11
513# endif
514#endif
515#if defined(Q_OS_MAC) && !defined(QMAC_PASCAL)
516# define QMAC_PASCAL
517#endif
518
519#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32)
520# define Q_WS_WIN
521#endif
522
523#if (defined(Q_WS_MAC9) || defined(Q_WS_MACX)) && !defined(Q_WS_QWS) && !defined(Q_WS_X11)
524# define Q_WS_MAC
525#endif
526
527
528/*
529 Some classes do not permit copies to be made of an object.
530 These classes contains a private copy constructor and operator=
531 to disable copying (the compiler gives an error message).
532 Undefine Q_DISABLE_COPY to turn off this checking.
533*/
534
535#define Q_DISABLE_COPY
536
537#if defined(__cplusplus)
538
539
540//
541// Useful type definitions for Qt
542//
543
544#if defined(Q_NO_BOOL_TYPE)
545#if defined(Q_CC_HP)
546// bool is an unsupported reserved keyword in later versions
547#define bool int
548#else
549typedef int bool;
550#endif
551#endif
552
553typedef unsigned char uchar;
554typedef unsigned short ushort;
555 typedef unsigneduint;
556typedef unsigned long ulong;
557 typedef char *pchar;
558 typedef uchar *puchar;
559typedef const char *pcchar;
560
561
562//
563// Constant bool values
564//
565
566#ifndef TRUE
567const bool FALSE = 0;
568const bool TRUE = !0;
569#endif
570#if defined(__WATCOMC__)
571# if defined(Q_OS_QNX4)
572const bool false = FALSE;
573const bool true = TRUE;
574# endif
575#endif
576
577
578//
579// Use the "explicit" keyword on platforms that support it.
580//
581
582#if !defined(Q_NO_EXPLICIT_KEYWORD)
583# define Q_EXPLICIT explicit
584#else
585# define Q_EXPLICIT
586#endif
587
588
589//
590// Workaround for static const members on MSVC++.
591//
592
593#if defined(Q_CC_MSVC)
594# define QT_STATIC_CONST static
595# define QT_STATIC_CONST_IMPL
596#else
597# define QT_STATIC_CONST static const
598# define QT_STATIC_CONST_IMPL const
599#endif
600
601
602//
603// Utility macros and inline functions
604//
605
606 #define QMAX(a, b)((b) < (a) ? (a) : (b))
607 #define QMIN(a, b)((a) < (b) ? (a) : (b))
608 #define QABS(a)((a) >= 0 ? (a) : -(a))
609
610inline int qRound( double d )
611{
612 return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1);
613}
614
615
616//
617// Size-dependent types (architechture-dependent byte order)
618//
619
620#if !defined(QT_CLEAN_NAMESPACE)
621// source compatibility with Qt 1.x
622 typedef signed char INT8; // 8 bit signed
623 typedef unsigned char UINT8; // 8 bit unsigned
624 typedef short INT16; // 16 bit signed
625 typedef unsigned short UINT16; // 16 bit unsigned
626 typedef int INT32; // 32 bit signed
627 typedef unsigned int UINT32; // 32 bit unsigned
628#endif
629
630 typedef signed char Q_INT8; // 8 bit signed
631 typedef unsigned char Q_UINT8;// 8 bit unsigned
632 typedef short Q_INT16;// 16 bit signed
633 typedef unsigned short Q_UINT16;// 16 bit unsigned
634 typedef int Q_INT32;// 32 bit signed
635 typedef unsigned int Q_UINT32;// 32 bit unsigned
636#if defined(Q_OS_WIN64)
637// LLP64 64-bit model on Windows
638 typedef __int64 Q_LONG; // word up to 64 bit signed
639 typedef unsigned __int64 Q_ULONG;// word up to 64 bit unsigned
640#else
641// LP64 64-bit model on Linux
642 typedef long Q_LONG;
643 typedef unsigned long Q_ULONG;
644#endif
645
646#if !defined(QT_CLEAN_NAMESPACE)
647// mininum size of 64 bits is not guaranteed
648 #define Q_INT64 Q_LONG
649 #define Q_UINT64 Q_ULONG
650#endif
651
652#if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT)
653# define QT_LARGEFILE_SUPPORT 64
654#endif
655#if defined(QT_LARGEFILE_SUPPORT)
656 typedef unsigned long long QtOffset;
657#else
658 typedef Q_ULONG QtOffset;
659#endif
660
661
662//
663// Data stream functions is provided by many classes (defined in qdatastream.h)
664//
665
666class QDataStream;
667
668
669//
670// Feature subsetting
671//
672// Note that disabling some features will produce a libqt that is not
673// compatible with other libqt builds. Such modifications are only
674// supported on Qt/Embedded where reducing the library size is important
675// and where the application-suite is often a fixed set.
676//
677
678#if !defined(QT_MOC)
679#if defined(QCONFIG_LOCAL)
680#include <qconfig-local.h>
681#elif defined(QCONFIG_MINIMAL)
682#include <qconfig-minimal.h>
683#elif defined(QCONFIG_SMALL)
684#include <qconfig-small.h>
685#elif defined(QCONFIG_MEDIUM)
686#include <qconfig-medium.h>
687#elif defined(QCONFIG_LARGE)
688#include <qconfig-large.h>
689#else // everything...
690#include <qconfig.h>
691#endif
692#endif
693
694
695#ifndef QT_BUILD_KEY
696#define QT_BUILD_KEY "unspecified"
697#endif
698
699// prune to local config
700#include "qmodules.h"
701#ifndef QT_MODULE_ICONVIEW
702# define QT_NO_ICONVIEW
703#endif
704#ifndef QT_MODULE_WORKSPACE
705# define QT_NO_WORKSPACE
706#endif
707#ifndef QT_MODULE_NETWORK
708#define QT_NO_NETWORK
709#endif
710#ifndef QT_MODULE_CANVAS
711# define QT_NO_CANVAS
712#endif
713#ifndef QT_MODULE_TABLE
714#define QT_NO_TABLE
715#endif
716#ifndef QT_MODULE_XML
717# define QT_NO_XML
718#endif
719#ifndef QT_MODULE_OPENGL
720# define QT_NO_OPENGL
721#endif
722#if !defined(QT_MODULE_SQL)
723# define QT_NO_SQL
724#endif
725
726#if defined(Q_WS_MAC9)
727//No need for menu merging
728# ifndef QMAC_QMENUBAR_NO_MERGE
729# define QMAC_QMENUBAR_NO_MERGE
730# endif
731//Mac9 does not use quartz
732# ifndef QMAC_NO_QUARTZ
733# define QMAC_NO_QUARTZ
734# endif
735# ifndef QMAC_QMENUBAR_NO_EVENT
736# define QMAC_QMENUBAR_NO_EVENT
737# endif
738#endif
739#if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks
740# ifndef QMAC_NO_QUARTZ
741# define QMAC_NO_QUARTZ
742# endif
743# ifndef QMAC_QMENUBAR_NO_EVENT
744# define QMAC_QMENUBAR_NO_EVENT
745# endif
746#endif
747
748#ifndef QT_H
749#include <qfeatures.h>
750#endif // QT_H
751
752
753//
754// Create Qt DLL if QT_DLL is defined (Windows only)
755//
756
757#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
758# if defined(QT_NODLL)
759# undef QT_MAKEDLL
760# undef QT_DLL
761 # elif defined(QT_MAKEDLL)/* create a Qt DLL library */
762# if defined(QT_DLL)
763# undef QT_DLL
764# endif
765# define Q_EXPORT __declspec(dllexport)
766# define Q_TEMPLATEDLL
767# define Q_TEMPLATE_EXTERN
768 # undef Q_DISABLE_COPY/* avoid unresolved externals */
769 # elif defined(QT_DLL) /* use a Qt DLL library */
770# define Q_EXPORT __declspec(dllimport)
771# define Q_TEMPLATEDLL
772# ifndef Q_TEMPLATE_EXTERN
773# if defined(Q_CC_MSVC)
774# define Q_TEMPLATE_EXTERN /*extern*/ //### too many warnings, even though disabled
775# else
776# define Q_TEMPLATE_EXTERN
777# endif
778# endif
779# undef Q_DISABLE_COPY /* avoid unresolved externals */
780# endif
781#else
782 # undef QT_MAKEDLL /* ignore these for other platforms */
783# undef QT_DLL
784#endif
785
786#ifndef Q_EXPORT
787# define Q_EXPORT
788#endif
789
790
791//
792// Some platform specific stuff
793//
794
795#if defined(Q_WS_WIN)
796extern Q_EXPORT bool qt_winunicode;
797#endif
798
799
800//
801// System information
802//
803
804Q_EXPORT const char *qVersion();
805Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
806#if defined(Q_WS_WIN)
807Q_EXPORT int qWinVersion();
808#if defined(UNICODE)
809#define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi }
810#define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi )
811#else
812#define QT_WA( uni, ansi ) ansi
813#define QT_WA_INLINE( uni, ansi ) ansi
814#endif
815#endif
816
817#ifdef Q_OS_TEMP
818#ifdef QT_WA
819#undef QT_WA
820#undef QT_WA_INLINE
821#endif
822#define QT_WA( uni, ansi ) uni
823#define QT_WA_INLINE( uni, ansi ) ( uni )
824#endif
825
826#ifndef Q_INLINE_TEMPLATES
827# define Q_INLINE_TEMPLATES
828#endif
829
830#ifndef Q_TYPENAME
831# define Q_TYPENAME typename
832#endif
833
834//
835// Use to avoid "unused parameter" warnings
836//
837
838#define Q_UNUSED(x) (void)x;
839
840//
841// Debugging and error handling
842//
843
844#if !defined(QT_NO_CHECK)
845 # define QT_CHECK_STATE // check state of objects etc.
846 # define QT_CHECK_RANGE // check range of indexes etc.
847 # define QT_CHECK_NULL // check null pointers
848 # define QT_CHECK_MATH // check math functions
849#endif
850
851#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
852 # define QT_DEBUG // display debug messages
853 # if !defined(QT_NO_COMPAT) // compatibility with Qt 2
854# if !defined(NO_DEBUG) && !defined(DEBUG)
855 # if !defined(Q_OS_MACX) // clash with MacOS X headers
856# define DEBUG
857# endif
858# endif
859# endif
860#endif
861
862
863 Q_EXPORT void qDebug( const char *, ... )// print debug message
864#if defined(Q_CC_GNU) && !defined(__INSURE__)
865 __attribute__ ((format (printf, 1, 2)))
866#endif
867;
868
869 Q_EXPORT void qWarning( const char *, ... )// print warning message
870#if defined(Q_CC_GNU) && !defined(__INSURE__)
871 __attribute__ ((format (printf, 1, 2)))
872#endif
873;
874
875 Q_EXPORT void qFatal( const char *, ... )// print fatal message and exit
876#if defined(Q_CC_GNU)
877 __attribute__ ((format (printf, 1, 2)))
878#endif
879;
880
881Q_EXPORT void qSystemWarning( const char *, int code = -1 );
882
883 #if !defined(QT_CLEAN_NAMESPACE) // compatibility with Qt 1
884
885 Q_EXPORT void debug( const char *, ... )// print debug message
886#if defined(Q_CC_GNU) && !defined(__INSURE__)
887 __attribute__ ((format (printf, 1, 2)))
888#endif
889;
890
891 Q_EXPORT void warning( const char *, ... )// print warning message
892#if defined(Q_CC_GNU) && !defined(__INSURE__)
893 __attribute__ ((format (printf, 1, 2)))
894#endif
895;
896
897 Q_EXPORT void fatal( const char *, ... )// print fatal message and exit
898#if defined(Q_CC_GNU) && !defined(__INSURE__)
899 __attribute__ ((format (printf, 1, 2)))
900#endif
901;
902
903#endif // QT_CLEAN_NAMESPACE
904
905
906#if !defined(Q_ASSERT)
907# if defined(QT_CHECK_STATE)
908# if defined(QT_FATAL_ASSERT)
909# define Q_ASSERT(x) ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
910# else
911# define Q_ASSERT(x) ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
912# endif
913# else
914# define Q_ASSERT(x)
915# endif
916#endif
917
918 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2
919# if !defined(ASSERT)
920# if !defined(Q_OS_TEMP)
921# define ASSERT(x) Q_ASSERT(x)
922# endif
923# endif
924#endif // QT_NO_COMPAT
925
926
927Q_EXPORT bool qt_check_pointer( bool c, const char *, int );
928
929#if defined(QT_CHECK_NULL)
930# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))
931#else
932# define Q_CHECK_PTR(p)
933#endif
934
935 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2
936# if !defined(CHECK_PTR)
937# define CHECK_PTR(x) Q_CHECK_PTR(x)
938# endif
939#endif // QT_NO_COMPAT
940
941enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
942
943typedef void (*QtMsgHandler)(QtMsgType, const char *);
944Q_EXPORT QtMsgHandler qInstallMsgHandler( QtMsgHandler );
945
946 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2
947typedef QtMsgHandler msg_handler;
948#endif // QT_NO_COMPAT
949
950Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );
951
952Q_EXPORT void qObsolete( const char *obj, const char *oldfunc,
953 const char *newfunc );
954Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );
955Q_EXPORT void qObsolete( const char *message );
956
957
958//
959// Install paths from configure
960//
961
962Q_EXPORT const char *qInstallPath();
963Q_EXPORT const char *qInstallPathDocs();
964Q_EXPORT const char *qInstallPathHeaders();
965Q_EXPORT const char *qInstallPathLibs();
966Q_EXPORT const char *qInstallPathBins();
967Q_EXPORT const char *qInstallPathPlugins();
968Q_EXPORT const char *qInstallPathData();
969
970#endif // __cplusplus
971
972#endif // QGLOBAL_H
973
974//
975// Avoid some particularly useless warnings from some stupid compilers.
976// To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
977// the line "#define QT_NO_WARNINGS"
978//
979
980#if !defined(QT_CC_WARNINGS)
981# define QT_NO_WARNINGS
982#endif
983#if defined(QT_NO_WARNINGS)
984# if defined(Q_CC_MSVC)
985# pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data
986# pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
987# pragma warning(disable: 4514) // unreferenced inline/local function has been removed
988# pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning)
989# pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2'
990# pragma warning(disable: 4706) // assignment within conditional expression
991# pragma warning(disable: 4786) // truncating debug info after 255 characters
992# pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated
993# pragma warning(disable: 4355) // 'this' : used in base member initializer list
994# pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation
995# elif defined(Q_CC_BOR)
996# pragma option -w-inl
997# pragma option -w-aus
998# pragma warn -inl
999# pragma warn -pia
1000# pragma warn -ccc
1001# pragma warn -rch
1002# pragma warn -sig
1003# elif defined(Q_CC_MWERKS)
1004# pragma warn_possunwant off
1005# endif
1006#endif
diff --git a/qmake/include/qgvector.h b/qmake/include/qgvector.h
new file mode 100644
index 0000000..6e8bdfc
--- a/dev/null
+++ b/qmake/include/qgvector.h
@@ -0,0 +1,121 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QGVector class
5**
6** Created : 930907
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QGVECTOR_H
39#define QGVECTOR_H
40
41#ifndef QT_H
42#include "qptrcollection.h"
43#endif // QT_H
44
45
46 class Q_EXPORT QGVector : public QPtrCollection// generic vector
47{
48 friend class QGList; // needed by QGList::toVector
49public:
50#ifndef QT_NO_DATASTREAM
51 QDataStream &read( QDataStream & ); // read vector from stream
52 QDataStream &write( QDataStream & ) const;// write vector to stream
53#endif
54 virtual int compareItems( Item, Item );
55
56protected:
57 QGVector(); // create empty vector
58 QGVector( uint size ); // create vector with nullptrs
59 QGVector( const QGVector &v ); // make copy of other vector
60 ~QGVector();
61
62 QGVector &operator=( const QGVector &v );// assign from other vector
63 bool operator==( const QGVector &v ) const;
64
65 Item *data() const{ return vec; }
66 uint size() const{ return len; }
67 uint count() const{ return numItems; }
68
69 bool insert( uint index, Item ); // insert item at index
70 bool remove( uint index ); // remove item
71 Item take( uint index ); // take out item
72
73 void clear(); // clear vector
74 bool resize( uint newsize ); // resize vector
75
76 bool fill( Item, int flen ); // resize and fill vector
77
78 void sort(); // sort vector
79 int bsearch( Item ) const; // binary search (when sorted)
80
81 int findRef( Item, uint index ) const;// find exact item in vector
82 int find( Item, uint index ) const;// find equal item in vector
83 uint containsRef( Item ) const; // get number of exact matches
84 uint contains( Item ) const; // get number of equal matches
85
86 Item at( uint index ) const // return indexed item
87 {
88#if defined(QT_CHECK_RANGE)
89 if ( index >= len )
90 warningIndexRange( index );
91#endif
92 return vec[index];
93 }
94
95 bool insertExpand( uint index, Item );// insert, expand if necessary
96
97 void toList( QGList * ) const; // put items in list
98
99#ifndef QT_NO_DATASTREAM
100 virtual QDataStream &read( QDataStream &, Item & );
101 virtual QDataStream &write( QDataStream &, Item ) const;
102#endif
103private:
104 Item *vec;
105 uint len;
106 uint numItems;
107
108 static void warningIndexRange( uint );
109};
110
111
112/*****************************************************************************
113 QGVector stream functions
114 *****************************************************************************/
115
116#ifndef QT_NO_DATASTREAM
117Q_EXPORT QDataStream &operator>>( QDataStream &, QGVector & );
118Q_EXPORT QDataStream &operator<<( QDataStream &, const QGVector & );
119#endif
120
121#endif // QGVECTOR_H
diff --git a/qmake/include/qintdict.h b/qmake/include/qintdict.h
new file mode 100644
index 0000000..b4cb223
--- a/dev/null
+++ b/qmake/include/qintdict.h
@@ -0,0 +1,114 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QIntDict template class
5**
6** Created : 940624
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QINTDICT_H
39#define QINTDICT_H
40
41#ifndef QT_H
42#include "qgdict.h"
43#endif // QT_H
44
45template<class type>
46class QIntDict
47#ifdef Q_QDOC
48 : public QPtrCollection
49#else
50 : public QGDict
51#endif
52{
53public:
54 QIntDict(int size=17) : QGDict(size,IntKey,0,0) {}
55 QIntDict( const QIntDict<type> &d ) : QGDict(d) {}
56 ~QIntDict() { clear(); }
57 QIntDict<type> &operator=(const QIntDict<type> &d)
58 { return (QIntDict<type>&)QGDict::operator=(d); }
59 uint count() const { return QGDict::count(); }
60 uint size() const { return QGDict::size(); }
61 bool isEmpty() const { return QGDict::count() == 0; }
62 void insert( long k, const type *d )
63 { QGDict::look_int(k,(Item)d,1); }
64 void replace( long k, const type *d )
65 { QGDict::look_int(k,(Item)d,2); }
66 bool remove( long k ) { return QGDict::remove_int(k); }
67 type *take( long k ) { return (type*)QGDict::take_int(k); }
68 type *find( long k ) const
69 { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
70 type *operator[]( long k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
72 void clear() { QGDict::clear(); }
73 void resize( uint n ) { QGDict::resize(n); }
74 void statistics() const { QGDict::statistics(); }
75
76#ifdef Q_QDOC
77protected:
78 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
79 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
80#endif
81
82private:
83 void deleteItem( Item d );
84};
85
86#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
87template<> inline void QIntDict<void>::deleteItem( QPtrCollection::Item )
88{
89}
90#endif
91
92template<class type> inline void QIntDict<type>::deleteItem( QPtrCollection::Item d )
93{
94 if ( del_item ) delete (type*)d;
95}
96
97template<class type>
98class QIntDictIterator : public QGDictIterator
99{
100public:
101 QIntDictIterator(const QIntDict<type> &d) :QGDictIterator((QGDict &)d) {}
102 ~QIntDictIterator() {}
103 uint count() const { return dict->count(); }
104 bool isEmpty() const { return dict->count() == 0; }
105 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
106 operator type *() const { return (type *)QGDictIterator::get(); }
107 type *current() const { return (type *)QGDictIterator::get(); }
108 long currentKey() const { return QGDictIterator::getKeyInt(); }
109 type *operator()() { return (type *)QGDictIterator::operator()(); }
110 type *operator++() { return (type *)QGDictIterator::operator++(); }
111 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
112};
113
114#endif // QINTDICT_H
diff --git a/qmake/include/qiodevice.h b/qmake/include/qiodevice.h
new file mode 100644
index 0000000..cb83463
--- a/dev/null
+++ b/qmake/include/qiodevice.h
@@ -0,0 +1,161 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QIODevice class
5**
6** Created : 940913
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QIODEVICE_H
39#define QIODEVICE_H
40
41#ifndef QT_H
42#include "qglobal.h"
43#include "qcstring.h"
44#endif // QT_H
45
46
47// IO device access types
48
49 #define IO_Direct 0x0100 // direct access device
50 #define IO_Sequential 0x0200 // sequential access device
51 #define IO_Combined 0x0300 // combined direct/sequential
52 #define IO_TypeMask 0x0f00
53
54// IO handling modes
55
56 #define IO_Raw 0x0040 // raw access (not buffered)
57 #define IO_Async 0x0080 // asynchronous mode
58
59// IO device open modes
60
61 #define IO_ReadOnly 0x0001 // readable device
62 #define IO_WriteOnly 0x0002 // writable device
63 #define IO_ReadWrite 0x0003 // read+write device
64 #define IO_Append 0x0004 // append
65 #define IO_Truncate 0x0008 // truncate device
66 #define IO_Translate 0x0010 // translate CR+LF
67 #define IO_ModeMask 0x00ff
68
69// IO device state
70
71 #define IO_Open 0x1000 // device is open
72 #define IO_StateMask 0xf000
73
74// IO device status
75
76 #define IO_Ok 0
77 #define IO_ReadError 1 // read error
78 #define IO_WriteError 2 // write error
79 #define IO_FatalError 3 // fatal unrecoverable error
80 #define IO_ResourceError 4 // resource limitation
81 #define IO_OpenError 5 // cannot open device
82 #define IO_ConnectError 5 // cannot connect to device
83 #define IO_AbortError 6 // abort error
84 #define IO_TimeOutError 7 // time out
85 #define IO_UnspecifiedError 8 // unspecified error
86
87
88class Q_EXPORT QIODevice
89{
90public:
91#if defined(QT_ABI_64BITOFFSET)
92 typedef QtOffset Offset;
93#else
94 typedef Q_ULONG Offset;
95#endif
96
97 QIODevice();
98 virtual ~QIODevice();
99
100 int flags() const { return ioMode; }
101 int mode() const { return ioMode & IO_ModeMask; }
102 int state() const { return ioMode & IO_StateMask; }
103
104 bool isDirectAccess() const { return ((ioMode & IO_Direct) == IO_Direct); }
105 bool isSequentialAccess() const { return ((ioMode & IO_Sequential) == IO_Sequential); }
106 bool isCombinedAccess() const { return ((ioMode & IO_Combined) == IO_Combined); }
107 bool isBuffered() const { return ((ioMode & IO_Raw) != IO_Raw); }
108 bool isRaw() const { return ((ioMode & IO_Raw) == IO_Raw); }
109 bool isSynchronous() const { return ((ioMode & IO_Async) != IO_Async); }
110 bool isAsynchronous() const { return ((ioMode & IO_Async) == IO_Async); }
111 bool isTranslated() const { return ((ioMode & IO_Translate) == IO_Translate); }
112 bool isReadable() const { return ((ioMode & IO_ReadOnly) == IO_ReadOnly); }
113 bool isWritable() const { return ((ioMode & IO_WriteOnly) == IO_WriteOnly); }
114 bool isReadWrite() const { return ((ioMode & IO_ReadWrite) == IO_ReadWrite); }
115 bool isInactive() const { return state() == 0; }
116 bool isOpen() const { return state() == IO_Open; }
117
118 int status() const { return ioSt; }
119 void resetStatus(){ ioSt = IO_Ok; }
120
121 virtual bool open( int mode ) = 0;
122 virtual void close() = 0;
123 virtual void flush() = 0;
124
125 virtual Offset size() const = 0;
126 virtual Offset at() const;
127 virtual bool at( Offset );
128 virtual bool atEnd() const;
129 bool reset() { return at(0); }
130
131 virtual Q_LONG readBlock( char *data, Q_ULONG maxlen ) = 0;
132 virtual Q_LONG writeBlock( const char *data, Q_ULONG len ) = 0;
133 virtual Q_LONG readLine( char *data, Q_ULONG maxlen );
134 Q_LONG writeBlock( const QByteArray& data );
135 virtual QByteArray readAll();
136
137 virtual int getch() = 0;
138 virtual int putch( int ) = 0;
139 virtual int ungetch( int ) = 0;
140
141protected:
142 void setFlags( int f ) { ioMode = f; }
143 void setType( int );
144 void setMode( int );
145 void setState( int );
146 void setStatus( int );
147 Offset ioIndex;
148
149private:
150 int ioMode;
151 int ioSt;
152
153 private:// Disabled copy constructor and operator=
154#if defined(Q_DISABLE_COPY)
155 QIODevice( const QIODevice & );
156 QIODevice &operator=( const QIODevice & );
157#endif
158};
159
160
161#endif // QIODEVICE_H
diff --git a/qmake/include/qmap.h b/qmake/include/qmap.h
new file mode 100644
index 0000000..269bd6b
--- a/dev/null
+++ b/qmake/include/qmap.h
@@ -0,0 +1,883 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QMap class
5**
6** Created : 990406
7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QMAP_H
39#define QMAP_H
40
41#ifndef QT_H
42#include "qglobal.h"
43#include "qshared.h"
44#include "qdatastream.h"
45#include "qpair.h"
46#include "qvaluelist.h"
47#endif // QT_H
48
49#ifndef QT_NO_STL
50#include <iterator>
51#include <map>
52#endif
53
54//#define QT_CHECK_MAP_RANGE
55
56struct Q_EXPORT QMapNodeBase
57{
58 enum Color { Red, Black };
59
60 QMapNodeBase* left;
61 QMapNodeBase* right;
62 QMapNodeBase* parent;
63
64 Color color;
65
66 QMapNodeBase* minimum() {
67 QMapNodeBase* x = this;
68 while ( x->left )
69 x = x->left;
70 return x;
71 }
72
73 QMapNodeBase* maximum() {
74 QMapNodeBase* x = this;
75 while ( x->right )
76 x = x->right;
77 return x;
78 }
79};
80
81
82template <class K, class T>
83struct QMapNode : public QMapNodeBase
84{
85 QMapNode( const K& _key, const T& _data ) { data = _data; key = _key; }
86 QMapNode( const K& _key ) { key = _key; }
87 QMapNode( const QMapNode<K,T>& _n ) { key = _n.key; data = _n.data; }
88 QMapNode() { }
89 T data;
90 K key;
91};
92
93
94template<class K, class T>
95class QMapIterator
96{
97 public:
98 /**
99 * Typedefs
100 */
101 typedef QMapNode< K, T >* NodePtr;
102#ifndef QT_NO_STL
103 typedef std::bidirectional_iterator_tag iterator_category;
104#endif
105 typedef T value_type;
106#ifndef QT_NO_STL
107 typedef ptrdiff_t difference_type;
108#else
109 typedef int difference_type;
110#endif
111 typedef T* pointer;
112 typedef T& reference;
113
114 /**
115 * Variables
116 */
117 QMapNode<K,T>* node;
118
119 /**
120 * Functions
121 */
122 QMapIterator() : node( 0 ) {}
123 QMapIterator( QMapNode<K,T>* p ) : node( p ) {}
124 QMapIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
125
126 bool operator==( const QMapIterator<K,T>& it ) const { return node == it.node; }
127 bool operator!=( const QMapIterator<K,T>& it ) const { return node != it.node; }
128 T& operator*() { return node->data; }
129 const T& operator*() const { return node->data; }
130 // UDT for T = x*
131 // T* operator->() const { return &node->data; }
132
133 const K& key() const { return node->key; }
134 T& data() { return node->data; }
135 const T& data() const { return node->data; }
136
137private:
138 int inc();
139 int dec();
140
141public:
142 QMapIterator<K,T>& operator++() {
143 inc();
144 return *this;
145 }
146
147 QMapIterator<K,T> operator++(int) {
148 QMapIterator<K,T> tmp = *this;
149 inc();
150 return tmp;
151 }
152
153 QMapIterator<K,T>& operator--() {
154 dec();
155 return *this;
156 }
157
158 QMapIterator<K,T> operator--(int) {
159 QMapIterator<K,T> tmp = *this;
160 dec();
161 return tmp;
162 }
163};
164
165template <class K, class T>
166Q_INLINE_TEMPLATES int QMapIterator<K,T>::inc()
167{
168 QMapNodeBase* tmp = node;
169 if ( tmp->right ) {
170 tmp = tmp->right;
171 while ( tmp->left )
172 tmp = tmp->left;
173 } else {
174 QMapNodeBase* y = tmp->parent;
175 while (tmp == y->right) {
176 tmp = y;
177 y = y->parent;
178 }
179 if (tmp->right != y)
180 tmp = y;
181 }
182 node = (NodePtr)tmp;
183 return 0;
184}
185
186template <class K, class T>
187Q_INLINE_TEMPLATES int QMapIterator<K,T>::dec()
188{
189 QMapNodeBase* tmp = node;
190 if (tmp->color == QMapNodeBase::Red &&
191 tmp->parent->parent == tmp ) {
192 tmp = tmp->right;
193 } else if (tmp->left != 0) {
194 QMapNodeBase* y = tmp->left;
195 while ( y->right )
196 y = y->right;
197 tmp = y;
198 } else {
199 QMapNodeBase* y = tmp->parent;
200 while (tmp == y->left) {
201 tmp = y;
202 y = y->parent;
203 }
204 tmp = y;
205 }
206 node = (NodePtr)tmp;
207 return 0;
208}
209
210template<class K, class T>
211class QMapConstIterator
212{
213 public:
214 /**
215 * Typedefs
216 */
217 typedef QMapNode< K, T >* NodePtr;
218#ifndef QT_NO_STL
219 typedef std::bidirectional_iterator_tag iterator_category;
220#endif
221 typedef T value_type;
222#ifndef QT_NO_STL
223 typedef ptrdiff_t difference_type;
224#else
225 typedef int difference_type;
226#endif
227 typedef const T* pointer;
228 typedef const T& reference;
229
230
231 /**
232 * Variables
233 */
234 QMapNode<K,T>* node;
235
236 /**
237 * Functions
238 */
239 QMapConstIterator() : node( 0 ) {}
240 QMapConstIterator( QMapNode<K,T>* p ) : node( p ) {}
241 QMapConstIterator( const QMapConstIterator<K,T>& it ) : node( it.node ) {}
242 QMapConstIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
243
244 bool operator==( const QMapConstIterator<K,T>& it ) const { return node == it.node; }
245 bool operator!=( const QMapConstIterator<K,T>& it ) const { return node != it.node; }
246 const T& operator*() const { return node->data; }
247 // UDT for T = x*
248 // const T* operator->() const { return &node->data; }
249
250 const K& key() const { return node->key; }
251 const T& data() const { return node->data; }
252
253private:
254 int inc();
255 int dec();
256
257public:
258 QMapConstIterator<K,T>& operator++() {
259 inc();
260 return *this;
261 }
262
263 QMapConstIterator<K,T> operator++(int) {
264 QMapConstIterator<K,T> tmp = *this;
265 inc();
266 return tmp;
267 }
268
269 QMapConstIterator<K,T>& operator--() {
270 dec();
271 return *this;
272 }
273
274 QMapConstIterator<K,T> operator--(int) {
275 QMapConstIterator<K,T> tmp = *this;
276 dec();
277 return tmp;
278 }
279};
280
281template <class K, class T>
282Q_INLINE_TEMPLATES int QMapConstIterator<K,T>::inc()
283{
284 QMapNodeBase* tmp = node;
285 if ( tmp->right ) {
286 tmp = tmp->right;
287 while ( tmp->left )
288 tmp = tmp->left;
289 } else {
290 QMapNodeBase* y = tmp->parent;
291 while (tmp == y->right) {
292 tmp = y;
293 y = y->parent;
294 }
295 if (tmp->right != y)
296 tmp = y;
297 }
298 node = (NodePtr)tmp;
299 return 0;
300}
301
302template <class K, class T>
303Q_INLINE_TEMPLATES int QMapConstIterator<K,T>::dec()
304{
305 QMapNodeBase* tmp = node;
306 if (tmp->color == QMapNodeBase::Red &&
307 tmp->parent->parent == tmp ) {
308 tmp = tmp->right;
309 } else if (tmp->left != 0) {
310 QMapNodeBase* y = tmp->left;
311 while ( y->right )
312 y = y->right;
313 tmp = y;
314 } else {
315 QMapNodeBase* y = tmp->parent;
316 while (tmp == y->left) {
317 tmp = y;
318 y = y->parent;
319 }
320 tmp = y;
321 }
322 node = (NodePtr)tmp;
323 return 0;
324}
325
326class Q_EXPORT QMapPrivateBase : public QShared
327{
328public:
329 QMapPrivateBase() {
330 node_count = 0;
331 }
332 QMapPrivateBase( const QMapPrivateBase* _map) {
333 node_count = _map->node_count;
334 }
335
336 /**
337 * Implementations of basic tree algorithms
338 */
339 void rotateLeft( QMapNodeBase* x, QMapNodeBase*& root);
340 void rotateRight( QMapNodeBase* x, QMapNodeBase*& root );
341 void rebalance( QMapNodeBase* x, QMapNodeBase*& root );
342 QMapNodeBase* removeAndRebalance( QMapNodeBase* z, QMapNodeBase*& root,
343 QMapNodeBase*& leftmost,
344 QMapNodeBase*& rightmost );
345
346 /**
347 * Variables
348 */
349 int node_count;
350};
351
352
353template <class Key, class T>
354class QMapPrivate : public QMapPrivateBase
355{
356public:
357 /**
358 * Typedefs
359 */
360 typedef QMapIterator< Key, T > Iterator;
361 typedef QMapConstIterator< Key, T > ConstIterator;
362 typedef QMapNode< Key, T > Node;
363 typedef QMapNode< Key, T >* NodePtr;
364
365 /**
366 * Functions
367 */
368 QMapPrivate();
369 QMapPrivate( const QMapPrivate< Key, T >* _map );
370 ~QMapPrivate() { clear(); delete header; }
371
372 NodePtr copy( NodePtr p );
373 void clear();
374 void clear( NodePtr p );
375
376 Iterator begin(){ return Iterator( (NodePtr)(header->left ) ); }
377 Iterator end(){ return Iterator( header ); }
378 ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); }
379 ConstIterator end() const { return ConstIterator( header ); }
380
381 ConstIterator find(const Key& k) const;
382
383 void remove( Iterator it ) {
384 NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right );
385 delete del;
386 --node_count;
387 }
388
389#ifdef QT_QMAP_DEBUG
390 void inorder( QMapNodeBase* x = 0, int level = 0 ){
391 if ( !x )
392 x = header->parent;
393 if ( x->left )
394 inorder( x->left, level + 1 );
395 //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl;
396 if ( x->right )
397 inorder( x->right, level + 1 );
398 }
399#endif
400
401#if 0
402 Iterator insertMulti(const Key& v){
403 QMapNodeBase* y = header;
404 QMapNodeBase* x = header->parent;
405 while (x != 0){
406 y = x;
407 x = ( v < key(x) ) ? x->left : x->right;
408 }
409 return insert(x, y, v);
410 }
411#endif
412
413 Iterator insertSingle( const Key& k );
414 Iterator insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k );
415
416protected:
417 /**
418 * Helpers
419 */
420 const Key& key( QMapNodeBase* b ) const { return ((NodePtr)b)->key; }
421
422 /**
423 * Variables
424 */
425 NodePtr header;
426};
427
428
429template <class Key, class T>
430Q_INLINE_TEMPLATES QMapPrivate<Key,T>::QMapPrivate() {
431 header = new Node;
432 header->color = QMapNodeBase::Red; // Mark the header
433 header->parent = 0;
434 header->left = header->right = header;
435}
436template <class Key, class T>
437Q_INLINE_TEMPLATES QMapPrivate<Key,T>::QMapPrivate( const QMapPrivate< Key, T >* _map ) : QMapPrivateBase( _map ) {
438 header = new Node;
439 header->color = QMapNodeBase::Red; // Mark the header
440 if ( _map->header->parent == 0 ) {
441 header->parent = 0;
442 header->left = header->right = header;
443 } else {
444 header->parent = copy( (NodePtr)(_map->header->parent) );
445 header->parent->parent = header;
446 header->left = header->parent->minimum();
447 header->right = header->parent->maximum();
448 }
449}
450
451template <class Key, class T>
452Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::NodePtr QMapPrivate<Key,T>::copy( Q_TYPENAME QMapPrivate<Key,T>::NodePtr p )
453{
454 if ( !p )
455 return 0;
456 NodePtr n = new Node( *p );
457 n->color = p->color;
458 if ( p->left ) {
459 n->left = copy( (NodePtr)(p->left) );
460 n->left->parent = n;
461 } else {
462 n->left = 0;
463 }
464 if ( p->right ) {
465 n->right = copy( (NodePtr)(p->right) );
466 n->right->parent = n;
467 } else {
468 n->right = 0;
469 }
470 return n;
471}
472
473template <class Key, class T>
474Q_INLINE_TEMPLATES void QMapPrivate<Key,T>::clear()
475{
476 clear( (NodePtr)(header->parent) );
477 header->color = QMapNodeBase::Red;
478 header->parent = 0;
479 header->left = header->right = header;
480 node_count = 0;
481}
482
483template <class Key, class T>
484Q_INLINE_TEMPLATES void QMapPrivate<Key,T>::clear( Q_TYPENAME QMapPrivate<Key,T>::NodePtr p )
485{
486 while ( p != 0 ) {
487 clear( (NodePtr)p->right );
488 NodePtr y = (NodePtr)p->left;
489 delete p;
490 p = y;
491 }
492}
493
494template <class Key, class T>
495Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::ConstIterator QMapPrivate<Key,T>::find(const Key& k) const
496{
497 QMapNodeBase* y = header; // Last node
498 QMapNodeBase* x = header->parent; // Root node.
499
500 while ( x != 0 ) {
501 // If as k <= key(x) go left
502 if ( !( key(x) < k ) ) {
503 y = x;
504 x = x->left;
505 } else {
506 x = x->right;
507 }
508 }
509
510 // Was k bigger/smaller then the biggest/smallest
511 // element of the tree ? Return end()
512 if ( y == header || k < key(y) )
513 return ConstIterator( header );
514 return ConstIterator( (NodePtr)y );
515}
516
517template <class Key, class T>
518Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insertSingle( const Key& k )
519{
520 // Search correct position in the tree
521 QMapNodeBase* y = header;
522 QMapNodeBase* x = header->parent;
523 bool result = TRUE;
524 while ( x != 0 ) {
525 result = ( k < key(x) );
526 y = x;
527 x = result ? x->left : x->right;
528 }
529 // Get iterator on the last not empty one
530 Iterator j( (NodePtr)y );
531 if ( result ) {
532 // Smaller then the leftmost one ?
533 if ( j == begin() ) {
534 return insert(x, y, k );
535 } else {
536 // Perhaps daddy is the right one ?
537 --j;
538 }
539 }
540 // Really bigger ?
541 if ( (j.node->key) < k )
542 return insert(x, y, k );
543 // We are going to replace a node
544 return j;
545}
546
547
548template <class Key, class T>
549Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k )
550{
551 NodePtr z = new Node( k );
552 if (y == header || x != 0 || k < key(y) ) {
553 y->left = z; // also makes leftmost = z when y == header
554 if ( y == header ) {
555 header->parent = z;
556 header->right = z;
557 } else if ( y == header->left )
558 header->left = z; // maintain leftmost pointing to min node
559 } else {
560 y->right = z;
561 if ( y == header->right )
562 header->right = z; // maintain rightmost pointing to max node
563 }
564 z->parent = y;
565 z->left = 0;
566 z->right = 0;
567 rebalance( z, header->parent );
568 ++node_count;
569 return Iterator(z);
570}
571
572
573#ifdef QT_CHECK_RANGE
574# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_MAP_RANGE )
575# define QT_CHECK_INVALID_MAP_ELEMENT if ( empty() ) qWarning( "QMap: Warning invalid element" )
576# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL Q_ASSERT( !empty() );
577# else
578# define QT_CHECK_INVALID_MAP_ELEMENT
579# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL
580# endif
581#else
582# define QT_CHECK_INVALID_MAP_ELEMENT
583# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL
584#endif
585
586template <class T> class QDeepCopy;
587
588template<class Key, class T>
589class QMap
590{
591public:
592 /**
593 * Typedefs
594 */
595 typedef Key key_type;
596 typedef T mapped_type;
597 typedef QPair<const key_type, mapped_type> value_type;
598 typedef value_type* pointer;
599 typedef const value_type* const_pointer;
600 typedef value_type& reference;
601 typedef const value_type& const_reference;
602#ifndef QT_NO_STL
603 typedef ptrdiff_t difference_type;
604#else
605 typedef int difference_type;
606#endif
607 typedef size_t size_type;
608 typedef QMapIterator<Key,T> iterator;
609 typedef QMapConstIterator<Key,T> const_iterator;
610 typedef QPair<iterator,bool> insert_pair;
611
612 typedef QMapIterator< Key, T > Iterator;
613 typedef QMapConstIterator< Key, T > ConstIterator;
614 typedef T ValueType;
615 typedef QMapPrivate< Key, T > Priv;
616
617 /**
618 * API
619 */
620 QMap()
621 {
622 sh = new QMapPrivate< Key, T >;
623 }
624 QMap( const QMap<Key,T>& m )
625 {
626 sh = m.sh; sh->ref();
627 }
628
629#ifndef QT_NO_STL
630# ifdef Q_CC_HPACC // HP-UX aCC does require typename in some place
631# undef Q_TYPENAME // but not accept them at others.
632# define Q_TYPENAME // also doesn't like re-defines ...
633# endif
634 QMap( const Q_TYPENAME std::map<Key,T>& m )
635 {
636 sh = new QMapPrivate<Key,T>;
637#if defined(Q_OS_WIN32)
638 std::map<Key,T>::const_iterator it = m.begin();
639#else
640 QMapConstIterator<Key,T> it = m.begin();
641#endif
642 for ( ; it != m.end(); ++it ) {
643 value_type p( (*it).first, (*it).second );
644 insert( p );
645 }
646 }
647#endif
648 ~QMap()
649 {
650 if ( sh->deref() )
651 delete sh;
652 }
653 QMap<Key,T>& operator= ( const QMap<Key,T>& m );
654#ifndef QT_NO_STL
655 QMap<Key,T>& operator= ( const Q_TYPENAME std::map<Key,T>& m )
656 {
657 clear();
658#if defined(Q_OS_WIN32)
659 std::map<Key,T>::const_iterator it = m.begin();
660#else
661 QMapConstIterator<Key,T> it = m.begin();
662#endif
663 for ( ; it != m.end(); ++it ) {
664 value_type p( (*it).first, (*it).second );
665 insert( p );
666 }
667 return *this;
668 }
669# ifdef Q_CC_HPACC // undo the HP-UX aCC hackery done above
670# undef Q_TYPENAME
671# define Q_TYPENAME typename
672# endif
673#endif
674
675 iterator begin() { detach(); return sh->begin(); }
676 iterator end() { detach(); return sh->end(); }
677 const_iterator begin() const { return ((const Priv*)sh)->begin(); }
678 const_iterator end() const { return ((const Priv*)sh)->end(); }
679 iterator replace( const Key& k, const T& v )
680 {
681 remove( k );
682 return insert( k, v );
683 }
684
685 size_type size() const
686 {
687 return sh->node_count;
688 }
689 bool empty() const
690 {
691 return sh->node_count == 0;
692 }
693 QPair<iterator,bool> insert( const value_type& x );
694
695 void erase( iterator it )
696 {
697 detach();
698 sh->remove( it );
699 }
700 void erase( const key_type& k );
701 size_type count( const key_type& k ) const;
702 T& operator[] ( const Key& k );
703 void clear();
704
705 iterator find ( const Key& k )
706 {
707 detach();
708 return iterator( sh->find( k ).node );
709 }
710 const_iterator find ( const Key& k ) const {return sh->find( k ); }
711
712 const T& operator[] ( const Key& k ) const
713 { QT_CHECK_INVALID_MAP_ELEMENT; return sh->find( k ).data(); }
714 bool contains ( const Key& k ) const
715 { return find( k ) != end(); }
716 //{ return sh->find( k ) != ((const Priv*)sh)->end(); }
717
718 size_type count() const { return sh->node_count; }
719
720 QValueList<Key> keys() const {
721 QValueList<Key> r;
722 for (const_iterator i=begin(); i!=end(); ++i)
723 r.append(i.key());
724 return r;
725 }
726
727 QValueList<T> values() const {
728 QValueList<T> r;
729 for (const_iterator i=begin(); i!=end(); ++i)
730 r.append(*i);
731 return r;
732 }
733
734 bool isEmpty() const { return sh->node_count == 0; }
735
736 iterator insert( const Key& key, const T& value, bool overwrite = TRUE );
737 void remove( iterator it ) { detach(); sh->remove( it ); }
738 void remove( const Key& k );
739
740#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
741 bool operator==( const QMap<Key,T>& ) const { return FALSE; }
742#ifndef QT_NO_STL
743 bool operator==( const Q_TYPENAME std::map<Key,T>& ) const { return FALSE; }
744#endif
745#endif
746
747protected:
748 /**
749 * Helpers
750 */
751 void detach() { if ( sh->count > 1 ) detachInternal(); }
752
753 Priv* sh;
754private:
755 void detachInternal();
756
757 friend class QDeepCopy< QMap<Key,T> >;
758};
759
760template<class Key, class T>
761Q_INLINE_TEMPLATES QMap<Key,T>& QMap<Key,T>::operator= ( const QMap<Key,T>& m )
762{
763 m.sh->ref();
764 if ( sh->deref() )
765 delete sh;
766 sh = m.sh;
767 return *this;
768}
769
770template<class Key, class T>
771Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::insert_pair QMap<Key,T>::insert( const Q_TYPENAME QMap<Key,T>::value_type& x )
772{
773 detach();
774 size_type n = size();
775 iterator it = sh->insertSingle( x.first );
776 bool inserted = FALSE;
777 if ( n < size() ) {
778 inserted = TRUE;
779 it.data() = x.second;
780 }
781 return QPair<iterator,bool>( it, inserted );
782}
783
784template<class Key, class T>
785Q_INLINE_TEMPLATES void QMap<Key,T>::erase( const Key& k )
786{
787 detach();
788 iterator it( sh->find( k ).node );
789 if ( it != end() )
790 sh->remove( it );
791}
792
793template<class Key, class T>
794Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::size_type QMap<Key,T>::count( const Key& k ) const
795{
796 const_iterator it( sh->find( k ).node );
797 if ( it != end() ) {
798 size_type c = 0;
799 while ( it != end() ) {
800 ++it;
801 ++c;
802 }
803 return c;
804 }
805 return 0;
806}
807
808template<class Key, class T>
809Q_INLINE_TEMPLATES T& QMap<Key,T>::operator[] ( const Key& k )
810{
811 detach();
812 QMapNode<Key,T>* p = sh->find( k ).node;
813 if ( p != sh->end().node )
814 return p->data;
815 return insert( k, T() ).data();
816}
817
818template<class Key, class T>
819Q_INLINE_TEMPLATES void QMap<Key,T>::clear()
820{
821 if ( sh->count == 1 )
822 sh->clear();
823 else {
824 sh->deref();
825 sh = new QMapPrivate<Key,T>;
826 }
827}
828
829template<class Key, class T>
830Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::iterator QMap<Key,T>::insert( const Key& key, const T& value, bool overwrite )
831{
832 detach();
833 size_type n = size();
834 iterator it = sh->insertSingle( key );
835 if ( overwrite || n < size() )
836 it.data() = value;
837 return it;
838}
839
840template<class Key, class T>
841Q_INLINE_TEMPLATES void QMap<Key,T>::remove( const Key& k )
842{
843 detach();
844 iterator it( sh->find( k ).node );
845 if ( it != end() )
846 sh->remove( it );
847}
848
849template<class Key, class T>
850Q_INLINE_TEMPLATES void QMap<Key,T>::detachInternal()
851{
852 sh->deref(); sh = new QMapPrivate<Key,T>( sh );
853}
854
855
856#ifndef QT_NO_DATASTREAM
857template<class Key, class T>
858Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) {
859 m.clear();
860 Q_UINT32 c;
861 s >> c;
862 for( Q_UINT32 i = 0; i < c; ++i ) {
863 Key k; T t;
864 s >> k >> t;
865 m.insert( k, t );
866 if ( s.atEnd() )
867 break;
868 }
869 return s;
870}
871
872
873template<class Key, class T>
874Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) {
875 s << (Q_UINT32)m.size();
876 QMapConstIterator<Key,T> it = m.begin();
877 for( ; it != m.end(); ++it )
878 s << it.key() << it.data();
879 return s;
880}
881#endif
882
883#endif // QMAP_H
diff --git a/qmake/include/qmemarray.h b/qmake/include/qmemarray.h
new file mode 100644
index 0000000..a5baf99
--- a/dev/null
+++ b/qmake/include/qmemarray.h
@@ -0,0 +1,122 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QMemArray template/macro class
5**
6** Created : 930906
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QMEMARRAY_H
39#define QMEMARRAY_H
40
41#ifndef QT_H
42#include "qgarray.h"
43#endif // QT_H
44
45
46template<class type>
47class QMemArray : public QGArray
48{
49public:
50 typedef type* Iterator;
51 typedef const type* ConstIterator;
52 typedef type ValueType;
53
54protected:
55 QMemArray( int, int ) : QGArray( 0, 0 ) {}
56
57public:
58 QMemArray() {}
59 QMemArray( int size ) : QGArray(size*sizeof(type)) {}
60 QMemArray( const QMemArray<type> &a ) : QGArray(a) {}
61 ~QMemArray() {}
62 QMemArray<type> &operator=(const QMemArray<type> &a)
63 { return (QMemArray<type>&)QGArray::assign(a); }
64 type *data() const{ return (type *)QGArray::data(); }
65 uint nrefs() const{ return QGArray::nrefs(); }
66 uint size() const{ return QGArray::size()/sizeof(type); }
67 uint count() const{ return size(); }
68 bool isEmpty() const{ return QGArray::size() == 0; }
69 bool isNull() const{ return QGArray::data() == 0; }
70 bool resize( uint size ){ return QGArray::resize(size*sizeof(type)); }
71 bool truncate( uint pos ){ return QGArray::resize(pos*sizeof(type)); }
72 bool fill( const type &d, int size = -1 )
73 { return QGArray::fill((char*)&d,size,sizeof(type) ); }
74 void detach() { QGArray::detach(); }
75 QMemArray<type> copy() const
76 { QMemArray<type> tmp; return tmp.duplicate(*this); }
77 QMemArray<type>& assign( const QMemArray<type>& a )
78 { return (QMemArray<type>&)QGArray::assign(a); }
79 QMemArray<type>& assign( const type *a, uint n )
80 { return (QMemArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); }
81 QMemArray<type>& duplicate( const QMemArray<type>& a )
82 { return (QMemArray<type>&)QGArray::duplicate(a); }
83 QMemArray<type>& duplicate( const type *a, uint n )
84 { return (QMemArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); }
85 QMemArray<type>& setRawData( const type *a, uint n )
86 { return (QMemArray<type>&)QGArray::setRawData((char*)a,
87 n*sizeof(type)); }
88 void resetRawData( const type *a, uint n )
89 { QGArray::resetRawData((char*)a,n*sizeof(type)); }
90 int find( const type &d, uint i=0 ) const
91 { return QGArray::find((char*)&d,i,sizeof(type)); }
92 int contains( const type &d ) const
93 { return QGArray::contains((char*)&d,sizeof(type)); }
94 void sort() { QGArray::sort(sizeof(type)); }
95 int bsearch( const type &d ) const
96 { return QGArray::bsearch((const char*)&d,sizeof(type)); }
97 // ### Qt 4.0: maybe provide uint overload as work-around for MSVC bug
98 type& operator[]( int i ) const
99 { return (type &)(*(type *)QGArray::at(i*sizeof(type))); }
100 type& at( uint i ) const
101 { return (type &)(*(type *)QGArray::at(i*sizeof(type))); }
102 operator const type*() const { return (const type *)QGArray::data(); }
103 bool operator==( const QMemArray<type> &a ) const { return isEqual(a); }
104 bool operator!=( const QMemArray<type> &a ) const { return !isEqual(a); }
105 Iterator begin() { return data(); }
106 Iterator end() { return data() + size(); }
107 ConstIterator begin() const { return data(); }
108 ConstIterator end() const { return data() + size(); }
109};
110
111#if defined(Q_TEMPLATEDLL)
112// MOC_SKIP_BEGIN
113Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<int>;
114Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<bool>;
115// MOC_SKIP_END
116#endif
117
118#ifndef QT_NO_COMPAT
119#define QArray QMemArray
120#endif
121
122#endif // QARRAY_H
diff --git a/qmake/include/qnamespace.h b/qmake/include/qnamespace.h
new file mode 100644
index 0000000..58b485f
--- a/dev/null
+++ b/qmake/include/qnamespace.h
@@ -0,0 +1,843 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of Qt namespace (as class for compiler compatibility)
5**
6** Created : 980927
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QNAMESPACE_H
39#define QNAMESPACE_H
40
41#ifndef QT_H
42#include "qglobal.h"
43#endif // QT_H
44
45
46class QColor;
47class QCursor;
48
49
50class Q_EXPORT Qt {
51public:
52 QT_STATIC_CONST QColor & color0;
53 QT_STATIC_CONST QColor & color1;
54 QT_STATIC_CONST QColor & black;
55 QT_STATIC_CONST QColor & white;
56 QT_STATIC_CONST QColor & darkGray;
57 QT_STATIC_CONST QColor & gray;
58 QT_STATIC_CONST QColor & lightGray;
59 QT_STATIC_CONST QColor & red;
60 QT_STATIC_CONST QColor & green;
61 QT_STATIC_CONST QColor & blue;
62 QT_STATIC_CONST QColor & cyan;
63 QT_STATIC_CONST QColor & magenta;
64 QT_STATIC_CONST QColor & yellow;
65 QT_STATIC_CONST QColor & darkRed;
66 QT_STATIC_CONST QColor & darkGreen;
67 QT_STATIC_CONST QColor & darkBlue;
68 QT_STATIC_CONST QColor & darkCyan;
69 QT_STATIC_CONST QColor & darkMagenta;
70 QT_STATIC_CONST QColor & darkYellow;
71
72 // documented in qevent.cpp
73 enum ButtonState { // mouse/keyboard state values
74 NoButton= 0x0000,
75 LeftButton= 0x0001,
76 RightButton= 0x0002,
77 MidButton= 0x0004,
78 MouseButtonMask = 0x0007,
79 ShiftButton= 0x0100,
80 ControlButton = 0x0200,
81 AltButton= 0x0400,
82 MetaButton= 0x0800,
83 KeyButtonMask= 0x0f00,
84 Keypad = 0x4000
85 };
86
87 // documented in qobject.cpp
88 // ideally would start at 1, as in QSizePolicy, but that breaks other things
89 enum Orientation {
90 Horizontal = 0,
91 Vertical
92 };
93
94 // Text formatting flags for QPainter::drawText and QLabel
95 // the following four enums can be combined to one integer which
96 // is passed as textflag to drawText and qt_format_text.
97
98 // documented in qpainter.cpp
99 enum AlignmentFlags {
100 AlignAuto = 0x0000, // text alignment
101 AlignLeft = 0x0001,
102 AlignRight = 0x0002,
103 AlignHCenter = 0x0004,
104 AlignJustify = 0x0008,
105 AlignHorizontal_Mask= AlignLeft | AlignRight | AlignHCenter | AlignJustify,
106 AlignTop = 0x0010,
107 AlignBottom = 0x0020,
108 AlignVCenter = 0x0040,
109 AlignVertical_Mask = AlignTop | AlignBottom | AlignVCenter,
110 AlignCenter = AlignVCenter | AlignHCenter
111 };
112
113 // documented in qpainter.cpp
114 enum TextFlags {
115 SingleLine = 0x0080, // misc. flags
116 DontClip= 0x0100,
117 ExpandTabs= 0x0200,
118 ShowPrefix= 0x0400,
119 WordBreak= 0x0800,
120 BreakAnywhere = 0x1000,
121 DontPrint = 0x2000, // internal
122 NoAccel = 0x4000
123 };
124
125 // Widget flags; documented in qwidget.cpp
126 typedef uint WState;
127
128 // QWidget state flags (internal, barely documented in qwidget.cpp)
129 enum WidgetState {
130 WState_Created = 0x00000001,
131 WState_Disabled = 0x00000002,
132 WState_Visible = 0x00000004,
133 WState_ForceHide= 0x00000008,
134 WState_OwnCursor= 0x00000010,
135 WState_MouseTracking= 0x00000020,
136 WState_CompressKeys= 0x00000040,
137 WState_BlockUpdates= 0x00000080,
138 WState_InPaintEvent= 0x00000100,
139 WState_Reparented= 0x00000200,
140 WState_ConfigPending= 0x00000400,
141 WState_Resized = 0x00000800,
142 WState_AutoMask = 0x00001000,
143 WState_Polished = 0x00002000,
144 WState_DND = 0x00004000,
145 WState_Reserved0= 0x00008000,
146 WState_Reserved1= 0x00010000,
147 WState_Reserved2= 0x00020000,
148 WState_CreatedHidden= 0x00040000,
149 WState_Maximized= 0x00080000,
150 WState_Minimized= 0x00100000,
151 WState_ForceDisabled= 0x00200000,
152 WState_Exposed = 0x00400000,
153 WState_HasMouse = 0x00800000
154 };
155
156 // Widget flags2; documented in qwidget.cpp
157 typedef uint WFlags;
158
159 // documented in qwidget.cpp
160 enum WidgetFlags {
161 WType_TopLevel = 0x00000001,// widget type flags
162 WType_Dialog = 0x00000002,
163 WType_Popup = 0x00000004,
164 WType_Desktop = 0x00000008,
165 WType_Mask = 0x0000000f,
166
167 WStyle_Customize = 0x00000010,// window style flags
168 WStyle_NormalBorder= 0x00000020,
169 WStyle_DialogBorder= 0x00000040, // MS-Windows only
170 WStyle_NoBorder = 0x00002000,
171 WStyle_Title = 0x00000080,
172 WStyle_SysMenu = 0x00000100,
173 WStyle_Minimize = 0x00000200,
174 WStyle_Maximize = 0x00000400,
175 WStyle_MinMax = WStyle_Minimize | WStyle_Maximize,
176 WStyle_Tool = 0x00000800,
177 WStyle_StaysOnTop= 0x00001000,
178 WStyle_ContextHelp= 0x00004000,
179 WStyle_Reserved = 0x00008000,
180 WStyle_Mask = 0x0000fff0,
181
182 WDestructiveClose = 0x00010000,// misc flags
183 WPaintDesktop = 0x00020000,
184 WPaintUnclipped = 0x00040000,
185 WPaintClever = 0x00080000,
186 WResizeNoErase = 0x00100000,
187 WMouseNoMask = 0x00200000,
188 WStaticContents = 0x00400000,
189 WRepaintNoErase = 0x00800000,
190#ifdef Q_WS_X11
191 WX11BypassWM = 0x01000000,
192 WWinOwnDC = 0x00000000,
193#else
194 WX11BypassWM = 0x00000000,
195 WWinOwnDC = 0x01000000,
196#endif
197 WGroupLeader = 0x02000000,
198 WShowModal = 0x04000000,
199 WNoMousePropagation= 0x08000000,
200 WSubWindow = 0x10000000
201#ifndef QT_NO_COMPAT
202 ,
203 WNorthWestGravity= WStaticContents,
204 WType_Modal = WType_Dialog | WShowModal,
205 WStyle_Dialog = WType_Dialog,
206 WStyle_NoBorderEx= WStyle_NoBorder
207#endif
208 };
209
210 // Image conversion flags. The unusual ordering is caused by
211 // compatibility and default requirements.
212 // Documented in qimage.cpp
213
214 enum ImageConversionFlags {
215 ColorMode_Mask = 0x00000003,
216 AutoColor = 0x00000000,
217 ColorOnly = 0x00000003,
218 MonoOnly = 0x00000002,
219 // Reserved= 0x00000001,
220
221 AlphaDither_Mask= 0x0000000c,
222 ThresholdAlphaDither= 0x00000000,
223 OrderedAlphaDither= 0x00000004,
224 DiffuseAlphaDither= 0x00000008,
225 NoAlpha = 0x0000000c, // Not supported
226
227 Dither_Mask = 0x00000030,
228 DiffuseDither = 0x00000000,
229 OrderedDither = 0x00000010,
230 ThresholdDither = 0x00000020,
231 // ReservedDither= 0x00000030,
232
233 DitherMode_Mask = 0x000000c0,
234 AutoDither = 0x00000000,
235 PreferDither = 0x00000040,
236 AvoidDither = 0x00000080
237 };
238
239 // documented in qpainter.cpp
240 enum BGMode { // background mode
241 TransparentMode,
242 OpaqueMode
243 };
244
245#ifndef QT_NO_COMPAT
246 // documented in qpainter.cpp
247 enum PaintUnit { // paint unit
248 PixelUnit,
249 LoMetricUnit, // OBSOLETE
250 HiMetricUnit, // OBSOLETE
251 LoEnglishUnit, // OBSOLETE
252 HiEnglishUnit, // OBSOLETE
253 TwipsUnit // OBSOLETE
254 };
255#endif
256
257 // documented in qstyle.cpp
258#ifdef QT_NO_COMPAT
259 enum GUIStyle {
260 WindowsStyle = 1, // ### Qt 4.0: either remove the obsolete enums or clean up compat vs.
261 MotifStyle = 4 // ### QT_NO_COMPAT by reordering or combination into one enum.
262 };
263#else
264 enum GUIStyle {
265 MacStyle, // OBSOLETE
266 WindowsStyle,
267 Win3Style, // OBSOLETE
268 PMStyle, // OBSOLETE
269 MotifStyle
270 };
271#endif
272
273 // documented in qkeysequence.cpp
274 enum SequenceMatch {
275 NoMatch,
276 PartialMatch,
277 Identical
278 };
279
280 // documented in qevent.cpp
281 enum Modifier { // accelerator modifiers
282 META = 0x00100000,
283 SHIFT = 0x00200000,
284 CTRL = 0x00400000,
285 ALT = 0x00800000,
286 MODIFIER_MASK = 0x00f00000,
287 UNICODE_ACCEL = 0x10000000,
288
289 ASCII_ACCEL = UNICODE_ACCEL // 1.x compat
290 };
291
292 // documented in qevent.cpp
293 enum Key {
294 Key_Escape = 0x1000, // misc keys
295 Key_Tab = 0x1001,
296 Key_Backtab = 0x1002, Key_BackTab = Key_Backtab,
297 Key_Backspace = 0x1003, Key_BackSpace = Key_Backspace,
298 Key_Return = 0x1004,
299 Key_Enter = 0x1005,
300 Key_Insert = 0x1006,
301 Key_Delete = 0x1007,
302 Key_Pause = 0x1008,
303 Key_Print = 0x1009,
304 Key_SysReq = 0x100a,
305 Key_Clear = 0x100b,
306 Key_Home = 0x1010, // cursor movement
307 Key_End = 0x1011,
308 Key_Left = 0x1012,
309 Key_Up = 0x1013,
310 Key_Right = 0x1014,
311 Key_Down = 0x1015,
312 Key_Prior = 0x1016, Key_PageUp = Key_Prior,
313 Key_Next = 0x1017, Key_PageDown = Key_Next,
314 Key_Shift = 0x1020, // modifiers
315 Key_Control = 0x1021,
316 Key_Meta = 0x1022,
317 Key_Alt = 0x1023,
318 Key_CapsLock = 0x1024,
319 Key_NumLock = 0x1025,
320 Key_ScrollLock = 0x1026,
321 Key_F1 = 0x1030, // function keys
322 Key_F2 = 0x1031,
323 Key_F3 = 0x1032,
324 Key_F4 = 0x1033,
325 Key_F5 = 0x1034,
326 Key_F6 = 0x1035,
327 Key_F7 = 0x1036,
328 Key_F8 = 0x1037,
329 Key_F9 = 0x1038,
330 Key_F10 = 0x1039,
331 Key_F11 = 0x103a,
332 Key_F12 = 0x103b,
333 Key_F13 = 0x103c,
334 Key_F14 = 0x103d,
335 Key_F15 = 0x103e,
336 Key_F16 = 0x103f,
337 Key_F17 = 0x1040,
338 Key_F18 = 0x1041,
339 Key_F19 = 0x1042,
340 Key_F20 = 0x1043,
341 Key_F21 = 0x1044,
342 Key_F22 = 0x1045,
343 Key_F23 = 0x1046,
344 Key_F24 = 0x1047,
345 Key_F25 = 0x1048, // F25 .. F35 only on X11
346 Key_F26 = 0x1049,
347 Key_F27 = 0x104a,
348 Key_F28 = 0x104b,
349 Key_F29 = 0x104c,
350 Key_F30 = 0x104d,
351 Key_F31 = 0x104e,
352 Key_F32 = 0x104f,
353 Key_F33 = 0x1050,
354 Key_F34 = 0x1051,
355 Key_F35 = 0x1052,
356 Key_Super_L = 0x1053, // extra keys
357 Key_Super_R = 0x1054,
358 Key_Menu = 0x1055,
359 Key_Hyper_L = 0x1056,
360 Key_Hyper_R = 0x1057,
361 Key_Help = 0x1058,
362 Key_Direction_L = 0x1059,
363 Key_Direction_R = 0x1060,
364 Key_Space = 0x20, // 7 bit printable ASCII
365 Key_Any = Key_Space,
366 Key_Exclam = 0x21,
367 Key_QuoteDbl = 0x22,
368 Key_NumberSign = 0x23,
369 Key_Dollar = 0x24,
370 Key_Percent = 0x25,
371 Key_Ampersand = 0x26,
372 Key_Apostrophe = 0x27,
373 Key_ParenLeft = 0x28,
374 Key_ParenRight = 0x29,
375 Key_Asterisk = 0x2a,
376 Key_Plus = 0x2b,
377 Key_Comma = 0x2c,
378 Key_Minus = 0x2d,
379 Key_Period = 0x2e,
380 Key_Slash = 0x2f,
381 Key_0 = 0x30,
382 Key_1 = 0x31,
383 Key_2 = 0x32,
384 Key_3 = 0x33,
385 Key_4 = 0x34,
386 Key_5 = 0x35,
387 Key_6 = 0x36,
388 Key_7 = 0x37,
389 Key_8 = 0x38,
390 Key_9 = 0x39,
391 Key_Colon = 0x3a,
392 Key_Semicolon = 0x3b,
393 Key_Less = 0x3c,
394 Key_Equal = 0x3d,
395 Key_Greater = 0x3e,
396 Key_Question = 0x3f,
397 Key_At = 0x40,
398 Key_A = 0x41,
399 Key_B = 0x42,
400 Key_C = 0x43,
401 Key_D = 0x44,
402 Key_E = 0x45,
403 Key_F = 0x46,
404 Key_G = 0x47,
405 Key_H = 0x48,
406 Key_I = 0x49,
407 Key_J = 0x4a,
408 Key_K = 0x4b,
409 Key_L = 0x4c,
410 Key_M = 0x4d,
411 Key_N = 0x4e,
412 Key_O = 0x4f,
413 Key_P = 0x50,
414 Key_Q = 0x51,
415 Key_R = 0x52,
416 Key_S = 0x53,
417 Key_T = 0x54,
418 Key_U = 0x55,
419 Key_V = 0x56,
420 Key_W = 0x57,
421 Key_X = 0x58,
422 Key_Y = 0x59,
423 Key_Z = 0x5a,
424 Key_BracketLeft = 0x5b,
425 Key_Backslash = 0x5c,
426 Key_BracketRight = 0x5d,
427 Key_AsciiCircum = 0x5e,
428 Key_Underscore = 0x5f,
429 Key_QuoteLeft = 0x60,
430 Key_BraceLeft = 0x7b,
431 Key_Bar = 0x7c,
432 Key_BraceRight = 0x7d,
433 Key_AsciiTilde = 0x7e,
434
435 // Latin 1 codes adapted from X: keysymdef.h,v 1.21 94/08/28 16:17:06
436
437 Key_nobreakspace = 0x0a0,
438 Key_exclamdown = 0x0a1,
439 Key_cent = 0x0a2,
440 Key_sterling = 0x0a3,
441 Key_currency = 0x0a4,
442 Key_yen = 0x0a5,
443 Key_brokenbar = 0x0a6,
444 Key_section = 0x0a7,
445 Key_diaeresis = 0x0a8,
446 Key_copyright = 0x0a9,
447 Key_ordfeminine = 0x0aa,
448 Key_guillemotleft = 0x0ab,// left angle quotation mark
449 Key_notsign = 0x0ac,
450 Key_hyphen = 0x0ad,
451 Key_registered = 0x0ae,
452 Key_macron = 0x0af,
453 Key_degree = 0x0b0,
454 Key_plusminus = 0x0b1,
455 Key_twosuperior = 0x0b2,
456 Key_threesuperior = 0x0b3,
457 Key_acute = 0x0b4,
458 Key_mu = 0x0b5,
459 Key_paragraph = 0x0b6,
460 Key_periodcentered = 0x0b7,
461 Key_cedilla = 0x0b8,
462 Key_onesuperior = 0x0b9,
463 Key_masculine = 0x0ba,
464 Key_guillemotright = 0x0bb,// right angle quotation mark
465 Key_onequarter = 0x0bc,
466 Key_onehalf = 0x0bd,
467 Key_threequarters = 0x0be,
468 Key_questiondown = 0x0bf,
469 Key_Agrave = 0x0c0,
470 Key_Aacute = 0x0c1,
471 Key_Acircumflex = 0x0c2,
472 Key_Atilde = 0x0c3,
473 Key_Adiaeresis = 0x0c4,
474 Key_Aring = 0x0c5,
475 Key_AE = 0x0c6,
476 Key_Ccedilla = 0x0c7,
477 Key_Egrave = 0x0c8,
478 Key_Eacute = 0x0c9,
479 Key_Ecircumflex = 0x0ca,
480 Key_Ediaeresis = 0x0cb,
481 Key_Igrave = 0x0cc,
482 Key_Iacute = 0x0cd,
483 Key_Icircumflex = 0x0ce,
484 Key_Idiaeresis = 0x0cf,
485 Key_ETH = 0x0d0,
486 Key_Ntilde = 0x0d1,
487 Key_Ograve = 0x0d2,
488 Key_Oacute = 0x0d3,
489 Key_Ocircumflex = 0x0d4,
490 Key_Otilde = 0x0d5,
491 Key_Odiaeresis = 0x0d6,
492 Key_multiply = 0x0d7,
493 Key_Ooblique = 0x0d8,
494 Key_Ugrave = 0x0d9,
495 Key_Uacute = 0x0da,
496 Key_Ucircumflex = 0x0db,
497 Key_Udiaeresis = 0x0dc,
498 Key_Yacute = 0x0dd,
499 Key_THORN = 0x0de,
500 Key_ssharp = 0x0df,
501 Key_agrave = 0x0e0,
502 Key_aacute = 0x0e1,
503 Key_acircumflex = 0x0e2,
504 Key_atilde = 0x0e3,
505 Key_adiaeresis = 0x0e4,
506 Key_aring = 0x0e5,
507 Key_ae = 0x0e6,
508 Key_ccedilla = 0x0e7,
509 Key_egrave = 0x0e8,
510 Key_eacute = 0x0e9,
511 Key_ecircumflex = 0x0ea,
512 Key_ediaeresis = 0x0eb,
513 Key_igrave = 0x0ec,
514 Key_iacute = 0x0ed,
515 Key_icircumflex = 0x0ee,
516 Key_idiaeresis = 0x0ef,
517 Key_eth = 0x0f0,
518 Key_ntilde = 0x0f1,
519 Key_ograve = 0x0f2,
520 Key_oacute = 0x0f3,
521 Key_ocircumflex = 0x0f4,
522 Key_otilde = 0x0f5,
523 Key_odiaeresis = 0x0f6,
524 Key_division = 0x0f7,
525 Key_oslash = 0x0f8,
526 Key_ugrave = 0x0f9,
527 Key_uacute = 0x0fa,
528 Key_ucircumflex = 0x0fb,
529 Key_udiaeresis = 0x0fc,
530 Key_yacute = 0x0fd,
531 Key_thorn = 0x0fe,
532 Key_ydiaeresis = 0x0ff,
533
534 // multimedia/internet keys - ignored by default - see QKeyEvent c'tor
535
536 Key_Back = 0x1061,
537 Key_Forward = 0x1062,
538 Key_Stop = 0x1063,
539 Key_Refresh = 0x1064,
540
541 Key_VolumeDown = 0x1070,
542 Key_VolumeMute = 0x1071,
543 Key_VolumeUp = 0x1072,
544 Key_BassBoost = 0x1073,
545 Key_BassUp = 0x1074,
546 Key_BassDown = 0x1075,
547 Key_TrebleUp = 0x1076,
548 Key_TrebleDown = 0x1077,
549
550 Key_MediaPlay = 0x1080,
551 Key_MediaStop = 0x1081,
552 Key_MediaPrev = 0x1082,
553 Key_MediaNext = 0x1083,
554 Key_MediaRecord = 0x1084,
555
556 Key_HomePage = 0x1090,
557 Key_Favorites = 0x1091,
558 Key_Search = 0x1092,
559 Key_Standby = 0x1093,
560 Key_OpenUrl = 0x1094,
561
562 Key_LaunchMail = 0x10a0,
563 Key_LaunchMedia = 0x10a1,
564 Key_Launch0 = 0x10a2,
565 Key_Launch1 = 0x10a3,
566 Key_Launch2 = 0x10a4,
567 Key_Launch3 = 0x10a5,
568 Key_Launch4 = 0x10a6,
569 Key_Launch5 = 0x10a7,
570 Key_Launch6 = 0x10a8,
571 Key_Launch7 = 0x10a9,
572 Key_Launch8 = 0x10aa,
573 Key_Launch9 = 0x10ab,
574 Key_LaunchA = 0x10ac,
575 Key_LaunchB = 0x10ad,
576 Key_LaunchC = 0x10ae,
577 Key_LaunchD = 0x10af,
578 Key_LaunchE = 0x10b0,
579 Key_LaunchF = 0x10b1,
580
581 Key_MediaLast = 0x1fff,
582
583 Key_unknown = 0xffff
584 };
585
586 // documented in qcommonstyle.cpp
587 enum ArrowType {
588 UpArrow,
589 DownArrow,
590 LeftArrow,
591 RightArrow
592 };
593
594 // documented in qpainter.cpp
595 enum RasterOp { // raster op mode
596 CopyROP,
597 OrROP,
598 XorROP,
599 NotAndROP, EraseROP=NotAndROP,
600 NotCopyROP,
601 NotOrROP,
602 NotXorROP,
603 AndROP,NotEraseROP=AndROP,
604 NotROP,
605 ClearROP,
606 SetROP,
607 NopROP,
608 AndNotROP,
609 OrNotROP,
610 NandROP,
611 NorROP,LastROP=NorROP
612 };
613
614 // documented in qpainter.cpp
615 enum PenStyle { // pen style
616 NoPen,
617 SolidLine,
618 DashLine,
619 DotLine,
620 DashDotLine,
621 DashDotDotLine,
622 MPenStyle = 0x0f
623 };
624
625 // documented in qpainter.cpp
626 enum PenCapStyle { // line endcap style
627 FlatCap = 0x00,
628 SquareCap = 0x10,
629 RoundCap = 0x20,
630 MPenCapStyle = 0x30
631 };
632
633 // documented in qpainter.cpp
634 enum PenJoinStyle { // line join style
635 MiterJoin = 0x00,
636 BevelJoin = 0x40,
637 RoundJoin = 0x80,
638 MPenJoinStyle = 0xc0
639 };
640
641 // documented in qpainter.cpp
642 enum BrushStyle { // brush style
643 NoBrush,
644 SolidPattern,
645 Dense1Pattern,
646 Dense2Pattern,
647 Dense3Pattern,
648 Dense4Pattern,
649 Dense5Pattern,
650 Dense6Pattern,
651 Dense7Pattern,
652 HorPattern,
653 VerPattern,
654 CrossPattern,
655 BDiagPattern,
656 FDiagPattern,
657 DiagCrossPattern,
658 CustomPattern=24
659 };
660
661 // documented in qapplication_win.cpp
662 enum WindowsVersion {
663 WV_32s = 0x0001,
664 WV_95 = 0x0002,
665 WV_98 = 0x0003,
666 WV_Me = 0x0004,
667 WV_DOS_based= 0x000f,
668
669 WV_NT = 0x0010,
670 WV_2000 = 0x0020,
671 WV_XP = 0x0030,
672 WV_NT_based= 0x00f0
673 };
674
675 // documented in qstyle.cpp
676 enum UIEffect {
677 UI_General,
678 UI_AnimateMenu,
679 UI_FadeMenu,
680 UI_AnimateCombo,
681 UI_AnimateTooltip,
682 UI_FadeTooltip
683 };
684
685 // documented in qcursor.cpp
686 enum CursorShape {
687 ArrowCursor,
688 UpArrowCursor,
689 CrossCursor,
690 WaitCursor,
691 IbeamCursor,
692 SizeVerCursor,
693 SizeHorCursor,
694 SizeBDiagCursor,
695 SizeFDiagCursor,
696 SizeAllCursor,
697 BlankCursor,
698 SplitVCursor,
699 SplitHCursor,
700 PointingHandCursor,
701 ForbiddenCursor,
702 WhatsThisCursor,
703 LastCursor= WhatsThisCursor,
704 BitmapCursor= 24
705 };
706
707 // Global cursors
708
709 QT_STATIC_CONST QCursor & arrowCursor;// standard arrow cursor
710 QT_STATIC_CONST QCursor & upArrowCursor;// upwards arrow
711 QT_STATIC_CONST QCursor & crossCursor;// crosshair
712 QT_STATIC_CONST QCursor & waitCursor;// hourglass/watch
713 QT_STATIC_CONST QCursor & ibeamCursor;// ibeam/text entry
714 QT_STATIC_CONST QCursor & sizeVerCursor;// vertical resize
715 QT_STATIC_CONST QCursor & sizeHorCursor;// horizontal resize
716 QT_STATIC_CONST QCursor & sizeBDiagCursor;// diagonal resize (/)
717 QT_STATIC_CONST QCursor & sizeFDiagCursor;// diagonal resize (\)
718 QT_STATIC_CONST QCursor & sizeAllCursor;// all directions resize
719 QT_STATIC_CONST QCursor & blankCursor;// blank/invisible cursor
720 QT_STATIC_CONST QCursor & splitVCursor;// vertical bar with left-right
721 // arrows
722 QT_STATIC_CONST QCursor & splitHCursor;// horizontal bar with up-down
723 // arrows
724 QT_STATIC_CONST QCursor & pointingHandCursor;// pointing hand
725 QT_STATIC_CONST QCursor & forbiddenCursor;// forbidden cursor (slashed circle)
726 QT_STATIC_CONST QCursor & whatsThisCursor; // arrow with a question mark
727
728
729 enum TextFormat {
730 PlainText,
731 RichText,
732 AutoText,
733 LogText
734 };
735
736 // Documented in qtextedit.cpp
737 enum AnchorAttribute {
738 AnchorName,
739 AnchorHref
740 };
741
742 // Documented in qmainwindow.cpp
743 enum Dock {
744 DockUnmanaged,
745 DockTornOff,
746 DockTop,
747 DockBottom,
748 DockRight,
749 DockLeft,
750 DockMinimized
751#ifndef QT_NO_COMPAT
752 ,
753 Unmanaged = DockUnmanaged,
754 TornOff = DockTornOff,
755 Top = DockTop,
756 Bottom = DockBottom,
757 Right = DockRight,
758 Left = DockLeft,
759 Minimized = DockMinimized
760#endif
761 };
762 // compatibility
763 typedef Dock ToolBarDock;
764
765 // documented in qdatetime.cpp
766 enum DateFormat {
767 TextDate, // default Qt
768 ISODate, // ISO 8601
769 LocalDate // locale dependant
770 };
771
772 // documented in qdatetime.cpp
773 enum TimeSpec {
774 LocalTime,
775 UTC
776 };
777
778 // documented in qwidget.cpp
779 enum BackgroundMode {
780 FixedColor,
781 FixedPixmap,
782 NoBackground,
783 PaletteForeground,
784 PaletteButton,
785 PaletteLight,
786 PaletteMidlight,
787 PaletteDark,
788 PaletteMid,
789 PaletteText,
790 PaletteBrightText,
791 PaletteBase,
792 PaletteBackground,
793 PaletteShadow,
794 PaletteHighlight,
795 PaletteHighlightedText,
796 PaletteButtonText,
797 PaletteLink,
798 PaletteLinkVisited,
799 X11ParentRelative
800 };
801
802 typedef uint ComparisonFlags;
803
804 // Documented in qstring.cpp
805 enum StringComparisonMode {
806 CaseSensitive = 0x00001, // 0 0001
807 BeginsWith = 0x00002, // 0 0010
808 EndsWith = 0x00004, // 0 0100
809 Contains = 0x00008, // 0 1000
810 ExactMatch = 0x00010 // 1 0000
811 };
812
813 // "handle" type for system objects. Documented as \internal in
814 // qapplication.cpp
815#if defined(Q_WS_MAC)
816 typedef void * HANDLE;
817#elif defined(Q_WS_WIN)
818 typedef void *HANDLE;
819#elif defined(Q_WS_X11)
820 typedef unsigned long HANDLE;
821#elif defined(Q_WS_QWS)
822 typedef void * HANDLE;
823#endif
824};
825
826
827class Q_EXPORT QInternal {
828public:
829 enum PaintDeviceFlags {
830 UndefinedDevice = 0x00,
831 Widget = 0x01,
832 Pixmap = 0x02,
833 Printer = 0x03,
834 Picture = 0x04,
835 System = 0x05,
836 DeviceTypeMask = 0x0f,
837 ExternalDevice = 0x10,
838 // used to emulate some of the behaviour different between Qt2 and Qt3 (mainly for printing)
839 CompatibilityMode = 0x20
840 };
841};
842
843#endif // QNAMESPACE_H
diff --git a/qmake/include/qpair.h b/qmake/include/qpair.h
new file mode 100644
index 0000000..e7cd70e
--- a/dev/null
+++ b/qmake/include/qpair.h
@@ -0,0 +1,96 @@
1/****************************************************************************
2**
3** Definition of QPair class
4**
5**
6** Copyright (C) 1992-2001 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QPAIR_H
37#define QPAIR_H
38
39#ifndef QT_H
40#include "qglobal.h"
41#include "qdatastream.h"
42#endif // QT_H
43
44template <class T1, class T2>
45struct QPair
46{
47 typedef T1 first_type;
48 typedef T2 second_type;
49
50 QPair()
51 : first( T1() ), second( T2() )
52 {}
53 QPair( const T1& t1, const T2& t2 )
54 : first( t1 ), second( t2 )
55 {}
56
57 T1 first;
58 T2 second;
59};
60
61template <class T1, class T2>
62Q_INLINE_TEMPLATES bool operator==( const QPair<T1, T2>& x, const QPair<T1, T2>& y )
63{
64 return x.first == y.first && x.second == y.second;
65}
66
67template <class T1, class T2>
68Q_INLINE_TEMPLATES bool operator<( const QPair<T1, T2>& x, const QPair<T1, T2>& y )
69{
70 return x.first < y.first ||
71 ( !( y.first < x.first ) && x.second < y.second );
72}
73
74template <class T1, class T2>
75Q_INLINE_TEMPLATES QPair<T1, T2> qMakePair( const T1& x, const T2& y )
76{
77 return QPair<T1, T2>( x, y );
78}
79
80#ifndef QT_NO_DATASTREAM
81template <class T1, class T2>
82inline QDataStream& operator>>( QDataStream& s, QPair<T1, T2>& p )
83{
84 s >> p.first >> p.second;
85 return s;
86}
87
88template <class T1, class T2>
89inline QDataStream& operator<<( QDataStream& s, const QPair<T1, T2>& p )
90{
91 s << p.first << p.second;
92 return s;
93}
94#endif
95
96#endif
diff --git a/qmake/include/qptrcollection.h b/qmake/include/qptrcollection.h
new file mode 100644
index 0000000..4f121fa
--- a/dev/null
+++ b/qmake/include/qptrcollection.h
@@ -0,0 +1,76 @@
1/****************************************************************************
2**
3** Definition of base class for all pointer based collection classes
4**
5**
6** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
7**
8** This file is part of the tools module of the Qt GUI Toolkit.
9**
10** This file may be distributed under the terms of the Q Public License
11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file.
13**
14** This file may be distributed and/or modified under the terms of the
15** GNU General Public License version 2 as published by the Free Software
16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file.
18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software.
22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30**
31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you.
33**
34**********************************************************************/
35
36#ifndef QPTRCOLLECTION_H
37#define QPTRCOLLECTION_H
38
39#ifndef QT_H
40#include "qglobal.h"
41#endif // QT_H
42
43
44class QGVector;
45class QGList;
46class QGDict;
47
48
49 class Q_EXPORT QPtrCollection // inherited by all collections
50{
51public:
52 bool autoDelete() const { return del_item; }
53 void setAutoDelete( bool enable ) { del_item = enable; }
54
55 virtual uint count() const = 0;
56 virtual void clear() = 0; // delete all objects
57
58 typedef void *Item; // generic collection item
59
60protected:
61 QPtrCollection() { del_item = FALSE; } // no deletion of objects
62 QPtrCollection(const QPtrCollection &) { del_item = FALSE; }
63 virtual ~QPtrCollection() {}
64
65 bool del_item; // default FALSE
66
67 virtual Item newItem( Item ); // create object
68 virtual void deleteItem( Item ) = 0;// delete object
69};
70
71
72#ifndef QT_NO_COMPAT
73#define QCollection QPtrCollection
74#endif
75
76#endif // QPTRCOLLECTION_H
diff --git a/qmake/include/qptrlist.h b/qmake/include/qptrlist.h
new file mode 100644
index 0000000..53fb605
--- a/dev/null
+++ b/qmake/include/qptrlist.h
@@ -0,0 +1,160 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QPtrList template/macro class
5**
6** Created :
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QPTRLIST_H
39#define QPTRLIST_H
40
41#ifndef QT_H
42#include "qglist.h"
43#endif // QT_H
44
45
46template<class type>
47class QPtrList
48#ifdef Q_QDOC
49 : public QPtrCollection
50#else
51 : public QGList
52#endif
53{
54public:
55 QPtrList() {}
56 QPtrList( const QPtrList<type> &l ) : QGList(l) {}
57 ~QPtrList() { clear(); }
58 QPtrList<type> &operator=(const QPtrList<type> &l)
59 { return (QPtrList<type>&)QGList::operator=(l); }
60 bool operator==( const QPtrList<type> &list ) const
61 { return QGList::operator==( list ); }
62 bool operator!=( const QPtrList<type> &list ) const
63 { return !QGList::operator==( list ); }
64 uint count() const { return QGList::count(); }
65 bool isEmpty() const { return QGList::count() == 0; }
66 bool insert( uint i, const type *d){ return QGList::insertAt(i,(QPtrCollection::Item)d); }
67 void inSort( const type *d ){ QGList::inSort((QPtrCollection::Item)d); }
68 void prepend( const type *d ){ QGList::insertAt(0,(QPtrCollection::Item)d); }
69 void append( const type *d ){ QGList::append((QPtrCollection::Item)d); }
70 bool remove( uint i ) { return QGList::removeAt(i); }
71 bool remove() { return QGList::remove((QPtrCollection::Item)0); }
72 bool remove( const type *d ){ return QGList::remove((QPtrCollection::Item)d); }
73 bool removeRef( const type *d ){ return QGList::removeRef((QPtrCollection::Item)d); }
74 void removeNode( QLNode *n ){ QGList::removeNode(n); }
75 bool removeFirst() { return QGList::removeFirst(); }
76 bool removeLast() { return QGList::removeLast(); }
77 type *take( uint i ) { return (type *)QGList::takeAt(i); }
78 type *take() { return (type *)QGList::take(); }
79 type *takeNode( QLNode *n ) { return (type *)QGList::takeNode(n); }
80 void clear() { QGList::clear(); }
81 void sort() { QGList::sort(); }
82 int find( const type *d ) { return QGList::find((QPtrCollection::Item)d); }
83 int findNext( const type *d ){ return QGList::find((QPtrCollection::Item)d,FALSE); }
84 int findRef( const type *d ){ return QGList::findRef((QPtrCollection::Item)d); }
85 int findNextRef( const type *d ){ return QGList::findRef((QPtrCollection::Item)d,FALSE);}
86 uint contains( const type *d ) const { return QGList::contains((QPtrCollection::Item)d); }
87 uint containsRef( const type *d ) const
88 { return QGList::containsRef((QPtrCollection::Item)d); }
89 bool replace( uint i, const type *d ) { return QGList::replaceAt( i, (QPtrCollection::Item)d ); }
90 type *at( uint i ) { return (type *)QGList::at(i); }
91 int at() const { return QGList::at(); }
92 type *current() const { return (type *)QGList::get(); }
93 QLNode *currentNode() const{ return QGList::currentNode(); }
94 type *getFirst() const { return (type *)QGList::cfirst(); }
95 type *getLast() const { return (type *)QGList::clast(); }
96 type *first() { return (type *)QGList::first(); }
97 type *last() { return (type *)QGList::last(); }
98 type *next() { return (type *)QGList::next(); }
99 type *prev() { return (type *)QGList::prev(); }
100 void toVector( QGVector *vec )const{ QGList::toVector(vec); }
101
102#ifdef Q_QDOC
103protected:
104 virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item );
105 virtual QDataStream& read( QDataStream&, QPtrCollection::Item& );
106 virtual QDataStream& write( QDataStream&, QPtrCollection::Item ) const;
107#endif
108
109private:
110 void deleteItem( Item d );
111};
112
113#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
114template<> inline void QPtrList<void>::deleteItem( QPtrCollection::Item )
115{
116}
117#endif
118
119template<class type> inline void QPtrList<type>::deleteItem( QPtrCollection::Item d )
120{
121 if ( del_item ) delete (type *)d;
122}
123
124template<class type>
125class QPtrListIterator : public QGListIterator
126{
127public:
128 QPtrListIterator(const QPtrList<type> &l) :QGListIterator((QGList &)l) {}
129 ~QPtrListIterator() {}
130 uint count() const { return list->count(); }
131 bool isEmpty() const { return list->count() == 0; }
132 bool atFirst() const { return QGListIterator::atFirst(); }
133 bool atLast() const { return QGListIterator::atLast(); }
134 type *toFirst() { return (type *)QGListIterator::toFirst(); }
135 type *toLast() { return (type *)QGListIterator::toLast(); }
136 operator type *() const { return (type *)QGListIterator::get(); }
137 type *operator*() { return (type *)QGListIterator::get(); }
138
139 // No good, since QPtrList<char> (ie. QStrList fails...
140 //
141 // MSVC++ gives warning
142 // Sunpro C++ 4.1 gives error
143 // type *operator->() { return (type *)QGListIterator::get(); }
144
145 type *current() const { return (type *)QGListIterator::get(); }
146 type *operator()() { return (type *)QGListIterator::operator()();}
147 type *operator++() { return (type *)QGListIterator::operator++(); }
148 type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);}
149 type *operator--() { return (type *)QGListIterator::operator--(); }
150 type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);}
151 QPtrListIterator<type>& operator=(const QPtrListIterator<type>&it)
152 { QGListIterator::operator=(it); return *this; }
153};
154
155#ifndef QT_NO_COMPAT
156#define QList QPtrList
157#define QListIterator QPtrListIterator
158#endif
159
160#endif // QPTRLIST_H
diff --git a/qmake/include/qptrvector.h b/qmake/include/qptrvector.h
new file mode 100644
index 0000000..f6d9623
--- a/dev/null
+++ b/qmake/include/qptrvector.h
@@ -0,0 +1,113 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QPtrVector pointer based template class
5**
6** Created : 930907
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QPTRVECTOR_H
39#define QPTRVECTOR_H
40
41#ifndef QT_H
42#include "qgvector.h"
43#endif // QT_H
44
45template<class type>
46class QPtrVector
47#ifdef Q_QDOC
48 : public QPtrCollection
49#else
50 : public QGVector
51#endif
52{
53public:
54 QPtrVector() { }
55 QPtrVector( uint size ) : QGVector(size) { }
56 QPtrVector( const QPtrVector<type> &v ) : QGVector( v ) { }
57 ~QPtrVector() { clear(); }
58 QPtrVector<type> &operator=(const QPtrVector<type> &v)
59 { return (QPtrVector<type>&)QGVector::operator=(v); }
60 bool operator==( const QPtrVector<type> &v ) const { return QGVector::operator==(v); }
61 type **data() const { return (type **)QGVector::data(); }
62 uint size() const { return QGVector::size(); }
63 uint count() const { return QGVector::count(); }
64 bool isEmpty() const { return QGVector::count() == 0; }
65 bool isNull() const { return QGVector::size() == 0; }
66 bool resize( uint size ) { return QGVector::resize(size); }
67 bool insert( uint i, const type *d){ return QGVector::insert(i,(Item)d); }
68 bool remove( uint i ) { return QGVector::remove(i); }
69 type *take( uint i ) { return (type *)QGVector::take(i); }
70 void clear() { QGVector::clear(); }
71 bool fill( const type *d, int size=-1 )
72 { return QGVector::fill((Item)d,size);}
73 void sort() { QGVector::sort(); }
74 int bsearch( const type *d ) const{ return QGVector::bsearch((Item)d); }
75 int findRef( const type *d, uint i=0 ) const
76 { return QGVector::findRef((Item)d,i);}
77 int find( const type *d, uint i= 0 ) const
78 { return QGVector::find((Item)d,i); }
79 uint containsRef( const type *d ) const
80 { return QGVector::containsRef((Item)d); }
81 uint contains( const type *d ) const
82 { return QGVector::contains((Item)d); }
83 type *operator[]( int i ) const{ return (type *)QGVector::at(i); }
84 type *at( uint i ) const { return (type *)QGVector::at(i); }
85 void toList( QGList *list ) const{ QGVector::toList(list); }
86
87#ifdef Q_QDOC
88protected:
89 virtual int compareItems( QPtrCollection::Item d1, QPtrCollection::Item d2 );
90 virtual QDataStream& read( QDataStream &s, QPtrCollection::Item &d );
91 virtual QDataStream& write( QDataStream &s, QPtrCollection::Item d ) const;
92#endif
93
94private:
95 void deleteItem( Item d );
96};
97
98#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
99template<> inline void QPtrVector<void>::deleteItem( QPtrCollection::Item )
100{
101}
102#endif
103
104template<class type> inline void QPtrVector<type>::deleteItem( QPtrCollection::Item d )
105{
106 if ( del_item ) delete (type *)d;
107}
108
109#ifndef QT_NO_COMPAT
110#define QVector QPtrVector
111#endif
112
113#endif // QVECTOR_H
diff --git a/qmake/include/qregexp.h b/qmake/include/qregexp.h
new file mode 100644
index 0000000..7bb777a
--- a/dev/null
+++ b/qmake/include/qregexp.h
@@ -0,0 +1,115 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QRegExp class
5**
6** Created : 950126
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QREGEXP_H
39#define QREGEXP_H
40
41#ifndef QT_H
42#include "qstringlist.h"
43#endif // QT_H
44
45#ifndef QT_NO_REGEXP
46class QRegExpEngine;
47struct QRegExpPrivate;
48
49class Q_EXPORT QRegExp
50{
51public:
52 enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
53
54 QRegExp();
55 QRegExp( const QString& pattern, bool caseSensitive = TRUE,
56 bool wildcard = FALSE );
57 QRegExp( const QRegExp& rx );
58 ~QRegExp();
59 QRegExp& operator=( const QRegExp& rx );
60
61 bool operator==( const QRegExp& rx ) const;
62 bool operator!=( const QRegExp& rx ) const { return !operator==( rx ); }
63
64 bool isEmpty() const;
65 bool isValid() const;
66 QString pattern() const;
67 void setPattern( const QString& pattern );
68 bool caseSensitive() const;
69 void setCaseSensitive( bool sensitive );
70#ifndef QT_NO_REGEXP_WILDCARD
71 bool wildcard() const;
72 void setWildcard( bool wildcard );
73#endif
74 bool minimal() const;
75 void setMinimal( bool minimal );
76
77 bool exactMatch( const QString& str ) const;
78#ifndef QT_NO_COMPAT
79 int match( const QString& str, int index = 0, int *len = 0,
80 bool indexIsStart = TRUE ) const;
81#endif
82
83#if defined(qdoc)
84 int search( const QString& str, int offset = 0,
85 CaretMode caretMode = CaretAtZero ) const;
86 int searchRev( const QString& str, int offset = -1,
87 CaretMode caretMode = CaretAtZero ) const;
88#else
89 // ### Qt 4.0: reduce these four to two functions
90 int search( const QString& str, int offset = 0 ) const;
91 int search( const QString& str, int offset, CaretMode caretMode ) const;
92 int searchRev( const QString& str, int offset = -1 ) const;
93 int searchRev( const QString& str, int offset, CaretMode caretMode ) const;
94#endif
95 int matchedLength() const;
96#ifndef QT_NO_REGEXP_CAPTURE
97 int numCaptures() const;
98 QStringList capturedTexts();
99 QString cap( int nth = 0 );
100 int pos( int nth = 0 );
101 QString errorString();
102#endif
103
104 static QString escape( const QString& str );
105
106private:
107 void compile( bool caseSensitive );
108
109 static int caretIndex( int offset, CaretMode caretMode );
110
111 QRegExpEngine *eng;
112 QRegExpPrivate *priv;
113};
114#endif // QT_NO_REGEXP
115#endif // QREGEXP_H
diff --git a/qmake/include/qshared.h b/qmake/include/qshared.h
new file mode 100644
index 0000000..3c2f97f
--- a/dev/null
+++ b/qmake/include/qshared.h
@@ -0,0 +1,55 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QShared struct
5**
6** Created : 940112
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QSHARED_H
39#define QSHARED_H
40
41#ifndef QT_H
42#include "qglobal.h"
43#endif // QT_H
44
45
46struct Q_EXPORT QShared
47{
48 QShared() : count( 1 ) { }
49 void ref() { count++; }
50 bool deref(){ return !--count; }
51 uint count;
52};
53
54
55#endif // QSHARED_H
diff --git a/qmake/include/qstring.h b/qmake/include/qstring.h
new file mode 100644
index 0000000..2a87a5a
--- a/dev/null
+++ b/qmake/include/qstring.h
@@ -0,0 +1,950 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of the QString class, and related Unicode
5** functions.
6**
7** Created : 920609
8**
9** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
10**
11** This file is part of the tools module of the Qt GUI Toolkit.
12**
13** This file may be distributed under the terms of the Q Public License
14** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file.
16**
17** This file may be distributed and/or modified under the terms of the
18** GNU General Public License version 2 as published by the Free Software
19** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file.
21**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software.
25**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
27** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information.
33**
34** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you.
36**
37**********************************************************************/
38
39#ifndef QSTRING_H
40#define QSTRING_H
41
42#ifndef QT_H
43#include "qcstring.h"
44#endif // QT_H
45
46
47/*****************************************************************************
48 QString class
49 *****************************************************************************/
50
51class QRegExp;
52class QString;
53class QCharRef;
54template <class T> class QDeepCopy;
55
56class Q_EXPORT QChar {
57public:
58 QChar();
59 QChar( char c );
60 QChar( uchar c );
61 QChar( uchar c, uchar r );
62 QChar( const QChar& c );
63 QChar( ushort rc );
64 QChar( short rc );
65 QChar( uint rc );
66 QChar( int rc );
67
68 QT_STATIC_CONST QChar null; // 0000
69 QT_STATIC_CONST QChar replacement; // FFFD
70 QT_STATIC_CONST QChar byteOrderMark; // FEFF
71 QT_STATIC_CONST QChar byteOrderSwapped; // FFFE
72 QT_STATIC_CONST QChar nbsp; // 00A0
73
74 // Unicode information
75
76 enum Category
77 {
78 NoCategory,
79
80 Mark_NonSpacing, // Mn
81 Mark_SpacingCombining, // Mc
82 Mark_Enclosing, // Me
83
84 Number_DecimalDigit, // Nd
85 Number_Letter, // Nl
86 Number_Other, // No
87
88 Separator_Space, // Zs
89 Separator_Line, // Zl
90 Separator_Paragraph, // Zp
91
92 Other_Control, // Cc
93 Other_Format, // Cf
94 Other_Surrogate, // Cs
95 Other_PrivateUse, // Co
96 Other_NotAssigned, // Cn
97
98 Letter_Uppercase, // Lu
99 Letter_Lowercase, // Ll
100 Letter_Titlecase, // Lt
101 Letter_Modifier, // Lm
102 Letter_Other, // Lo
103
104 Punctuation_Connector, // Pc
105 Punctuation_Dash, // Pd
106 Punctuation_Dask = Punctuation_Dash, // oops
107 Punctuation_Open, // Ps
108 Punctuation_Close, // Pe
109 Punctuation_InitialQuote, // Pi
110 Punctuation_FinalQuote, // Pf
111 Punctuation_Other, // Po
112
113 Symbol_Math, // Sm
114 Symbol_Currency, // Sc
115 Symbol_Modifier, // Sk
116 Symbol_Other // So
117 };
118
119 enum Direction
120 {
121 DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
122 DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
123 };
124
125 enum Decomposition
126 {
127 Single, Canonical, Font, NoBreak, Initial, Medial,
128 Final, Isolated, Circle, Super, Sub, Vertical,
129 Wide, Narrow, Small, Square, Compat, Fraction
130 };
131
132 enum Joining
133 {
134 OtherJoining, Dual, Right, Center
135 };
136
137 enum CombiningClass
138 {
139 Combining_BelowLeftAttached = 200,
140 Combining_BelowAttached = 202,
141 Combining_BelowRightAttached = 204,
142 Combining_LeftAttached = 208,
143 Combining_RightAttached = 210,
144 Combining_AboveLeftAttached = 212,
145 Combining_AboveAttached = 214,
146 Combining_AboveRightAttached = 216,
147
148 Combining_BelowLeft = 218,
149 Combining_Below = 220,
150 Combining_BelowRight = 222,
151 Combining_Left = 224,
152 Combining_Right = 226,
153 Combining_AboveLeft = 228,
154 Combining_Above = 230,
155 Combining_AboveRight = 232,
156
157 Combining_DoubleBelow = 233,
158 Combining_DoubleAbove = 234,
159 Combining_IotaSubscript = 240
160 };
161
162 // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
163
164 int digitValue() const;
165 QChar lower() const;
166 QChar upper() const;
167
168 Category category() const;
169 Direction direction() const;
170 Joining joining() const;
171 bool mirrored() const;
172 QChar mirroredChar() const;
173 const QString &decomposition() const; // ### return just QString in 4.0
174 Decomposition decompositionTag() const;
175 unsigned char combiningClass() const;
176
177 char latin1() const { return ucs > 0xff ? 0 : (char) ucs; }
178 ushort unicode() const { return ucs; }
179 ushort &unicode() { return ucs; }
180#ifndef QT_NO_CAST_ASCII
181 // like all ifdef'd code this is undocumented
182 operator char() const { return latin1(); }
183#endif
184
185 bool isNull() const { return unicode()==0; }
186 bool isPrint() const;
187 bool isPunct() const;
188 bool isSpace() const;
189 bool isMark() const;
190 bool isLetter() const;
191 bool isNumber() const;
192 bool isLetterOrNumber() const;
193 bool isDigit() const;
194 bool isSymbol() const;
195
196 uchar cell() const { return ((uchar) ucs & 0xff); }
197 uchar row() const { return ((uchar) (ucs>>8)&0xff); }
198 void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; }
199 void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); }
200
201 static bool networkOrdered() {
202 int wordSize;
203 bool bigEndian = FALSE;
204 qSysInfo( &wordSize, &bigEndian );
205 return bigEndian;
206 }
207
208 friend inline bool operator==( char ch, QChar c );
209 friend inline bool operator==( QChar c, char ch );
210 friend inline bool operator==( QChar c1, QChar c2 );
211 friend inline bool operator!=( QChar c1, QChar c2 );
212 friend inline bool operator!=( char ch, QChar c );
213 friend inline bool operator!=( QChar c, char ch );
214 friend inline bool operator<=( QChar c, char ch );
215 friend inline bool operator<=( char ch, QChar c );
216 friend inline bool operator<=( QChar c1, QChar c2 );
217
218private:
219 ushort ucs;
220#if defined(QT_QSTRING_UCS_4)
221 ushort grp;
222#endif
223} Q_PACKED;
224
225inline QChar::QChar() : ucs( 0 )
226#ifdef QT_QSTRING_UCS_4
227 , grp( 0 )
228#endif
229{
230}
231inline QChar::QChar( char c ) : ucs( (uchar)c )
232#ifdef QT_QSTRING_UCS_4
233 , grp( 0 )
234#endif
235{
236}
237inline QChar::QChar( uchar c ) : ucs( c )
238#ifdef QT_QSTRING_UCS_4
239 , grp( 0 )
240#endif
241{
242}
243inline QChar::QChar( uchar c, uchar r ) : ucs( (r << 8) | c )
244#ifdef QT_QSTRING_UCS_4
245 , grp( 0 )
246#endif
247{
248}
249inline QChar::QChar( const QChar& c ) : ucs( c.ucs )
250#ifdef QT_QSTRING_UCS_4
251 , grp( c.grp )
252#endif
253{
254}
255
256inline QChar::QChar( ushort rc ) : ucs( rc )
257#ifdef QT_QSTRING_UCS_4
258 , grp( 0 )
259#endif
260{
261}
262inline QChar::QChar( short rc ) : ucs( (ushort) rc )
263#ifdef QT_QSTRING_UCS_4
264 , grp( 0 )
265#endif
266{
267}
268inline QChar::QChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) )
269#ifdef QT_QSTRING_UCS_4
270 , grp( (ushort) ((rc >> 16) & 0xffff) )
271#endif
272{
273}
274inline QChar::QChar( int rc ) : ucs( (ushort) (rc & 0xffff) )
275#ifdef QT_QSTRING_UCS_4
276 , grp( (ushort) ((rc >> 16) & 0xffff) )
277#endif
278{
279}
280
281inline bool operator==( char ch, QChar c )
282{
283 return ((uchar) ch) == c.ucs;
284}
285
286inline bool operator==( QChar c, char ch )
287{
288 return ((uchar) ch) == c.ucs;
289}
290
291inline bool operator==( QChar c1, QChar c2 )
292{
293 return c1.ucs == c2.ucs;
294}
295
296inline bool operator!=( QChar c1, QChar c2 )
297{
298 return c1.ucs != c2.ucs;
299}
300
301inline bool operator!=( char ch, QChar c )
302{
303 return ((uchar)ch) != c.ucs;
304}
305
306inline bool operator!=( QChar c, char ch )
307{
308 return ((uchar) ch) != c.ucs;
309}
310
311inline bool operator<=( QChar c, char ch )
312{
313 return c.ucs <= ((uchar) ch);
314}
315
316inline bool operator<=( char ch, QChar c )
317{
318 return ((uchar) ch) <= c.ucs;
319}
320
321inline bool operator<=( QChar c1, QChar c2 )
322{
323 return c1.ucs <= c2.ucs;
324}
325
326inline bool operator>=( QChar c, char ch ) { return ch <= c; }
327inline bool operator>=( char ch, QChar c ) { return c <= ch; }
328inline bool operator>=( QChar c1, QChar c2 ) { return c2 <= c1; }
329inline bool operator<( QChar c, char ch ) { return !(ch<=c); }
330inline bool operator<( char ch, QChar c ) { return !(c<=ch); }
331inline bool operator<( QChar c1, QChar c2 ) { return !(c2<=c1); }
332inline bool operator>( QChar c, char ch ) { return !(ch>=c); }
333inline bool operator>( char ch, QChar c ) { return !(c>=ch); }
334inline bool operator>( QChar c1, QChar c2 ) { return !(c2>=c1); }
335
336// internal
337struct Q_EXPORT QStringData : public QShared {
338 QStringData() :
339 QShared(), unicode(0), ascii(0), len(0), simpletext(1), maxl(0), dirty(0) { ref(); }
340 QStringData(QChar *u, uint l, uint m) :
341 QShared(), unicode(u), ascii(0), len(l), simpletext(1), maxl(m), dirty(1) { }
342 ~QStringData() { if ( unicode ) delete[] ((char*)unicode);
343 if ( ascii ) delete[] ascii; }
344
345 void deleteSelf();
346 QChar *unicode;
347 char *ascii;
348 void setDirty() {
349 if ( ascii ) {
350 delete [] ascii;
351 ascii = 0;
352 }
353 dirty = 1;
354 }
355#ifdef Q_OS_MAC9
356 uint len;
357#else
358 uint len : 30;
359#endif
360 uint simpletext : 1;
361#ifdef Q_OS_MAC9
362 uint maxl;
363#else
364 uint maxl : 30;
365#endif
366 uint dirty : 1;
367
368private:
369#if defined(Q_DISABLE_COPY)
370 QStringData( const QStringData& );
371 QStringData& operator=( const QStringData& );
372#endif
373};
374
375
376class Q_EXPORT QString
377{
378public:
379 QString(); // make null string
380 QString( QChar ); // one-char string
381 QString( const QString & ); // impl-shared copy
382 QString( const QByteArray& ); // deep copy
383 QString( const QChar* unicode, uint length ); // deep copy
384#ifndef QT_NO_CAST_ASCII
385 QString( const char *str ); // deep copy
386#endif
387 ~QString();
388
389 QString &operator=( const QString & ); // impl-shared copy
390#ifndef QT_NO_CAST_ASCII
391 QString &operator=( const char * ); // deep copy
392#endif
393 QString &operator=( const QCString& ); // deep copy
394 QString &operator=( QChar c );
395 QString &operator=( char c );
396
397 QT_STATIC_CONST QString null;
398
399 bool isNull() const;
400 bool isEmpty() const;
401 uint length() const;
402 void truncate( uint pos );
403
404 QString & fill( QChar c, int len = -1 );
405
406 QString copy() const;
407
408 QString arg( long a, int fieldwidth=0, int base=10 ) const;
409 QString arg( ulong a, int fieldwidth=0, int base=10 ) const;
410 QString arg( int a, int fieldwidth=0, int base=10 ) const;
411 QString arg( uint a, int fieldwidth=0, int base=10 ) const;
412 QString arg( short a, int fieldwidth=0, int base=10 ) const;
413 QString arg( ushort a, int fieldwidth=0, int base=10 ) const;
414 QString arg( char a, int fieldwidth=0 ) const;
415 QString arg( QChar a, int fieldwidth=0 ) const;
416 QString arg( const QString& a, int fieldwidth=0 ) const;
417 QString arg( double a, int fieldwidth=0, char fmt='g', int prec=-1 ) const;
418
419#ifndef QT_NO_SPRINTF
420 QString &sprintf( const char* format, ... )
421#if defined(Q_CC_GNU) && !defined(__INSURE__)
422 __attribute__ ((format (printf, 2, 3)))
423#endif
424 ;
425#endif
426
427 int find( QChar c, int index=0, bool cs=TRUE ) const;
428 int find( char c, int index=0, bool cs=TRUE ) const;
429 int find( const QString &str, int index=0, bool cs=TRUE ) const;
430#ifndef QT_NO_REGEXP
431 int find( const QRegExp &, int index=0 ) const;
432#endif
433#ifndef QT_NO_CAST_ASCII
434 int find( const char* str, int index=0 ) const;
435#endif
436 int findRev( QChar c, int index=-1, bool cs=TRUE) const;
437 int findRev( char c, int index=-1, bool cs=TRUE) const;
438 int findRev( const QString &str, int index=-1, bool cs=TRUE) const;
439#ifndef QT_NO_REGEXP
440 int findRev( const QRegExp &, int index=-1 ) const;
441#endif
442#ifndef QT_NO_CAST_ASCII
443 int findRev( const char* str, int index=-1 ) const;
444#endif
445 int contains( QChar c, bool cs=TRUE ) const;
446 int contains( char c, bool cs=TRUE ) const
447 { return contains(QChar(c), cs); }
448#ifndef QT_NO_CAST_ASCII
449 int contains( const char* str, bool cs=TRUE ) const;
450#endif
451 int contains( const QString &str, bool cs=TRUE ) const;
452#ifndef QT_NO_REGEXP
453 int contains( const QRegExp & ) const;
454#endif
455
456 enum SectionFlags {
457 SectionDefault = 0x00,
458 SectionSkipEmpty = 0x01,
459 SectionIncludeLeadingSep = 0x02,
460 SectionIncludeTrailingSep = 0x04,
461 SectionCaseInsensitiveSeps = 0x08
462 };
463 QString section( QChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
464 QString section( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
465#ifndef QT_NO_CAST_ASCII
466 QString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
467#endif
468 QString section( const QString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
469#ifndef QT_NO_REGEXP
470 QString section( const QRegExp &reg, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
471#endif
472
473 QString left( uint len ) const;
474 QString right( uint len ) const;
475 QString mid( uint index, uint len=0xffffffff) const;
476
477 QString leftJustify( uint width, QChar fill=' ', bool trunc=FALSE)const;
478 QString rightJustify( uint width, QChar fill=' ',bool trunc=FALSE)const;
479
480 QString lower() const;
481 QString upper() const;
482
483 QString stripWhiteSpace() const;
484 QString simplifyWhiteSpace() const;
485
486 QString &insert( uint index, const QString & );
487 QString &insert( uint index, const QChar*, uint len );
488 QString &insert( uint index, QChar );
489 QString &insert( uint index, char c ) { return insert(index,QChar(c)); }
490 QString &append( char );
491 QString &append( QChar );
492 QString &append( const QString & );
493#ifndef QT_NO_CAST_ASCII
494 QString &append( const QByteArray & );
495 QString &append( const char * );
496#endif
497 QString &prepend( char );
498 QString &prepend( QChar );
499 QString &prepend( const QString & );
500#ifndef QT_NO_CAST_ASCII
501 QString &prepend( const QByteArray & );
502 QString &prepend( const char * );
503#endif
504 QString &remove( uint index, uint len );
505 QString &remove( QChar c );
506 QString &remove( char c ) { return remove( QChar(c) ); }
507 QString &remove( const QString & );
508#ifndef QT_NO_REGEXP
509 QString &remove( const QRegExp & );
510#endif
511#ifndef QT_NO_CAST_ASCII
512 QString &remove( const char * );
513#endif
514 QString &replace( uint index, uint len, const QString & );
515 QString &replace( uint index, uint len, const QChar*, uint clen );
516 QString &replace( uint index, uint len, QChar );
517 QString &replace( uint index, uint len, char c )
518 { return replace( index, len, QChar(c) ); }
519 QString &replace( QChar c, const QString & );
520 QString &replace( char c, const QString & after )
521 { return replace( QChar(c), after ); }
522 QString &replace( const QString &, const QString & );
523#ifndef QT_NO_REGEXP_CAPTURE
524 QString &replace( const QRegExp &, const QString & );
525#endif
526 QString &replace( QChar, QChar );
527
528 short toShort( bool *ok=0, int base=10 ) const;
529 ushort toUShort( bool *ok=0, int base=10 ) const;
530 int toInt( bool *ok=0, int base=10 ) const;
531 uint toUInt( bool *ok=0, int base=10 ) const;
532 long toLong( bool *ok=0, int base=10 ) const;
533 ulong toULong( bool *ok=0, int base=10 ) const;
534 float toFloat( bool *ok=0 ) const;
535 double toDouble( bool *ok=0 ) const;
536
537 QString &setNum( short, int base=10 );
538 QString &setNum( ushort, int base=10 );
539 QString &setNum( int, int base=10 );
540 QString &setNum( uint, int base=10 );
541 QString &setNum( long, int base=10 );
542 QString &setNum( ulong, int base=10 );
543 QString &setNum( float, char f='g', int prec=6 );
544 QString &setNum( double, char f='g', int prec=6 );
545
546 static QString number( long, int base=10 );
547 static QString number( ulong, int base=10);
548 static QString number( int, int base=10 );
549 static QString number( uint, int base=10);
550 static QString number( double, char f='g', int prec=6 );
551
552 void setExpand( uint index, QChar c );
553
554 QString &operator+=( const QString &str );
555#ifndef QT_NO_CAST_ASCII
556 QString &operator+=( const QByteArray &str );
557 QString &operator+=( const char *str );
558#endif
559 QString &operator+=( QChar c );
560 QString &operator+=( char c );
561
562 QChar at( uint i ) const
563 { return i < d->len ? d->unicode[i] : QChar::null; }
564 QChar operator[]( int i ) const { return at((uint)i); }
565 QCharRef at( uint i );
566 QCharRef operator[]( int i );
567
568 QChar constref(uint i) const
569 { return at(i); }
570 QChar& ref(uint i)
571 { // Optimized for easy-inlining by simple compilers.
572 if ( d->count != 1 || i >= d->len )
573 subat( i );
574 d->setDirty();
575 return d->unicode[i];
576 }
577
578 const QChar* unicode() const { return d->unicode; }
579 const char* ascii() const { return latin1(); }
580 const char* latin1() const;
581 static QString fromLatin1(const char*, int len=-1);
582 QCString utf8() const;
583 static QString fromUtf8(const char*, int len=-1);
584 QCString local8Bit() const;
585 static QString fromLocal8Bit(const char*, int len=-1);
586 bool operator!() const;
587#ifndef QT_NO_ASCII_CAST
588 operator const char *() const { return latin1(); }
589#endif
590 static QString fromUcs2( const unsigned short *ucs2 );
591 const unsigned short *ucs2() const;
592
593 QString &setUnicode( const QChar* unicode, uint len );
594 QString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len );
595 QString &setLatin1( const char*, int len=-1 );
596
597 int compare( const QString& s ) const;
598 static int compare( const QString& s1, const QString& s2 )
599 { return s1.compare( s2 ); }
600
601 int localeAwareCompare( const QString& s ) const;
602 static int localeAwareCompare( const QString& s1, const QString& s2 )
603 { return s1.localeAwareCompare( s2 ); }
604
605#ifndef QT_NO_DATASTREAM
606 friend Q_EXPORT QDataStream &operator>>( QDataStream &, QString & );
607#endif
608
609 void compose();
610
611#ifndef QT_NO_COMPAT
612 const char* data() const { return latin1(); }
613#endif
614
615 bool startsWith( const QString& ) const;
616 bool endsWith( const QString& ) const;
617
618 void setLength( uint newLength );
619
620 bool simpleText() const { if ( d->dirty ) checkSimpleText(); return (bool)d->simpletext; }
621 bool isRightToLeft() const;
622
623
624private:
625 QString( int size, bool /* dummy */ );// allocate size incl. \0
626
627 void deref();
628 void real_detach();
629 void subat( uint );
630 bool findArg(int& pos, int& len) const;
631
632 void checkSimpleText() const;
633
634 static QChar* asciiToUnicode( const char*, uint * len, uint maxlen=(uint)-1 );
635 static QChar* asciiToUnicode( const QByteArray&, uint * len );
636 static char* unicodeToAscii( const QChar*, uint len );
637
638 QStringData *d;
639 static QStringData* shared_null;
640 static QStringData* makeSharedNull();
641
642 friend class QConstString;
643 friend class QTextStream;
644 QString( QStringData* dd, bool /* dummy */ ) : d(dd) { }
645
646 // needed for QDeepCopy
647 void detach();
648 friend class QDeepCopy<QString>;
649};
650
651class Q_EXPORT QCharRef {
652 friend class QString;
653 QString& s;
654 uint p;
655 QCharRef(QString* str, uint pos) : s(*str), p(pos) { }
656
657public:
658 // most QChar operations repeated here...
659
660 // all this is not documented: We just say "like QChar" and let it be.
661#ifndef Q_QDOC
662 ushort unicode() const { return s.constref(p).unicode(); }
663 char latin1() const { return s.constref(p).latin1(); }
664
665 // An operator= for each QChar cast constructor...
666 QCharRef operator=(char c ) { s.ref(p)=c; return *this; }
667 QCharRef operator=(uchar c ) { s.ref(p)=c; return *this; }
668 QCharRef operator=(QChar c ) { s.ref(p)=c; return *this; }
669 QCharRef operator=(const QCharRef& c ) { s.ref(p)=c.unicode(); return *this; }
670 QCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; }
671 QCharRef operator=(short rc ) { s.ref(p)=rc; return *this; }
672 QCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; }
673 QCharRef operator=(int rc ) { s.ref(p)=rc; return *this; }
674
675 operator QChar () const { return s.constref(p); }
676
677 // each function...
678 bool isNull() const { return unicode()==0; }
679 bool isPrint() const { return s.constref(p).isPrint(); }
680 bool isPunct() const { return s.constref(p).isPunct(); }
681 bool isSpace() const { return s.constref(p).isSpace(); }
682 bool isMark() const { return s.constref(p).isMark(); }
683 bool isLetter() const { return s.constref(p).isLetter(); }
684 bool isNumber() const { return s.constref(p).isNumber(); }
685 bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); }
686 bool isDigit() const { return s.constref(p).isDigit(); }
687
688 int digitValue() const { return s.constref(p).digitValue(); }
689 QChar lower() const { return s.constref(p).lower(); }
690 QChar upper() const { return s.constref(p).upper(); }
691
692 QChar::Category category() const { return s.constref(p).category(); }
693 QChar::Direction direction() const { return s.constref(p).direction(); }
694 QChar::Joining joining() const { return s.constref(p).joining(); }
695 bool mirrored() const { return s.constref(p).mirrored(); }
696 QChar mirroredChar() const { return s.constref(p).mirroredChar(); }
697 const QString &decomposition() const { return s.constref(p).decomposition(); }
698 QChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); }
699 unsigned char combiningClass() const { return s.constref(p).combiningClass(); }
700
701 // Not the non-const ones of these.
702 uchar cell() const { return s.constref(p).cell(); }
703 uchar row() const { return s.constref(p).row(); }
704#endif
705};
706
707inline QCharRef QString::at( uint i ) { return QCharRef(this,i); }
708inline QCharRef QString::operator[]( int i ) { return at((uint)i); }
709
710
711class Q_EXPORT QConstString : private QString {
712public:
713 QConstString( const QChar* unicode, uint length );
714 ~QConstString();
715 const QString& string() const { return *this; }
716};
717
718
719/*****************************************************************************
720 QString stream functions
721 *****************************************************************************/
722#ifndef QT_NO_DATASTREAM
723Q_EXPORT QDataStream &operator<<( QDataStream &, const QString & );
724Q_EXPORT QDataStream &operator>>( QDataStream &, QString & );
725#endif
726
727/*****************************************************************************
728 QString inline functions
729 *****************************************************************************/
730
731// These two move code into makeSharedNull() and deletesData()
732// to improve cache-coherence (and reduce code bloat), while
733// keeping the common cases fast.
734//
735// No safe way to pre-init shared_null on ALL compilers/linkers.
736inline QString::QString() :
737 d(shared_null ? shared_null : makeSharedNull())
738{
739 d->ref();
740}
741//
742inline QString::~QString()
743{
744 if ( d->deref() ) {
745 if ( d != shared_null )
746 d->deleteSelf();
747 }
748}
749
750// needed for QDeepCopy
751inline void QString::detach()
752{ real_detach(); }
753
754inline QString QString::section( QChar sep, int start, int end, int flags ) const
755{ return section(QString(sep), start, end, flags); }
756
757inline QString QString::section( char sep, int start, int end, int flags ) const
758{ return section(QChar(sep), start, end, flags); }
759
760#ifndef QT_NO_CAST_ASCII
761inline QString QString::section( const char *in_sep, int start, int end, int flags ) const
762{ return section(QString(in_sep), start, end, flags); }
763#endif
764
765inline QString &QString::operator=( QChar c )
766{ *this = QString(c); return *this; }
767
768inline QString &QString::operator=( char c )
769{ *this = QString(QChar(c)); return *this; }
770
771inline bool QString::isNull() const
772{ return unicode() == 0; }
773
774inline bool QString::operator!() const
775{ return isNull(); }
776
777inline uint QString::length() const
778{ return d->len; }
779
780inline bool QString::isEmpty() const
781{ return length() == 0; }
782
783inline QString QString::copy() const
784{ return QString( *this ); }
785
786inline QString &QString::prepend( const QString & s )
787{ return insert(0,s); }
788
789inline QString &QString::prepend( QChar c )
790{ return insert(0,c); }
791
792inline QString &QString::prepend( char c )
793{ return insert(0,c); }
794
795#ifndef QT_NO_CAST_ASCII
796inline QString &QString::prepend( const QByteArray & s )
797{ return insert(0,s.data()); }
798#endif
799
800inline QString &QString::append( const QString & s )
801{ return operator+=(s); }
802
803#ifndef QT_NO_CAST_ASCII
804inline QString &QString::append( const QByteArray &s )
805{ return operator+=(s.data()); }
806
807inline QString &QString::append( const char * s )
808{ return operator+=(s); }
809#endif
810
811inline QString &QString::append( QChar c )
812{ return operator+=(c); }
813
814inline QString &QString::append( char c )
815{ return operator+=(c); }
816
817#ifndef QT_NO_CAST_ASCII
818inline QString &QString::operator+=( const QByteArray &s )
819{ return operator+=(s.data()); }
820#endif
821
822inline QString &QString::setNum( short n, int base )
823{ return setNum((long)n, base); }
824
825inline QString &QString::setNum( ushort n, int base )
826{ return setNum((ulong)n, base); }
827
828inline QString &QString::setNum( int n, int base )
829{ return setNum((long)n, base); }
830
831inline QString &QString::setNum( uint n, int base )
832{ return setNum((ulong)n, base); }
833
834inline QString &QString::setNum( float n, char f, int prec )
835{ return setNum((double)n,f,prec); }
836
837inline QString QString::arg(int a, int fieldwidth, int base) const
838{ return arg((long)a, fieldwidth, base); }
839
840inline QString QString::arg(uint a, int fieldwidth, int base) const
841{ return arg((ulong)a, fieldwidth, base); }
842
843inline QString QString::arg(short a, int fieldwidth, int base) const
844{ return arg((long)a, fieldwidth, base); }
845
846inline QString QString::arg(ushort a, int fieldwidth, int base) const
847{ return arg((ulong)a, fieldwidth, base); }
848
849inline int QString::find( char c, int index, bool cs ) const
850{ return find(QChar(c), index, cs); }
851
852inline int QString::findRev( char c, int index, bool cs) const
853{ return findRev( QChar(c), index, cs ); }
854
855#ifndef QT_NO_CAST_ASCII
856inline int QString::find( const char* str, int index ) const
857{ return find(QString::fromLatin1(str), index); }
858
859inline int QString::findRev( const char* str, int index ) const
860{ return findRev(QString::fromLatin1(str), index); }
861#endif
862
863
864/*****************************************************************************
865 QString non-member operators
866 *****************************************************************************/
867
868Q_EXPORT bool operator!=( const QString &s1, const QString &s2 );
869Q_EXPORT bool operator<( const QString &s1, const QString &s2 );
870Q_EXPORT bool operator<=( const QString &s1, const QString &s2 );
871Q_EXPORT bool operator==( const QString &s1, const QString &s2 );
872Q_EXPORT bool operator>( const QString &s1, const QString &s2 );
873Q_EXPORT bool operator>=( const QString &s1, const QString &s2 );
874#ifndef QT_NO_CAST_ASCII
875Q_EXPORT bool operator!=( const QString &s1, const char *s2 );
876Q_EXPORT bool operator<( const QString &s1, const char *s2 );
877Q_EXPORT bool operator<=( const QString &s1, const char *s2 );
878Q_EXPORT bool operator==( const QString &s1, const char *s2 );
879Q_EXPORT bool operator>( const QString &s1, const char *s2 );
880Q_EXPORT bool operator>=( const QString &s1, const char *s2 );
881Q_EXPORT bool operator!=( const char *s1, const QString &s2 );
882Q_EXPORT bool operator<( const char *s1, const QString &s2 );
883Q_EXPORT bool operator<=( const char *s1, const QString &s2 );
884Q_EXPORT bool operator==( const char *s1, const QString &s2 );
885//Q_EXPORT bool operator>( const char *s1, const QString &s2 ); // MSVC++
886Q_EXPORT bool operator>=( const char *s1, const QString &s2 );
887#endif
888
889Q_EXPORT inline const QString operator+( const QString &s1, const QString &s2 )
890{
891 QString tmp( s1 );
892 tmp += s2;
893 return tmp;
894}
895
896#ifndef QT_NO_CAST_ASCII
897Q_EXPORT inline const QString operator+( const QString &s1, const char *s2 )
898{
899 QString tmp( s1 );
900 tmp += QString::fromLatin1(s2);
901 return tmp;
902}
903
904Q_EXPORT inline const QString operator+( const char *s1, const QString &s2 )
905{
906 QString tmp = QString::fromLatin1( s1 );
907 tmp += s2;
908 return tmp;
909}
910#endif
911
912Q_EXPORT inline const QString operator+( const QString &s1, QChar c2 )
913{
914 QString tmp( s1 );
915 tmp += c2;
916 return tmp;
917}
918
919Q_EXPORT inline const QString operator+( const QString &s1, char c2 )
920{
921 QString tmp( s1 );
922 tmp += c2;
923 return tmp;
924}
925
926Q_EXPORT inline const QString operator+( QChar c1, const QString &s2 )
927{
928 QString tmp;
929 tmp += c1;
930 tmp += s2;
931 return tmp;
932}
933
934Q_EXPORT inline const QString operator+( char c1, const QString &s2 )
935{
936 QString tmp;
937 tmp += c1;
938 tmp += s2;
939 return tmp;
940}
941
942#if defined(Q_OS_WIN32)
943extern Q_EXPORT QString qt_winQString(void*);
944extern Q_EXPORT const void* qt_winTchar(const QString& str, bool addnul);
945extern Q_EXPORT void* qt_winTchar_new(const QString& str);
946extern Q_EXPORT QCString qt_winQString2MB( const QString& s, int len=-1 );
947extern Q_EXPORT QString qt_winMB2QString( const char* mb, int len=-1 );
948#endif
949
950#endif // QSTRING_H
diff --git a/qmake/include/qstringlist.h b/qmake/include/qstringlist.h
new file mode 100644
index 0000000..be9d6ae
--- a/dev/null
+++ b/qmake/include/qstringlist.h
@@ -0,0 +1,86 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QStringList class
5**
6** Created : 990406
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QSTRINGLIST_H
39#define QSTRINGLIST_H
40
41#ifndef QT_H
42#include "qvaluelist.h"
43#include "qstring.h"
44#include "qstrlist.h"
45#endif // QT_H
46
47#ifndef QT_NO_STRINGLIST
48
49class QRegExp;
50
51class Q_EXPORT QStringList : public QValueList<QString>
52{
53public:
54 QStringList() { }
55 QStringList( const QStringList& l ) : QValueList<QString>(l) { }
56 QStringList( const QValueList<QString>& l ) : QValueList<QString>(l) { }
57 QStringList( const QString& i ) { append(i); }
58#ifndef QT_NO_CAST_ASCII
59 QStringList( const char* i ) { append(i); }
60#endif
61
62 static QStringList fromStrList(const QStrList&);
63
64 void sort();
65
66 static QStringList split( const QString &sep, const QString &str, bool allowEmptyEntries = FALSE );
67 static QStringList split( const QChar &sep, const QString &str, bool allowEmptyEntries = FALSE );
68#ifndef QT_NO_REGEXP
69 static QStringList split( const QRegExp &sep, const QString &str, bool allowEmptyEntries = FALSE );
70#endif
71 QString join( const QString &sep ) const;
72
73 QStringList grep( const QString &str, bool cs = TRUE ) const;
74#ifndef QT_NO_REGEXP
75 QStringList grep( const QRegExp &expr ) const;
76#endif
77};
78
79#ifndef QT_NO_DATASTREAM
80class QDataStream;
81extern Q_EXPORT QDataStream &operator>>( QDataStream &, QStringList& );
82extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QStringList& );
83#endif
84
85#endif // QT_NO_STRINGLIST
86#endif // QSTRINGLIST_H
diff --git a/qmake/include/qstrlist.h b/qmake/include/qstrlist.h
new file mode 100644
index 0000000..86de328
--- a/dev/null
+++ b/qmake/include/qstrlist.h
@@ -0,0 +1,112 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QStrList, QStrIList and QStrListIterator classes
5**
6** Created : 920730
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QSTRLIST_H
39#define QSTRLIST_H
40
41#ifndef QT_H
42#include "qstring.h"
43#include "qptrlist.h"
44#include "qdatastream.h"
45#endif // QT_H
46
47
48#if defined(Q_TEMPLATEDLL)
49Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<char>;
50Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrListIterator<char>;
51#endif
52
53#if defined(Q_QDOC)
54class QStrListIterator : public QPtrListIterator<char>
55{
56};
57#else
58typedef QPtrListIterator<char> QStrListIterator;
59#endif
60
61class Q_EXPORT QStrList : public QPtrList<char>
62{
63public:
64 QStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; }
65 QStrList( const QStrList & );
66 ~QStrList() { clear(); }
67 QStrList& operator=( const QStrList & );
68
69private:
70 QPtrCollection::Item newItem( QPtrCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; }
71 void deleteItem( QPtrCollection::Item d ) { if ( del_item ) delete[] (char*)d; }
72 int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ) { return qstrcmp((const char*)s1,
73 (const char*)s2); }
74#ifndef QT_NO_DATASTREAM
75 QDataStream &read( QDataStream &s, QPtrCollection::Item &d )
76 { s >> (char *&)d; return s; }
77 QDataStream &write( QDataStream &s, QPtrCollection::Item d ) const
78 { return s << (const char *)d; }
79#endif
80 bool dc;
81};
82
83
84 class Q_EXPORT QStrIList : public QStrList// case insensitive string list
85{
86public:
87 QStrIList( bool deepCopies=TRUE ) : QStrList( deepCopies ) {}
88 ~QStrIList() { clear(); }
89private:
90 int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 )
91 { return qstricmp((const char*)s1,
92 (const char*)s2); }
93};
94
95
96inline QStrList & QStrList::operator=( const QStrList &strList )
97{
98 clear();
99 dc = strList.dc;
100 del_item = dc;
101 QPtrList<char>::operator=( strList );
102 return *this;
103}
104
105inline QStrList::QStrList( const QStrList &strList )
106 : QPtrList<char>( strList )
107{
108 dc = FALSE;
109 operator=( strList );
110}
111
112#endif // QSTRLIST_H
diff --git a/qmake/include/qtextcodec.h b/qmake/include/qtextcodec.h
new file mode 100644
index 0000000..149b5cb
--- a/dev/null
+++ b/qmake/include/qtextcodec.h
@@ -0,0 +1,114 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QTextCodec class
5**
6** Created : 981015
7**
8** Copyright (C) 1998-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QTEXTCODEC_H
39#define QTEXTCODEC_H
40
41#ifndef QT_H
42#include "qstring.h"
43#endif // QT_H
44
45#ifndef QT_NO_TEXTCODEC
46
47class QTextCodec;
48class QIODevice;
49class QFont;
50
51class Q_EXPORT QTextEncoder {
52public:
53 virtual ~QTextEncoder();
54 virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0;
55};
56
57class Q_EXPORT QTextDecoder {
58public:
59 virtual ~QTextDecoder();
60 virtual QString toUnicode(const char* chars, int len) = 0;
61};
62
63class Q_EXPORT QTextCodec {
64public:
65 virtual ~QTextCodec();
66
67#ifndef QT_NO_CODECS
68 static QTextCodec* loadCharmap(QIODevice*);
69 static QTextCodec* loadCharmapFile(QString filename);
70#endif //QT_NO_CODECS
71 static QTextCodec* codecForMib(int mib);
72 static QTextCodec* codecForName(const char* hint, int accuracy=0);
73 static QTextCodec* codecForContent(const char* chars, int len);
74 static QTextCodec* codecForIndex(int i);
75 static QTextCodec* codecForLocale();
76 static void setCodecForLocale(QTextCodec *c);
77
78 static void deleteAllCodecs();
79
80 static const char* locale();
81
82 virtual const char* name() const = 0;
83 virtual const char* mimeName() const;
84 virtual int mibEnum() const = 0;
85
86 virtual QTextDecoder* makeDecoder() const;
87 virtual QTextEncoder* makeEncoder() const;
88
89 virtual QString toUnicode(const char* chars, int len) const;
90 virtual QCString fromUnicode(const QString& uc, int& lenInOut) const;
91
92 QCString fromUnicode(const QString& uc) const;
93 QString toUnicode(const QByteArray&, int len) const;
94 QString toUnicode(const QByteArray&) const;
95 QString toUnicode(const QCString&, int len) const;
96 QString toUnicode(const QCString&) const;
97 QString toUnicode(const char* chars) const;
98 virtual bool canEncode( QChar ) const;
99 virtual bool canEncode( const QString& ) const;
100
101 virtual int heuristicContentMatch(const char* chars, int len) const = 0;
102 virtual int heuristicNameMatch(const char* hint) const;
103
104 virtual QByteArray fromUnicode(const QString& uc, int from, int len) const;
105 virtual unsigned short characterFromUnicode(const QString &str, int pos) const;
106
107protected:
108 QTextCodec();
109 static int simpleHeuristicNameMatch(const char* name, const char* hint);
110
111 friend class QFont;
112};
113#endif // QT_NO_TEXTCODEC
114#endif // QTEXTCODEC_H
diff --git a/qmake/include/qtextstream.h b/qmake/include/qtextstream.h
new file mode 100644
index 0000000..6979ed7
--- a/dev/null
+++ b/qmake/include/qtextstream.h
@@ -0,0 +1,335 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QTextStream class
5**
6** Created : 940922
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QTEXTSTREAM_H
39#define QTEXTSTREAM_H
40
41#ifndef QT_H
42#include "qiodevice.h"
43#include "qstring.h"
44#include <stdio.h>
45#endif // QT_H
46
47#ifndef QT_NO_TEXTSTREAM
48class QTextCodec;
49class QTextDecoder;
50
51class QTextStreamPrivate;
52
53 class Q_EXPORT QTextStream // text stream class
54{
55public:
56 enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
57 UnicodeReverse, RawUnicode, UnicodeUTF8 };
58
59 voidsetEncoding( Encoding );
60#ifndef QT_NO_TEXTCODEC
61 voidsetCodec( QTextCodec* );
62 QTextCodec *codec();
63#endif
64
65 QTextStream();
66 QTextStream( QIODevice * );
67 QTextStream( QString*, int mode );
68 QTextStream( QString&, int mode ); // obsolete
69 QTextStream( QByteArray, int mode );
70 QTextStream( FILE *, int mode );
71 virtual ~QTextStream();
72
73 QIODevice*device() const;
74 void setDevice( QIODevice * );
75 void unsetDevice();
76
77 bool atEnd() const;
78 bool eof() const;
79
80 QTextStream &operator>>( QChar & );
81 QTextStream &operator>>( char & );
82 QTextStream &operator>>( signed short & );
83 QTextStream &operator>>( unsigned short & );
84 QTextStream &operator>>( signed int & );
85 QTextStream &operator>>( unsigned int & );
86 QTextStream &operator>>( signed long & );
87 QTextStream &operator>>( unsigned long & );
88 QTextStream &operator>>( float & );
89 QTextStream &operator>>( double & );
90 QTextStream &operator>>( char * );
91 QTextStream &operator>>( QString & );
92 QTextStream &operator>>( QCString & );
93
94 QTextStream &operator<<( QChar );
95 QTextStream &operator<<( char );
96 QTextStream &operator<<( signed short );
97 QTextStream &operator<<( unsigned short );
98 QTextStream &operator<<( signed int );
99 QTextStream &operator<<( unsigned int );
100 QTextStream &operator<<( signed long );
101 QTextStream &operator<<( unsigned long );
102 QTextStream &operator<<( float );
103 QTextStream &operator<<( double );
104 QTextStream &operator<<( const char* );
105 QTextStream &operator<<( const QString & );
106 QTextStream &operator<<( const QCString & );
107 QTextStream &operator<<( void * ); // any pointer
108
109 QTextStream &readRawBytes( char *, uint len );
110 QTextStream &writeRawBytes( const char* , uint len );
111
112 QStringreadLine();
113 QStringread();
114 voidskipWhiteSpace();
115
116 enum {
117 skipws = 0x0001, // skip whitespace on input
118 left = 0x0002, // left-adjust output
119 right = 0x0004, // right-adjust output
120 internal = 0x0008, // pad after sign
121 bin = 0x0010, // binary format integer
122 oct = 0x0020, // octal format integer
123 dec = 0x0040, // decimal format integer
124 hex = 0x0080, // hex format integer
125 showbase = 0x0100, // show base indicator
126 showpoint = 0x0200, // force decimal point (float)
127 uppercase = 0x0400, // upper-case hex output
128 showpos = 0x0800, // add '+' to positive integers
129 scientific= 0x1000, // scientific float output
130 fixed = 0x2000 // fixed float output
131 };
132
133 static const int basefield; // bin | oct | dec | hex
134 static const int adjustfield; // left | right | internal
135 static const int floatfield; // scientific | fixed
136
137 int flags() const;
138 int flags( int f );
139 int setf( int bits );
140 int setf( int bits, int mask );
141 int unsetf( int bits );
142
143 void reset();
144
145 int width()const;
146 int width( int );
147 int fill()const;
148 int fill( int );
149 int precision()const;
150 int precision( int );
151
152private:
153 longinput_int();
154 voidinit();
155 QTextStream &output_int( int, ulong, bool );
156 QIODevice*dev;
157
158 int fflags;
159 int fwidth;
160 int fillchar;
161 int fprec;
162 booldoUnicodeHeader;
163 boolowndev;
164 QTextCodec *mapper;
165 QTextStreamPrivate * d;
166 QCharunused1; // ### remove in Qt 4.0
167 boollatin1;
168 bool internalOrder;
169 boolnetworkOrder;
170 void*unused2; // ### remove in Qt 4.0
171
172 QChareat_ws();
173 uint ts_getline( QChar* );
174 voidts_ungetc( QChar );
175 QCharts_getc();
176 uintts_getbuf( QChar*, uint );
177 voidts_putc(int);
178 voidts_putc(QChar);
179 boolts_isspace(QChar);
180 boolts_isdigit(QChar);
181 ulonginput_bin();
182 ulonginput_oct();
183 ulonginput_dec();
184 ulonginput_hex();
185 doubleinput_double();
186 QTextStream &writeBlock( const char* p, uint len );
187 QTextStream &writeBlock( const QChar* p, uint len );
188
189 private:// Disabled copy constructor and operator=
190#if defined(Q_DISABLE_COPY)
191 QTextStream( const QTextStream & );
192 QTextStream &operator=( const QTextStream & );
193#endif
194};
195
196typedef QTextStream QTS;
197
198class Q_EXPORT QTextIStream : public QTextStream {
199public:
200 QTextIStream( const QString* s ) :
201 QTextStream((QString*)s,IO_ReadOnly) { }
202 QTextIStream( QByteArray ba ) :
203 QTextStream(ba,IO_ReadOnly) { }
204 QTextIStream( FILE *f ) :
205 QTextStream(f,IO_ReadOnly) { }
206
207 private:// Disabled copy constructor and operator=
208#if defined(Q_DISABLE_COPY)
209 QTextIStream( const QTextIStream & );
210 QTextIStream &operator=( const QTextIStream & );
211#endif
212};
213
214class Q_EXPORT QTextOStream : public QTextStream {
215public:
216 QTextOStream( QString* s ) :
217 QTextStream(s,IO_WriteOnly) { }
218 QTextOStream( QByteArray ba ) :
219 QTextStream(ba,IO_WriteOnly) { }
220 QTextOStream( FILE *f ) :
221 QTextStream(f,IO_WriteOnly) { }
222
223 private:// Disabled copy constructor and operator=
224#if defined(Q_DISABLE_COPY)
225 QTextOStream( const QTextOStream & );
226 QTextOStream &operator=( const QTextOStream & );
227#endif
228};
229
230/*****************************************************************************
231 QTextStream inline functions
232 *****************************************************************************/
233
234inline QIODevice *QTextStream::device() const
235{ return dev; }
236
237inline bool QTextStream::atEnd() const
238{ return dev ? dev->atEnd() : FALSE; }
239
240inline bool QTextStream::eof() const
241{ return atEnd(); }
242
243inline int QTextStream::flags() const
244{ return fflags; }
245
246inline int QTextStream::flags( int f )
247{ int oldf = fflags; fflags = f; return oldf; }
248
249inline int QTextStream::setf( int bits )
250{ int oldf = fflags; fflags |= bits; return oldf; }
251
252inline int QTextStream::setf( int bits, int mask )
253{ int oldf = fflags; fflags = (fflags & ~mask) | (bits & mask); return oldf; }
254
255inline int QTextStream::unsetf( int bits )
256 { int oldf = fflags; fflags &= ~bits;return oldf; }
257
258inline int QTextStream::width() const
259{ return fwidth; }
260
261inline int QTextStream::width( int w )
262 { int oldw = fwidth; fwidth = w; return oldw; }
263
264inline int QTextStream::fill() const
265{ return fillchar; }
266
267inline int QTextStream::fill( int f )
268 { int oldc = fillchar;fillchar = f; return oldc; }
269
270inline int QTextStream::precision() const
271{ return fprec; }
272
273inline int QTextStream::precision( int p )
274 { int oldp = fprec; fprec = p; return oldp; }
275
276/*!
277 Returns one character from the stream, or EOF.
278*/
279inline QChar QTextStream::ts_getc()
280{ QChar r; return ( ts_getbuf( &r,1 ) == 1 ? r : QChar((ushort)0xffff) ); }
281
282/*****************************************************************************
283 QTextStream manipulators
284 *****************************************************************************/
285
286typedef QTextStream & (*QTSFUNC)(QTextStream &);// manipulator function
287 typedef int (QTextStream::*QTSMFI)(int);// manipulator w/int argument
288
289 class Q_EXPORT QTSManip { // text stream manipulator
290public:
291 QTSManip( QTSMFI m, int a ) { mf=m; arg=a; }
292 void exec( QTextStream &s ) { (s.*mf)(arg); }
293private:
294 QTSMFI mf; // QTextStream member function
295 int arg; // member function argument
296};
297
298Q_EXPORT inline QTextStream &operator>>( QTextStream &s, QTSFUNC f )
299{ return (*f)( s ); }
300
301Q_EXPORT inline QTextStream &operator<<( QTextStream &s, QTSFUNC f )
302{ return (*f)( s ); }
303
304Q_EXPORT inline QTextStream &operator<<( QTextStream &s, QTSManip m )
305{ m.exec(s); return s; }
306
307 Q_EXPORT QTextStream &bin( QTextStream &s );// set bin notation
308 Q_EXPORT QTextStream &oct( QTextStream &s );// set oct notation
309 Q_EXPORT QTextStream &dec( QTextStream &s );// set dec notation
310 Q_EXPORT QTextStream &hex( QTextStream &s );// set hex notation
311 Q_EXPORT QTextStream &endl( QTextStream &s );// insert EOL ('\n')
312 Q_EXPORT QTextStream &flush( QTextStream &s );// flush output
313 Q_EXPORT QTextStream &ws( QTextStream &s );// eat whitespace on input
314 Q_EXPORT QTextStream &reset( QTextStream &s );// set default flags
315
316Q_EXPORT inline QTSManip qSetW( int w )
317{
318 QTSMFI func = &QTextStream::width;
319 return QTSManip(func,w);
320}
321
322Q_EXPORT inline QTSManip qSetFill( int f )
323{
324 QTSMFI func = &QTextStream::fill;
325 return QTSManip(func,f);
326}
327
328Q_EXPORT inline QTSManip qSetPrecision( int p )
329{
330 QTSMFI func = &QTextStream::precision;
331 return QTSManip(func,p);
332}
333
334#endif // QT_NO_TEXTSTREAM
335#endif // QTEXTSTREAM_H
diff --git a/qmake/include/qtl.h b/qmake/include/qtl.h
new file mode 100644
index 0000000..346cecc
--- a/dev/null
+++ b/qmake/include/qtl.h
@@ -0,0 +1,321 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of Qt template library classes
5**
6** Created : 990128
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QTL_H
39#define QTL_H
40
41#ifndef QT_H
42#include "qglobal.h"
43#include "qtextstream.h"
44#include "qstring.h"
45#endif // QT_H
46
47#ifndef QT_NO_TEXTSTREAM
48template <class T>
49class QTextOStreamIterator
50{
51protected:
52 QTextOStream& stream;
53 QString separator;
54
55public:
56 QTextOStreamIterator( QTextOStream& s) : stream( s ) {}
57 QTextOStreamIterator( QTextOStream& s, const QString& sep )
58 : stream( s ), separator( sep ) {}
59 QTextOStreamIterator<T>& operator= ( const T& x ) {
60 stream << x;
61 if ( !separator.isEmpty() )
62 stream << separator;
63 return *this;
64 }
65 QTextOStreamIterator<T>& operator*() { return *this; }
66 QTextOStreamIterator<T>& operator++() { return *this; }
67 QTextOStreamIterator<T>& operator++(int) { return *this; }
68};
69#endif //QT_NO_TEXTSTREAM
70
71template <class InputIterator, class OutputIterator>
72inline OutputIterator qCopy( InputIterator _begin, InputIterator _end,
73 OutputIterator _dest )
74{
75 while( _begin != _end )
76 *_dest++ = *_begin++;
77 return _dest;
78}
79
80template <class BiIterator, class BiOutputIterator>
81inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end,
82 BiOutputIterator _dest )
83{
84 while ( _begin != _end )
85 *--_dest = *--_end;
86 return _dest;
87}
88
89template <class InputIterator1, class InputIterator2>
90inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 )
91{
92 for ( ; first1 != last1; ++first1, ++first2 )
93 if ( *first1 != *first2 )
94 return FALSE;
95 return TRUE;
96}
97
98template <class ForwardIterator, class T>
99inline void qFill( ForwardIterator first, ForwardIterator last, const T& val )
100{
101 for ( ; first != last; ++first )
102 *first = val;
103}
104
105#if 0
106template <class BiIterator, class OutputIterator>
107inline OutputIterator qReverseCopy( BiIterator _begin, BiIterator _end,
108 OutputIterator _dest )
109{
110 while ( _begin != _end ) {
111 --_end;
112 *_dest = *_end;
113 ++_dest;
114 }
115 return _dest;
116}
117#endif
118
119
120template <class InputIterator, class T>
121inline InputIterator qFind( InputIterator first, InputIterator last,
122 const T& val )
123{
124 while ( first != last && *first != val )
125 ++first;
126 return first;
127}
128
129template <class InputIterator, class T, class Size>
130inline void qCount( InputIterator first, InputIterator last, const T& value,
131 Size& n )
132{
133 for ( ; first != last; ++first )
134 if ( *first == value )
135 ++n;
136}
137
138template <class T>
139inline void qSwap( T& _value1, T& _value2 )
140{
141 T tmp = _value1;
142 _value1 = _value2;
143 _value2 = tmp;
144}
145
146
147template <class InputIterator>
148Q_INLINE_TEMPLATES void qBubbleSort( InputIterator b, InputIterator e )
149{
150 // Goto last element;
151 InputIterator last = e;
152 --last;
153 // only one element or no elements ?
154 if ( last == b )
155 return;
156
157 // So we have at least two elements in here
158 while( b != last ) {
159 bool swapped = FALSE;
160 InputIterator swap_pos = b;
161 InputIterator x = e;
162 InputIterator y = x;
163 y--;
164 do {
165 --x;
166 --y;
167 if ( *x < *y ) {
168 swapped = TRUE;
169 qSwap( *x, *y );
170 swap_pos = y;
171 }
172 } while( y != b );
173 if ( !swapped )
174 return;
175 b = swap_pos;
176 b++;
177 }
178}
179
180
181template <class Container>
182inline void qBubbleSort( Container &c )
183{
184 qBubbleSort( c.begin(), c.end() );
185}
186
187
188template <class Value>
189Q_INLINE_TEMPLATES void qHeapSortPushDown( Value* heap, int first, int last )
190{
191 int r = first;
192 while ( r <= last / 2 ) {
193 if ( last == 2 * r ) {
194 // node r has only one child
195 if ( heap[2 * r] < heap[r] )
196 qSwap( heap[r], heap[2 * r] );
197 r = last;
198 } else {
199 // node r has two children
200 if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) {
201 // swap with left child
202 qSwap( heap[r], heap[2 * r] );
203 r *= 2;
204 } else if ( heap[2 * r + 1] < heap[r]
205 && heap[2 * r + 1] < heap[2 * r] ) {
206 // swap with right child
207 qSwap( heap[r], heap[2 * r + 1] );
208 r = 2 * r + 1;
209 } else {
210 r = last;
211 }
212 }
213 }
214}
215
216
217template <class InputIterator, class Value>
218Q_INLINE_TEMPLATES void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n )
219{
220 // Create the heap
221 InputIterator insert = b;
222 Value* realheap = new Value[n];
223 // Wow, what a fake. But I want the heap to be indexed as 1...n
224 Value* heap = realheap - 1;
225 int size = 0;
226 for( ; insert != e; ++insert ) {
227 heap[++size] = *insert;
228 int i = size;
229 while( i > 1 && heap[i] < heap[i / 2] ) {
230 qSwap( heap[i], heap[i / 2] );
231 i /= 2;
232 }
233 }
234
235 // Now do the sorting
236 for( uint i = n; i > 0; i-- ) {
237 *b++ = heap[1];
238 if ( i > 1 ) {
239 heap[1] = heap[i];
240 qHeapSortPushDown( heap, 1, (int)i - 1 );
241 }
242 }
243
244 delete[] realheap;
245}
246
247
248template <class InputIterator>
249Q_INLINE_TEMPLATES void qHeapSort( InputIterator b, InputIterator e )
250{
251 // Empty ?
252 if ( b == e )
253 return;
254
255 // How many entries have to be sorted ?
256 InputIterator it = b;
257 uint n = 0;
258 while ( it != e ) {
259 ++n;
260 ++it;
261 }
262
263 // The second last parameter is a hack to retrieve the value type
264 // Do the real sorting here
265 qHeapSortHelper( b, e, *b, n );
266}
267
268
269template <class Container>
270Q_INLINE_TEMPLATES void qHeapSort( Container &c )
271{
272 if ( c.begin() == c.end() )
273 return;
274
275 // The second last parameter is a hack to retrieve the value type
276 // Do the real sorting here
277 qHeapSortHelper( c.begin(), c.end(), *(c.begin()), (uint)c.count() );
278}
279
280template <class Container>
281class QBackInsertIterator
282{
283public:
284 Q_EXPLICIT QBackInsertIterator( Container &c )
285 : container( &c )
286 {
287 }
288
289 QBackInsertIterator<Container>&
290 operator=( const Q_TYPENAME Container::value_type &value )
291 {
292 container->push_back( value );
293 return *this;
294 }
295
296 QBackInsertIterator<Container>& operator*()
297 {
298 return *this;
299 }
300
301 QBackInsertIterator<Container>& operator++()
302 {
303 return *this;
304 }
305
306 QBackInsertIterator<Container>& operator++(int)
307 {
308 return *this;
309 }
310
311protected:
312 Container *container;
313};
314
315template <class Container>
316inline QBackInsertIterator<Container> qBackInserter( Container &c )
317{
318 return QBackInsertIterator<Container>( c );
319}
320
321#endif
diff --git a/qmake/include/quuid.h b/qmake/include/quuid.h
new file mode 100644
index 0000000..591d2f1
--- a/dev/null
+++ b/qmake/include/quuid.h
@@ -0,0 +1,168 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QUuid class
5**
6** Created: 010523
7**
8** Copyright (C) 1992-2001 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QUUID_H
39#define QUUID_H
40
41#ifndef QT_H
42#include <qstring.h>
43#endif // QT_H
44
45#include <string.h>
46
47#if defined(Q_OS_WIN32)
48#ifndef GUID_DEFINED
49#define GUID_DEFINED
50typedef struct _GUID
51{
52 ulong Data1;
53 ushort Data2;
54 ushort Data3;
55 uchar Data4[ 8 ];
56} GUID;
57#endif
58#endif
59
60struct Q_EXPORT QUuid
61{
62 QUuid()
63 {
64 memset( this, 0, sizeof(QUuid) );
65 }
66 QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 )
67 {
68 data1 = l;
69 data2 = w1;
70 data3 = w2;
71 data4[0] = b1;
72 data4[1] = b2;
73 data4[2] = b3;
74 data4[3] = b4;
75 data4[4] = b5;
76 data4[5] = b6;
77 data4[6] = b7;
78 data4[7] = b8;
79 }
80 QUuid( const QUuid &uuid )
81 {
82 memcpy( this, &uuid, sizeof(QUuid) );
83 }
84#ifndef QT_NO_QUUID_STRING
85 QUuid( const QString & );
86 QUuid( const char * );
87 QString toString() const;
88 operator QString() const { return toString(); }
89#endif
90 bool isNull() const;
91
92 QUuid &operator=(const QUuid &orig )
93 {
94 memcpy( this, &orig, sizeof(QUuid) );
95 return *this;
96 }
97
98 bool operator==(const QUuid &orig ) const
99 {
100 uint i;
101 if ( data1 != orig.data1 || data2 != orig.data2 ||
102 data3 != orig.data3 )
103 return FALSE;
104
105 for( i = 0; i < 8; i++ )
106 if ( data4[i] != orig.data4[i] )
107 return FALSE;
108
109 return TRUE;
110 }
111
112 bool operator!=(const QUuid &orig ) const
113 {
114 return !( *this == orig );
115 }
116
117#if defined(Q_OS_WIN32)
118 // On Windows we have a type GUID that is used by the platform API, so we
119 // provide convenience operators to cast from and to this type.
120 QUuid( const GUID &guid )
121 {
122 memcpy( this, &guid, sizeof(GUID) );
123 }
124
125 QUuid &operator=(const GUID &orig )
126 {
127 memcpy( this, &orig, sizeof(QUuid) );
128 return *this;
129 }
130
131 operator GUID() const
132 {
133 GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } };
134 return guid;
135 }
136
137 bool operator==( const GUID &guid ) const
138 {
139 uint i;
140 if ( data1 != guid.Data1 || data2 != guid.Data2 ||
141 data3 != guid.Data3 )
142 return FALSE;
143
144 for( i = 0; i < 8; i++ )
145 if ( data4[i] != guid.Data4[i] )
146 return FALSE;
147
148 return TRUE;
149 }
150
151 bool operator!=( const GUID &guid ) const
152 {
153 return !( *this == guid );
154 }
155#endif
156
157 uint data1;
158 ushort data2;
159 ushort data3;
160 uchar data4[ 8 ];
161};
162
163#ifndef QT_NO_DATASTREAM
164Q_EXPORT QDataStream &operator<<( QDataStream &, const QUuid & );
165Q_EXPORT QDataStream &operator>>( QDataStream &, QUuid & );
166#endif
167
168#endif //QUUID_H
diff --git a/qmake/include/qvaluelist.h b/qmake/include/qvaluelist.h
new file mode 100644
index 0000000..54f7aec
--- a/dev/null
+++ b/qmake/include/qvaluelist.h
@@ -0,0 +1,665 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QValueList class
5**
6** Created : 990406
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QVALUELIST_H
39#define QVALUELIST_H
40
41#ifndef QT_H
42#include "qtl.h"
43#include "qshared.h"
44#include "qdatastream.h"
45#endif // QT_H
46
47#ifndef QT_NO_STL
48#include <iterator>
49#include <list>
50#endif
51
52//#define QT_CHECK_VALUELIST_RANGE
53
54#if defined(Q_CC_MSVC)
55#pragma warning(disable:4284) // "return type for operator -> is not a UDT"
56#endif
57
58template <class T>
59class QValueListNode
60{
61public:
62 QValueListNode( const T& t ) : data( t ) { }
63 QValueListNode() { }
64#if defined(Q_TEMPLATEDLL)
65 // Workaround MS bug in memory de/allocation in DLL vs. EXE
66 virtual ~QValueListNode() { }
67#endif
68
69 QValueListNode<T>* next;
70 QValueListNode<T>* prev;
71 T data;
72};
73
74template<class T>
75class QValueListIterator
76{
77 public:
78 /**
79 * Typedefs
80 */
81 typedef QValueListNode<T>* NodePtr;
82#ifndef QT_NO_STL
83 typedef std::bidirectional_iterator_tag iterator_category;
84#endif
85 typedef T value_type;
86 typedef size_t size_type;
87#ifndef QT_NO_STL
88 typedef ptrdiff_t difference_type;
89#else
90 typedef int difference_type;
91#endif
92 typedef T* pointer;
93 typedef T& reference;
94
95 /**
96 * Variables
97 */
98 NodePtr node;
99
100 /**
101 * Functions
102 */
103 QValueListIterator() : node( 0 ) {}
104 QValueListIterator( NodePtr p ) : node( p ) {}
105 QValueListIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
106
107 bool operator==( const QValueListIterator<T>& it ) const { return node == it.node; }
108 bool operator!=( const QValueListIterator<T>& it ) const { return node != it.node; }
109 const T& operator*() const { return node->data; }
110 T& operator*() { return node->data; }
111 // UDT for T = x*
112 // T* operator->() const { return &node->data; }
113
114 QValueListIterator<T>& operator++() {
115 node = node->next;
116 return *this;
117 }
118
119 QValueListIterator<T> operator++(int) {
120 QValueListIterator<T> tmp = *this;
121 node = node->next;
122 return tmp;
123 }
124
125 QValueListIterator<T>& operator--() {
126 node = node->prev;
127 return *this;
128 }
129
130 QValueListIterator<T> operator--(int) {
131 QValueListIterator<T> tmp = *this;
132 node = node->prev;
133 return tmp;
134 }
135
136 QValueListIterator<T>& operator+=( int j ) {
137 while ( j-- )
138 node = node->next;
139 return *this;
140 }
141
142 QValueListIterator<T>& operator-=( int j ) {
143 while ( j-- )
144 node = node->prev;
145 return *this;
146 }
147
148};
149
150template<class T>
151class QValueListConstIterator
152{
153 public:
154 /**
155 * Typedefs
156 */
157 typedef QValueListNode<T>* NodePtr;
158#ifndef QT_NO_STL
159 typedef std::bidirectional_iterator_tag iterator_category;
160#endif
161 typedef T value_type;
162 typedef size_t size_type;
163#ifndef QT_NO_STL
164 typedef ptrdiff_t difference_type;
165#else
166 typedef int difference_type;
167#endif
168 typedef const T* pointer;
169 typedef const T& reference;
170
171 /**
172 * Variables
173 */
174 NodePtr node;
175
176 /**
177 * Functions
178 */
179 QValueListConstIterator() : node( 0 ) {}
180 QValueListConstIterator( NodePtr p ) : node( p ) {}
181 QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {}
182 QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
183
184 bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; }
185 bool operator!=( const QValueListConstIterator<T>& it ) const { return node != it.node; }
186 const T& operator*() const { return node->data; }
187 // UDT for T = x*
188 // const T* operator->() const { return &node->data; }
189
190 QValueListConstIterator<T>& operator++() {
191 node = node->next;
192 return *this;
193 }
194
195 QValueListConstIterator<T> operator++(int) {
196 QValueListConstIterator<T> tmp = *this;
197 node = node->next;
198 return tmp;
199 }
200
201 QValueListConstIterator<T>& operator--() {
202 node = node->prev;
203 return *this;
204 }
205
206 QValueListConstIterator<T> operator--(int) {
207 QValueListConstIterator<T> tmp = *this;
208 node = node->prev;
209 return tmp;
210 }
211};
212
213template <class T>
214class QValueListPrivate : public QShared
215{
216public:
217 /**
218 * Typedefs
219 */
220 typedef QValueListIterator<T> Iterator;
221 typedef QValueListConstIterator<T> ConstIterator;
222 typedef QValueListNode<T> Node;
223 typedef QValueListNode<T>* NodePtr;
224 typedef size_t size_type;
225
226 /**
227 * Functions
228 */
229 QValueListPrivate();
230 QValueListPrivate( const QValueListPrivate<T>& _p );
231
232 void derefAndDelete() // ### hack to get around hp-cc brain damage
233 {
234 if ( deref() )
235 delete this;
236 }
237
238#if defined(Q_TEMPLATEDLL)
239 // Workaround MS bug in memory de/allocation in DLL vs. EXE
240 virtual
241#endif
242 ~QValueListPrivate();
243
244 Iterator insert( Iterator it, const T& x );
245 Iterator remove( Iterator it );
246 NodePtr find( NodePtr start, const T& x ) const;
247 int findIndex( NodePtr start, const T& x ) const;
248 uint contains( const T& x ) const;
249 uint remove( const T& x );
250 NodePtr at( size_type i ) const;
251 void clear();
252
253 NodePtr node;
254 size_type nodes;
255};
256
257template <class T>
258Q_INLINE_TEMPLATES QValueListPrivate<T>::QValueListPrivate()
259{
260 node = new Node; node->next = node->prev = node; nodes = 0;
261}
262
263template <class T>
264Q_INLINE_TEMPLATES QValueListPrivate<T>::QValueListPrivate( const QValueListPrivate<T>& _p )
265 : QShared()
266{
267 node = new Node; node->next = node->prev = node; nodes = 0;
268 Iterator b( _p.node->next );
269 Iterator e( _p.node );
270 Iterator i( node );
271 while( b != e )
272 insert( i, *b++ );
273}
274
275template <class T>
276Q_INLINE_TEMPLATES QValueListPrivate<T>::~QValueListPrivate() {
277 NodePtr p = node->next;
278 while( p != node ) {
279 NodePtr x = p->next;
280 delete p;
281 p = x;
282 }
283 delete node;
284}
285
286template <class T>
287Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::Iterator QValueListPrivate<T>::insert( Q_TYPENAME QValueListPrivate<T>::Iterator it, const T& x )
288{
289 NodePtr p = new Node( x );
290 p->next = it.node;
291 p->prev = it.node->prev;
292 it.node->prev->next = p;
293 it.node->prev = p;
294 nodes++;
295 return p;
296}
297
298template <class T>
299Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::Iterator QValueListPrivate<T>::remove( Q_TYPENAME QValueListPrivate<T>::Iterator it )
300{
301 Q_ASSERT ( it.node != node );
302 NodePtr next = it.node->next;
303 NodePtr prev = it.node->prev;
304 prev->next = next;
305 next->prev = prev;
306 delete it.node;
307 nodes--;
308 return Iterator( next );
309}
310
311template <class T>
312Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::find( Q_TYPENAME QValueListPrivate<T>::NodePtr start, const T& x ) const
313{
314 ConstIterator first( start );
315 ConstIterator last( node );
316 while( first != last) {
317 if ( *first == x )
318 return first.node;
319 ++first;
320 }
321 return last.node;
322}
323
324template <class T>
325Q_INLINE_TEMPLATES int QValueListPrivate<T>::findIndex( Q_TYPENAME QValueListPrivate<T>::NodePtr start, const T& x ) const
326{
327 ConstIterator first( start );
328 ConstIterator last( node );
329 int pos = 0;
330 while( first != last) {
331 if ( *first == x )
332 return pos;
333 ++first;
334 ++pos;
335 }
336 return -1;
337}
338
339template <class T>
340Q_INLINE_TEMPLATES uint QValueListPrivate<T>::contains( const T& x ) const
341{
342 uint result = 0;
343 Iterator first = Iterator( node->next );
344 Iterator last = Iterator( node );
345 while( first != last) {
346 if ( *first == x )
347 ++result;
348 ++first;
349 }
350 return result;
351}
352
353template <class T>
354Q_INLINE_TEMPLATES uint QValueListPrivate<T>::remove( const T& x )
355{
356 uint result = 0;
357 Iterator first = Iterator( node->next );
358 Iterator last = Iterator( node );
359 while( first != last) {
360 if ( *first == x ) {
361 first = remove( first );
362 ++result;
363 } else
364 ++first;
365 }
366 return result;
367}
368
369template <class T>
370Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::at( size_type i ) const
371{
372 Q_ASSERT( i <= nodes );
373 NodePtr p = node->next;
374 for( size_type x = 0; x < i; ++x )
375 p = p->next;
376 return p;
377}
378
379template <class T>
380Q_INLINE_TEMPLATES void QValueListPrivate<T>::clear()
381{
382 nodes = 0;
383 NodePtr p = node->next;
384 while( p != node ) {
385 NodePtr next = p->next;
386 delete p;
387 p = next;
388 }
389 node->next = node->prev = node;
390}
391
392#ifdef QT_CHECK_RANGE
393# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_VALUELIST_RANGE )
394# define QT_CHECK_INVALID_LIST_ELEMENT if ( empty() ) qWarning( "QValueList: Warning invalid element" )
395# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL Q_ASSERT( !empty() );
396# else
397# define QT_CHECK_INVALID_LIST_ELEMENT
398# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL
399# endif
400#else
401# define QT_CHECK_INVALID_LIST_ELEMENT
402# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL
403#endif
404
405template <class T> class QDeepCopy;
406
407template <class T>
408class QValueList
409{
410public:
411 /**
412 * Typedefs
413 */
414 typedef QValueListIterator<T> iterator;
415 typedef QValueListConstIterator<T> const_iterator;
416 typedef T value_type;
417 typedef value_type* pointer;
418 typedef const value_type* const_pointer;
419 typedef value_type& reference;
420 typedef const value_type& const_reference;
421 typedef size_t size_type;
422#ifndef QT_NO_STL
423 typedef ptrdiff_t difference_type;
424#else
425 typedef int difference_type;
426#endif
427
428 /**
429 * API
430 */
431 QValueList() { sh = new QValueListPrivate<T>; }
432 QValueList( const QValueList<T>& l ) { sh = l.sh; sh->ref(); }
433#ifndef QT_NO_STL
434# ifdef Q_CC_HPACC // HP-UX aCC does require typename in some place
435# undef Q_TYPENAME // but not accept them at others.
436# define Q_TYPENAME // also doesn't like re-defines ...
437# endif
438 QValueList( const Q_TYPENAME std::list<T>& l )
439 {
440 sh = new QValueListPrivate<T>;
441 qCopy( l.begin(), l.end(), std::back_inserter( *this ) );
442 }
443#endif
444 ~QValueList() { sh->derefAndDelete(); }
445
446 QValueList<T>& operator= ( const QValueList<T>& l )
447 {
448 l.sh->ref();
449 sh->derefAndDelete();
450 sh = l.sh;
451 return *this;
452 }
453#ifndef QT_NO_STL
454 QValueList<T>& operator= ( const Q_TYPENAME std::list<T>& l )
455 {
456 detach();
457 qCopy( l.begin(), l.end(), std::back_inserter( *this ) );
458 return *this;
459 }
460 bool operator== ( const Q_TYPENAME std::list<T>& l ) const
461 {
462 if ( size() != l.size() )
463 return FALSE;
464 const_iterator it2 = begin();
465#if !defined(Q_CC_MIPS)
466 typename
467#endif
468 std::list<T>::const_iterator it = l.begin();
469 for ( ; it2 != end(); ++it2, ++it )
470 if ( !((*it2) == (*it)) )
471 return FALSE;
472 return TRUE;
473 }
474# ifdef Q_CC_HPACC // undo the HP-UX aCC hackery done above
475# undef Q_TYPENAME
476# define Q_TYPENAME typename
477# endif
478#endif
479 bool operator== ( const QValueList<T>& l ) const;
480 bool operator!= ( const QValueList<T>& l ) const { return !( *this == l ); }
481 iterator begin() { detach(); return iterator( sh->node->next ); }
482 const_iterator begin() const { return const_iterator( sh->node->next ); }
483 iterator end() { detach(); return iterator( sh->node ); }
484 const_iterator end() const { return const_iterator( sh->node ); }
485 iterator insert( iterator it, const T& x ) { detach(); return sh->insert( it, x ); }
486 uint remove( const T& x ) { detach(); return sh->remove( x ); }
487 void clear();
488
489 QValueList<T>& operator<< ( const T& x )
490 {
491 append( x );
492 return *this;
493 }
494
495 size_type size() const { return sh->nodes; }
496 bool empty() const { return sh->nodes == 0; }
497 void push_front( const T& x ) { detach(); sh->insert( begin(), x ); }
498 void push_back( const T& x ) { detach(); sh->insert( end(), x ); }
499 iterator erase( iterator pos ) { detach(); return sh->remove( pos ); }
500 iterator erase( iterator first, iterator last );
501 reference front() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); }
502 const_reference front() const { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); }
503 reference back() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); }
504 const_reference back() const { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); }
505 void pop_front() { QT_CHECK_INVALID_LIST_ELEMENT; erase( begin() ); }
506 void pop_back() {
507 QT_CHECK_INVALID_LIST_ELEMENT;
508 iterator tmp = end();
509 erase( --tmp );
510 }
511 void insert( iterator pos, size_type n, const T& x );
512 // Some compilers (incl. vc++) would instantiate this function even if
513 // it is not used; this would constrain QValueList to classes that provide
514 // an operator<
515 /*
516 void sort()
517 {
518 qHeapSort( *this );
519 }
520 */
521
522 QValueList<T> operator+ ( const QValueList<T>& l ) const;
523 QValueList<T>& operator+= ( const QValueList<T>& l );
524
525 iterator fromLast() { detach(); return iterator( sh->node->prev ); }
526 const_iterator fromLast() const { return const_iterator( sh->node->prev ); }
527
528 bool isEmpty() const { return ( sh->nodes == 0 ); }
529
530 iterator append( const T& x ) { detach(); return sh->insert( end(), x ); }
531 iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); }
532
533 iterator remove( iterator it ) { detach(); return sh->remove( it ); }
534
535 T& first() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->next->data; }
536 const T& first() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->next->data; }
537 T& last() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->prev->data; }
538 const T& last() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->prev->data; }
539
540 T& operator[] ( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->at(i)->data; }
541 const T& operator[] ( size_type i ) const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->at(i)->data; }
542 iterator at( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return iterator( sh->at(i) ); }
543 const_iterator at( size_type i ) const { QT_CHECK_INVALID_LIST_ELEMENT; return const_iterator( sh->at(i) ); }
544 iterator find ( const T& x ) { detach(); return iterator( sh->find( sh->node->next, x) ); }
545 const_iterator find ( const T& x ) const { return const_iterator( sh->find( sh->node->next, x) ); }
546 iterator find ( iterator it, const T& x ) { detach(); return iterator( sh->find( it.node, x ) ); }
547 const_iterator find ( const_iterator it, const T& x ) const { return const_iterator( sh->find( it.node, x ) ); }
548 int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; }
549 size_type contains( const T& x ) const { return sh->contains( x ); }
550
551 size_type count() const { return sh->nodes; }
552
553 QValueList<T>& operator+= ( const T& x )
554 {
555 append( x );
556 return *this;
557 }
558 typedef QValueListIterator<T> Iterator;
559 typedef QValueListConstIterator<T> ConstIterator;
560 typedef T ValueType;
561
562protected:
563 /**
564 * Helpers
565 */
566 void detach() { if ( sh->count > 1 ) detachInternal(); }
567
568 /**
569 * Variables
570 */
571 QValueListPrivate<T>* sh;
572
573private:
574 void detachInternal();
575
576 friend class QDeepCopy< QValueList<T> >;
577};
578
579template <class T>
580Q_INLINE_TEMPLATES bool QValueList<T>::operator== ( const QValueList<T>& l ) const
581{
582 if ( size() != l.size() )
583 return FALSE;
584 const_iterator it2 = begin();
585 const_iterator it = l.begin();
586 for( ; it != l.end(); ++it, ++it2 )
587 if ( !( *it == *it2 ) )
588 return FALSE;
589 return TRUE;
590}
591
592template <class T>
593Q_INLINE_TEMPLATES void QValueList<T>::clear()
594{
595 if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QValueListPrivate<T>; }
596}
597
598template <class T>
599Q_INLINE_TEMPLATES Q_TYPENAME QValueList<T>::iterator QValueList<T>::erase( Q_TYPENAME QValueList<T>::iterator first, Q_TYPENAME QValueList<T>::iterator last )
600{
601 while ( first != last )
602 erase( first++ );
603 return last;
604}
605
606
607template <class T>
608Q_INLINE_TEMPLATES void QValueList<T>::insert( Q_TYPENAME QValueList<T>::iterator pos, size_type n, const T& x )
609{
610 for ( ; n > 0; --n )
611 insert( pos, x );
612}
613
614template <class T>
615Q_INLINE_TEMPLATES QValueList<T> QValueList<T>::operator+ ( const QValueList<T>& l ) const
616{
617 QValueList<T> l2( *this );
618 for( const_iterator it = l.begin(); it != l.end(); ++it )
619 l2.append( *it );
620 return l2;
621}
622
623template <class T>
624Q_INLINE_TEMPLATES QValueList<T>& QValueList<T>::operator+= ( const QValueList<T>& l )
625{
626 for( const_iterator it = l.begin(); it != l.end(); ++it )
627 append( *it );
628 return *this;
629}
630
631template <class T>
632Q_INLINE_TEMPLATES void QValueList<T>::detachInternal()
633{
634 sh->deref(); sh = new QValueListPrivate<T>( *sh );
635}
636
637#ifndef QT_NO_DATASTREAM
638template <class T>
639Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QValueList<T>& l )
640{
641 l.clear();
642 Q_UINT32 c;
643 s >> c;
644 for( Q_UINT32 i = 0; i < c; ++i )
645 {
646 T t;
647 s >> t;
648 l.append( t );
649 if ( s.atEnd() )
650 break;
651 }
652 return s;
653}
654
655template <class T>
656Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QValueList<T>& l )
657{
658 s << (Q_UINT32)l.size();
659 QValueListConstIterator<T> it = l.begin();
660 for( ; it != l.end(); ++it )
661 s << *it;
662 return s;
663}
664#endif // QT_NO_DATASTREAM
665#endif // QVALUELIST_H
diff --git a/qmake/include/qvaluestack.h b/qmake/include/qvaluestack.h
new file mode 100644
index 0000000..7e9bc48
--- a/dev/null
+++ b/qmake/include/qvaluestack.h
@@ -0,0 +1,64 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QValueStack class
5**
6** Created : 990925
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9**
10** This file is part of the tools module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QVALUESTACK_H
39#define QVALUESTACK_H
40
41#ifndef QT_H
42#include "qvaluelist.h"
43#endif // QT_H
44
45
46template<class T>
47class QValueStack : public QValueList<T>
48{
49public:
50 QValueStack() {}
51 ~QValueStack() {}
52 void push( const T& d ) { append(d); }
53 T pop()
54 {
55 T elem( this->last() );
56 if ( !this->isEmpty() )
57 remove( this->fromLast() );
58 return elem;
59 }
60 T& top() { return this->last(); }
61 const T& top() const { return this->last(); }
62};
63
64#endif