summaryrefslogtreecommitdiff
path: root/qmake/include
authorllornkcor <llornkcor>2003-07-10 02:40:10 (UTC)
committer llornkcor <llornkcor>2003-07-10 02:40:10 (UTC)
commit155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (unidiff)
treee6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/include
parent86703e8a5527ef114facd02c005b6b3a7e62e263 (diff)
downloadopie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip
opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz
opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2
update qmake to 1.05a
Diffstat (limited to 'qmake/include') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qapplication_p.h5
-rw-r--r--qmake/include/private/qcom_p.h6
-rw-r--r--qmake/include/private/qcomlibrary_p.h6
-rw-r--r--qmake/include/private/qcomplextext_p.h8
-rw-r--r--qmake/include/private/qcomponentfactory_p.h6
-rw-r--r--qmake/include/private/qcriticalsection_p.h4
-rw-r--r--qmake/include/private/qdir_p.h9
-rw-r--r--qmake/include/private/qeffects_p.h2
-rw-r--r--qmake/include/private/qeventloop_p.h70
-rw-r--r--qmake/include/private/qfontcodecs_p.h4
-rw-r--r--qmake/include/private/qfontdata_p.h3
-rw-r--r--qmake/include/private/qgfxdriverinterface_p.h18
-rw-r--r--qmake/include/private/qgpluginmanager_p.h8
-rw-r--r--qmake/include/private/qimageformatinterface_p.h8
-rw-r--r--qmake/include/private/qinputcontext_p.h5
-rw-r--r--qmake/include/private/qkbddriverinterface_p.h18
-rw-r--r--qmake/include/private/qlibrary_p.h5
-rw-r--r--qmake/include/private/qlock_p.h93
-rw-r--r--qmake/include/private/qmousedriverinterface_p.h18
-rw-r--r--qmake/include/private/qmutexpool_p.h44
-rw-r--r--qmake/include/private/qpluginmanager_p.h16
-rw-r--r--qmake/include/private/qpsprinter_p.h4
-rw-r--r--qmake/include/private/qrichtext_p.h59
-rw-r--r--qmake/include/private/qsettings_p.h2
-rw-r--r--qmake/include/private/qsharedmemory_p.h11
-rw-r--r--qmake/include/private/qsqldriverinterface_p.h17
-rw-r--r--qmake/include/private/qsqlextension_p.h41
-rw-r--r--qmake/include/private/qstyleinterface_p.h18
-rw-r--r--qmake/include/private/qsvgdevice_p.h8
-rw-r--r--qmake/include/private/qtextcodecinterface_p.h2
-rw-r--r--qmake/include/private/qtitlebar_p.h2
-rw-r--r--qmake/include/private/qucom_p.h76
-rw-r--r--qmake/include/private/qucomextra_p.h18
-rw-r--r--qmake/include/private/qwidgetinterface_p.h65
-rw-r--r--qmake/include/private/qwidgetresizehandler_p.h18
-rw-r--r--qmake/include/qasciidict.h4
-rw-r--r--qmake/include/qcstring.h7
-rw-r--r--qmake/include/qdict.h4
-rw-r--r--qmake/include/qdir.h3
-rw-r--r--qmake/include/qfeatures.h2
-rw-r--r--qmake/include/qgarray.h13
-rw-r--r--qmake/include/qglobal.h87
-rw-r--r--qmake/include/qintdict.h4
-rw-r--r--qmake/include/qmap.h4
-rw-r--r--qmake/include/qmemarray.h9
-rw-r--r--qmake/include/qptrlist.h6
-rw-r--r--qmake/include/qptrvector.h4
-rw-r--r--qmake/include/qregexp.h2
-rw-r--r--qmake/include/qstring.h91
-rw-r--r--qmake/include/qstrlist.h2
-rw-r--r--qmake/include/qtextcodec.h16
-rw-r--r--qmake/include/qtl.h1
-rw-r--r--qmake/include/quuid.h6
-rw-r--r--qmake/include/qvaluelist.h4
-rw-r--r--qmake/include/qvaluestack.h4
55 files changed, 730 insertions, 240 deletions
diff --git a/qmake/include/private/qapplication_p.h b/qmake/include/private/qapplication_p.h
index 6fab6b3..280992e 100644
--- a/qmake/include/private/qapplication_p.h
+++ b/qmake/include/private/qapplication_p.h
@@ -1,87 +1,88 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of some Qt private functions. 4** Definition of some Qt private functions.
5** 5**
6** Created : 000228 6** Created : 000228
7** 7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QAPPLICATION_P_H 38#ifndef QAPPLICATION_P_H
39#define QAPPLICATION_P_H 39#define QAPPLICATION_P_H
40 40
41 41
42// 42//
43// W A R N I N G 43// W A R N I N G
44// ------------- 44// -------------
45// 45//
46// This file is not part of the Qt API. It exists for the convenience 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 47// of qapplication_*.cpp, qwidget*.cpp, qcolor_x11.cpp, qfiledialog.cpp
48// and many other. This header file may change from version to version 48// and many other. This header file may change from version to version
49// without notice, or even be removed. 49// without notice, or even be removed.
50// 50//
51// We mean it. 51// We mean it.
52// 52//
53// 53//
54 54
55#ifndef QT_H 55#ifndef QT_H
56#endif // QT_H 56#endif // QT_H
57 57
58class QWidget; 58class QWidget;
59class QObject; 59class QObject;
60class QClipboard; 60class QClipboard;
61class QKeyEvent; 61class QKeyEvent;
62class QMouseEvent; 62class QMouseEvent;
63class QWheelEvent; 63class QWheelEvent;
64 64
65extern Q_EXPORT bool qt_modal_state(); 65extern Q_EXPORT bool qt_modal_state();
66extern Q_EXPORT void qt_enter_modal( QWidget* ); 66extern Q_EXPORT void qt_enter_modal( QWidget* );
67extern Q_EXPORT void qt_leave_modal( QWidget* ); 67extern Q_EXPORT void qt_leave_modal( QWidget* );
68 68
69extern bool qt_is_gui_used; 69extern bool qt_is_gui_used;
70#ifndef QT_NO_CLIPBOARD 70#ifndef QT_NO_CLIPBOARD
71extern QClipboard *qt_clipboard; 71extern QClipboard *qt_clipboard;
72#endif 72#endif
73 73
74#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) 74#if defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN)
75extern Qt::WindowsVersion qt_winver; 75extern Qt::WindowsVersion qt_winver;
76#elif defined (Q_OS_MAC)
77extern Qt::MacintoshVersion qt_macver;
76#endif 78#endif
77 79
78#if defined (Q_WS_X11) 80#if defined (Q_WS_X11)
79extern int qt_ncols_option; 81extern int qt_ncols_option;
80#endif 82#endif
81 83
82 84
83extern void qt_dispatchEnterLeave( QWidget*, QWidget* ); 85extern void qt_dispatchEnterLeave( QWidget*, QWidget* );
84 86extern bool qt_tryModalHelper( QWidget *, QWidget ** = 0 );
85
86 87
87#endif 88#endif
diff --git a/qmake/include/private/qcom_p.h b/qmake/include/private/qcom_p.h
index 6e7e1c8..5bed8c8c 100644
--- a/qmake/include/private/qcom_p.h
+++ b/qmake/include/private/qcom_p.h
@@ -1,337 +1,337 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** ... 4** ...
5** 5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the tools module of the Qt GUI Toolkit. 8** This file is part of the tools module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QCOM_H 36#ifndef QCOM_P_H
37#define QCOM_H 37#define QCOM_P_H
38 38
39// 39//
40// W A R N I N G 40// W A R N I N G
41// ------------- 41// -------------
42// 42//
43// This file is not part of the Qt API. It exists for the convenience 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 44// of a number of Qt sources files. This header file may change from
45// version to version without notice, or even be removed. 45// version to version without notice, or even be removed.
46// 46//
47// We mean it. 47// We mean it.
48// 48//
49// 49//
50 50
51#ifndef QT_H 51#ifndef QT_H
52#include "qstringlist.h" 52#include "qstringlist.h"
53#include "quuid.h" 53#include "quuid.h"
54#endif // QT_H 54#endif // QT_H
55 55
56#ifndef QT_NO_COMPONENT 56#ifndef QT_NO_COMPONENT
57 57
58class QObject; 58class QObject;
59struct QUInterfaceDescription; 59struct QUInterfaceDescription;
60struct QUObject; 60struct QUObject;
61 61
62 #define QRESULT unsigned long 62 #define QRESULT unsigned long
63 #define QS_OK (QRESULT)0x00000000 63 #define QS_OK (QRESULT)0x00000000
64 #define QS_FALSE(QRESULT)0x00000001 64 #define QS_FALSE(QRESULT)0x00000001
65 65
66#define QE_NOTIMPL (QRESULT)0x80000001 66#define QE_NOTIMPL (QRESULT)0x80000001
67#define QE_OUTOFMEMORY (QRESULT)0x80000002 67#define QE_OUTOFMEMORY (QRESULT)0x80000002
68 #define QE_INVALIDARG(QRESULT)0x80000003 68 #define QE_INVALIDARG(QRESULT)0x80000003
69 #define QE_NOINTERFACE(QRESULT)0x80000004 69 #define QE_NOINTERFACE(QRESULT)0x80000004
70 #define QE_NOCOMPONENT(QRESULT)0x80000005 70 #define QE_NOCOMPONENT(QRESULT)0x80000005
71 71
72 72
73// {1D8518CD-E8F5-4366-99E8-879FD7E482DE} 73// {1D8518CD-E8F5-4366-99E8-879FD7E482DE}
74#ifndef IID_QUnknown 74#ifndef IID_QUnknown
75#define IID_QUnknown QUuid(0x1d8518cd, 0xe8f5, 0x4366, 0x99, 0xe8, 0x87, 0x9f, 0xd7, 0xe4, 0x82, 0xde) 75#define IID_QUnknown QUuid(0x1d8518cd, 0xe8f5, 0x4366, 0x99, 0xe8, 0x87, 0x9f, 0xd7, 0xe4, 0x82, 0xde)
76#endif 76#endif
77 77
78struct Q_EXPORT QUnknownInterface 78struct Q_EXPORT QUnknownInterface
79{ 79{
80 virtual QRESULT queryInterface( const QUuid&, QUnknownInterface** ) = 0; 80 virtual QRESULT queryInterface( const QUuid&, QUnknownInterface** ) = 0;
81 virtual ulong addRef() = 0; 81 virtual ulong addRef() = 0;
82 virtual ulong release() = 0; 82 virtual ulong release() = 0;
83}; 83};
84 84
85// {FBAC965E-A441-413F-935E-CDF582573FAB} 85// {FBAC965E-A441-413F-935E-CDF582573FAB}
86#ifndef IID_QDispatch 86#ifndef IID_QDispatch
87#define IID_QDispatch QUuid( 0xfbac965e, 0xa441, 0x413f, 0x93, 0x5e, 0xcd, 0xf5, 0x82, 0x57, 0x3f, 0xab) 87#define IID_QDispatch QUuid( 0xfbac965e, 0xa441, 0x413f, 0x93, 0x5e, 0xcd, 0xf5, 0x82, 0x57, 0x3f, 0xab)
88#endif 88#endif
89 89
90// the dispatch interface that inherits the unknown interface.. It is 90// the dispatch interface that inherits the unknown interface.. It is
91// used to explore interfaces during runtime and to do dynamic calls. 91// used to explore interfaces during runtime and to do dynamic calls.
92struct Q_EXPORT QDispatchInterface : public QUnknownInterface 92struct Q_EXPORT QDispatchInterface : public QUnknownInterface
93{ 93{
94 // returns the interface description of this dispatch interface. 94 // returns the interface description of this dispatch interface.
95 virtual const QUInterfaceDescription* interfaceDescription() const = 0; 95 virtual const QUInterfaceDescription* interfaceDescription() const = 0;
96 96
97 // returns the event description of this dispatch interface. 97 // returns the event description of this dispatch interface.
98 virtual const QUInterfaceDescription* eventsDescription() const = 0; 98 virtual const QUInterfaceDescription* eventsDescription() const = 0;
99 99
100 // invokes method id with parameters V*. Returns some sort of 100 // invokes method id with parameters V*. Returns some sort of
101 // exception code. 101 // exception code.
102 virtual QRESULT invoke( int id, QUObject* o ) = 0; 102 virtual QRESULT invoke( int id, QUObject* o ) = 0;
103 103
104 // installs listener as event listener 104 // installs listener as event listener
105 virtual void installListener( QDispatchInterface* listener ) = 0; 105 virtual void installListener( QDispatchInterface* listener ) = 0;
106 106
107 // remove listener as event listener 107 // remove listener as event listener
108 virtual void removeListener( QDispatchInterface* listener ) = 0; 108 virtual void removeListener( QDispatchInterface* listener ) = 0;
109}; 109};
110 110
111template <class T> 111template <class T>
112class QInterfacePtr 112class QInterfacePtr
113{ 113{
114public: 114public:
115 QInterfacePtr():iface(0){} 115 QInterfacePtr():iface(0){}
116 116
117 QInterfacePtr( T* i) { 117 QInterfacePtr( T* i) {
118 if ( (iface = i) ) 118 if ( (iface = i) )
119 iface->addRef(); 119 iface->addRef();
120 } 120 }
121 121
122 QInterfacePtr(const QInterfacePtr<T> &p) { 122 QInterfacePtr(const QInterfacePtr<T> &p) {
123 if ( (iface = p.iface) ) 123 if ( (iface = p.iface) )
124 iface->addRef(); 124 iface->addRef();
125 } 125 }
126 126
127 ~QInterfacePtr() { 127 ~QInterfacePtr() {
128 if ( iface ) 128 if ( iface )
129 iface->release(); 129 iface->release();
130 } 130 }
131 131
132 QInterfacePtr<T> &operator=(const QInterfacePtr<T> &p) { 132 QInterfacePtr<T> &operator=(const QInterfacePtr<T> &p) {
133 if ( iface != p.iface ) { 133 if ( iface != p.iface ) {
134 if ( iface ) 134 if ( iface )
135 iface->release(); 135 iface->release();
136 if ( (iface = p.iface) ) 136 if ( (iface = p.iface) )
137 iface->addRef(); 137 iface->addRef();
138 } 138 }
139 return *this; 139 return *this;
140 } 140 }
141 141
142 QInterfacePtr<T> &operator=(T* i) { 142 QInterfacePtr<T> &operator=(T* i) {
143 if (iface != i ) { 143 if (iface != i ) {
144 if ( iface ) 144 if ( iface )
145 iface->release(); 145 iface->release();
146 if ( (iface = i) ) 146 if ( (iface = i) )
147 iface->addRef(); 147 iface->addRef();
148 } 148 }
149 return *this; 149 return *this;
150 } 150 }
151 151
152 bool operator==( const QInterfacePtr<T> &p ) const { return iface == p.iface; } 152 bool operator==( const QInterfacePtr<T> &p ) const { return iface == p.iface; }
153 153
154 bool operator!= ( const QInterfacePtr<T>& p ) const { return !( *this == p ); } 154 bool operator!= ( const QInterfacePtr<T>& p ) const { return !( *this == p ); }
155 155
156 bool isNull() const { return !iface; } 156 bool isNull() const { return !iface; }
157 157
158 T* operator->() const { return iface; } 158 T* operator->() const { return iface; }
159 159
160 T& operator*() const { return *iface; } 160 T& operator*() const { return *iface; }
161 161
162 operator T*() const { return iface; } 162 operator T*() const { return iface; }
163 163
164 QUnknownInterface** operator &() const { 164 QUnknownInterface** operator &() const {
165 if( iface ) 165 if( iface )
166 iface->release(); 166 iface->release();
167 return (QUnknownInterface**)&iface; 167 return (QUnknownInterface**)&iface;
168 } 168 }
169 169
170 T** operator &() { 170 T** operator &() {
171 if ( iface ) 171 if ( iface )
172 iface->release(); 172 iface->release();
173 return &iface; 173 return &iface;
174 } 174 }
175 175
176private: 176private:
177 T* iface; 177 T* iface;
178}; 178};
179 179
180// {10A1501B-4C5F-4914-95DD-C400486CF900} 180// {10A1501B-4C5F-4914-95DD-C400486CF900}
181#ifndef IID_QObject 181#ifndef IID_QObject
182#define IID_QObject QUuid( 0x10a1501b, 0x4c5f, 0x4914, 0x95, 0xdd, 0xc4, 0x00, 0x48, 0x6c, 0xf9, 0x00) 182#define IID_QObject QUuid( 0x10a1501b, 0x4c5f, 0x4914, 0x95, 0xdd, 0xc4, 0x00, 0x48, 0x6c, 0xf9, 0x00)
183#endif 183#endif
184 184
185struct Q_EXPORT QObjectInterface 185struct Q_EXPORT QObjectInterface
186{ 186{
187 virtual QObject* qObject() = 0; 187 virtual QObject* qObject() = 0;
188}; 188};
189 189
190// {5F3968A5-F451-45b1-96FB-061AD98F926E} 190// {5F3968A5-F451-45b1-96FB-061AD98F926E}
191#ifndef IID_QComponentInformation 191#ifndef IID_QComponentInformation
192#define IID_QComponentInformation QUuid(0x5f3968a5, 0xf451, 0x45b1, 0x96, 0xfb, 0x6, 0x1a, 0xd9, 0x8f, 0x92, 0x6e) 192#define IID_QComponentInformation QUuid(0x5f3968a5, 0xf451, 0x45b1, 0x96, 0xfb, 0x6, 0x1a, 0xd9, 0x8f, 0x92, 0x6e)
193#endif 193#endif
194 194
195struct Q_EXPORT QComponentInformationInterface : public QUnknownInterface 195struct Q_EXPORT QComponentInformationInterface : public QUnknownInterface
196{ 196{
197 virtual QString name() const = 0; 197 virtual QString name() const = 0;
198 virtual QString description() const = 0; 198 virtual QString description() const = 0;
199 virtual QString author() const = 0; 199 virtual QString author() const = 0;
200 virtual QString version() const = 0; 200 virtual QString version() const = 0;
201}; 201};
202 202
203// {6CAA771B-17BB-4988-9E78-BA5CDDAAC31E} 203// {6CAA771B-17BB-4988-9E78-BA5CDDAAC31E}
204#ifndef IID_QComponentFactory 204#ifndef IID_QComponentFactory
205#define IID_QComponentFactory QUuid( 0x6caa771b, 0x17bb, 0x4988, 0x9e, 0x78, 0xba, 0x5c, 0xdd, 0xaa, 0xc3, 0x1e) 205#define IID_QComponentFactory QUuid( 0x6caa771b, 0x17bb, 0x4988, 0x9e, 0x78, 0xba, 0x5c, 0xdd, 0xaa, 0xc3, 0x1e)
206#endif 206#endif
207 207
208struct Q_EXPORT QComponentFactoryInterface : public QUnknownInterface 208struct Q_EXPORT QComponentFactoryInterface : public QUnknownInterface
209{ 209{
210 virtual QRESULT createInstance( const QUuid &cid, const QUuid &iid, QUnknownInterface** instance, QUnknownInterface *outer ) = 0; 210 virtual QRESULT createInstance( const QUuid &cid, const QUuid &iid, QUnknownInterface** instance, QUnknownInterface *outer ) = 0;
211}; 211};
212 212
213// {D16111D4-E1E7-4C47-8599-24483DAE2E07} 213// {D16111D4-E1E7-4C47-8599-24483DAE2E07}
214#ifndef IID_QLibrary 214#ifndef IID_QLibrary
215#define IID_QLibrary QUuid( 0xd16111d4, 0xe1e7, 0x4c47, 0x85, 0x99, 0x24, 0x48, 0x3d, 0xae, 0x2e, 0x07) 215#define IID_QLibrary QUuid( 0xd16111d4, 0xe1e7, 0x4c47, 0x85, 0x99, 0x24, 0x48, 0x3d, 0xae, 0x2e, 0x07)
216#endif 216#endif
217 217
218struct Q_EXPORT QLibraryInterface : public QUnknownInterface 218struct Q_EXPORT QLibraryInterface : public QUnknownInterface
219{ 219{
220 virtual bool init() = 0; 220 virtual bool init() = 0;
221 virtual void cleanup() = 0; 221 virtual void cleanup() = 0;
222 virtual bool canUnload() const = 0; 222 virtual bool canUnload() const = 0;
223}; 223};
224 224
225// {3F8FDC44-3015-4f3e-B6D6-E4AAAABDEAAD} 225// {3F8FDC44-3015-4f3e-B6D6-E4AAAABDEAAD}
226#ifndef IID_QFeatureList 226#ifndef IID_QFeatureList
227#define IID_QFeatureList QUuid(0x3f8fdc44, 0x3015, 0x4f3e, 0xb6, 0xd6, 0xe4, 0xaa, 0xaa, 0xbd, 0xea, 0xad) 227#define IID_QFeatureList QUuid(0x3f8fdc44, 0x3015, 0x4f3e, 0xb6, 0xd6, 0xe4, 0xaa, 0xaa, 0xbd, 0xea, 0xad)
228#endif 228#endif
229 229
230struct Q_EXPORT QFeatureListInterface : public QUnknownInterface 230struct Q_EXPORT QFeatureListInterface : public QUnknownInterface
231{ 231{
232 virtual QStringListfeatureList() const = 0; 232 virtual QStringListfeatureList() const = 0;
233}; 233};
234 234
235// {B5FEB5DE-E0CD-4E37-B0EB-8A812499A0C1} 235// {B5FEB5DE-E0CD-4E37-B0EB-8A812499A0C1}
236#ifndef IID_QComponentRegistration 236#ifndef IID_QComponentRegistration
237#define IID_QComponentRegistration QUuid( 0xb5feb5de, 0xe0cd, 0x4e37, 0xb0, 0xeb, 0x8a, 0x81, 0x24, 0x99, 0xa0, 0xc1) 237#define IID_QComponentRegistration QUuid( 0xb5feb5de, 0xe0cd, 0x4e37, 0xb0, 0xeb, 0x8a, 0x81, 0x24, 0x99, 0xa0, 0xc1)
238#endif 238#endif
239 239
240struct Q_EXPORT QComponentRegistrationInterface : public QUnknownInterface 240struct Q_EXPORT QComponentRegistrationInterface : public QUnknownInterface
241{ 241{
242 virtual bool registerComponents( const QString &filepath ) const = 0; 242 virtual bool registerComponents( const QString &filepath ) const = 0;
243 virtual bool unregisterComponents() const = 0; 243 virtual bool unregisterComponents() const = 0;
244}; 244};
245 245
246// internal class that wraps an initialized ulong 246// internal class that wraps an initialized ulong
247struct Q_EXPORT QtULong 247struct Q_EXPORT QtULong
248{ 248{
249 QtULong() : ref( 0 ) { } 249 QtULong() : ref( 0 ) { }
250 operator unsigned long () const { return ref; } 250 operator unsigned long () const { return ref; }
251 unsigned long& operator++() { return ++ref; } 251 unsigned long& operator++() { return ++ref; }
252 unsigned long operator++( int ) { return ref++; } 252 unsigned long operator++( int ) { return ref++; }
253 unsigned long& operator--() { return --ref; } 253 unsigned long& operator--() { return --ref; }
254 unsigned long operator--( int ) { return ref--; } 254 unsigned long operator--( int ) { return ref--; }
255 255
256 unsigned long ref; 256 unsigned long ref;
257}; 257};
258// default implementation of ref counting. A variable "ulong ref" has to be a member 258// default implementation of ref counting. A variable "ulong ref" has to be a member
259 259
260 260
261#define Q_REFCOUNT \ 261#define Q_REFCOUNT \
262 private: \ 262 private: \
263 QtULong qtrefcount; \ 263 QtULong qtrefcount; \
264 public: \ 264 public: \
265 ulong addRef() {return qtrefcount++;} \ 265 ulong addRef() {return qtrefcount++;} \
266 ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;} 266 ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;}
267 267
268#ifndef Q_EXPORT_COMPONENT 268#ifndef Q_EXPORT_COMPONENT
269#if defined(QT_THREAD_SUPPORT) 269#if defined(QT_THREAD_SUPPORT)
270#define QT_THREADED_BUILD 1 270#define QT_THREADED_BUILD 1
271#define Q_UCM_FLAGS_STRING "11" 271#define Q_UCM_FLAGS_STRING "11"
272#else 272#else
273#define QT_THREADED_BUILD 0 273#define QT_THREADED_BUILD 0
274#define Q_UCM_FLAGS_STRING "01" 274#define Q_UCM_FLAGS_STRING "01"
275#endif 275#endif
276 276
277#ifndef Q_EXTERN_C 277#ifndef Q_EXTERN_C
278#ifdef __cplusplus 278#ifdef __cplusplus
279#define Q_EXTERN_C extern "C" 279#define Q_EXTERN_C extern "C"
280#else 280#else
281#define Q_EXTERN_C extern 281#define Q_EXTERN_C extern
282#endif 282#endif
283#endif 283#endif
284 284
285// this is duplicated at Q_PLUGIN_VERIFICATION_DATA in qgplugin.h 285// this is duplicated at Q_PLUGIN_VERIFICATION_DATA in qgplugin.h
286// NOTE: if you change pattern, you MUST change the pattern in 286// NOTE: if you change pattern, you MUST change the pattern in
287// qcomlibrary.cpp as well. changing the pattern will break all 287// qcomlibrary.cpp as well. changing the pattern will break all
288// backwards compatibility as well (no old plugins will be loaded). 288// backwards compatibility as well (no old plugins will be loaded).
289#ifndef Q_UCM_VERIFICATION_DATA 289#ifndef Q_UCM_VERIFICATION_DATA
290# define Q_UCM_VERIFICATION_DATA \ 290# define Q_UCM_VERIFICATION_DATA \
291 static const char *qt_ucm_verification_data = \ 291 static const char *qt_ucm_verification_data = \
292 "pattern=""QT_UCM_VERIFICATION_DATA""\n" \ 292 "pattern=""QT_UCM_VERIFICATION_DATA""\n" \
293 "version="QT_VERSION_STR"\n" \ 293 "version="QT_VERSION_STR"\n" \
294 "flags="Q_UCM_FLAGS_STRING"\n" \ 294 "flags="Q_UCM_FLAGS_STRING"\n" \
295 "buildkey="QT_BUILD_KEY"\0"; 295 "buildkey="QT_BUILD_KEY"\0";
296#endif // Q_UCM_VERIFICATION_DATA 296#endif // Q_UCM_VERIFICATION_DATA
297 297
298// This macro expands to the default implementation of ucm_instantiate. 298// This macro expands to the default implementation of ucm_instantiate.
299#ifndef Q_CREATE_INSTANCE 299#ifndef Q_CREATE_INSTANCE
300 # define Q_CREATE_INSTANCE( IMPLEMENTATION ) \ 300 # define Q_CREATE_INSTANCE( IMPLEMENTATION ) \
301 IMPLEMENTATION *i = new IMPLEMENTATION; \ 301 IMPLEMENTATION *i = new IMPLEMENTATION; \
302 QUnknownInterface* iface = 0; \ 302 QUnknownInterface* iface = 0; \
303 i->queryInterface( IID_QUnknown, &iface );\ 303 i->queryInterface( IID_QUnknown, &iface );\
304 return iface; 304 return iface;
305#endif // Q_CREATE_INSTANCE 305#endif // Q_CREATE_INSTANCE
306 306
307# ifdef Q_WS_WIN 307# ifdef Q_WS_WIN
308 #ifdef Q_CC_BOR 308 #ifdef Q_CC_BOR
309 # define Q_EXPORT_COMPONENT() \ 309 # define Q_EXPORT_COMPONENT() \
310 Q_UCM_VERIFICATION_DATA \ 310 Q_UCM_VERIFICATION_DATA \
311 Q_EXTERN_C __declspec(dllexport) \ 311 Q_EXTERN_C __declspec(dllexport) \
312 const char * __stdcall qt_ucm_query_verification_data() \ 312 const char * __stdcall qt_ucm_query_verification_data() \
313 { return qt_ucm_verification_data; } \ 313 { return qt_ucm_verification_data; } \
314 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \ 314 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \
315 __stdcall ucm_instantiate() 315 __stdcall ucm_instantiate()
316 #else 316 #else
317 # define Q_EXPORT_COMPONENT() \ 317 # define Q_EXPORT_COMPONENT() \
318 Q_UCM_VERIFICATION_DATA \ 318 Q_UCM_VERIFICATION_DATA \
319 Q_EXTERN_C __declspec(dllexport) \ 319 Q_EXTERN_C __declspec(dllexport) \
320 const char *qt_ucm_query_verification_data() \ 320 const char *qt_ucm_query_verification_data() \
321 { return qt_ucm_verification_data; } \ 321 { return qt_ucm_verification_data; } \
322 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate() 322 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate()
323 #endif 323 #endif
324# else 324# else
325 #define Q_EXPORT_COMPONENT() \ 325 #define Q_EXPORT_COMPONENT() \
326 Q_UCM_VERIFICATION_DATA \ 326 Q_UCM_VERIFICATION_DATA \
327 Q_EXTERN_C \ 327 Q_EXTERN_C \
328 const char *qt_ucm_query_verification_data() \ 328 const char *qt_ucm_query_verification_data() \
329 { return qt_ucm_verification_data; } \ 329 { return qt_ucm_verification_data; } \
330 Q_EXTERN_C QUnknownInterface* ucm_instantiate() 330 Q_EXTERN_C QUnknownInterface* ucm_instantiate()
331# endif 331# endif
332# define Q_EXPORT_INTERFACE() Q_EXPORT_COMPONENT() 332# define Q_EXPORT_INTERFACE() Q_EXPORT_COMPONENT()
333#endif 333#endif
334 334
335#endif //QT_NO_COMPONENT 335#endif //QT_NO_COMPONENT
336 336
337#endif //QCOM_H 337#endif //QCOM_P_H
diff --git a/qmake/include/private/qcomlibrary_p.h b/qmake/include/private/qcomlibrary_p.h
index f52f679..3f440c0 100644
--- a/qmake/include/private/qcomlibrary_p.h
+++ b/qmake/include/private/qcomlibrary_p.h
@@ -1,79 +1,79 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QComLibrary class 4** Definition of QComLibrary class
5** 5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the tools module of the Qt GUI Toolkit. 8** This file is part of the tools module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QUCOMLIBRARY_H 36#ifndef QCOMLIBRARY_P_H
37#define QUCOMLIBRARY_H 37#define QCOMLIBRARY_P_H
38 38
39// 39//
40// W A R N I N G 40// W A R N I N G
41// ------------- 41// -------------
42// 42//
43// This file is not part of the Qt API. It exists for the convenience 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 44// of a number of Qt sources files. This header file may change from
45// version to version without notice, or even be removed. 45// version to version without notice, or even be removed.
46// 46//
47// We mean it. 47// We mean it.
48// 48//
49// 49//
50 50
51#ifndef QT_H 51#ifndef QT_H
52#include "qcom_p.h" 52#include "qcom_p.h"
53#include "qlibrary.h" 53#include "qlibrary.h"
54#endif // QT_H 54#endif // QT_H
55 55
56#ifndef QT_NO_COMPONENT 56#ifndef QT_NO_COMPONENT
57 57
58class Q_EXPORT QComLibrary : public QLibrary 58class Q_EXPORT QComLibrary : public QLibrary
59{ 59{
60public: 60public:
61 QComLibrary( const QString &filename ); 61 QComLibrary( const QString &filename );
62 ~QComLibrary(); 62 ~QComLibrary();
63 63
64 bool unload(); 64 bool unload();
65 QRESULT queryInterface( const QUuid &iid, QUnknownInterface **iface ); 65 QRESULT queryInterface( const QUuid &iid, QUnknownInterface **iface );
66 uint qtVersion(); 66 uint qtVersion();
67 67
68private: 68private:
69 void createInstanceInternal(); 69 void createInstanceInternal();
70 70
71 QUnknownInterface *entry; 71 QUnknownInterface *entry;
72 QLibraryInterface *libiface; 72 QLibraryInterface *libiface;
73 uint qt_version; 73 uint qt_version;
74 74
75}; 75};
76 76
77#endif //QT_NO_COMPONENT 77#endif //QT_NO_COMPONENT
78 78
79#endif // QUCOMLIBRARY_H 79#endif
diff --git a/qmake/include/private/qcomplextext_p.h b/qmake/include/private/qcomplextext_p.h
index 2132522..c3aeeb1 100644
--- a/qmake/include/private/qcomplextext_p.h
+++ b/qmake/include/private/qcomplextext_p.h
@@ -1,123 +1,121 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Internal header file. 4** Internal header file.
5** 5**
6** Created : 6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7**
8** Copyright (C) 2001 Trolltech AS. All rights reserved.
9** 7**
10** This file is part of the kernel module of the Qt GUI Toolkit. 8** This file is part of the kernel module of the Qt GUI Toolkit.
11** 9**
12** This file may be distributed under the terms of the Q Public License 10** 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 11** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
15** 13**
16** This file may be distributed and/or modified under the terms of the 14** 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 15** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the 16** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 17** packaging of this file.
20** 18**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 21** Agreement provided with the Software.
24** 22**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 23** 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 25**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 30**
33** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 32** not clear to you.
35** 33**
36**********************************************************************/ 34**********************************************************************/
37 35
38#ifndef QCOMPLEXTEXT_H 36#ifndef QCOMPLEXTEXT_P_H
39#define QCOMPLEXTEXT_H 37#define QCOMPLEXTEXT_P_H
40 38
41// 39//
42// W A R N I N G 40// W A R N I N G
43// ------------- 41// -------------
44// 42//
45// This file is not part of the Qt API. It exists for the convenience 43// 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 44// of Qt Remote Control. This header file may change from version to
47// version without notice, or even be removed. 45// version without notice, or even be removed.
48// 46//
49// We mean it. 47// We mean it.
50// 48//
51// 49//
52 50
53#ifndef QT_H 51#ifndef QT_H
54#include <qstring.h> 52#include <qstring.h>
55#include <qpointarray.h> 53#include <qpointarray.h>
56#include <qfont.h> 54#include <qfont.h>
57#include <qpainter.h> 55#include <qpainter.h>
58#include <qptrlist.h> 56#include <qptrlist.h>
59#include <qshared.h> 57#include <qshared.h>
60#endif // QT_H 58#endif // QT_H
61 59
62#ifndef QT_NO_COMPLEXTEXT 60#ifndef QT_NO_COMPLEXTEXT
63 61
64// bidi helper classes. Internal to Qt 62// bidi helper classes. Internal to Qt
65struct Q_EXPORT QBidiStatus { 63struct Q_EXPORT QBidiStatus {
66 QBidiStatus() { 64 QBidiStatus() {
67 eor = QChar::DirON; 65 eor = QChar::DirON;
68 lastStrong = QChar::DirON; 66 lastStrong = QChar::DirON;
69 last = QChar:: DirON; 67 last = QChar:: DirON;
70 } 68 }
71 QChar::Direction eor; 69 QChar::Direction eor;
72 QChar::Direction lastStrong; 70 QChar::Direction lastStrong;
73 QChar::Direction last; 71 QChar::Direction last;
74}; 72};
75 73
76struct Q_EXPORT QBidiContext : public QShared { 74struct Q_EXPORT QBidiContext : public QShared {
77 // ### ref and deref parent? 75 // ### ref and deref parent?
78 QBidiContext( uchar level, QChar::Direction embedding, QBidiContext *parent = 0, bool override = FALSE ); 76 QBidiContext( uchar level, QChar::Direction embedding, QBidiContext *parent = 0, bool override = FALSE );
79 ~QBidiContext(); 77 ~QBidiContext();
80 78
81 unsigned char level; 79 unsigned char level;
82 bool override : 1; 80 bool override : 1;
83 QChar::Direction dir : 5; 81 QChar::Direction dir : 5;
84 82
85 QBidiContext *parent; 83 QBidiContext *parent;
86}; 84};
87 85
88struct Q_EXPORT QBidiControl { 86struct Q_EXPORT QBidiControl {
89 QBidiControl() { context = 0; } 87 QBidiControl() { context = 0; }
90 QBidiControl( QBidiContext *c, QBidiStatus s) 88 QBidiControl( QBidiContext *c, QBidiStatus s)
91 { context = c; if( context ) context->ref(); status = s; } 89 { context = c; if( context ) context->ref(); status = s; }
92 ~QBidiControl() { if ( context && context->deref() ) delete context; } 90 ~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(); } 91 void setContext( QBidiContext *c ) { if ( context == c ) return; if ( context && context->deref() ) delete context; context = c; context->ref(); }
94 QBidiContext *context; 92 QBidiContext *context;
95 QBidiStatus status; 93 QBidiStatus status;
96}; 94};
97 95
98struct Q_EXPORT QTextRun { 96struct Q_EXPORT QTextRun {
99 QTextRun(int _start, int _stop, QBidiContext *context, QChar::Direction dir); 97 QTextRun(int _start, int _stop, QBidiContext *context, QChar::Direction dir);
100 98
101 int start; 99 int start;
102 int stop; 100 int stop;
103 // explicit + implicit levels here 101 // explicit + implicit levels here
104 uchar level; 102 uchar level;
105}; 103};
106 104
107class Q_EXPORT QComplexText { 105class Q_EXPORT QComplexText {
108public: 106public:
109 static QString shapedString( const QString &str, int from = 0, int len = -1, QPainter::TextDirection dir = QPainter::Auto, const QFontMetrics *fm = 0); 107 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); 108 static QChar shapedCharacter(const QString &str, int pos, const QFontMetrics *fm = 0);
111 109
112 // positions non spacing marks relative to the base character at position pos. 110 // 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 ); 111 static QPointArray positionMarks( QFontPrivate *f, const QString &str, int pos, QRect *boundingRect = 0 );
114 112
115 static QPtrList<QTextRun> *bidiReorderLine( QBidiControl *control, const QString &str, int start, int len, 113 static QPtrList<QTextRun> *bidiReorderLine( QBidiControl *control, const QString &str, int start, int len,
116 QChar::Direction basicDir = QChar::DirON ); 114 QChar::Direction basicDir = QChar::DirON );
117 static QString bidiReorderString( const QString &str, QChar::Direction basicDir = QChar::DirON ); 115 static QString bidiReorderString( const QString &str, QChar::Direction basicDir = QChar::DirON );
118}; 116};
119 117
120 118
121#endif //QT_NO_COMPLEXTEXT 119#endif //QT_NO_COMPLEXTEXT
122 120
123#endif 121#endif
diff --git a/qmake/include/private/qcomponentfactory_p.h b/qmake/include/private/qcomponentfactory_p.h
index 1ac973f..d5c1743 100644
--- a/qmake/include/private/qcomponentfactory_p.h
+++ b/qmake/include/private/qcomponentfactory_p.h
@@ -1,73 +1,73 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of the QComponentFactory class 4** Definition of the QComponentFactory class
5** 5**
6** Created : 990101 6** Created : 990101
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QCOMPONENTFACTORY_H 38#ifndef QCOMPONENTFACTORY_P_H
39#define QCOMPONENTFACTORY_H 39#define QCOMPONENTFACTORY_P_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qcom_p.h" 42#include "qcom_p.h"
43#endif // QT_H 43#endif // QT_H
44 44
45// 45//
46// W A R N I N G 46// W A R N I N G
47// ------------- 47// -------------
48// 48//
49// This file is not part of the Qt API. It exists for the convenience 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 50// of a number of Qt sources files. This header file may change from
51// version to version without notice, or even be removed. 51// version to version without notice, or even be removed.
52// 52//
53// We mean it. 53// We mean it.
54// 54//
55// 55//
56 56
57#ifndef QT_NO_COMPONENT 57#ifndef QT_NO_COMPONENT
58 58
59class Q_EXPORT QComponentFactory 59class Q_EXPORT QComponentFactory
60{ 60{
61public: 61public:
62 static QRESULT createInstance( const QString &cid, const QUuid &iid, QUnknownInterface** instance, QUnknownInterface *outer = 0 ); 62 static QRESULT createInstance( const QString &cid, const QUuid &iid, QUnknownInterface** instance, QUnknownInterface *outer = 0 );
63 static QRESULT registerServer( const QString &filename ); 63 static QRESULT registerServer( const QString &filename );
64 static QRESULT unregisterServer( const QString &filename ); 64 static QRESULT unregisterServer( const QString &filename );
65 65
66 static bool registerComponent( const QUuid &cid, const QString &filename, const QString &name = QString::null, 66 static bool registerComponent( const QUuid &cid, const QString &filename, const QString &name = QString::null,
67 int version = 0, const QString &description = QString::null ); 67 int version = 0, const QString &description = QString::null );
68 static bool unregisterComponent( const QUuid &cid ); 68 static bool unregisterComponent( const QUuid &cid );
69}; 69};
70 70
71#endif // QT_NO_COMPONENT 71#endif // QT_NO_COMPONENT
72 72
73#endif // QCOMPONENTFACTORY_H 73#endif // QCOMPONENTFACTORY_P_H
diff --git a/qmake/include/private/qcriticalsection_p.h b/qmake/include/private/qcriticalsection_p.h
index 7d9feca..8dacc62 100644
--- a/qmake/include/private/qcriticalsection_p.h
+++ b/qmake/include/private/qcriticalsection_p.h
@@ -1,80 +1,80 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QCriticalSection class 4** Definition of QCriticalSection class
5** 5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the Qt GUI Toolkit. 8** This file is part of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QCRITICALSECTION_H 36#ifndef QCRITICALSECTION_P_H
37#define QCRITICALSECTION_H 37#define QCRITICALSECTION_P_H
38 38
39#ifndef QT_H 39#ifndef QT_H
40#endif // QT_H 40#endif // QT_H
41 41
42// 42//
43// W A R N I N G 43// W A R N I N G
44// ------------- 44// -------------
45// 45//
46// This file is not part of the Qt API. It exists for the convenience 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 47// of Qt Remote Control. This header file may change from version to
48// version without notice, or even be removed. 48// version without notice, or even be removed.
49// 49//
50// We mean it. 50// We mean it.
51// 51//
52// 52//
53 53
54#if defined(QT_THREAD_SUPPORT) 54#if defined(QT_THREAD_SUPPORT)
55 55
56#if defined(Q_WS_WIN) 56#if defined(Q_WS_WIN)
57 57
58/* 58/*
59 QCriticalSection 59 QCriticalSection
60*/ 60*/
61 61
62class QCriticalSectionPrivate; 62class QCriticalSectionPrivate;
63 63
64class QCriticalSection 64class QCriticalSection
65{ 65{
66public: 66public:
67 QCriticalSection(); 67 QCriticalSection();
68 ~QCriticalSection(); 68 ~QCriticalSection();
69 void enter(); 69 void enter();
70 void leave(); 70 void leave();
71 71
72private: 72private:
73 QCriticalSectionPrivate *d; 73 QCriticalSectionPrivate *d;
74}; 74};
75 75
76#endif 76#endif
77 77
78#endif 78#endif
79 79
80#endif 80#endif
diff --git a/qmake/include/private/qdir_p.h b/qmake/include/private/qdir_p.h
index 35dba28..a6c7c91 100644
--- a/qmake/include/private/qdir_p.h
+++ b/qmake/include/private/qdir_p.h
@@ -1,78 +1,79 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of some private QDir functions. 4** Definition of some private QDir functions.
5** 5**
6** Created : 2000.11.06 6** Created : 001106
7** 7**
8** Copyright (C) 2000 Trolltech AS. All rights reserved. 8** Copyright (C) 2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QDIR_P_H 38#ifndef QDIR_P_H
39#define QDIR_P_H 39#define QDIR_P_H
40 40
41
42// 41//
43// W A R N I N G 42// W A R N I N G
44// ------------- 43// -------------
45// 44//
46// This file is not part of the Qt API. It exists for the convenience 45// This file is not part of the Qt API. It exists for the convenience
47// of qdir.cpp and qdir_*.cpp. 46// of qdir.cpp and qdir_*.cpp.
48// This header file may change from version to version without notice, 47// This header file may change from version to version without notice,
49// or even be removed. 48// or even be removed.
50// 49//
51// We mean it. 50// We mean it.
52// 51//
53// 52//
54 53
55#ifndef QT_H 54#ifndef QT_H
55#include "qregexp.h"
56#include "qvaluelist.h"
56#endif // QT_H 57#endif // QT_H
57 58
58extern QStringList qt_makeFilterList( const QString & ); 59extern QValueList<QRegExp> qt_makeFilterList( const QString & );
59 60extern bool qt_matchFilterList( const QValueList<QRegExp> &, const QString & );
60 61
61extern int qt_cmp_si_sortSpec; 62extern int qt_cmp_si_sortSpec;
62 63
63#if defined(Q_C_CALLBACKS) 64#if defined(Q_C_CALLBACKS)
64extern "C" { 65extern "C" {
65#endif 66#endif
66 67
67#ifdef Q_OS_TEMP 68#ifdef Q_OS_TEMP
68extern int __cdecl qt_cmp_si( const void *, const void * ); 69extern int __cdecl qt_cmp_si( const void *, const void * );
69#else 70#else
70extern int qt_cmp_si( const void *, const void * ); 71extern int qt_cmp_si( const void *, const void * );
71#endif 72#endif
72 73
73#if defined(Q_C_CALLBACKS) 74#if defined(Q_C_CALLBACKS)
74} 75}
75#endif 76#endif
76 77
77 78
78#endif // QDIR_P_H 79#endif // QDIR_P_H
diff --git a/qmake/include/private/qeffects_p.h b/qmake/include/private/qeffects_p.h
index 4178b6f..3b6c212 100644
--- a/qmake/include/private/qeffects_p.h
+++ b/qmake/include/private/qeffects_p.h
@@ -1,78 +1,78 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QEffects functions 4** Definition of QEffects functions
5** 5**
6** Created : 2000.06.21 6** Created : 000621
7** 7**
8** Copyright (C) 2000 Trolltech AS. All rights reserved. 8** Copyright (C) 2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the widgets module of the Qt GUI Toolkit. 10** This file is part of the widgets module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QEFFECTS_P_H 38#ifndef QEFFECTS_P_H
39#define QEFFECTS_P_H 39#define QEFFECTS_P_H
40 40
41 41
42// 42//
43// W A R N I N G 43// W A R N I N G
44// ------------- 44// -------------
45// 45//
46// This file is not part of the Qt API. It exists for the convenience 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. 47// of qeffects.cpp, qcombobox.cpp, qpopupmenu.cpp and qtooltip.cpp.
48// This header file may change from version to version without notice, 48// This header file may change from version to version without notice,
49// or even be removed. 49// or even be removed.
50// 50//
51// We mean it. 51// We mean it.
52// 52//
53// 53//
54 54
55#ifndef QT_H 55#ifndef QT_H
56#include "qnamespace.h" 56#include "qnamespace.h"
57#endif // QT_H 57#endif // QT_H
58 58
59#ifndef QT_NO_EFFECTS 59#ifndef QT_NO_EFFECTS
60class QWidget; 60class QWidget;
61 61
62struct QEffects 62struct QEffects
63{ 63{
64 enum Direction { 64 enum Direction {
65 LeftScroll= 0x0001, 65 LeftScroll= 0x0001,
66 RightScroll= 0x0002, 66 RightScroll= 0x0002,
67 UpScroll= 0x0004, 67 UpScroll= 0x0004,
68 DownScroll= 0x0008 68 DownScroll= 0x0008
69 }; 69 };
70 70
71 typedef uint DirFlags; 71 typedef uint DirFlags;
72}; 72};
73 73
74extern void Q_EXPORT qScrollEffect( QWidget*, QEffects::DirFlags dir = QEffects::DownScroll, int time = -1 ); 74extern void Q_EXPORT qScrollEffect( QWidget*, QEffects::DirFlags dir = QEffects::DownScroll, int time = -1 );
75extern void Q_EXPORT qFadeEffect( QWidget*, int time = -1 ); 75extern void Q_EXPORT qFadeEffect( QWidget*, int time = -1 );
76#endif // QT_NO_EFFECTS 76#endif // QT_NO_EFFECTS
77 77
78#endif // QEFFECTS_P_H 78#endif // QEFFECTS_P_H
diff --git a/qmake/include/private/qeventloop_p.h b/qmake/include/private/qeventloop_p.h
index b64d0df..3a5350e 100644
--- a/qmake/include/private/qeventloop_p.h
+++ b/qmake/include/private/qeventloop_p.h
@@ -1,74 +1,138 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QEventLoop class
5**
6** Copyright (C) 1992-2003 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 and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file.
14**
15** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
16** licenses for Qt/Embedded may use this file in accordance with the
17** Qt Embedded Commercial License Agreement provided with the Software.
18**
19** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21**
22** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
23** information about Qt Commercial License Agreements.
24** See http://www.trolltech.com/gpl/ for GPL licensing information.
25**
26** Contact info@trolltech.com if any conditions of this licensing are
27** not clear to you.
28**
29**********************************************************************/
30
1#ifndef QEVENTLOOP_P_H 31#ifndef QEVENTLOOP_P_H
2#define QEVENTLOOP_P_H 32#define QEVENTLOOP_P_H
3 33
34//
35// W A R N I N G
36// -------------
37//
38// This file is not part of the Qt API. This header file may
39// change from version to version without notice, or even be
40// removed.
41//
42// We mean it.
43//
44//
45
4#include "qplatformdefs.h" 46#include "qplatformdefs.h"
47
48// SCO OpenServer redefines raise -> kill
49#if defined(raise)
50# undef raise
51#endif
52
5#include "qwindowdefs.h" 53#include "qwindowdefs.h"
6 54
7class QSocketNotifier; 55class QSocketNotifier;
8 56
9#if defined(Q_OS_UNIX) 57#if defined(Q_OS_UNIX) || defined (Q_WS_WIN)
10#include <qptrlist.h> 58#include <qptrlist.h>
59#endif // Q_OS_UNIX || Q_WS_WIN
11 60
61#if defined(Q_OS_UNIX)
12struct QSockNot 62struct QSockNot
13{ 63{
14 QSocketNotifier *obj; 64 QSocketNotifier *obj;
15 int fd; 65 int fd;
16 fd_set *queue; 66 fd_set *queue;
17}; 67};
18 68
19class QSockNotType 69class QSockNotType
20{ 70{
21public: 71public:
22 QSockNotType(); 72 QSockNotType();
23 ~QSockNotType(); 73 ~QSockNotType();
24 74
25 QPtrList<QSockNot> *list; 75 QPtrList<QSockNot> *list;
26 fd_set select_fds; 76 fd_set select_fds;
27 fd_set enabled_fds; 77 fd_set enabled_fds;
28 fd_set pending_fds; 78 fd_set pending_fds;
29 79
30}; 80};
31#endif // Q_OS_UNIX 81#endif // Q_OS_UNIX
32 82
83#if defined(Q_WS_WIN)
84struct QSockNot {
85 QSocketNotifier *obj;
86 int fd;
87};
88#endif // Q_WS_WIN
33 89
34class QEventLoopPrivate 90class QEventLoopPrivate
35{ 91{
36public: 92public:
37 QEventLoopPrivate() 93 QEventLoopPrivate()
38 { 94 {
39 reset(); 95 reset();
40 } 96 }
41 97
42 void reset() { 98 void reset() {
43 looplevel = 0; 99 looplevel = 0;
44 quitcode = 0; 100 quitcode = 0;
45 quitnow = FALSE; 101 quitnow = FALSE;
46 exitloop = FALSE; 102 exitloop = FALSE;
103 shortcut = FALSE;
47 } 104 }
48 105
49 int looplevel; 106 int looplevel;
50 int quitcode; 107 int quitcode;
51 bool quitnow; 108 unsigned int quitnow : 1;
52 bool exitloop; 109 unsigned int exitloop : 1;
110 unsigned int shortcut : 1;
53 111
54#if defined(Q_WS_MAC) 112#if defined(Q_WS_MAC)
55 EventLoopTimerRef select_timer; 113 EventLoopTimerRef select_timer;
56#endif 114#endif
57 115
58#if defined(Q_WS_X11) 116#if defined(Q_WS_X11)
59 int xfd; 117 int xfd;
60#endif // Q_WS_X11 118#endif // Q_WS_X11
61 119
62#if defined(Q_OS_UNIX) 120#if defined(Q_OS_UNIX)
63 int thread_pipe[2]; 121 int thread_pipe[2];
64 122
65 // pending socket notifiers list 123 // pending socket notifiers list
66 QPtrList<QSockNot> sn_pending_list; 124 QPtrList<QSockNot> sn_pending_list;
67 // highest fd for all socket notifiers 125 // highest fd for all socket notifiers
68 int sn_highest; 126 int sn_highest;
69 // 3 socket notifier types - read, write and exception 127 // 3 socket notifier types - read, write and exception
70 QSockNotType sn_vec[3]; 128 QSockNotType sn_vec[3];
71#endif 129#endif
130
131#ifdef Q_WS_WIN
132 // pending socket notifiers list
133 QPtrList<QSockNot> sn_pending_list;
134#endif // Q_WS_WIN
135
72}; 136};
73 137
74#endif // QEVENTLOOP_P_H 138#endif // QEVENTLOOP_P_H
diff --git a/qmake/include/private/qfontcodecs_p.h b/qmake/include/private/qfontcodecs_p.h
index 8222f98..54b0ac1 100644
--- a/qmake/include/private/qfontcodecs_p.h
+++ b/qmake/include/private/qfontcodecs_p.h
@@ -1,368 +1,368 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Font utilities for X11 4** Font utilities for X11
5** 5**
6** Created : 20001101 6** Created : 20001101
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QFONTCODECS_P_H 38#ifndef QFONTCODECS_P_H
39#define QFONTCODECS_P_H 39#define QFONTCODECS_P_H
40 40
41// 41//
42// W A R N I N G 42// W A R N I N G
43// ------------- 43// -------------
44// 44//
45// This file is not part of the Qt API. It exists for the convenience 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 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. 47// change from version to version without notice, or even be removed.
48// 48//
49// We mean it. 49// We mean it.
50// 50//
51// 51//
52 52
53#ifndef QT_H 53#ifndef QT_H
54#include <qglobal.h> 54#include "qglobal.h"
55#include <qtextcodec.h> 55#include "qtextcodec.h"
56#endif // QT_H 56#endif // QT_H
57 57
58 58
59#ifndef QT_NO_CODECS 59#ifndef QT_NO_CODECS
60#ifndef QT_NO_BIG_CODECS 60#ifndef QT_NO_BIG_CODECS
61 61
62 62
63class QJpUnicodeConv; 63class QJpUnicodeConv;
64 64
65 65
66class QFontJis0201Codec : public QTextCodec 66class QFontJis0201Codec : public QTextCodec
67{ 67{
68public: 68public:
69 QFontJis0201Codec(); 69 QFontJis0201Codec();
70 70
71 const char *name() const; 71 const char *name() const;
72 72
73 int mibEnum() const; 73 int mibEnum() const;
74 74
75#if !defined(Q_NO_USING_KEYWORD) 75#if !defined(Q_NO_USING_KEYWORD)
76 using QTextCodec::fromUnicode; 76 using QTextCodec::fromUnicode;
77#endif 77#endif
78 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 78 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
79 79
80 int heuristicContentMatch(const char *, int) const; 80 int heuristicContentMatch(const char *, int) const;
81 int heuristicNameMatch(const char* hint) const; 81 int heuristicNameMatch(const char* hint) const;
82 82
83#if !defined(Q_NO_USING_KEYWORD) 83#if !defined(Q_NO_USING_KEYWORD)
84 using QTextCodec::canEncode; 84 using QTextCodec::canEncode;
85#endif 85#endif
86 bool canEncode( QChar ) const; 86 bool canEncode( QChar ) const;
87}; 87};
88 88
89 89
90class QFontJis0208Codec : public QTextCodec 90class QFontJis0208Codec : public QTextCodec
91{ 91{
92public: 92public:
93 QFontJis0208Codec(); 93 QFontJis0208Codec();
94 ~QFontJis0208Codec(); 94 ~QFontJis0208Codec();
95 95
96 // Return the official name for the encoding. 96 // Return the official name for the encoding.
97 const char* name() const ; 97 const char* name() const ;
98 98
99 // Return the MIB enum for the encoding if it is listed in the 99 // Return the MIB enum for the encoding if it is listed in the
100 // IANA character-sets encoding file. 100 // IANA character-sets encoding file.
101 int mibEnum() const ; 101 int mibEnum() const ;
102 102
103 // Converts len characters from chars to Unicode. 103 // Converts len characters from chars to Unicode.
104 QString toUnicode(const char* chars, int len) const ; 104 QString toUnicode(const char* chars, int len) const ;
105 105
106 // Converts lenInOut characters (of type QChar) from the start of 106 // Converts lenInOut characters (of type QChar) from the start of
107 // the string uc, returning a QCString result, and also returning 107 // the string uc, returning a QCString result, and also returning
108 // the length of the result in lenInOut. 108 // the length of the result in lenInOut.
109#if !defined(Q_NO_USING_KEYWORD) 109#if !defined(Q_NO_USING_KEYWORD)
110 using QTextCodec::fromUnicode; 110 using QTextCodec::fromUnicode;
111#endif 111#endif
112 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 112 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
113 113
114 int heuristicContentMatch(const char *, int) const; 114 int heuristicContentMatch(const char *, int) const;
115 int heuristicNameMatch(const char* hint) const; 115 int heuristicNameMatch(const char* hint) const;
116 116
117#if !defined(Q_NO_USING_KEYWORD) 117#if !defined(Q_NO_USING_KEYWORD)
118 using QTextCodec::canEncode; 118 using QTextCodec::canEncode;
119#endif 119#endif
120 bool canEncode( QChar ) const; 120 bool canEncode( QChar ) const;
121 121
122private: 122private:
123 QJpUnicodeConv *convJP; 123 QJpUnicodeConv *convJP;
124}; 124};
125 125
126 126
127 127
128 128
129class QFontKsc5601Codec : public QTextCodec 129class QFontKsc5601Codec : public QTextCodec
130{ 130{
131public: 131public:
132 QFontKsc5601Codec(); 132 QFontKsc5601Codec();
133 133
134 // Return the official name for the encoding. 134 // Return the official name for the encoding.
135 const char* name() const ; 135 const char* name() const ;
136 136
137 // Return the MIB enum for the encoding if it is listed in the 137 // Return the MIB enum for the encoding if it is listed in the
138 // IANA character-sets encoding file. 138 // IANA character-sets encoding file.
139 int mibEnum() const ; 139 int mibEnum() const ;
140 140
141 // Converts len characters from chars to Unicode. 141 // Converts len characters from chars to Unicode.
142 QString toUnicode(const char* chars, int len) const ; 142 QString toUnicode(const char* chars, int len) const ;
143 143
144 // Converts lenInOut characters (of type QChar) from the start of 144 // Converts lenInOut characters (of type QChar) from the start of
145 // the string uc, returning a QCString result, and also returning 145 // the string uc, returning a QCString result, and also returning
146 // the length of the result in lenInOut. 146 // the length of the result in lenInOut.
147#if !defined(Q_NO_USING_KEYWORD) 147#if !defined(Q_NO_USING_KEYWORD)
148 using QTextCodec::fromUnicode; 148 using QTextCodec::fromUnicode;
149#endif 149#endif
150 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 150 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
151 151
152 int heuristicContentMatch(const char *, int) const; 152 int heuristicContentMatch(const char *, int) const;
153#if !defined(Q_NO_USING_KEYWORD) 153#if !defined(Q_NO_USING_KEYWORD)
154 using QTextCodec::canEncode; 154 using QTextCodec::canEncode;
155#endif 155#endif
156 bool canEncode( QChar ) const; 156 bool canEncode( QChar ) const;
157}; 157};
158 158
159 159
160 160
161 161
162class QFontGb2312Codec : public QTextCodec 162class QFontGb2312Codec : public QTextCodec
163{ 163{
164public: 164public:
165 QFontGb2312Codec(); 165 QFontGb2312Codec();
166 166
167 // Return the official name for the encoding. 167 // Return the official name for the encoding.
168 const char* name() const ; 168 const char* name() const ;
169 169
170 // Return the MIB enum for the encoding if it is listed in the 170 // Return the MIB enum for the encoding if it is listed in the
171 // IANA character-sets encoding file. 171 // IANA character-sets encoding file.
172 int mibEnum() const ; 172 int mibEnum() const ;
173 173
174 // Converts len characters from chars to Unicode. 174 // Converts len characters from chars to Unicode.
175 QString toUnicode(const char* chars, int len) const ; 175 QString toUnicode(const char* chars, int len) const ;
176 176
177 // Converts lenInOut characters (of type QChar) from the start of 177 // Converts lenInOut characters (of type QChar) from the start of
178 // the string uc, returning a QCString result, and also returning 178 // the string uc, returning a QCString result, and also returning
179 // the length of the result in lenInOut. 179 // the length of the result in lenInOut.
180 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 180 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
181 181
182 int heuristicContentMatch(const char *, int) const; 182 int heuristicContentMatch(const char *, int) const;
183 bool canEncode( QChar ) const; 183 bool canEncode( QChar ) const;
184}; 184};
185 185
186 186
187 187
188 188
189class QFontGbkCodec : public QTextCodec 189class QFontGbkCodec : public QTextCodec
190{ 190{
191public: 191public:
192 QFontGbkCodec(); 192 QFontGbkCodec();
193 193
194 // Return the official name for the encoding. 194 // Return the official name for the encoding.
195 const char* name() const ; 195 const char* name() const ;
196 196
197 // Return the MIB enum for the encoding if it is listed in the 197 // Return the MIB enum for the encoding if it is listed in the
198 // IANA character-sets encoding file. 198 // IANA character-sets encoding file.
199 int mibEnum() const ; 199 int mibEnum() const ;
200 200
201 // Converts len characters from chars to Unicode. 201 // Converts len characters from chars to Unicode.
202 QString toUnicode(const char* chars, int len) const ; 202 QString toUnicode(const char* chars, int len) const ;
203 203
204 // Converts lenInOut characters (of type QChar) from the start of 204 // Converts lenInOut characters (of type QChar) from the start of
205 // the string uc, returning a QCString result, and also returning 205 // the string uc, returning a QCString result, and also returning
206 // the length of the result in lenInOut. 206 // the length of the result in lenInOut.
207 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 207 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
208 208
209 int heuristicContentMatch(const char *, int) const; 209 int heuristicContentMatch(const char *, int) const;
210 int heuristicNameMatch(const char* hint) const; 210 int heuristicNameMatch(const char* hint) const;
211 bool canEncode( QChar ) const; 211 bool canEncode( QChar ) const;
212}; 212};
213 213
214 214
215 215
216 216
217class QFontGb18030_0Codec : public QTextCodec 217class QFontGb18030_0Codec : public QTextCodec
218{ 218{
219public: 219public:
220 QFontGb18030_0Codec(); 220 QFontGb18030_0Codec();
221 221
222 // Return the official name for the encoding. 222 // Return the official name for the encoding.
223 const char* name() const ; 223 const char* name() const ;
224 224
225 // Return the MIB enum for the encoding if it is listed in the 225 // Return the MIB enum for the encoding if it is listed in the
226 // IANA character-sets encoding file. 226 // IANA character-sets encoding file.
227 int mibEnum() const ; 227 int mibEnum() const ;
228 228
229 // Converts len characters from chars to Unicode. 229 // Converts len characters from chars to Unicode.
230 QString toUnicode(const char* chars, int len) const ; 230 QString toUnicode(const char* chars, int len) const ;
231 231
232 // Converts lenInOut characters (of type QChar) from the start of 232 // Converts lenInOut characters (of type QChar) from the start of
233 // the string uc, returning a QCString result, and also returning 233 // the string uc, returning a QCString result, and also returning
234 // the length of the result in lenInOut. 234 // the length of the result in lenInOut.
235#if !defined(Q_NO_USING_KEYWORD) 235#if !defined(Q_NO_USING_KEYWORD)
236 using QTextCodec::fromUnicode; 236 using QTextCodec::fromUnicode;
237#endif 237#endif
238 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 238 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
239 239
240 int heuristicContentMatch(const char *, int) const; 240 int heuristicContentMatch(const char *, int) const;
241#if !defined(Q_NO_USING_KEYWORD) 241#if !defined(Q_NO_USING_KEYWORD)
242 using QTextCodec::canEncode; 242 using QTextCodec::canEncode;
243#endif 243#endif
244 bool canEncode( QChar ) const; 244 bool canEncode( QChar ) const;
245}; 245};
246 246
247 247
248 248
249 249
250class QFontBig5Codec : public QTextCodec 250class QFontBig5Codec : public QTextCodec
251{ 251{
252public: 252public:
253 QFontBig5Codec(); 253 QFontBig5Codec();
254 254
255 // Return the official name for the encoding. 255 // Return the official name for the encoding.
256 const char* name() const ; 256 const char* name() const ;
257 257
258 // Return the MIB enum for the encoding if it is listed in the 258 // Return the MIB enum for the encoding if it is listed in the
259 // IANA character-sets encoding file. 259 // IANA character-sets encoding file.
260 int mibEnum() const ; 260 int mibEnum() const ;
261 261
262 // Converts len characters from chars to Unicode. 262 // Converts len characters from chars to Unicode.
263 QString toUnicode(const char* chars, int len) const ; 263 QString toUnicode(const char* chars, int len) const ;
264 264
265 // Converts lenInOut characters (of type QChar) from the start of 265 // Converts lenInOut characters (of type QChar) from the start of
266 // the string uc, returning a QCString result, and also returning 266 // the string uc, returning a QCString result, and also returning
267 // the length of the result in lenInOut. 267 // the length of the result in lenInOut.
268#if !defined(Q_NO_USING_KEYWORD) 268#if !defined(Q_NO_USING_KEYWORD)
269 using QTextCodec::fromUnicode; 269 using QTextCodec::fromUnicode;
270#endif 270#endif
271 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 271 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
272 272
273 int heuristicContentMatch(const char *, int) const; 273 int heuristicContentMatch(const char *, int) const;
274#if !defined(Q_NO_USING_KEYWORD) 274#if !defined(Q_NO_USING_KEYWORD)
275 using QTextCodec::canEncode; 275 using QTextCodec::canEncode;
276#endif 276#endif
277 int heuristicNameMatch(const char* hint) const; 277 int heuristicNameMatch(const char* hint) const;
278 bool canEncode( QChar ) const; 278 bool canEncode( QChar ) const;
279}; 279};
280 280
281 281
282 282
283class QFontBig5hkscsCodec : public QTextCodec 283class QFontBig5hkscsCodec : public QTextCodec
284{ 284{
285public: 285public:
286 QFontBig5hkscsCodec(); 286 QFontBig5hkscsCodec();
287 287
288 // Return the official name for the encoding. 288 // Return the official name for the encoding.
289 const char* name() const ; 289 const char* name() const ;
290 290
291 // Return the MIB enum for the encoding if it is listed in the 291 // Return the MIB enum for the encoding if it is listed in the
292 // IANA character-sets encoding file. 292 // IANA character-sets encoding file.
293 int mibEnum() const ; 293 int mibEnum() const ;
294 294
295 // Converts len characters from chars to Unicode. 295 // Converts len characters from chars to Unicode.
296 QString toUnicode(const char* chars, int len) const ; 296 QString toUnicode(const char* chars, int len) const ;
297 297
298 // Converts lenInOut characters (of type QChar) from the start of 298 // Converts lenInOut characters (of type QChar) from the start of
299 // the string uc, returning a QCString result, and also returning 299 // the string uc, returning a QCString result, and also returning
300 // the length of the result in lenInOut. 300 // the length of the result in lenInOut.
301 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 301 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
302 302
303 int heuristicContentMatch(const char *, int) const; 303 int heuristicContentMatch(const char *, int) const;
304 int heuristicNameMatch(const char* hint) const; 304 int heuristicNameMatch(const char* hint) const;
305#if !defined(Q_NO_USING_KEYWORD) 305#if !defined(Q_NO_USING_KEYWORD)
306 using QTextCodec::canEncode; 306 using QTextCodec::canEncode;
307#endif 307#endif
308 bool canEncode( QChar ) const; 308 bool canEncode( QChar ) const;
309}; 309};
310 310
311 311
312 312
313 313
314// ------------------------------------------------------------------ 314// ------------------------------------------------------------------
315// the shaping codec for iso8859-6.8x fonts (see www.langbox.com) 315// the shaping codec for iso8859-6.8x fonts (see www.langbox.com)
316 316
317class QFontArabic68Codec : public QTextCodec 317class QFontArabic68Codec : public QTextCodec
318{ 318{
319public: 319public:
320 QFontArabic68Codec(); 320 QFontArabic68Codec();
321 321
322 // Return the official name for the encoding. 322 // Return the official name for the encoding.
323 const char* name() const ; 323 const char* name() const ;
324 324
325 // Return the MIB enum for the encoding if it is listed in the 325 // Return the MIB enum for the encoding if it is listed in the
326 // IANA character-sets encoding file. 326 // IANA character-sets encoding file.
327 int mibEnum() const ; 327 int mibEnum() const ;
328 328
329 // Converts len characters from chars to Unicode. 329 // Converts len characters from chars to Unicode.
330 QString toUnicode(const char* chars, int len) const ; 330 QString toUnicode(const char* chars, int len) const ;
331 331
332 // Converts lenInOut characters (of type QChar) from the start of 332 // Converts lenInOut characters (of type QChar) from the start of
333 // the string uc, returning a QCString result, and also returning 333 // the string uc, returning a QCString result, and also returning
334 // the length of the result in lenInOut. 334 // the length of the result in lenInOut.
335 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 335 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
336 336
337 int heuristicContentMatch(const char *, int) const; 337 int heuristicContentMatch(const char *, int) const;
338 QByteArray fromUnicode( const QString &str, int from, int len ) const; 338 QByteArray fromUnicode( const QString &str, int from, int len ) const;
339 unsigned short characterFromUnicode(const QString &str, int pos) const; 339 unsigned short characterFromUnicode(const QString &str, int pos) const;
340}; 340};
341 341
342 342
343class QFontLaoCodec : public QTextCodec 343class QFontLaoCodec : public QTextCodec
344{ 344{
345public: 345public:
346 QFontLaoCodec(); 346 QFontLaoCodec();
347 347
348 const char *name() const; 348 const char *name() const;
349 349
350 int mibEnum() const; 350 int mibEnum() const;
351 351
352#if !defined(Q_NO_USING_KEYWORD) 352#if !defined(Q_NO_USING_KEYWORD)
353 using QTextCodec::fromUnicode; 353 using QTextCodec::fromUnicode;
354#endif 354#endif
355 QCString fromUnicode(const QString& uc, int& lenInOut ) const; 355 QCString fromUnicode(const QString& uc, int& lenInOut ) const;
356 356
357 int heuristicContentMatch(const char *, int) const; 357 int heuristicContentMatch(const char *, int) const;
358 358
359#if !defined(Q_NO_USING_KEYWORD) 359#if !defined(Q_NO_USING_KEYWORD)
360 using QTextCodec::canEncode; 360 using QTextCodec::canEncode;
361#endif 361#endif
362 bool canEncode( QChar ) const; 362 bool canEncode( QChar ) const;
363}; 363};
364 364
365#endif // QT_NO_BIG_CODECS 365#endif // QT_NO_BIG_CODECS
366#endif // QT_NO_CODECS 366#endif // QT_NO_CODECS
367 367
368#endif // QFONTCODECS_P_H 368#endif // QFONTCODECS_P_H
diff --git a/qmake/include/private/qfontdata_p.h b/qmake/include/private/qfontdata_p.h
index 917d14f..1eaf80c 100644
--- a/qmake/include/private/qfontdata_p.h
+++ b/qmake/include/private/qfontdata_p.h
@@ -1,479 +1,480 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of internal QFontData struct 4** Definition of internal QFontData struct
5** 5**
6** Created : 941229 6** Created : 941229
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QFONTDATA_P_H 38#ifndef QFONTDATA_P_H
39#define QFONTDATA_P_H 39#define QFONTDATA_P_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include <qcache.h> 42#include <qcache.h>
43#include <qobject.h> 43#include <qobject.h>
44#include <qpaintdevice.h> 44#include <qpaintdevice.h>
45#endif // QT_H 45#endif // QT_H
46#include <limits.h> 46#include <limits.h>
47 47
48// 48//
49// W A R N I N G 49// W A R N I N G
50// ------------- 50// -------------
51// 51//
52// This file is not part of the Qt API. It exists for the convenience 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 53// of internal files. This header file may change from version to version
54// without notice, or even be removed. 54// without notice, or even be removed.
55// 55//
56// We mean it. 56// We mean it.
57// 57//
58// 58//
59 59
60class QPaintDevice; 60class QPaintDevice;
61 61
62#ifdef Q_WS_WIN 62#ifdef Q_WS_WIN
63#include <qt_windows.h> 63#include <qt_windows.h>
64#endif 64#endif
65 65
66#ifdef Q_WS_X11 66#ifdef Q_WS_X11
67#include <qt_x11.h> 67#include <qt_x11.h>
68 68
69class QCharStruct; 69class QCharStruct;
70#endif 70#endif
71 71
72// font description 72// font description
73struct QFontDef { 73struct QFontDef {
74 QFontDef() 74 QFontDef()
75 : pixelSize(0), pointSize(0), lbearing(SHRT_MIN), rbearing(SHRT_MIN), 75 : pixelSize(0), pointSize(0), lbearing(SHRT_MIN), rbearing(SHRT_MIN),
76 styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle), 76 styleStrategy(QFont::PreferDefault), styleHint(QFont::AnyStyle),
77 weight(0), italic(FALSE), underline(FALSE), strikeOut(FALSE), 77 weight(0), italic(FALSE), underline(FALSE), strikeOut(FALSE),
78 fixedPitch(FALSE), hintSetByUser(FALSE), rawMode(FALSE), dirty(TRUE) 78 fixedPitch(FALSE), hintSetByUser(FALSE), rawMode(FALSE), dirty(TRUE)
79 { ; } 79 { ; }
80 80
81 QString family; 81 QString family;
82 QString addStyle; 82 QString addStyle;
83 83
84 int pixelSize; 84 int pixelSize;
85 int pointSize; 85 int pointSize;
86 short lbearing; 86 short lbearing;
87 short rbearing; 87 short rbearing;
88 88
89 ushort styleStrategy; 89 ushort styleStrategy;
90 uchar styleHint; 90 uchar styleHint;
91 uchar weight; 91 uchar weight;
92 92
93 bool italic; 93 bool italic;
94 bool underline; 94 bool underline;
95 bool strikeOut; 95 bool strikeOut;
96 bool fixedPitch; 96 bool fixedPitch;
97 bool hintSetByUser; 97 bool hintSetByUser;
98 bool rawMode; 98 bool rawMode;
99 99
100 bool dirty; 100 bool dirty;
101}; 101};
102 102
103 103
104class QTextCodec; 104class QTextCodec;
105 105
106#ifdef Q_WS_X11 106#ifdef Q_WS_X11
107 107
108// this is a shared wrapper for XFontStruct (to prevent a font being freed by 108// this is a shared wrapper for XFontStruct (to prevent a font being freed by
109// the cache while it's being used) 109// the cache while it's being used)
110class QFontStruct : public QShared 110class QFontStruct : public QShared
111{ 111{
112public: 112public:
113 QFontStruct(Qt::HANDLE h, Qt::HANDLE xfth, Qt::HANDLE xftp, 113 QFontStruct(Qt::HANDLE h, Qt::HANDLE xfth, Qt::HANDLE xftp,
114 QCString n, QTextCodec *c, int a) : 114 QCString n, QTextCodec *c, int a) :
115 QShared(), handle(h), xfthandle(xfth), xftpattern(xftp), 115 QShared(), handle(h), xfthandle(xfth), xftpattern(xftp),
116 name(n), codec(c), cache_cost(a), scale( 1. ) 116 name(n), codec(c), cache_cost(a), scale( 1. )
117 { ; } 117 { ; }
118 118
119 ~QFontStruct(); 119 ~QFontStruct();
120 120
121 Qt::HANDLE handle, xfthandle, xftpattern; 121 Qt::HANDLE handle, xfthandle, xftpattern;
122 QCString name; 122 QCString name;
123 QTextCodec *codec; 123 QTextCodec *codec;
124 int cache_cost; 124 int cache_cost;
125 float scale; // needed for printing, to correctly scale font metrics for bitmap fonts 125 float scale; // needed for printing, to correctly scale font metrics for bitmap fonts
126}; 126};
127 127
128enum { widthCacheSize = 0x500 }; 128enum { widthCacheSize = 0x500 };
129 129
130class QFontX11Data // used as a QFontPrivate member 130class QFontX11Data // used as a QFontPrivate member
131{ 131{
132public: 132public:
133 // X fontstruct handles for each character set 133 // X fontstruct handles for each character set
134 QFontStruct *fontstruct[QFont::LastPrivateScript]; 134 QFontStruct *fontstruct[QFont::LastPrivateScript];
135 135
136 uchar widthCache[widthCacheSize]; 136 uchar widthCache[widthCacheSize];
137 137
138 QFontX11Data(); 138 QFontX11Data();
139 ~QFontX11Data(); 139 ~QFontX11Data();
140}; 140};
141 141
142#endif // Q_WS_X11 142#endif // Q_WS_X11
143 143
144 144
145#ifdef Q_WS_WIN 145#ifdef Q_WS_WIN
146 146
147class QFontStruct : public QShared 147class QFontStruct : public QShared
148{ 148{
149public: 149public:
150 QFontStruct( const QString &key ); 150 QFontStruct( const QString &key );
151 ~QFontStruct() { reset(); } 151 ~QFontStruct() { reset(); }
152 bool dirty() const { return hfont == 0; } 152 bool dirty() const { return hfont == 0; }
153 HDC dc() const; 153 HDC dc() const;
154 HFONT font() const { return hfont; } 154 HFONT font() const { return hfont; }
155 const TEXTMETRICA *textMetricA() const { return &tm.a; } 155 const TEXTMETRICA *textMetricA() const { return &tm.a; }
156 const TEXTMETRICW *textMetricW() const { return &tm.w; } 156 const TEXTMETRICW *textMetricW() const { return &tm.w; }
157 QString key() const { return k; } 157 QString key() const { return k; }
158 void reset(); 158 void reset();
159 159
160 QStringk; 160 QStringk;
161 HDC hdc; 161 HDC hdc;
162 HFONThfont; 162 HFONThfont;
163 uintstockFont:1; 163 uintstockFont:1;
164 uintpaintDevice:1; 164 uintpaintDevice:1;
165 uint useTextOutA:1;
165 union { 166 union {
166 TEXTMETRICWw; 167 TEXTMETRICWw;
167 TEXTMETRICAa; 168 TEXTMETRICAa;
168 } tm; 169 } tm;
169 int lw; 170 int lw;
170 int cache_cost; 171 int cache_cost;
171// friend void QFont::initFontInfo() const; 172// friend void QFont::initFontInfo() const;
172}; 173};
173 174
174#endif // Q_WS_WIN 175#endif // Q_WS_WIN
175 176
176#if defined( Q_WS_MAC ) 177#if defined( Q_WS_MAC )
177 178
178#if defined( Q_WS_MACX ) 179#if defined( Q_WS_MACX )
179# define QMAC_FONT_ATSUI 180# define QMAC_FONT_ATSUI
180#endif 181#endif
181#include "qt_mac.h" 182#include "qt_mac.h"
182class QMacFontInfo; 183class QMacFontInfo;
183 184
184class QFontStruct : public QShared 185class QFontStruct : public QShared
185{ 186{
186public: 187public:
187 inline QFontStruct() : QShared(), info(NULL), fnum(-1), cache_cost(0), internal_fi(NULL) { } 188 inline QFontStruct() : QShared(), info(NULL), fnum(-1), cache_cost(0), internal_fi(NULL) { }
188#if defined( QMAC_FONT_ATSUI ) && 0 189#if defined( QMAC_FONT_ATSUI ) && 0
189 ATSFontMetrics *info; 190 ATSFontMetrics *info;
190 int maxWidth() const { return (int)info->maxAdvanceWidth; } 191 int maxWidth() const { return (int)info->maxAdvanceWidth; }
191#else 192#else
192 FontInfo *info; 193 FontInfo *info;
193 int maxWidth() const { return info->widMax; } 194 int maxWidth() const { return info->widMax; }
194#endif 195#endif
195 int ascent() const { return (int)info->ascent; } 196 int ascent() const { return (int)info->ascent; }
196 int descent() const { return (int)info->descent; } 197 int descent() const { return (int)info->descent; }
197 int leading() const { return (int)info->leading; } 198 int leading() const { return (int)info->leading; }
198 int minLeftBearing() const { return 0; } 199 int minLeftBearing() const { return 0; }
199 int minRightBearing() const { return 0; } 200 int minRightBearing() const { return 0; }
200 201
201 short fnum; 202 short fnum;
202 int psize, cache_cost; 203 int psize, cache_cost;
203 QMacFontInfo *internal_fi; 204 QMacFontInfo *internal_fi;
204}; 205};
205 206
206#endif 207#endif
207 208
208#ifdef Q_WS_QWS 209#ifdef Q_WS_QWS
209class QFontStruct; 210class QFontStruct;
210class QGfx; 211class QGfx;
211#endif 212#endif
212 213
213typedef QCacheIterator<QFontStruct> QFontCacheIterator; 214typedef QCacheIterator<QFontStruct> QFontCacheIterator;
214class QFontCache : public QObject, public QCache<QFontStruct> 215class QFontCache : public QObject, public QCache<QFontStruct>
215{ 216{
216public: 217public:
217 QFontCache(); 218 QFontCache();
218 ~QFontCache(); 219 ~QFontCache();
219 220
220 bool insert(const QString &, const QFontStruct *, int c); 221 bool insert(const QString &, const QFontStruct *, int c);
221#ifndef Q_WS_MAC 222#ifndef Q_WS_MAC
222 void deleteItem(Item d); 223 void deleteItem(Item d);
223#endif 224#endif
224 void timerEvent(QTimerEvent *); 225 void timerEvent(QTimerEvent *);
225 226
226 227
227protected: 228protected:
228 229
229 230
230private: 231private:
231 int timer_id; 232 int timer_id;
232 bool fast; 233 bool fast;
233}; 234};
234 235
235 236
236// QFontPrivate - holds all data on which a font operates 237// QFontPrivate - holds all data on which a font operates
237class QFontPrivate : public QShared 238class QFontPrivate : public QShared
238{ 239{
239public: 240public:
240 static QFontCache *fontCache; 241 static QFontCache *fontCache;
241 242
242 243
243public: 244public:
244 245
245 QFontPrivate(); 246 QFontPrivate();
246 QFontPrivate(const QFontPrivate &fp); 247 QFontPrivate(const QFontPrivate &fp);
247 QFontPrivate( const QFontPrivate &fp, QPaintDevice *pd ); 248 QFontPrivate( const QFontPrivate &fp, QPaintDevice *pd );
248 ~QFontPrivate(); 249 ~QFontPrivate();
249 250
250 // requested font 251 // requested font
251 QFontDef request; 252 QFontDef request;
252 // actual font 253 // actual font
253 QFontDef actual; 254 QFontDef actual;
254 255
255 bool exactMatch; 256 bool exactMatch;
256 int lineWidth; 257 int lineWidth;
257 258
258 // common functions 259 // common functions
259 QString defaultFamily() const; 260 QString defaultFamily() const;
260 QString lastResortFamily() const; 261 QString lastResortFamily() const;
261 QString lastResortFont() const; 262 QString lastResortFont() const;
262 QString key() const; 263 QString key() const;
263 264
264 static int getFontWeight(const QCString &, bool = FALSE); 265 static int getFontWeight(const QCString &, bool = FALSE);
265 QRect boundingRect( const QChar &ch ); 266 QRect boundingRect( const QChar &ch );
266 267
267 struct TextRun { 268 struct TextRun {
268 TextRun() 269 TextRun()
269 { 270 {
270 xoff = 0; 271 xoff = 0;
271 yoff = 0; 272 yoff = 0;
272 x2off = 0; 273 x2off = 0;
273 script = QFont::NoScript; 274 script = QFont::NoScript;
274 string = 0; 275 string = 0;
275 length = 0; 276 length = 0;
276 next = 0; 277 next = 0;
277 } 278 }
278 279
279 ~TextRun() 280 ~TextRun()
280 { 281 {
281 if ( next ) 282 if ( next )
282 delete next; 283 delete next;
283 } 284 }
284 285
285 void setParams( int x, int y, int x2, const QChar *s, int len, 286 void setParams( int x, int y, int x2, const QChar *s, int len,
286 QFont::Script sc = QFont::NoScript ) { 287 QFont::Script sc = QFont::NoScript ) {
287 xoff = x; 288 xoff = x;
288 yoff = y; 289 yoff = y;
289 x2off = x2; 290 x2off = x2;
290 string = s; 291 string = s;
291 length = len; 292 length = len;
292 script = sc; 293 script = sc;
293 } 294 }
294 int xoff; 295 int xoff;
295 int yoff; 296 int yoff;
296 int x2off; 297 int x2off;
297 QFont::Script script; 298 QFont::Script script;
298 const QChar *string; 299 const QChar *string;
299 int length; 300 int length;
300 TextRun *next; 301 TextRun *next;
301#ifdef Q_WS_X11 302#ifdef Q_WS_X11
302 QByteArray mapped; 303 QByteArray mapped;
303#endif 304#endif
304 }; 305 };
305 306
306 // some replacement functions for native calls. This is needed, because shaping and 307 // 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 // 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 // drawing needs to take care to correctly position non spacing marks.
309 int textWidth( const QString &str, int pos, int len ); 310 int textWidth( const QString &str, int pos, int len );
310 311
311 // returns the script a certain character is in. Needed to separate the string 312 // 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 // into runs of different scripts as required for X11 and opentype.
313 QFont::Script scriptForChar(const QChar &c); 314 QFont::Script scriptForChar(const QChar &c);
314 315
315#ifdef Q_WS_X11 316#ifdef Q_WS_X11
316 QFont::Script hanHack( const QChar & c ); 317 QFont::Script hanHack( const QChar & c );
317 static char **getXFontNames(const char *, int *); 318 static char **getXFontNames(const char *, int *);
318 static bool fontExists(const QString &); 319 static bool fontExists(const QString &);
319 static bool parseXFontName(char *, char **); 320 static bool parseXFontName(char *, char **);
320 static QCString fixXLFD( const QCString & ); 321 static QCString fixXLFD( const QCString & );
321 static bool fillFontDef(XFontStruct *, QFontDef *, int); 322 static bool fillFontDef(XFontStruct *, QFontDef *, int);
322 static bool fillFontDef(const QCString &, QFontDef *, int); 323 static bool fillFontDef(const QCString &, QFontDef *, int);
323 324
324 static inline bool isZero(char *x) 325 static inline bool isZero(char *x)
325 { 326 {
326 return (x[0] == '0' && x[1] == 0); 327 return (x[0] == '0' && x[1] == 0);
327 } 328 }
328 329
329 static inline bool isScalable( char **tokens ) 330 static inline bool isScalable( char **tokens )
330 { 331 {
331 return (isZero(tokens[PixelSize]) && 332 return (isZero(tokens[PixelSize]) &&
332 isZero(tokens[PointSize]) && 333 isZero(tokens[PointSize]) &&
333 isZero(tokens[AverageWidth])); 334 isZero(tokens[AverageWidth]));
334 } 335 }
335 336
336 static inline bool isSmoothlyScalable( char **tokens ) 337 static inline bool isSmoothlyScalable( char **tokens )
337 { 338 {
338 return (isZero(tokens[ResolutionX]) && isZero(tokens[ResolutionY])); 339 return (isZero(tokens[ResolutionX]) && isZero(tokens[ResolutionY]));
339 } 340 }
340 341
341 static inline bool isFixedPitch( char **tokens ) 342 static inline bool isFixedPitch( char **tokens )
342 { 343 {
343 return (tokens[Spacing][0] == 'm' || 344 return (tokens[Spacing][0] == 'm' ||
344 tokens[Spacing][0] == 'c' || 345 tokens[Spacing][0] == 'c' ||
345 tokens[Spacing][0] == 'M' || 346 tokens[Spacing][0] == 'M' ||
346 tokens[Spacing][0] == 'C'); 347 tokens[Spacing][0] == 'C');
347 } 348 }
348 349
349 // XLFD fields 350 // XLFD fields
350 enum FontFieldNames { 351 enum FontFieldNames {
351 Foundry, 352 Foundry,
352 Family, 353 Family,
353 Weight, 354 Weight,
354 Slant, 355 Slant,
355 Width, 356 Width,
356 AddStyle, 357 AddStyle,
357 PixelSize, 358 PixelSize,
358 PointSize, 359 PointSize,
359 ResolutionX, 360 ResolutionX,
360 ResolutionY, 361 ResolutionY,
361 Spacing, 362 Spacing,
362 AverageWidth, 363 AverageWidth,
363 CharsetRegistry, 364 CharsetRegistry,
364 CharsetEncoding, 365 CharsetEncoding,
365 NFontFields 366 NFontFields
366 }; 367 };
367 368
368#ifndef QT_NO_XFTFREETYPE 369#ifndef QT_NO_XFTFREETYPE
369 XftPattern *findXftFont(const QChar &, bool *, double *scale) const; 370 XftPattern *findXftFont(const QChar &, bool *, double *scale) const;
370 XftPattern *bestXftPattern(const QString &, const QString &, const QChar &, double *scale) const; 371 XftPattern *bestXftPattern(const QString &, const QString &, const QChar &, double *scale) const;
371#endif // QT_NO_XFTFREETYPE 372#endif // QT_NO_XFTFREETYPE
372 QCString findFont(QFont::Script, bool *, double *) const; 373 QCString findFont(QFont::Script, bool *, double *) const;
373 QCString bestFamilyMember(QFont::Script, const QString &, const QString &, 374 QCString bestFamilyMember(QFont::Script, const QString &, const QString &,
374 const QString &, int *, double *) const; 375 const QString &, int *, double *) const;
375 QCString bestMatch(const char *, int *, QFont::Script, double *) const; 376 QCString bestMatch(const char *, int *, QFont::Script, double *) const;
376 int fontMatchScore(const char *, QCString &, float *, int *, bool *, 377 int fontMatchScore(const char *, QCString &, float *, int *, bool *,
377 bool *, QFont::Script, double *) const; 378 bool *, QFont::Script, double *) const;
378 void initFontInfo(QFont::Script, double scale); 379 void initFontInfo(QFont::Script, double scale);
379 void load(QFont::Script = QFont::NoScript, bool = TRUE); 380 void load(QFont::Script = QFont::NoScript, bool = TRUE);
380 bool loadUnicode(QFont::Script, const QChar &); 381 bool loadUnicode(QFont::Script, const QChar &);
381 void computeLineWidth(); 382 void computeLineWidth();
382 383
383 int textWidth( const QString &str, int pos, int len, TextRun *cache ); 384 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 textExtents( const QString &str, int pos, int len, QCharStruct *overall );
385 void drawText( Display *dpy, int screen, Qt::HANDLE hd, Qt::HANDLE rendhd, 386 void drawText( Display *dpy, int screen, Qt::HANDLE hd, Qt::HANDLE rendhd,
386 GC gc, const QColor &pen, Qt::BGMode, const QColor &bgcolor, 387 GC gc, const QColor &pen, Qt::BGMode, const QColor &bgcolor,
387 int x, int y, const TextRun *cache, int pdWidth ); 388 int x, int y, const TextRun *cache, int pdWidth );
388 bool inFont( const QChar &ch ); 389 bool inFont( const QChar &ch );
389 390
390 QFontX11Data x11data; 391 QFontX11Data x11data;
391 static QFont::Script defaultScript; 392 static QFont::Script defaultScript;
392 int x11Screen; 393 int x11Screen;
393#endif // Q_WS_X11 394#endif // Q_WS_X11
394 395
395 QPaintDevice *paintdevice; 396 QPaintDevice *paintdevice;
396 397
397#ifdef Q_WS_WIN 398#ifdef Q_WS_WIN
398 void load(); 399 void load();
399 void initFontInfo(); 400 void initFontInfo();
400 HFONT create( bool *stockFont, HDC hdc = 0, bool compatMode = FALSE ); 401 HFONT create( bool *stockFont, HDC hdc = 0, bool compatMode = FALSE );
401 QFontStruct *fin; 402 QFontStruct *fin;
402 403
403 void buildCache( HDC hdc, const QString &str, int pos, int len, TextRun *cache ); 404 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 void drawText( HDC hdc, int x, int y, TextRun *cache );
405#endif // Q_WS_WIN 406#endif // Q_WS_WIN
406 407
407#ifdef Q_WS_QWS 408#ifdef Q_WS_QWS
408 void load(); 409 void load();
409 QFontStruct *fin; 410 QFontStruct *fin;
410 int textWidth( const QString &str, int pos, int len, TextRun *cache ); 411 int textWidth( const QString &str, int pos, int len, TextRun *cache );
411 void drawText( QGfx *gfx, int x, int y, const TextRun *cache ); 412 void drawText( QGfx *gfx, int x, int y, const TextRun *cache );
412#endif 413#endif
413 414
414#if defined( Q_WS_MAC ) 415#if defined( Q_WS_MAC )
415 void macSetFont(QPaintDevice *); 416 void macSetFont(QPaintDevice *);
416 void drawText(int x, int y, QString s, int len, QPaintDevice *dev, const QRegion *rgn); 417 void drawText(int x, int y, const QString &s, int from, int len, QPaintDevice *dev, const QRegion *rgn, int dir);
417 void computeLineWidth(); 418 void computeLineWidth();
418 void load(); 419 void load();
419 QFontStruct *fin; 420 QFontStruct *fin;
420#endif 421#endif
421 422
422}; 423};
423 424
424inline QFontPrivate::QFontPrivate() 425inline QFontPrivate::QFontPrivate()
425 : QShared(), exactMatch(FALSE), lineWidth(1) 426 : QShared(), exactMatch(FALSE), lineWidth(1)
426{ 427{
427 428
428#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC) 429#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC)
429 fin = 0; 430 fin = 0;
430#endif // Q_WS_WIN || Q_WS_QWS 431#endif // Q_WS_WIN || Q_WS_QWS
431#if defined(Q_WS_X11) 432#if defined(Q_WS_X11)
432 x11Screen = QPaintDevice::x11AppScreen(); 433 x11Screen = QPaintDevice::x11AppScreen();
433#endif // Q_WS_X11 434#endif // Q_WS_X11
434 paintdevice = 0; 435 paintdevice = 0;
435} 436}
436 437
437inline QFontPrivate::QFontPrivate(const QFontPrivate &fp) 438inline QFontPrivate::QFontPrivate(const QFontPrivate &fp)
438 : QShared(), request(fp.request), actual(fp.actual), 439 : QShared(), request(fp.request), actual(fp.actual),
439exactMatch(fp.exactMatch), lineWidth(1) 440exactMatch(fp.exactMatch), lineWidth(1)
440{ 441{
441 Q_ASSERT(!fp.paintdevice); 442 Q_ASSERT(!fp.paintdevice);
442#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC) 443#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC)
443 fin = 0; 444 fin = 0;
444#endif // Q_WS_WIN || Q_WS_QWS 445#endif // Q_WS_WIN || Q_WS_QWS
445#if defined(Q_WS_X11) 446#if defined(Q_WS_X11)
446 x11Screen = fp.x11Screen; 447 x11Screen = fp.x11Screen;
447#endif // Q_WS_X11 448#endif // Q_WS_X11
448 paintdevice = 0; 449 paintdevice = 0;
449} 450}
450 451
451inline QFontPrivate::QFontPrivate( const QFontPrivate &fp, QPaintDevice *pd ) 452inline QFontPrivate::QFontPrivate( const QFontPrivate &fp, QPaintDevice *pd )
452 : QShared(), request(fp.request), actual(fp.actual), 453 : QShared(), request(fp.request), actual(fp.actual),
453exactMatch(fp.exactMatch), lineWidth(1) 454exactMatch(fp.exactMatch), lineWidth(1)
454{ 455{
455 456
456#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC) 457#if defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_MAC)
457 fin = 0; 458 fin = 0;
458#endif // Q_WS_WIN || Q_WS_QWS 459#endif // Q_WS_WIN || Q_WS_QWS
459#if defined(Q_WS_X11) 460#if defined(Q_WS_X11)
460 x11Screen = pd->x11Screen(); 461 x11Screen = pd->x11Screen();
461#endif // Q_WS_X11 462#endif // Q_WS_X11
462 paintdevice = pd; 463 paintdevice = pd;
463} 464}
464 465
465#ifndef Q_WS_QWS 466#ifndef Q_WS_QWS
466inline QFontPrivate::~QFontPrivate() 467inline QFontPrivate::~QFontPrivate()
467{ 468{
468#if defined(Q_WS_WIN) 469#if defined(Q_WS_WIN)
469 if( fin ) 470 if( fin )
470 fin->deref(); 471 fin->deref();
471#endif 472#endif
472#if defined(Q_WS_MAC) 473#if defined(Q_WS_MAC)
473 if( fin && fin->deref() ) 474 if( fin && fin->deref() )
474 delete fin; 475 delete fin;
475#endif 476#endif
476} 477}
477#endif 478#endif
478 479
479#endif // QFONTDATA_P_H 480#endif // QFONTDATA_P_H
diff --git a/qmake/include/private/qgfxdriverinterface_p.h b/qmake/include/private/qgfxdriverinterface_p.h
index 1782ed4..e8259ac 100644
--- a/qmake/include/private/qgfxdriverinterface_p.h
+++ b/qmake/include/private/qgfxdriverinterface_p.h
@@ -1,56 +1,68 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of Qt/Embedded Graphics Driver Interface 4** Definition of Qt/Embedded Graphics Driver Interface
5** 5**
6** Created : 20020211 6** Created : 20020211
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed and/or modified under the terms of the 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 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 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the 18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software. 19** Qt Embedded Commercial License Agreement provided with the Software.
20** 20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23** 23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements. 25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information. 26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27** 27**
28** Contact info@trolltech.com if any conditions of this licensing are 28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you. 29** not clear to you.
30** 30**
31**********************************************************************/ 31**********************************************************************/
32 32
33#ifndef QGFXDRIVERINTERFACE_H 33#ifndef QGFXDRIVERINTERFACE_P_H
34#define QGFXDRIVERINTERFACE_H 34#define QGFXDRIVERINTERFACE_P_H
35
36//
37// W A R N I N G
38// -------------
39//
40// This file is not part of the Qt API. This header file may
41// change from version to version without notice, or even be
42// removed.
43//
44// We mean it.
45//
46//
35 47
36#ifndef QT_H 48#ifndef QT_H
37#include <private/qcom_p.h> 49#include <private/qcom_p.h>
38#endif // QT_H 50#endif // QT_H
39 51
40#ifndef QT_NO_COMPONENT 52#ifndef QT_NO_COMPONENT
41 53
42// {449EC6C6-DF3E-43E3-9E57-354A3D05AB34} 54// {449EC6C6-DF3E-43E3-9E57-354A3D05AB34}
43#ifndef IID_QGfxDriver 55#ifndef IID_QGfxDriver
44#define IID_QGfxDriver QUuid( 0x449ec6c6, 0xdf3e, 0x43e3, 0x9e, 0x57, 0x35, 0x4a, 0x3d, 0x05, 0xab, 0x34) 56#define IID_QGfxDriver QUuid( 0x449ec6c6, 0xdf3e, 0x43e3, 0x9e, 0x57, 0x35, 0x4a, 0x3d, 0x05, 0xab, 0x34)
45#endif 57#endif
46 58
47class QScreen; 59class QScreen;
48 60
49struct Q_EXPORT QGfxDriverInterface : public QFeatureListInterface 61struct Q_EXPORT QGfxDriverInterface : public QFeatureListInterface
50{ 62{
51 virtual QScreen* create( const QString& driver, int displayId ) = 0; 63 virtual QScreen* create( const QString& driver, int displayId ) = 0;
52}; 64};
53 65
54#endif // QT_NO_COMPONENT 66#endif // QT_NO_COMPONENT
55 67
56#endif // QGFXDRIVERINTERFACE_H 68#endif // QGFXDRIVERINTERFACE_P_H
diff --git a/qmake/include/private/qgpluginmanager_p.h b/qmake/include/private/qgpluginmanager_p.h
index e0c0e78..2e4e9c5 100644
--- a/qmake/include/private/qgpluginmanager_p.h
+++ b/qmake/include/private/qgpluginmanager_p.h
@@ -1,107 +1,107 @@
1/********************************************************************** 1/**********************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QGPluginManager class 4** Definition of QGPluginManager class
5** 5**
6** Copyright (C) 2000-2001 Trolltech AS. All rights reserved. 6** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the tools module of the Qt GUI Toolkit. 8** This file is part of the tools module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QGPLUGINMANAGER_H 36#ifndef QGPLUGINMANAGER_P_H
37#define QGPLUGINMANAGER_H 37#define QGPLUGINMANAGER_P_H
38 38
39#ifndef QT_H 39#ifndef QT_H
40#include "qdict.h" 40#include "qdict.h"
41#include "qlibrary.h" 41#include "qlibrary.h"
42#include "quuid.h" 42#include "quuid.h"
43#include "qstringlist.h" 43#include "qstringlist.h"
44#include "qcom_p.h" 44#include "qcom_p.h"
45#endif // QT_H 45#endif // QT_H
46 46
47// 47//
48// W A R N I N G 48// W A R N I N G
49// ------------- 49// -------------
50// 50//
51// This file is not part of the Qt API. It exists for the convenience 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 52// of a number of Qt sources files. This header file may change from
53// version to version without notice, or even be removed. 53// version to version without notice, or even be removed.
54// 54//
55// We mean it. 55// We mean it.
56// 56//
57// 57//
58 58
59#ifndef QT_NO_COMPONENT 59#ifndef QT_NO_COMPONENT
60 60
61#if defined(Q_TEMPLATEDLL) 61#if defined(Q_TEMPLATEDLL)
62// MOC_SKIP_BEGIN 62// MOC_SKIP_BEGIN
63Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QLibrary>; 63Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QLibrary>;
64// MOC_SKIP_END 64// MOC_SKIP_END
65#endif 65#endif
66 66
67class Q_EXPORT QGPluginManager 67class Q_EXPORT QGPluginManager
68{ 68{
69public: 69public:
70 QGPluginManager( const QUuid& id, const QStringList& paths = QString::null, const QString &suffix = QString::null, bool cs = TRUE ); 70 QGPluginManager( const QUuid& id, const QStringList& paths = QString::null, const QString &suffix = QString::null, bool cs = TRUE );
71 ~QGPluginManager(); 71 ~QGPluginManager();
72 72
73 void addLibraryPath( const QString& path ); 73 void addLibraryPath( const QString& path );
74 const QLibrary* library( const QString& feature ) const; 74 const QLibrary* library( const QString& feature ) const;
75 QStringList featureList() const; 75 QStringList featureList() const;
76 76
77 bool autoUnload() const; 77 bool autoUnload() const;
78 void setAutoUnload( bool ); 78 void setAutoUnload( bool );
79 79
80protected: 80protected:
81 bool enabled() const; 81 bool enabled() const;
82 bool addLibrary( QLibrary* plugin ); 82 bool addLibrary( QLibrary* plugin );
83 83
84 QRESULT queryUnknownInterface(const QString& feature, QUnknownInterface** iface) const; 84 QRESULT queryUnknownInterface(const QString& feature, QUnknownInterface** iface) const;
85 85
86 QUuid interfaceId; 86 QUuid interfaceId;
87 QDict<QLibrary> plugDict; // Dict to match feature with library 87 QDict<QLibrary> plugDict; // Dict to match feature with library
88 QDict<QLibrary> libDict; // Dict to match library file with library 88 QDict<QLibrary> libDict; // Dict to match library file with library
89 QStringList libList; 89 QStringList libList;
90 90
91 uint casesens : 1; 91 uint casesens : 1;
92 uint autounload : 1; 92 uint autounload : 1;
93}; 93};
94 94
95inline void QGPluginManager::setAutoUnload( bool unload ) 95inline void QGPluginManager::setAutoUnload( bool unload )
96{ 96{
97 autounload = unload; 97 autounload = unload;
98} 98}
99 99
100inline bool QGPluginManager::autoUnload() const 100inline bool QGPluginManager::autoUnload() const
101{ 101{
102 return autounload; 102 return autounload;
103} 103}
104 104
105#endif 105#endif
106 106
107#endif //QGPLUGINMANAGER_H 107#endif //QGPLUGINMANAGER_P_H
diff --git a/qmake/include/private/qimageformatinterface_p.h b/qmake/include/private/qimageformatinterface_p.h
index 5f7601c..fd4c256 100644
--- a/qmake/include/private/qimageformatinterface_p.h
+++ b/qmake/include/private/qimageformatinterface_p.h
@@ -1,75 +1,75 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of ??? 4** ...
5** 5**
6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the kernel module of the Qt GUI Toolkit. 8** This file is part of the kernel module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QIMAGEFORMATINTERFACE_H 36#ifndef QIMAGEFORMATINTERFACE_P_H
37#define QIMAGEFORMATINTERFACE_H 37#define QIMAGEFORMATINTERFACE_P_H
38 38
39#ifndef QT_H 39#ifndef QT_H
40#include <private/qcom_p.h> 40#include <private/qcom_p.h>
41#endif // QT_H 41#endif // QT_H
42 42
43 43
44// 44//
45// W A R N I N G 45// W A R N I N G
46// ------------- 46// -------------
47// 47//
48// This file is not part of the Qt API. It exists for the convenience 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 49// of internal files. This header file may change from version to version
50// without notice, or even be removed. 50// without notice, or even be removed.
51// 51//
52// We mean it. 52// We mean it.
53// 53//
54// 54//
55 55
56#ifndef QT_NO_COMPONENT 56#ifndef QT_NO_COMPONENT
57 57
58// {04903F05-54B1-4726-A849-FB5CB097CA87} 58// {04903F05-54B1-4726-A849-FB5CB097CA87}
59#ifndef IID_QImageFormat 59#ifndef IID_QImageFormat
60#define IID_QImageFormat QUuid( 0x04903f05, 0x54b1, 0x4726, 0xa8, 0x49, 0xfb, 0x5c, 0xb0, 0x97, 0xca, 0x87 ) 60#define IID_QImageFormat QUuid( 0x04903f05, 0x54b1, 0x4726, 0xa8, 0x49, 0xfb, 0x5c, 0xb0, 0x97, 0xca, 0x87 )
61#endif 61#endif
62 62
63class QImage; 63class QImage;
64 64
65struct Q_EXPORT QImageFormatInterface : public QFeatureListInterface 65struct Q_EXPORT QImageFormatInterface : public QFeatureListInterface
66{ 66{
67 virtual QRESULT loadImage( const QString &format, const QString &filename, QImage * ) = 0; 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; 68 virtual QRESULT saveImage( const QString &format, const QString &filename, const QImage & ) = 0;
69 69
70 virtual QRESULT installIOHandler( const QString & ) = 0; 70 virtual QRESULT installIOHandler( const QString & ) = 0;
71}; 71};
72 72
73#endif // QT_NO_COMPONENT 73#endif // QT_NO_COMPONENT
74 74
75#endif // QIMAGEFORMATINTERFACE_H 75#endif // QIMAGEFORMATINTERFACE_P_H
diff --git a/qmake/include/private/qinputcontext_p.h b/qmake/include/private/qinputcontext_p.h
index 9ac0d2b..4d94147 100644
--- a/qmake/include/private/qinputcontext_p.h
+++ b/qmake/include/private/qinputcontext_p.h
@@ -1,121 +1,124 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of ??? 4** Definition of ???
5** 5**
6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the kernel module of the Qt GUI Toolkit. 8** This file is part of the kernel module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QINPUTCONTEXT_P_H 36#ifndef QINPUTCONTEXT_P_H
37#define QINPUTCONTEXT_P_H 37#define QINPUTCONTEXT_P_H
38 38
39 39
40// 40//
41// W A R N I N G 41// W A R N I N G
42// ------------- 42// -------------
43// 43//
44// This file is not part of the Qt API. It exists for the convenience 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 45// of internal files. This header file may change from version to version
46// without notice, or even be removed. 46// without notice, or even be removed.
47// 47//
48// We mean it. 48// We mean it.
49// 49//
50// 50//
51 51
52#include <qglobal.h> 52#include <qglobal.h>
53 53
54class QKeyEvent; 54class QKeyEvent;
55class QWidget; 55class QWidget;
56class QFont; 56class QFont;
57class QString; 57class QString;
58 58
59 59
60#ifdef Q_WS_X11 60#ifdef Q_WS_X11
61#include "qarray.h" 61#include "qarray.h"
62#include "qwindowdefs.h" 62#include "qwindowdefs.h"
63#include "qt_x11.h" 63#include "qt_x11.h"
64#endif 64#endif
65 65
66#ifdef Q_WS_WIN 66#ifdef Q_WS_WIN
67#include <qt_windows.h> 67#include <qt_windows.h>
68#endif 68#endif
69 69
70#ifdef Q_WS_QWS 70#ifdef Q_WS_QWS
71class QWSIMEvent; 71class QWSIMEvent;
72#endif 72#endif
73 73
74class QInputContext 74class QInputContext
75{ 75{
76public: 76public:
77#ifdef Q_WS_X11 77#ifdef Q_WS_X11
78 QInputContext(QWidget *); // should be a toplevel widget 78 QInputContext(QWidget *); // should be a toplevel widget
79 ~QInputContext(); 79 ~QInputContext();
80 80
81 void setFocus(); 81 void setFocus();
82 void setComposePosition(int, int); 82 void setComposePosition(int, int);
83 void setComposeArea(int, int, int, int); 83 void setComposeArea(int, int, int, int);
84 void reset(); 84 void reset();
85 85
86 int lookupString(XKeyEvent *, QCString &, KeySym *, Status *) const; 86 int lookupString(XKeyEvent *, QCString &, KeySym *, Status *) const;
87 void setXFontSet(const QFont &); 87 void setXFontSet(const QFont &);
88 88
89 void *ic; 89 void *ic;
90 QString text, lastcompose; 90 QString text;
91 QWidget *focusWidget; 91 QWidget *focusWidget;
92 bool composing; 92 bool composing;
93 QFont font; 93 QFont font;
94 XFontSet fontset; 94 XFontSet fontset;
95 QMemArray<bool> selectedChars; 95 QMemArray<bool> selectedChars;
96#endif // Q_WS_X11 96#endif // Q_WS_X11
97 97
98#ifdef Q_WS_QWS 98#ifdef Q_WS_QWS
99 static void translateIMEvent( QWSIMEvent *, QWidget * ); 99 static void translateIMEvent( QWSIMEvent *, QWidget * );
100 static void reset(); 100 static void reset();
101private: 101private:
102 static QWidget* focusWidget; 102 static QWidget* focusWidget;
103 static QString* composition; 103 static QString* composition;
104#endif //Q_WS_QWS 104#endif //Q_WS_QWS
105 105
106#ifdef Q_WS_WIN 106#ifdef Q_WS_WIN
107 static void init(); 107 static void init();
108 static void shutdown(); 108 static void shutdown();
109 109
110 static void TranslateMessage( const MSG *msg); 110 static void TranslateMessage( const MSG *msg);
111 static LRESULT DefWindowProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 111 static LRESULT DefWindowProc( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam );
112 112
113 static void setFont( const QWidget *w, const QFont & ); 113 static void setFont( const QWidget *w, const QFont & );
114 static void setFocusHint( int x, int y, int w, int h, const QWidget *widget ); 114 static void setFocusHint( int x, int y, int w, int h, const QWidget *widget );
115 static bool startComposition(); 115 static bool startComposition();
116 static bool endComposition( QWidget *fw = 0 ); 116 static bool endComposition( QWidget *fw = 0 );
117 static bool composition( LPARAM lparam ); 117 static bool composition( LPARAM lparam );
118
119 static void accept( QWidget *fw = 0 );
120 static void enable( bool );
118#endif 121#endif
119}; 122};
120 123
121#endif // QINPUTCONTEXT_P_H 124#endif // QINPUTCONTEXT_P_H
diff --git a/qmake/include/private/qkbddriverinterface_p.h b/qmake/include/private/qkbddriverinterface_p.h
index efc7ded..fe13487 100644
--- a/qmake/include/private/qkbddriverinterface_p.h
+++ b/qmake/include/private/qkbddriverinterface_p.h
@@ -1,56 +1,68 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of Qt/Embedded Keyboard Driver Interface 4** Definition of Qt/Embedded Keyboard Driver Interface
5** 5**
6** Created : 20020218 6** Created : 20020218
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed and/or modified under the terms of the 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 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 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the 18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software. 19** Qt Embedded Commercial License Agreement provided with the Software.
20** 20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23** 23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements. 25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information. 26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27** 27**
28** Contact info@trolltech.com if any conditions of this licensing are 28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you. 29** not clear to you.
30** 30**
31**********************************************************************/ 31**********************************************************************/
32 32
33#ifndef QKBDDRIVERINTERFACE_H 33#ifndef QKBDDRIVERINTERFACE_P_H
34#define QKBDDRIVERINTERFACE_H 34#define QKBDDRIVERINTERFACE_P_H
35
36//
37// W A R N I N G
38// -------------
39//
40// This file is not part of the Qt API. This header file may
41// change from version to version without notice, or even be
42// removed.
43//
44// We mean it.
45//
46//
35 47
36#ifndef QT_H 48#ifndef QT_H
37#include <private/qcom_p.h> 49#include <private/qcom_p.h>
38#endif // QT_H 50#endif // QT_H
39 51
40#ifndef QT_NO_COMPONENT 52#ifndef QT_NO_COMPONENT
41 53
42// {C7C838EA-FC3E-4905-92AD-F479E81F1D02} 54// {C7C838EA-FC3E-4905-92AD-F479E81F1D02}
43#ifndef IID_QKbdDriver 55#ifndef IID_QKbdDriver
44#define IID_QKbdDriver QUuid( 0xc7c838ea, 0xfc3e, 0x4905, 0x92, 0xad, 0xf4, 0x79, 0xe8, 0x1f, 0x1d, 0x02) 56#define IID_QKbdDriver QUuid( 0xc7c838ea, 0xfc3e, 0x4905, 0x92, 0xad, 0xf4, 0x79, 0xe8, 0x1f, 0x1d, 0x02)
45#endif 57#endif
46 58
47class QWSKeyboardHandler; 59class QWSKeyboardHandler;
48 60
49struct Q_EXPORT QKbdDriverInterface : public QFeatureListInterface 61struct Q_EXPORT QKbdDriverInterface : public QFeatureListInterface
50{ 62{
51 virtual QWSKeyboardHandler* create( const QString& driver, const QString& device ) = 0; 63 virtual QWSKeyboardHandler* create( const QString& driver, const QString& device ) = 0;
52}; 64};
53 65
54#endif // QT_NO_COMPONENT 66#endif // QT_NO_COMPONENT
55 67
56#endif // QKBDDRIVERINTERFACE_H 68#endif // QKBDDRIVERINTERFACE_P_H
diff --git a/qmake/include/private/qlibrary_p.h b/qmake/include/private/qlibrary_p.h
index c4dd565..1624ca5 100644
--- a/qmake/include/private/qlibrary_p.h
+++ b/qmake/include/private/qlibrary_p.h
@@ -1,84 +1,81 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of an internal QLibrary class 4** Definition of an internal QLibrary class
5** 5**
6** Created : 2000-01-01 6** Created : 000101
7** 7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QLIBRARY_P_H 38#ifndef QLIBRARY_P_H
39#define QLIBRARY_P_H 39#define QLIBRARY_P_H
40 40
41// 41//
42// W A R N I N G 42// W A R N I N G
43// ------------- 43// -------------
44// 44//
45// This file is not part of the Qt API. It exists for the convenience 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 46// of the QLibrary class. This header file may change from
47// version to version without notice, or even be removed. 47// version to version without notice, or even be removed.
48// 48//
49// We mean it. 49// We mean it.
50// 50//
51// 51//
52 52
53#include "qlibrary.h" 53#include "qlibrary.h"
54 54
55#ifndef QT_NO_LIBRARY 55#ifndef QT_NO_LIBRARY
56 56
57#ifndef QT_H 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" 58#include "qwindowdefs.h"
62#endif // QT_H 59#endif // QT_H
63 60
64class QLibraryPrivate 61class QLibraryPrivate
65{ 62{
66public: 63public:
67 QLibraryPrivate( QLibrary *lib ); 64 QLibraryPrivate( QLibrary *lib );
68 65
69#ifdef Q_WS_WIN 66#ifdef Q_WS_WIN
70 HINSTANCE pHnd; 67 HINSTANCE pHnd;
71#else 68#else
72 void *pHnd; 69 void *pHnd;
73#endif 70#endif
74 71
75 bool loadLibrary(); 72 bool loadLibrary();
76 bool freeLibrary(); 73 bool freeLibrary();
77 void *resolveSymbol( const char * ); 74 void *resolveSymbol( const char * );
78 75
79private: 76private:
80 QLibrary *library; 77 QLibrary *library;
81}; 78};
82 79
83#endif // QT_NO_LIBRARY 80#endif // QT_NO_LIBRARY
84#endif // QLIBRARY_P_H 81#endif // QLIBRARY_P_H
diff --git a/qmake/include/private/qlock_p.h b/qmake/include/private/qlock_p.h
new file mode 100644
index 0000000..5c261aa
--- a/dev/null
+++ b/qmake/include/private/qlock_p.h
@@ -0,0 +1,93 @@
1/****************************************************************************
2** $Id$
3**
4** Definition of QLock class. This manages interprocess locking
5**
6** Created : 20000406
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 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 QLOCK_P_H
34#define QLOCK_P_H
35
36//
37// W A R N I N G
38// -------------
39//
40// This file is not part of the Qt API. This header file may
41// change from version to version without notice, or even be
42// removed.
43//
44// We mean it.
45//
46//
47
48#ifndef QT_H
49#include <qstring.h>
50#endif // QT_H
51
52class QLockData;
53
54class QLock
55{
56public:
57 QLock( const QString &filename, char id, bool create = FALSE );
58 ~QLock();
59
60 enum Type { Read, Write };
61
62 bool isValid() const;
63 void lock( Type type );
64 void unlock();
65 bool locked() const;
66
67private:
68 Type type;
69 QLockData *data;
70};
71
72
73// Nice class for ensuring the lock is released.
74// Just create one on the stack and the lock is automatically released
75// when QLockHolder is destructed.
76class QLockHolder
77{
78public:
79 QLockHolder( QLock *l, QLock::Type type ) : qlock(l) {
80 qlock->lock( type );
81 }
82 ~QLockHolder() { if ( locked() ) qlock->unlock(); }
83
84 void lock( QLock::Type type ) { qlock->lock( type ); }
85 void unlock() { qlock->unlock(); }
86 bool locked() const { return qlock->locked(); }
87
88private:
89 QLock *qlock;
90};
91
92#endif
93
diff --git a/qmake/include/private/qmousedriverinterface_p.h b/qmake/include/private/qmousedriverinterface_p.h
index fd76308..42a2e3e 100644
--- a/qmake/include/private/qmousedriverinterface_p.h
+++ b/qmake/include/private/qmousedriverinterface_p.h
@@ -1,56 +1,68 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of Qt/Embedded Mouse Driver Interface 4** Definition of Qt/Embedded Mouse Driver Interface
5** 5**
6** Created : 20020220 6** Created : 20020220
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed and/or modified under the terms of the 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 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 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the 18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software. 19** Qt Embedded Commercial License Agreement provided with the Software.
20** 20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23** 23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements. 25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information. 26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27** 27**
28** Contact info@trolltech.com if any conditions of this licensing are 28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you. 29** not clear to you.
30** 30**
31**********************************************************************/ 31**********************************************************************/
32 32
33#ifndef QMOUSEDRIVERINTERFACE_H 33#ifndef QMOUSEDRIVERINTERFACE_P_H
34#define QMOUSEDRIVERINTERFACE_H 34#define QMOUSEDRIVERINTERFACE_P_H
35
36//
37// W A R N I N G
38// -------------
39//
40// This file is not part of the Qt API. This header file may
41// change from version to version without notice, or even be
42// removed.
43//
44// We mean it.
45//
46//
35 47
36#ifndef QT_H 48#ifndef QT_H
37#include <private/qcom_p.h> 49#include <private/qcom_p.h>
38#endif // QT_H 50#endif // QT_H
39 51
40#ifndef QT_NO_COMPONENT 52#ifndef QT_NO_COMPONENT
41 53
42// {4367CF5A-F7CE-407B-8BB6-DF19AEDA2EBB} 54// {4367CF5A-F7CE-407B-8BB6-DF19AEDA2EBB}
43#ifndef IID_QMouseDriver 55#ifndef IID_QMouseDriver
44#define IID_QMouseDriver QUuid( 0x4367cf5a, 0xf7ce, 0x407b, 0x8b, 0xb6, 0xdf, 0x19, 0xae, 0xda, 0x2e, 0xbb) 56#define IID_QMouseDriver QUuid( 0x4367cf5a, 0xf7ce, 0x407b, 0x8b, 0xb6, 0xdf, 0x19, 0xae, 0xda, 0x2e, 0xbb)
45#endif 57#endif
46 58
47class QWSMouseHandler; 59class QWSMouseHandler;
48 60
49struct Q_EXPORT QMouseDriverInterface : public QFeatureListInterface 61struct Q_EXPORT QMouseDriverInterface : public QFeatureListInterface
50{ 62{
51 virtual QWSMouseHandler* create( const QString& driver, const QString &device ) = 0; 63 virtual QWSMouseHandler* create( const QString& driver, const QString &device ) = 0;
52}; 64};
53 65
54#endif // QT_NO_COMPONENT 66#endif // QT_NO_COMPONENT
55 67
56#endif // QMOUSEDRIVERINTERFACE_H 68#endif // QMOUSEDRIVERINTERFACE_P_H
diff --git a/qmake/include/private/qmutexpool_p.h b/qmake/include/private/qmutexpool_p.h
index 3d9fef7..fb84157 100644
--- a/qmake/include/private/qmutexpool_p.h
+++ b/qmake/include/private/qmutexpool_p.h
@@ -1,39 +1,75 @@
1#ifndef QMUTEXPOOL_H 1/****************************************************************************
2#define QMUTEXPOOL_H 2** $Id$
3**
4** ...
5**
6** Copyright (C) 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 QMUTEXPOOL_P_H
37#define QMUTEXPOOL_P_H
3 38
4// 39//
5// W A R N I N G 40// W A R N I N G
6// ------------- 41// -------------
7// 42//
8// This file is not part of the Qt API. It exists for the convenience 43// 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 44// of QSettings. This header file may change from version to
10// version without notice, or even be removed. 45// version without notice, or even be removed.
11// 46//
12// We mean it. 47// We mean it.
13// 48//
14// 49//
15 50
16#ifdef QT_THREAD_SUPPORT 51#ifdef QT_THREAD_SUPPORT
17 52
18#include "qmutex.h" 53#include "qmutex.h"
19#include "qmemarray.h" 54#include "qmemarray.h"
20 55
21class QMutexPool 56class QMutexPool
22{ 57{
23public: 58public:
24 QMutexPool( bool recursive = FALSE, int size = 17 ); 59 QMutexPool( bool recursive = FALSE, int size = 17 );
25 ~QMutexPool(); 60 ~QMutexPool();
26 61
27 QMutex *get( void *address ); 62 QMutex *get( void *address );
28 63
29private: 64private:
30 QMutex mutex; 65 QMutex mutex;
31 QMemArray<QMutex*> mutexes; 66 QMutex **mutexes;
67 int count;
32 bool recurs; 68 bool recurs;
33}; 69};
34 70
35extern QMutexPool *qt_global_mutexpool; 71extern QMutexPool *qt_global_mutexpool;
36 72
37#endif // QT_THREAD_SUPPORT 73#endif // QT_THREAD_SUPPORT
38 74
39#endif // QMUTEXPOOL_H 75#endif // QMUTEXPOOL_P_H
diff --git a/qmake/include/private/qpluginmanager_p.h b/qmake/include/private/qpluginmanager_p.h
index 4b64ba0..a8da10e 100644
--- a/qmake/include/private/qpluginmanager_p.h
+++ b/qmake/include/private/qpluginmanager_p.h
@@ -1,73 +1,73 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QPluginManager class 4** Definition of QPluginManager class
5** 5**
6** Created : 2000-01-01 6** Created : 000101
7** 7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QPLUGINMANAGER_H 38#ifndef QPLUGINMANAGER_P_H
39#define QPLUGINMANAGER_H 39#define QPLUGINMANAGER_P_H
40
41#ifndef QT_H
42#include "qgpluginmanager_p.h"
43#endif // QT_H
44 40
45// 41//
46// W A R N I N G 42// W A R N I N G
47// ------------- 43// -------------
48// 44//
49// This file is not part of the Qt API. It exists for the convenience 45// 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 46// of a number of Qt sources files. This header file may change from
51// version to version without notice, or even be removed. 47// version to version without notice, or even be removed.
52// 48//
53// We mean it. 49// We mean it.
54// 50//
55// 51//
56 52
53#ifndef QT_H
54#include "qgpluginmanager_p.h"
55#endif // QT_H
56
57#ifndef QT_NO_COMPONENT 57#ifndef QT_NO_COMPONENT
58 58
59template<class Type> 59template<class Type>
60class QPluginManager : public QGPluginManager 60class QPluginManager : public QGPluginManager
61{ 61{
62public: 62public:
63 QPluginManager( const QUuid& id, const QStringList& paths = QString::null, const QString &suffix = QString::null, bool cs = TRUE ) 63 QPluginManager( const QUuid& id, const QStringList& paths = QString::null, const QString &suffix = QString::null, bool cs = TRUE )
64 : QGPluginManager( id, paths, suffix, cs ) {} 64 : QGPluginManager( id, paths, suffix, cs ) {}
65 QRESULT queryInterface(const QString& feature, Type** iface) const 65 QRESULT queryInterface(const QString& feature, Type** iface) const
66 { 66 {
67 return queryUnknownInterface( feature, (QUnknownInterface**)iface ); 67 return queryUnknownInterface( feature, (QUnknownInterface**)iface );
68 } 68 }
69}; 69};
70 70
71#endif //QT_NO_COMPONENT 71#endif //QT_NO_COMPONENT
72 72
73#endif //QPLUGINMANAGER_H 73#endif //QPLUGINMANAGER_P_H
diff --git a/qmake/include/private/qpsprinter_p.h b/qmake/include/private/qpsprinter_p.h
index 27a4968..692cb44 100644
--- a/qmake/include/private/qpsprinter_p.h
+++ b/qmake/include/private/qpsprinter_p.h
@@ -1,89 +1,89 @@
1/********************************************************************** 1/**********************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of internal QPSPrinter class. 4** Definition of internal QPSPrinter class.
5** QPSPrinter implements PostScript (tm) output via QPrinter. 5** QPSPrinter implements PostScript (tm) output via QPrinter.
6** 6**
7** Created : 940927 7** Created : 940927
8** 8**
9** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 9** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
10** 10**
11** This file is part of the kernel module of the Qt GUI Toolkit. 11** This file is part of the kernel module of the Qt GUI Toolkit.
12** 12**
13** This file may be distributed under the terms of the Q Public License 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 14** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file. 15** LICENSE.QPL included in the packaging of this file.
16** 16**
17** This file may be distributed and/or modified under the terms of the 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 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 19** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file. 20** packaging of this file.
21** 21**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License 23** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software. 24** Agreement provided with the Software.
25** 25**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 27** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28** 28**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements. 30** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information. 31** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information. 32** See http://www.trolltech.com/gpl/ for GPL licensing information.
33** 33**
34** Contact info@trolltech.com if any conditions of this licensing are 34** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you. 35** not clear to you.
36** 36**
37**********************************************************************/ 37**********************************************************************/
38 38
39#ifndef QPSPRINTER_P_H 39#ifndef QPSPRINTER_P_H
40#define QPSPRINTER_P_H 40#define QPSPRINTER_P_H
41 41
42 42
43// 43//
44// W A R N I N G 44// W A R N I N G
45// ------------- 45// -------------
46// 46//
47// This file is not part of the Qt API. It exists for the convenience 47// This file is not part of the Qt API. It exists for the convenience
48// of qpsprinter.cpp and qprinter_x11.cpp. 48// of qpsprinter.cpp and qprinter_x11.cpp.
49// This header file may change from version to version without notice, 49// This header file may change from version to version without notice,
50// or even be removed. 50// or even be removed.
51// 51//
52// We mean it. 52// We mean it.
53// 53//
54// 54//
55 55
56 56
57#ifndef QT_H 57#ifndef QT_H
58#include "qprinter.h" 58#include "qprinter.h"
59#include "qtextstream.h" 59#include "qtextstream.h"
60#endif // QT_H 60#endif // QT_H
61 61
62#ifndef QT_NO_PRINTER 62#ifndef QT_NO_PRINTER
63 63
64struct QPSPrinterPrivate; 64class QPSPrinterPrivate;
65 65
66class Q_EXPORT QPSPrinter : public QPaintDevice 66class Q_EXPORT QPSPrinter : public QPaintDevice
67{ 67{
68private: 68private:
69 // QPrinter uses these 69 // QPrinter uses these
70 QPSPrinter( QPrinter *, int ); 70 QPSPrinter( QPrinter *, int );
71 ~QPSPrinter(); 71 ~QPSPrinter();
72 72
73 bool cmd ( int, QPainter *, QPDevCmdParam * ); 73 bool cmd ( int, QPainter *, QPDevCmdParam * );
74 74
75 enum { NewPage = 100, AbortPrinting }; 75 enum { NewPage = 100, AbortPrinting };
76 76
77 friend class QPrinter; 77 friend class QPrinter;
78private: 78private:
79 // not used by QPrinter 79 // not used by QPrinter
80 QPSPrinterPrivate *d; 80 QPSPrinterPrivate *d;
81 81
82 // Disabled copy constructor and operator= 82 // Disabled copy constructor and operator=
83 QPSPrinter( const QPSPrinter & ); 83 QPSPrinter( const QPSPrinter & );
84 QPSPrinter &operator=( const QPSPrinter & ); 84 QPSPrinter &operator=( const QPSPrinter & );
85}; 85};
86 86
87#endif // QT_NO_PRINTER 87#endif // QT_NO_PRINTER
88 88
89#endif // QPSPRINTER_P_H 89#endif // QPSPRINTER_P_H
diff --git a/qmake/include/private/qrichtext_p.h b/qmake/include/private/qrichtext_p.h
index 8e29804..9ed87cf 100644
--- a/qmake/include/private/qrichtext_p.h
+++ b/qmake/include/private/qrichtext_p.h
@@ -1,2133 +1,2156 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of internal rich text classes 4** Definition of internal rich text classes
5** 5**
6** Created : 990124 6** Created : 990124
7** 7**
8** Copyright (C) 1999-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1999-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QRICHTEXT_P_H 38#ifndef QRICHTEXT_P_H
39#define QRICHTEXT_P_H 39#define QRICHTEXT_P_H
40 40
41// 41//
42// W A R N I N G 42// W A R N I N G
43// ------------- 43// -------------
44// 44//
45// This file is not part of the Qt API. It exists for the convenience 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 46// of a number of Qt sources files. This header file may change from
47// version to version without notice, or even be removed. 47// version to version without notice, or even be removed.
48// 48//
49// We mean it. 49// We mean it.
50// 50//
51// 51//
52 52
53#ifndef QT_H 53#ifndef QT_H
54#include "qstring.h" 54#include "qstring.h"
55#include "qptrlist.h" 55#include "qptrlist.h"
56#include "qrect.h" 56#include "qrect.h"
57#include "qfontmetrics.h" 57#include "qfontmetrics.h"
58#include "qintdict.h" 58#include "qintdict.h"
59#include "qmap.h" 59#include "qmap.h"
60#include "qstringlist.h" 60#include "qstringlist.h"
61#include "qfont.h" 61#include "qfont.h"
62#include "qcolor.h" 62#include "qcolor.h"
63#include "qsize.h" 63#include "qsize.h"
64#include "qvaluelist.h" 64#include "qvaluelist.h"
65#include "qvaluestack.h" 65#include "qvaluestack.h"
66#include "qobject.h" 66#include "qobject.h"
67#include "qdict.h" 67#include "qdict.h"
68#include "qpixmap.h" 68#include "qpixmap.h"
69#include "qstylesheet.h" 69#include "qstylesheet.h"
70#include "qptrvector.h" 70#include "qptrvector.h"
71#include "qpainter.h" 71#include "qpainter.h"
72#include "qlayout.h" 72#include "qlayout.h"
73#include "qobject.h" 73#include "qobject.h"
74#include "private/qcomplextext_p.h" 74#include "private/qcomplextext_p.h"
75#include "qapplication.h" 75#include "qapplication.h"
76#endif // QT_H 76#endif // QT_H
77 77
78#ifndef QT_NO_RICHTEXT 78#ifndef QT_NO_RICHTEXT
79 79
80class QTextDocument; 80class QTextDocument;
81class QTextString; 81class QTextString;
82class QTextPreProcessor; 82class QTextPreProcessor;
83class QTextFormat; 83class QTextFormat;
84class QTextCursor; 84class QTextCursor;
85class QTextParagraph; 85class QTextParagraph;
86class QTextFormatter; 86class QTextFormatter;
87class QTextIndent; 87class QTextIndent;
88class QTextFormatCollection; 88class QTextFormatCollection;
89class QStyleSheetItem; 89class QStyleSheetItem;
90#ifndef QT_NO_TEXTCUSTOMITEM 90#ifndef QT_NO_TEXTCUSTOMITEM
91class QTextCustomItem; 91class QTextCustomItem;
92#endif 92#endif
93class QTextFlow; 93class QTextFlow;
94struct QBidiContext; 94struct QBidiContext;
95 95
96// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 96// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
97 97
98class Q_EXPORT QTextStringChar 98class Q_EXPORT QTextStringChar
99{ 99{
100 friend class QTextString; 100 friend class QTextString;
101 101
102public: 102public:
103 // this is never called, initialize variables in QTextString::insert()!!! 103 // this is never called, initialize variables in QTextString::insert()!!!
104 QTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0;} 104 QTextStringChar() : lineStart( 0 ), type( Regular ), startOfRun( 0 ) {d.format=0;}
105 ~QTextStringChar(); 105 ~QTextStringChar();
106 106
107 QChar c; 107 QChar c;
108 enum Type { Regular=0, Custom=1, Anchor=2, CustomAnchor=3 }; 108 enum Type { Regular=0, Custom=1, Anchor=2, CustomAnchor=3 };
109 uint lineStart : 1; 109 uint lineStart : 1;
110 uint rightToLeft : 1; 110 uint rightToLeft : 1;
111 uint hasCursor : 1; 111 uint hasCursor : 1;
112 uint canBreak : 1; 112 uint canBreak : 1;
113 Type type : 2; 113 Type type : 2;
114 uint startOfRun : 1; 114 uint startOfRun : 1;
115 115
116 int x; 116 int x;
117 int height() const; 117 int height() const;
118 int ascent() const; 118 int ascent() const;
119 int descent() const; 119 int descent() const;
120 bool isCustom() const { return (type & Custom) != 0; } 120 bool isCustom() const { return (type & Custom) != 0; }
121 QTextFormat *format() const; 121 QTextFormat *format() const;
122#ifndef QT_NO_TEXTCUSTOMITEM 122#ifndef QT_NO_TEXTCUSTOMITEM
123 QTextCustomItem *customItem() const; 123 QTextCustomItem *customItem() const;
124#endif 124#endif
125 void setFormat( QTextFormat *f ); 125 void setFormat( QTextFormat *f );
126#ifndef QT_NO_TEXTCUSTOMITEM 126#ifndef QT_NO_TEXTCUSTOMITEM
127 void setCustomItem( QTextCustomItem *i ); 127 void setCustomItem( QTextCustomItem *i );
128#endif 128#endif
129 struct CustomData 129 struct CustomData
130 { 130 {
131 QTextFormat *format; 131 QTextFormat *format;
132#ifndef QT_NO_TEXTCUSTOMITEM 132#ifndef QT_NO_TEXTCUSTOMITEM
133 QTextCustomItem *custom; 133 QTextCustomItem *custom;
134#endif 134#endif
135 QString anchorName; 135 QString anchorName;
136 QString anchorHref; 136 QString anchorHref;
137 }; 137 };
138 138
139#ifndef QT_NO_TEXTCUSTOMITEM 139#ifndef QT_NO_TEXTCUSTOMITEM
140 void loseCustomItem(); 140 void loseCustomItem();
141#endif 141#endif
142 142
143 union { 143 union {
144 QTextFormat* format; 144 QTextFormat* format;
145 CustomData* custom; 145 CustomData* custom;
146 } d; 146 } d;
147 147
148 bool isAnchor() const { return ( type & Anchor) != 0; } 148 bool isAnchor() const { return ( type & Anchor) != 0; }
149 bool isLink() const { return isAnchor() && !!d.custom->anchorHref; } 149 bool isLink() const { return isAnchor() && !!d.custom->anchorHref; }
150 QString anchorName() const; 150 QString anchorName() const;
151 QString anchorHref() const; 151 QString anchorHref() const;
152 void setAnchor( const QString& name, const QString& href ); 152 void setAnchor( const QString& name, const QString& href );
153 153
154private: 154private:
155 QTextStringChar &operator=( const QTextStringChar & ) { 155 QTextStringChar &operator=( const QTextStringChar & ) {
156 //abort(); 156 //abort();
157 return *this; 157 return *this;
158 } 158 }
159 QTextStringChar( const QTextStringChar & ) {
160 }
159 friend class QComplexText; 161 friend class QComplexText;
160 friend class QTextParagraph; 162 friend class QTextParagraph;
161}; 163};
162 164
163#if defined(Q_TEMPLATEDLL) 165#if defined(Q_TEMPLATEDLL)
164// MOC_SKIP_BEGIN 166// MOC_SKIP_BEGIN
165Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<QTextStringChar>; 167Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<QTextStringChar>;
166// MOC_SKIP_END 168// MOC_SKIP_END
167#endif 169#endif
168 170
169class Q_EXPORT QTextString 171class Q_EXPORT QTextString
170{ 172{
171public: 173public:
172 174
173 QTextString(); 175 QTextString();
174 QTextString( const QTextString &s ); 176 QTextString( const QTextString &s );
175 virtual ~QTextString(); 177 virtual ~QTextString();
176 178
177 static QString toString( const QMemArray<QTextStringChar> &data ); 179 static QString toString( const QMemArray<QTextStringChar> &data, bool fixspaces = TRUE );
178 QString toString() const; 180 QString toString( bool fixspaces = TRUE ) const;
179 181
180 QTextStringChar &at( int i ) const; 182 QTextStringChar &at( int i ) const;
181#if defined(Q_STRICT_INLINING_RULES) 183#if defined(Q_STRICT_INLINING_RULES)
182 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the 184 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
183 // implementation to be a redefinition. 185 // implementation to be a redefinition.
184 inline int length() const; 186 inline int length() const;
185#else 187#else
186 int length() const; 188 int length() const;
187#endif 189#endif
188 190
189 int width( int idx ) const; 191 int width( int idx ) const;
190 192
191 void insert( int index, const QString &s, QTextFormat *f ); 193 void insert( int index, const QString &s, QTextFormat *f );
192 void insert( int index, const QChar *unicode, int len, QTextFormat *f ); 194 void insert( int index, const QChar *unicode, int len, QTextFormat *f );
193 void insert( int index, QTextStringChar *c, bool doAddRefFormat = FALSE ); 195 void insert( int index, QTextStringChar *c, bool doAddRefFormat = FALSE );
194 void truncate( int index ); 196 void truncate( int index );
195 void remove( int index, int len ); 197 void remove( int index, int len );
196 void clear(); 198 void clear();
197 199
198 void setFormat( int index, QTextFormat *f, bool useCollection ); 200 void setFormat( int index, QTextFormat *f, bool useCollection );
199 201
200 void setBidi( bool b ) { bidi = b; } 202 void setBidi( bool b ) { bidi = b; }
201 bool isBidi() const; 203 bool isBidi() const;
202 bool isRightToLeft() const; 204 bool isRightToLeft() const;
203 QChar::Direction direction() const; 205 QChar::Direction direction() const;
204 void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; } 206 void setDirection( QChar::Direction d ) { dir = d; bidiDirty = TRUE; }
205 207
206 QMemArray<QTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const; 208 QMemArray<QTextStringChar> subString( int start = 0, int len = 0xFFFFFF ) const;
207 QMemArray<QTextStringChar> rawData() const { return data.copy(); } 209 QMemArray<QTextStringChar> rawData() const { return data.copy(); }
208 210
209 void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); } 211 void operator=( const QString &s ) { clear(); insert( 0, s, 0 ); }
210 void operator+=( const QString &s ) { insert( length(), s, 0 ); } 212 void operator+=( const QString &s ) { insert( length(), s, 0 ); }
211 void prepend( const QString &s ) { insert( 0, s, 0 ); } 213 void prepend( const QString &s ) { insert( 0, s, 0 ); }
212 214
213private: 215private:
214 void checkBidi() const; 216 void checkBidi() const;
215 217
216 QMemArray<QTextStringChar> data; 218 QMemArray<QTextStringChar> data;
217 uint bidiDirty : 1; 219 uint bidiDirty : 1;
218 uint bidi : 1; // true when the paragraph has right to left characters 220 uint bidi : 1; // true when the paragraph has right to left characters
219 uint rightToLeft : 1; 221 uint rightToLeft : 1;
220 uint dir : 5; 222 uint dir : 5;
221}; 223};
222 224
223inline bool QTextString::isBidi() const 225inline bool QTextString::isBidi() const
224{ 226{
225 if ( bidiDirty ) 227 if ( bidiDirty )
226 checkBidi(); 228 checkBidi();
227 return bidi; 229 return bidi;
228} 230}
229 231
230inline bool QTextString::isRightToLeft() const 232inline bool QTextString::isRightToLeft() const
231{ 233{
232 if ( bidiDirty ) 234 if ( bidiDirty )
233 checkBidi(); 235 checkBidi();
234 return rightToLeft; 236 return rightToLeft;
235} 237}
236 238
237inline QChar::Direction QTextString::direction() const 239inline QChar::Direction QTextString::direction() const
238{ 240{
239 return (QChar::Direction) dir; 241 return (QChar::Direction) dir;
240} 242}
241 243
242// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 244// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
243 245
244#if defined(Q_TEMPLATEDLL) 246#if defined(Q_TEMPLATEDLL)
245// MOC_SKIP_BEGIN 247// MOC_SKIP_BEGIN
246Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<int>; 248Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<int>;
247Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<QTextParagraph*>; 249Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<QTextParagraph*>;
248Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<bool>; 250Q_TEMPLATE_EXTERN template class Q_EXPORT QValueStack<bool>;
249// MOC_SKIP_END 251// MOC_SKIP_END
250#endif 252#endif
251 253
252class Q_EXPORT QTextCursor 254class Q_EXPORT QTextCursor
253{ 255{
254public: 256public:
255 QTextCursor( QTextDocument *d = 0 ); 257 QTextCursor( QTextDocument *d = 0 );
256 QTextCursor( const QTextCursor &c ); 258 QTextCursor( const QTextCursor &c );
257 QTextCursor &operator=( const QTextCursor &c ); 259 QTextCursor &operator=( const QTextCursor &c );
258 virtual ~QTextCursor() {} 260 virtual ~QTextCursor() {}
259 261
260 bool operator==( const QTextCursor &c ) const; 262 bool operator==( const QTextCursor &c ) const;
261 bool operator!=( const QTextCursor &c ) const { return !(*this == c); } 263 bool operator!=( const QTextCursor &c ) const { return !(*this == c); }
262 264
263#if defined(Q_STRICT_INLINING_RULES) 265#if defined(Q_STRICT_INLINING_RULES)
264 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the 266 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
265 // implementation to be a redefinition. 267 // implementation to be a redefinition.
266 inline QTextParagraph *paragraph() const; 268 inline QTextParagraph *paragraph() const;
267#else 269#else
268 QTextParagraph *paragraph() const; 270 QTextParagraph *paragraph() const;
269#endif 271#endif
270 272
271 void setParagraph( QTextParagraph*p ) { gotoPosition(p, 0 ); } 273 void setParagraph( QTextParagraph*p ) { gotoPosition(p, 0 ); }
272 QTextDocument *document() const; 274 QTextDocument *document() const;
273 int index() const; 275 int index() const;
274 void setIndex( int index ) { gotoPosition(paragraph(), index ); } 276 void setIndex( int index ) { gotoPosition(paragraph(), index ); }
275 277
276 void gotoPosition( QTextParagraph* p, int index = 0); 278 void gotoPosition( QTextParagraph* p, int index = 0);
277 void gotoLeft(); 279 void gotoLeft();
278 void gotoRight(); 280 void gotoRight();
279 void gotoNextLetter(); 281 void gotoNextLetter();
280 void gotoPreviousLetter(); 282 void gotoPreviousLetter();
281 void gotoUp(); 283 void gotoUp();
282 void gotoDown(); 284 void gotoDown();
283 void gotoLineEnd(); 285 void gotoLineEnd();
284 void gotoLineStart(); 286 void gotoLineStart();
285 void gotoHome(); 287 void gotoHome();
286 void gotoEnd(); 288 void gotoEnd();
287 void gotoPageUp( int visibleHeight ); 289 void gotoPageUp( int visibleHeight );
288 void gotoPageDown( int visibleHeight ); 290 void gotoPageDown( int visibleHeight );
289 void gotoNextWord(); 291 void gotoNextWord( bool onlySpace = FALSE );
290 void gotoPreviousWord(); 292 void gotoPreviousWord( bool onlySpace = FALSE );
291 void gotoWordLeft(); 293 void gotoWordLeft();
292 void gotoWordRight(); 294 void gotoWordRight();
293 295
294 void insert( const QString &s, bool checkNewLine, QMemArray<QTextStringChar> *formatting = 0 ); 296 void insert( const QString &s, bool checkNewLine, QMemArray<QTextStringChar> *formatting = 0 );
295 void splitAndInsertEmptyParagraph( bool ind = TRUE, bool updateIds = TRUE ); 297 void splitAndInsertEmptyParagraph( bool ind = TRUE, bool updateIds = TRUE );
296 bool remove(); 298 bool remove();
297 void indent(); 299 void indent();
298 300
299 bool atParagStart(); 301 bool atParagStart();
300 bool atParagEnd(); 302 bool atParagEnd();
301 303
302 int x() const; // x in current paragraph 304 int x() const; // x in current paragraph
303 int y() const; // y in current paragraph 305 int y() const; // y in current paragraph
304 306
305 int globalX() const; 307 int globalX() const;
306 int globalY() const; 308 int globalY() const;
307 309
308 QTextParagraph *topParagraph() const { return paras.isEmpty() ? para : paras.first(); } 310 QTextParagraph *topParagraph() const { return paras.isEmpty() ? para : paras.first(); }
309 int offsetX() const { return ox; } // inner document offset 311 int offsetX() const { return ox; } // inner document offset
310 int offsetY() const { return oy; } // inner document offset 312 int offsetY() const { return oy; } // inner document offset
311 int totalOffsetX() const; // total document offset 313 int totalOffsetX() const; // total document offset
312 int totalOffsetY() const; // total document offset 314 int totalOffsetY() const; // total document offset
313 315
314 bool place( const QPoint &pos, QTextParagraph *s ) { return place( pos, s, FALSE ); } 316 bool place( const QPoint &pos, QTextParagraph *s ) { return place( pos, s, FALSE ); }
315 bool place( const QPoint &pos, QTextParagraph *s, bool link ); 317 bool place( const QPoint &pos, QTextParagraph *s, bool link );
316 void restoreState(); 318 void restoreState();
317 319
318 320
319 int nestedDepth() const { return (int)indices.count(); } //### size_t/int cast 321 int nestedDepth() const { return (int)indices.count(); } //### size_t/int cast
320 void oneUp() { if ( !indices.isEmpty() ) pop(); } 322 void oneUp() { if ( !indices.isEmpty() ) pop(); }
321 void setValid( bool b ) { valid = b; } 323 void setValid( bool b ) { valid = b; }
322 bool isValid() const { return valid; } 324 bool isValid() const { return valid; }
323 325
324private: 326private:
325 enum Operation { EnterBegin, EnterEnd, Next, Prev, Up, Down }; 327 enum Operation { EnterBegin, EnterEnd, Next, Prev, Up, Down };
326 328
327 void push(); 329 void push();
328 void pop(); 330 void pop();
329 void processNesting( Operation op ); 331 bool processNesting( Operation op );
330 void invalidateNested(); 332 void invalidateNested();
331 void gotoIntoNested( const QPoint &globalPos ); 333 void gotoIntoNested( const QPoint &globalPos );
332 334
333 QTextParagraph *para; 335 QTextParagraph *para;
334 int idx, tmpIndex; 336 int idx, tmpIndex;
335 int ox, oy; 337 int ox, oy;
336 QValueStack<int> indices; 338 QValueStack<int> indices;
337 QValueStack<QTextParagraph*> paras; 339 QValueStack<QTextParagraph*> paras;
338 QValueStack<int> xOffsets; 340 QValueStack<int> xOffsets;
339 QValueStack<int> yOffsets; 341 QValueStack<int> yOffsets;
340 uint valid : 1; 342 uint valid : 1;
341 343
342}; 344};
343 345
344// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 346// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
345 347
346class Q_EXPORT QTextCommand 348class Q_EXPORT QTextCommand
347{ 349{
348public: 350public:
349 enum Commands { Invalid, Insert, Delete, Format, Style }; 351 enum Commands { Invalid, Insert, Delete, Format, Style };
350 352
351 QTextCommand( QTextDocument *d ) : doc( d ), cursor( d ) {} 353 QTextCommand( QTextDocument *d ) : doc( d ), cursor( d ) {}
352 virtual ~QTextCommand(); 354 virtual ~QTextCommand();
353 355
354 virtual Commands type() const; 356 virtual Commands type() const;
355 357
356 virtual QTextCursor *execute( QTextCursor *c ) = 0; 358 virtual QTextCursor *execute( QTextCursor *c ) = 0;
357 virtual QTextCursor *unexecute( QTextCursor *c ) = 0; 359 virtual QTextCursor *unexecute( QTextCursor *c ) = 0;
358 360
359protected: 361protected:
360 QTextDocument *doc; 362 QTextDocument *doc;
361 QTextCursor cursor; 363 QTextCursor cursor;
362 364
363}; 365};
364 366
365#if defined(Q_TEMPLATEDLL) 367#if defined(Q_TEMPLATEDLL)
366// MOC_SKIP_BEGIN 368// MOC_SKIP_BEGIN
367Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCommand>; 369Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCommand>;
368// MOC_SKIP_END 370// MOC_SKIP_END
369#endif 371#endif
370 372
371class Q_EXPORT QTextCommandHistory 373class Q_EXPORT QTextCommandHistory
372{ 374{
373public: 375public:
374 QTextCommandHistory( int s ) : current( -1 ), steps( s ) { history.setAutoDelete( TRUE ); } 376 QTextCommandHistory( int s ) : current( -1 ), steps( s ) { history.setAutoDelete( TRUE ); }
375 virtual ~QTextCommandHistory(); 377 virtual ~QTextCommandHistory();
376 378
377 void clear() { history.clear(); current = -1; } 379 void clear() { history.clear(); current = -1; }
378 380
379 void addCommand( QTextCommand *cmd ); 381 void addCommand( QTextCommand *cmd );
380 QTextCursor *undo( QTextCursor *c ); 382 QTextCursor *undo( QTextCursor *c );
381 QTextCursor *redo( QTextCursor *c ); 383 QTextCursor *redo( QTextCursor *c );
382 384
383 bool isUndoAvailable(); 385 bool isUndoAvailable();
384 bool isRedoAvailable(); 386 bool isRedoAvailable();
385 387
386 void setUndoDepth( int d ) { steps = d; } 388 void setUndoDepth( int d ) { steps = d; }
387 int undoDepth() const { return steps; } 389 int undoDepth() const { return steps; }
388 390
389 int historySize() const { return history.count(); } 391 int historySize() const { return history.count(); }
390 int currentPosition() const { return current; } 392 int currentPosition() const { return current; }
391 393
392private: 394private:
393 QPtrList<QTextCommand> history; 395 QPtrList<QTextCommand> history;
394 int current, steps; 396 int current, steps;
395 397
396}; 398};
397 399
398inline QTextCommandHistory::~QTextCommandHistory() 400inline QTextCommandHistory::~QTextCommandHistory()
399{ 401{
400 clear(); 402 clear();
401} 403}
402 404
403// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 405// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
404 406
405#ifndef QT_NO_TEXTCUSTOMITEM 407#ifndef QT_NO_TEXTCUSTOMITEM
406class Q_EXPORT QTextCustomItem 408class Q_EXPORT QTextCustomItem
407{ 409{
408public: 410public:
409 QTextCustomItem( QTextDocument *p ) 411 QTextCustomItem( QTextDocument *p )
410 : xpos(0), ypos(-1), width(-1), height(0), parent( p ) 412 : xpos(0), ypos(-1), width(-1), height(0), parent( p )
411 {} 413 {}
412 virtual ~QTextCustomItem(); 414 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; 415 virtual void draw(QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ) = 0;
414 416
415 virtual void adjustToPainter( QPainter* ); 417 virtual void adjustToPainter( QPainter* );
416 418
417 enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight }; 419 enum Placement { PlaceInline = 0, PlaceLeft, PlaceRight };
418 virtual Placement placement() const; 420 virtual Placement placement() const;
419 bool placeInline() { return placement() == PlaceInline; } 421 bool placeInline() { return placement() == PlaceInline; }
420 422
421 virtual bool ownLine() const; 423 virtual bool ownLine() const;
422 virtual void resize( int nwidth ); 424 virtual void resize( int nwidth );
423 virtual void invalidate(); 425 virtual void invalidate();
424 virtual int ascent() const { return height; } 426 virtual int ascent() const { return height; }
425 427
426 virtual bool isNested() const; 428 virtual bool isNested() const;
427 virtual int minimumWidth() const; 429 virtual int minimumWidth() const;
428 430
429 virtual QString richText() const; 431 virtual QString richText() const;
430 432
431 int xpos; // used for floating items 433 int xpos; // used for floating items
432 int ypos; // used for floating items 434 int ypos; // used for floating items
433 int width; 435 int width;
434 int height; 436 int height;
435 437
436 QRect geometry() const { return QRect( xpos, ypos, width, height ); } 438 QRect geometry() const { return QRect( xpos, ypos, width, height ); }
437 439
438 virtual bool enter( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE ); 440 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 & ); 441 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 ); 442 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 ); 443 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 ); 444 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 ); 445 virtual bool up( QTextCursor *, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
444 446
445 void setParagraph( QTextParagraph *p ) { parag = p; } 447 void setParagraph( QTextParagraph *p ) { parag = p; }
446 QTextParagraph *paragraph() const { return parag; } 448 QTextParagraph *paragraph() const { return parag; }
447 449
448 QTextDocument *parent; 450 QTextDocument *parent;
449 QTextParagraph *parag; 451 QTextParagraph *parag;
450 452
451 virtual void pageBreak( int y, QTextFlow* flow ); 453 virtual void pageBreak( int y, QTextFlow* flow );
452}; 454};
453#endif 455#endif
454 456
455#if defined(Q_TEMPLATEDLL) 457#if defined(Q_TEMPLATEDLL)
456// MOC_SKIP_BEGIN 458// MOC_SKIP_BEGIN
457Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QString, QString>; 459Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QString, QString>;
458// MOC_SKIP_END 460// MOC_SKIP_END
459#endif 461#endif
460 462
461#ifndef QT_NO_TEXTCUSTOMITEM 463#ifndef QT_NO_TEXTCUSTOMITEM
462class Q_EXPORT QTextImage : public QTextCustomItem 464class Q_EXPORT QTextImage : public QTextCustomItem
463{ 465{
464public: 466public:
465 QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, 467 QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
466 QMimeSourceFactory &factory ); 468 QMimeSourceFactory &factory );
467 virtual ~QTextImage(); 469 virtual ~QTextImage();
468 470
469 Placement placement() const { return place; } 471 Placement placement() const { return place; }
470 void adjustToPainter( QPainter* ); 472 void adjustToPainter( QPainter* );
471 int minimumWidth() const { return width; } 473 int minimumWidth() const { return width; }
472 474
473 QString richText() const; 475 QString richText() const;
474 476
475 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); 477 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
476 478
477private: 479private:
478 QRegion* reg; 480 QRegion* reg;
479 QPixmap pm; 481 QPixmap pm;
480 Placement place; 482 Placement place;
481 int tmpwidth, tmpheight; 483 int tmpwidth, tmpheight;
482 QMap<QString, QString> attributes; 484 QMap<QString, QString> attributes;
483 QString imgId; 485 QString imgId;
484 486
485}; 487};
486#endif 488#endif
487 489
488#ifndef QT_NO_TEXTCUSTOMITEM 490#ifndef QT_NO_TEXTCUSTOMITEM
489class Q_EXPORT QTextHorizontalLine : public QTextCustomItem 491class Q_EXPORT QTextHorizontalLine : public QTextCustomItem
490{ 492{
491public: 493public:
492 QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, 494 QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context,
493 QMimeSourceFactory &factory ); 495 QMimeSourceFactory &factory );
494 virtual ~QTextHorizontalLine(); 496 virtual ~QTextHorizontalLine();
495 497
496 void adjustToPainter( QPainter* ); 498 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 ); 499 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; 500 QString richText() const;
499 501
500 bool ownLine() const { return TRUE; } 502 bool ownLine() const { return TRUE; }
501 503
502private: 504private:
503 int tmpheight; 505 int tmpheight;
504 QColor color; 506 QColor color;
505 bool shade; 507 bool shade;
506 508
507}; 509};
508#endif 510#endif
509 511
510#ifndef QT_NO_TEXTCUSTOMITEM 512#ifndef QT_NO_TEXTCUSTOMITEM
511#if defined(Q_TEMPLATEDLL) 513#if defined(Q_TEMPLATEDLL)
512// MOC_SKIP_BEGIN 514// MOC_SKIP_BEGIN
513Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCustomItem>; 515Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextCustomItem>;
514// MOC_SKIP_END 516// MOC_SKIP_END
515#endif 517#endif
516#endif 518#endif
517 519
518class Q_EXPORT QTextFlow 520class Q_EXPORT QTextFlow
519{ 521{
520 friend class QTextDocument; 522 friend class QTextDocument;
521#ifndef QT_NO_TEXTCUSTOMITEM 523#ifndef QT_NO_TEXTCUSTOMITEM
522 friend class QTextTableCell; 524 friend class QTextTableCell;
523#endif 525#endif
524 526
525public: 527public:
526 QTextFlow(); 528 QTextFlow();
527 virtual ~QTextFlow(); 529 virtual ~QTextFlow();
528 530
529 virtual void setWidth( int width ); 531 virtual void setWidth( int width );
530 int width() const; 532 int width() const;
531 533
532 virtual void setPageSize( int ps ); 534 virtual void setPageSize( int ps );
533 int pageSize() const { return pagesize; } 535 int pageSize() const { return pagesize; }
534 536
535 virtual int adjustLMargin( int yp, int h, int margin, int space ); 537 virtual int adjustLMargin( int yp, int h, int margin, int space );
536 virtual int adjustRMargin( int yp, int h, int margin, int space ); 538 virtual int adjustRMargin( int yp, int h, int margin, int space );
537 539
538#ifndef QT_NO_TEXTCUSTOMITEM 540#ifndef QT_NO_TEXTCUSTOMITEM
539 virtual void registerFloatingItem( QTextCustomItem* item ); 541 virtual void registerFloatingItem( QTextCustomItem* item );
540 virtual void unregisterFloatingItem( QTextCustomItem* item ); 542 virtual void unregisterFloatingItem( QTextCustomItem* item );
541#endif 543#endif
542 virtual QRect boundingRect() const; 544 virtual QRect boundingRect() const;
543 virtual void drawFloatingItems(QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); 545 virtual void drawFloatingItems(QPainter* p, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
544 546
545 virtual int adjustFlow( int y, int w, int h ); // adjusts y according to the defined pagesize. Returns the shift. 547 virtual int adjustFlow( int y, int w, int h ); // adjusts y according to the defined pagesize. Returns the shift.
546 548
547 virtual bool isEmpty(); 549 virtual bool isEmpty();
548 550
549 void clear(); 551 void clear();
550 552
551private: 553private:
552 int w; 554 int w;
553 int pagesize; 555 int pagesize;
554 556
555#ifndef QT_NO_TEXTCUSTOMITEM 557#ifndef QT_NO_TEXTCUSTOMITEM
556 QPtrList<QTextCustomItem> leftItems; 558 QPtrList<QTextCustomItem> leftItems;
557 QPtrList<QTextCustomItem> rightItems; 559 QPtrList<QTextCustomItem> rightItems;
558#endif 560#endif
559}; 561};
560 562
561inline int QTextFlow::width() const { return w; } 563inline int QTextFlow::width() const { return w; }
562 564
563#ifndef QT_NO_TEXTCUSTOMITEM 565#ifndef QT_NO_TEXTCUSTOMITEM
564class QTextTable; 566class QTextTable;
565 567
566class Q_EXPORT QTextTableCell : public QLayoutItem 568class Q_EXPORT QTextTableCell : public QLayoutItem
567{ 569{
568 friend class QTextTable; 570 friend class QTextTable;
569 571
570public: 572public:
571 QTextTableCell( QTextTable* table, 573 QTextTableCell( QTextTable* table,
572 int row, int column, 574 int row, int column,
573 const QMap<QString, QString> &attr, 575 const QMap<QString, QString> &attr,
574 const QStyleSheetItem* style, 576 const QStyleSheetItem* style,
575 const QTextFormat& fmt, const QString& context, 577 const QTextFormat& fmt, const QString& context,
576 QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); 578 QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc );
577 virtual ~QTextTableCell(); 579 virtual ~QTextTableCell();
578 580
579 QSize sizeHint() const ; 581 QSize sizeHint() const ;
580 QSize minimumSize() const ; 582 QSize minimumSize() const ;
581 QSize maximumSize() const ; 583 QSize maximumSize() const ;
582 QSizePolicy::ExpandData expanding() const; 584 QSizePolicy::ExpandData expanding() const;
583 bool isEmpty() const; 585 bool isEmpty() const;
584 void setGeometry( const QRect& ) ; 586 void setGeometry( const QRect& ) ;
585 QRect geometry() const; 587 QRect geometry() const;
586 588
587 bool hasHeightForWidth() const; 589 bool hasHeightForWidth() const;
588 int heightForWidth( int ) const; 590 int heightForWidth( int ) const;
589 591
590 void adjustToPainter( QPainter* ); 592 void adjustToPainter( QPainter* );
591 593
592 int row() const { return row_; } 594 int row() const { return row_; }
593 int column() const { return col_; } 595 int column() const { return col_; }
594 int rowspan() const { return rowspan_; } 596 int rowspan() const { return rowspan_; }
595 int colspan() const { return colspan_; } 597 int colspan() const { return colspan_; }
596 int stretch() const { return stretch_; } 598 int stretch() const { return stretch_; }
597 599
598 QTextDocument* richText() const { return richtext; } 600 QTextDocument* richText() const { return richtext; }
599 QTextTable* table() const { return parent; } 601 QTextTable* table() const { return parent; }
600 602
601 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected ); 603 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, const QColorGroup& cg, bool selected );
602 604
603 QBrush *backGround() const { return background; } 605 QBrush *backGround() const { return background; }
604 virtual void invalidate(); 606 virtual void invalidate();
605 607
606 int verticalAlignmentOffset() const; 608 int verticalAlignmentOffset() const;
607 int horizontalAlignmentOffset() const; 609 int horizontalAlignmentOffset() const;
608 610
609private: 611private:
610 QRect geom; 612 QRect geom;
611 QTextTable* parent; 613 QTextTable* parent;
612 QTextDocument* richtext; 614 QTextDocument* richtext;
613 int row_; 615 int row_;
614 int col_; 616 int col_;
615 int rowspan_; 617 int rowspan_;
616 int colspan_; 618 int colspan_;
617 int stretch_; 619 int stretch_;
618 int maxw; 620 int maxw;
619 int minw; 621 int minw;
620 bool hasFixedWidth; 622 bool hasFixedWidth;
621 QBrush *background; 623 QBrush *background;
622 int cached_width; 624 int cached_width;
623 int cached_sizehint; 625 int cached_sizehint;
624 QMap<QString, QString> attributes; 626 QMap<QString, QString> attributes;
625 int align; 627 int align;
626}; 628};
627#endif 629#endif
628 630
629#if defined(Q_TEMPLATEDLL) 631#if defined(Q_TEMPLATEDLL)
630// MOC_SKIP_BEGIN 632// MOC_SKIP_BEGIN
631Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextTableCell>; 633Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextTableCell>;
632Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QTextCursor*, int>; 634Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<QTextCursor*, int>;
633// MOC_SKIP_END 635// MOC_SKIP_END
634#endif 636#endif
635 637
636#ifndef QT_NO_TEXTCUSTOMITEM 638#ifndef QT_NO_TEXTCUSTOMITEM
637class Q_EXPORT QTextTable: public QTextCustomItem 639class Q_EXPORT QTextTable: public QTextCustomItem
638{ 640{
639 friend class QTextTableCell; 641 friend class QTextTableCell;
640 642
641public: 643public:
642 QTextTable( QTextDocument *p, const QMap<QString, QString> &attr ); 644 QTextTable( QTextDocument *p, const QMap<QString, QString> &attr );
643 virtual ~QTextTable(); 645 virtual ~QTextTable();
644 646
645 void adjustToPainter( QPainter *p ); 647 void adjustToPainter( QPainter *p );
646 void pageBreak( int y, QTextFlow* flow ); 648 void pageBreak( int y, QTextFlow* flow );
647 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, 649 void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch,
648 const QColorGroup& cg, bool selected ); 650 const QColorGroup& cg, bool selected );
649 651
650 bool noErase() const { return TRUE; } 652 bool noErase() const { return TRUE; }
651 bool ownLine() const { return TRUE; } 653 bool ownLine() const { return TRUE; }
652 Placement placement() const { return place; } 654 Placement placement() const { return place; }
653 bool isNested() const { return TRUE; } 655 bool isNested() const { return TRUE; }
654 void resize( int nwidth ); 656 void resize( int nwidth );
655 virtual void invalidate(); 657 virtual void invalidate();
656 658
657 virtual bool enter( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy, bool atEnd = FALSE ); 659 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 ); 660 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 ); 661 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 ); 662 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 ); 663 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 ); 664 virtual bool up( QTextCursor *c, QTextDocument *&doc, QTextParagraph *&parag, int &idx, int &ox, int &oy );
663 665
664 QString richText() const; 666 QString richText() const;
665 667
666 int minimumWidth() const; 668 int minimumWidth() const;
667 669
668 QPtrList<QTextTableCell> tableCells() const { return cells; } 670 QPtrList<QTextTableCell> tableCells() const { return cells; }
669 671
670 bool isStretching() const { return stretch; } 672 bool isStretching() const { return stretch; }
671 673
672private: 674private:
673 void format( int w ); 675 void format( int w );
674 void addCell( QTextTableCell* cell ); 676 void addCell( QTextTableCell* cell );
675 677
676private: 678private:
677 QGridLayout* layout; 679 QGridLayout* layout;
678 QPtrList<QTextTableCell> cells; 680 QPtrList<QTextTableCell> cells;
679 int cachewidth; 681 int cachewidth;
680 int fixwidth; 682 int fixwidth;
681 int cellpadding; 683 int cellpadding;
682 int cellspacing; 684 int cellspacing;
683 int border; 685 int border;
684 int outerborder; 686 int outerborder;
685 int stretch; 687 int stretch;
686 int innerborder; 688 int innerborder;
687 int us_cp, us_ib, us_b, us_ob, us_cs; 689 int us_cp, us_ib, us_b, us_ob, us_cs;
688 QMap<QString, QString> attributes; 690 QMap<QString, QString> attributes;
689 QMap<QTextCursor*, int> currCell; 691 QMap<QTextCursor*, int> currCell;
690 Placement place; 692 Placement place;
691 void adjustCells( int y , int shift ); 693 void adjustCells( int y , int shift );
692 int pageBreakFor; 694 int pageBreakFor;
693}; 695};
694#endif 696#endif
695// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 697// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
696 698
697#ifndef QT_NO_TEXTCUSTOMITEM 699#ifndef QT_NO_TEXTCUSTOMITEM
698class QTextTableCell; 700class QTextTableCell;
699class QTextParagraph; 701class QTextParagraph;
700#endif 702#endif
701 703
702struct Q_EXPORT QTextDocumentSelection 704struct Q_EXPORT QTextDocumentSelection
703{ 705{
704 QTextCursor startCursor, endCursor; 706 QTextCursor startCursor, endCursor;
705 bool swapped; 707 bool swapped;
708 Q_DUMMY_COMPARISON_OPERATOR(QTextDocumentSelection)
706}; 709};
707 710
708#if defined(Q_TEMPLATEDLL) 711#if defined(Q_TEMPLATEDLL)
709// MOC_SKIP_BEGIN 712// MOC_SKIP_BEGIN
710Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>; 713Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QColor>;
711Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>; 714Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, bool>;
712Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextDocumentSelection>; 715Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextDocumentSelection>;
713Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextDocument>; 716Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<QTextDocument>;
714// MOC_SKIP_END 717// MOC_SKIP_END
715#endif 718#endif
716 719
717class Q_EXPORT QTextDocument : public QObject 720class Q_EXPORT QTextDocument : public QObject
718{ 721{
719 Q_OBJECT 722 Q_OBJECT
720 723
721#ifndef QT_NO_TEXTCUSTOMITEM 724#ifndef QT_NO_TEXTCUSTOMITEM
722 friend class QTextTableCell; 725 friend class QTextTableCell;
723#endif 726#endif
724 friend class QTextCursor; 727 friend class QTextCursor;
725 friend class QTextEdit; 728 friend class QTextEdit;
726 friend class QTextParagraph; 729 friend class QTextParagraph;
727 730
728public: 731public:
729 enum SelectionIds { 732 enum SelectionIds {
730 Standard = 0, 733 Standard = 0,
731 IMSelectionText = 31998, 734 IMSelectionText = 31998,
732 IMCompositionText= 31999, // this must be higher! 735 IMCompositionText= 31999, // this must be higher!
733 Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to 736 Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to
734 // remove multiple lines with removeSelectedText() 737 // remove multiple lines with removeSelectedText()
735 }; 738 };
736 739
737 QTextDocument( QTextDocument *p ); 740 QTextDocument( QTextDocument *p );
738 QTextDocument( QTextDocument *d, QTextFormatCollection *f ); 741 QTextDocument( QTextDocument *d, QTextFormatCollection *f );
739 virtual ~QTextDocument(); 742 virtual ~QTextDocument();
740 743
741 QTextDocument *parent() const { return par; } 744 QTextDocument *parent() const { return par; }
742 QTextParagraph *parentParagraph() const { return parentPar; } 745 QTextParagraph *parentParagraph() const { return parentPar; }
743 746
744 void setText( const QString &text, const QString &context ); 747 void setText( const QString &text, const QString &context );
745 QMap<QString, QString> attributes() const { return attribs; } 748 QMap<QString, QString> attributes() const { return attribs; }
746 void setAttributes( const QMap<QString, QString> &attr ) { attribs = attr; } 749 void setAttributes( const QMap<QString, QString> &attr ) { attribs = attr; }
747 750
748 QString text() const; 751 QString text() const;
749 QString text( int parag ) const; 752 QString text( int parag ) const;
750 QString originalText() const; 753 QString originalText() const;
751 754
752 int x() const; 755 int x() const;
753 int y() const; 756 int y() const;
754 int width() const; 757 int width() const;
755 int widthUsed() const; 758 int widthUsed() const;
756 int visibleWidth() const; 759 int visibleWidth() const;
757 int height() const; 760 int height() const;
758 void setWidth( int w ); 761 void setWidth( int w );
759 int minimumWidth() const; 762 int minimumWidth() const;
760 bool setMinimumWidth( int needed, int used = -1, QTextParagraph *parag = 0 ); 763 bool setMinimumWidth( int needed, int used = -1, QTextParagraph *parag = 0 );
761 764
762 void setY( int y ); 765 void setY( int y );
763 int leftMargin() const; 766 int leftMargin() const;
764 void setLeftMargin( int lm ); 767 void setLeftMargin( int lm );
765 int rightMargin() const; 768 int rightMargin() const;
766 void setRightMargin( int rm ); 769 void setRightMargin( int rm );
767 770
768 QTextParagraph *firstParagraph() const; 771 QTextParagraph *firstParagraph() const;
769 QTextParagraph *lastParagraph() const; 772 QTextParagraph *lastParagraph() const;
770 void setFirstParagraph( QTextParagraph *p ); 773 void setFirstParagraph( QTextParagraph *p );
771 void setLastParagraph( QTextParagraph *p ); 774 void setLastParagraph( QTextParagraph *p );
772 775
773 void invalidate(); 776 void invalidate();
774 777
775 void setPreProcessor( QTextPreProcessor *sh ); 778 void setPreProcessor( QTextPreProcessor *sh );
776 QTextPreProcessor *preProcessor() const; 779 QTextPreProcessor *preProcessor() const;
777 780
778 void setFormatter( QTextFormatter *f ); 781 void setFormatter( QTextFormatter *f );
779 QTextFormatter *formatter() const; 782 QTextFormatter *formatter() const;
780 783
781 void setIndent( QTextIndent *i ); 784 void setIndent( QTextIndent *i );
782 QTextIndent *indent() const; 785 QTextIndent *indent() const;
783 786
784 QColor selectionColor( int id ) const; 787 QColor selectionColor( int id ) const;
785 bool invertSelectionText( int id ) const; 788 bool invertSelectionText( int id ) const;
786 void setSelectionColor( int id, const QColor &c ); 789 void setSelectionColor( int id, const QColor &c );
787 void setInvertSelectionText( int id, bool b ); 790 void setInvertSelectionText( int id, bool b );
788 bool hasSelection( int id, bool visible = FALSE ) const; 791 bool hasSelection( int id, bool visible = FALSE ) const;
789 void setSelectionStart( int id, const QTextCursor &cursor ); 792 void setSelectionStart( int id, const QTextCursor &cursor );
790 bool setSelectionEnd( int id, const QTextCursor &cursor ); 793 bool setSelectionEnd( int id, const QTextCursor &cursor );
791 void selectAll( int id ); 794 void selectAll( int id );
792 bool removeSelection( int id ); 795 bool removeSelection( int id );
793 void selectionStart( int id, int &paragId, int &index ); 796 void selectionStart( int id, int &paragId, int &index );
794 QTextCursor selectionStartCursor( int id ); 797 QTextCursor selectionStartCursor( int id );
795 QTextCursor selectionEndCursor( int id ); 798 QTextCursor selectionEndCursor( int id );
796 void selectionEnd( int id, int &paragId, int &index ); 799 void selectionEnd( int id, int &paragId, int &index );
797 void setFormat( int id, QTextFormat *f, int flags ); 800 void setFormat( int id, QTextFormat *f, int flags );
798 int numSelections() const { return nSelections; } 801 int numSelections() const { return nSelections; }
799 void addSelection( int id ); 802 void addSelection( int id );
800 803
801 QString selectedText( int id, bool asRichText = FALSE ) const; 804 QString selectedText( int id, bool asRichText = FALSE ) const;
802 void removeSelectedText( int id, QTextCursor *cursor ); 805 void removeSelectedText( int id, QTextCursor *cursor );
803 void indentSelection( int id ); 806 void indentSelection( int id );
804 807
805 QTextParagraph *paragAt( int i ) const; 808 QTextParagraph *paragAt( int i ) const;
806 809
807 void addCommand( QTextCommand *cmd ); 810 void addCommand( QTextCommand *cmd );
808 QTextCursor *undo( QTextCursor *c = 0 ); 811 QTextCursor *undo( QTextCursor *c = 0 );
809 QTextCursor *redo( QTextCursor *c = 0 ); 812 QTextCursor *redo( QTextCursor *c = 0 );
810 QTextCommandHistory *commands() const { return commandHistory; } 813 QTextCommandHistory *commands() const { return commandHistory; }
811 814
812 QTextFormatCollection *formatCollection() const; 815 QTextFormatCollection *formatCollection() const;
813 816
814 bool find( QTextCursor &cursor, const QString &expr, bool cs, bool wo, bool forward); 817 bool find( QTextCursor &cursor, const QString &expr, bool cs, bool wo, bool forward);
815 818
816 void setTextFormat( Qt::TextFormat f ); 819 void setTextFormat( Qt::TextFormat f );
817 Qt::TextFormat textFormat() const; 820 Qt::TextFormat textFormat() const;
818 821
819 bool inSelection( int selId, const QPoint &pos ) const; 822 bool inSelection( int selId, const QPoint &pos ) const;
820 823
821 QStyleSheet *styleSheet() const { return sheet_; } 824 QStyleSheet *styleSheet() const { return sheet_; }
822#ifndef QT_NO_MIME 825#ifndef QT_NO_MIME
823 QMimeSourceFactory *mimeSourceFactory() const { return factory_; } 826 QMimeSourceFactory *mimeSourceFactory() const { return factory_; }
824#endif 827#endif
825 QString context() const { return contxt; } 828 QString context() const { return contxt; }
826 829
827 void setStyleSheet( QStyleSheet *s ); 830 void setStyleSheet( QStyleSheet *s );
828 void setDefaultFormat( const QFont &font, const QColor &color ); 831 void setDefaultFormat( const QFont &font, const QColor &color );
829#ifndef QT_NO_MIME 832#ifndef QT_NO_MIME
830 void setMimeSourceFactory( QMimeSourceFactory *f ) { if ( f ) factory_ = f; } 833 void setMimeSourceFactory( QMimeSourceFactory *f ) { if ( f ) factory_ = f; }
831#endif 834#endif
832 void setContext( const QString &c ) { if ( !c.isEmpty() ) contxt = c; } 835 void setContext( const QString &c ) { if ( !c.isEmpty() ) contxt = c; }
833 836
834 void setUnderlineLinks( bool b ); 837 void setUnderlineLinks( bool b );
835 bool underlineLinks() const { return underlLinks; } 838 bool underlineLinks() const { return underlLinks; }
836 839
837 void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; } 840 void setPaper( QBrush *brush ) { if ( backBrush ) delete backBrush; backBrush = brush; }
838 QBrush *paper() const { return backBrush; } 841 QBrush *paper() const { return backBrush; }
839 842
840 void doLayout( QPainter *p, int w ); 843 void doLayout( QPainter *p, int w );
841 void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 ); 844 void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 );
845 void eraseParagraphEmptyArea( QTextParagraph *parag, QPainter *p, const QColorGroup &cg );
846 bool useDoubleBuffer( QTextParagraph *parag, QPainter *p );
847
842 void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch, 848 void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch,
843 QPixmap *&doubleBuffer, const QColorGroup &cg, 849 QPixmap *&doubleBuffer, const QColorGroup &cg,
844 bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); 850 bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE );
845 QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, 851 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, 852 bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0,
847 bool resetChanged = TRUE ); 853 bool resetChanged = TRUE );
848 854
849#ifndef QT_NO_TEXTCUSTOMITEM 855#ifndef QT_NO_TEXTCUSTOMITEM
850 void registerCustomItem( QTextCustomItem *i, QTextParagraph *p ); 856 void registerCustomItem( QTextCustomItem *i, QTextParagraph *p );
851 void unregisterCustomItem( QTextCustomItem *i, QTextParagraph *p ); 857 void unregisterCustomItem( QTextCustomItem *i, QTextParagraph *p );
852#endif 858#endif
853 859
854 void setFlow( QTextFlow *f ); 860 void setFlow( QTextFlow *f );
855 void takeFlow(); 861 void takeFlow();
856 QTextFlow *flow() const { return flow_; } 862 QTextFlow *flow() const { return flow_; }
857 bool isPageBreakEnabled() const { return pages; } 863 bool isPageBreakEnabled() const { return pages; }
858 void setPageBreakEnabled( bool b ) { pages = b; } 864 void setPageBreakEnabled( bool b ) { pages = b; }
859 865
860 void setUseFormatCollection( bool b ) { useFC = b; } 866 void setUseFormatCollection( bool b ) { useFC = b; }
861 bool useFormatCollection() const { return useFC; } 867 bool useFormatCollection() const { return useFC; }
862 868
863#ifndef QT_NO_TEXTCUSTOMITEM 869#ifndef QT_NO_TEXTCUSTOMITEM
864 QTextTableCell *tableCell() const { return tc; } 870 QTextTableCell *tableCell() const { return tc; }
865 void setTableCell( QTextTableCell *c ) { tc = c; } 871 void setTableCell( QTextTableCell *c ) { tc = c; }
866#endif 872#endif
867 873
868 void setPlainText( const QString &text ); 874 void setPlainText( const QString &text );
869 void setRichText( const QString &text, const QString &context ); 875 void setRichText( const QString &text, const QString &context );
870 QString richText() const; 876 QString richText() const;
871 QString plainText() const; 877 QString plainText() const;
872 878
873 bool focusNextPrevChild( bool next ); 879 bool focusNextPrevChild( bool next );
874 880
875 int alignment() const; 881 int alignment() const;
876 void setAlignment( int a ); 882 void setAlignment( int a );
877 883
878 int *tabArray() const; 884 int *tabArray() const;
879 int tabStopWidth() const; 885 int tabStopWidth() const;
880 void setTabArray( int *a ); 886 void setTabArray( int *a );
881 void setTabStops( int tw ); 887 void setTabStops( int tw );
882 888
883 void setUndoDepth( int d ) { commandHistory->setUndoDepth( d ); } 889 void setUndoDepth( int d ) { commandHistory->setUndoDepth( d ); }
884 int undoDepth() const { return commandHistory->undoDepth(); } 890 int undoDepth() const { return commandHistory->undoDepth(); }
885 891
886 int length() const; 892 int length() const;
887 void clear( bool createEmptyParag = FALSE ); 893 void clear( bool createEmptyParag = FALSE );
888 894
889 virtual QTextParagraph *createParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE ); 895 virtual QTextParagraph *createParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
890 void insertChild( QObject *o ) { QObject::insertChild( o ); } 896 void insertChild( QObject *o ) { QObject::insertChild( o ); }
891 void removeChild( QObject *o ) { QObject::removeChild( o ); } 897 void removeChild( QObject *o ) { QObject::removeChild( o ); }
892 void insertChild( QTextDocument *d ) { childList.append( d ); } 898 void insertChild( QTextDocument *d ) { childList.append( d ); }
893 void removeChild( QTextDocument *d ) { childList.removeRef( d ); } 899 void removeChild( QTextDocument *d ) { childList.removeRef( d ); }
894 QPtrList<QTextDocument> children() const { return childList; } 900 QPtrList<QTextDocument> children() const { return childList; }
895 901
896 bool hasFocusParagraph() const; 902 bool hasFocusParagraph() const;
897 QString focusHref() const; 903 QString focusHref() const;
898 QString focusName() const; 904 QString focusName() const;
899 905
900 void invalidateOriginalText() { oTextValid = FALSE; oText = ""; } 906 void invalidateOriginalText() { oTextValid = FALSE; oText = ""; }
901 907
902signals: 908signals:
903 void minimumWidthChanged( int ); 909 void minimumWidthChanged( int );
904 910
905private: 911private:
906 void init(); 912 void init();
907 QPixmap *bufferPixmap( const QSize &s ); 913 QPixmap *bufferPixmap( const QSize &s );
908 // HTML parser 914 // HTML parser
909 bool hasPrefix(const QChar* doc, int length, int pos, QChar c); 915 bool hasPrefix(const QChar* doc, int length, int pos, QChar c);
910 bool hasPrefix(const QChar* doc, int length, int pos, const QString& s); 916 bool hasPrefix(const QChar* doc, int length, int pos, const QString& s);
911#ifndef QT_NO_TEXTCUSTOMITEM 917#ifndef QT_NO_TEXTCUSTOMITEM
912 QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt, 918 QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt,
913 const QChar* doc, int length, int& pos, QTextParagraph *curpar ); 919 const QChar* doc, int length, int& pos, QTextParagraph *curpar );
914#endif 920#endif
915 bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE ); 921 bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE );
916 bool eat(const QChar* doc, int length, int& pos, QChar c); 922 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); 923 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 ); 924 QString parseCloseTag( const QChar* doc, int length, int& pos );
919 QChar parseHTMLSpecialChar(const QChar* doc, int length, int& pos); 925 QChar parseHTMLSpecialChar(const QChar* doc, int length, int& pos);
920 QString parseWord(const QChar* doc, int length, int& pos, bool lower = TRUE); 926 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 ); 927 QChar parseChar(const QChar* doc, int length, int& pos, QStyleSheetItem::WhiteSpaceMode wsm );
922 void setRichTextInternal( const QString &text, QTextCursor* cursor = 0 ); 928 void setRichTextInternal( const QString &text, QTextCursor* cursor = 0 );
923 void setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar ); 929 void setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheetItem> >& styles, QTextParagraph* stylesPar );
924 930
925private: 931private:
926 struct Q_EXPORT Focus { 932 struct Q_EXPORT Focus {
927 QTextParagraph *parag; 933 QTextParagraph *parag;
928 int start, len; 934 int start, len;
929 QString href; 935 QString href;
930 QString name; 936 QString name;
931 }; 937 };
932 938
933 int cx, cy, cw, vw; 939 int cx, cy, cw, vw;
934 QTextParagraph *fParag, *lParag; 940 QTextParagraph *fParag, *lParag;
935 QTextPreProcessor *pProcessor; 941 QTextPreProcessor *pProcessor;
936 QMap<int, QColor> selectionColors; 942 QMap<int, QColor> selectionColors;
937 QMap<int, QTextDocumentSelection> selections; 943 QMap<int, QTextDocumentSelection> selections;
938 QMap<int, bool> selectionText; 944 QMap<int, bool> selectionText;
939 QTextCommandHistory *commandHistory; 945 QTextCommandHistory *commandHistory;
940 QTextFormatter *pFormatter; 946 QTextFormatter *pFormatter;
941 QTextIndent *indenter; 947 QTextIndent *indenter;
942 QTextFormatCollection *fCollection; 948 QTextFormatCollection *fCollection;
943 Qt::TextFormat txtFormat; 949 Qt::TextFormat txtFormat;
944 uint preferRichText : 1; 950 uint preferRichText : 1;
945 uint pages : 1; 951 uint pages : 1;
946 uint useFC : 1; 952 uint useFC : 1;
947 uint withoutDoubleBuffer : 1; 953 uint withoutDoubleBuffer : 1;
948 uint underlLinks : 1; 954 uint underlLinks : 1;
949 uint nextDoubleBuffered : 1; 955 uint nextDoubleBuffered : 1;
950 uint oTextValid : 1; 956 uint oTextValid : 1;
951 uint mightHaveCustomItems : 1; 957 uint mightHaveCustomItems : 1;
952 int align; 958 int align;
953 int nSelections; 959 int nSelections;
954 QTextFlow *flow_; 960 QTextFlow *flow_;
955 QTextDocument *par; 961 QTextDocument *par;
956 QTextParagraph *parentPar; 962 QTextParagraph *parentPar;
957#ifndef QT_NO_TEXTCUSTOMITEM 963#ifndef QT_NO_TEXTCUSTOMITEM
958 QTextTableCell *tc; 964 QTextTableCell *tc;
959#endif 965#endif
960 QBrush *backBrush; 966 QBrush *backBrush;
961 QPixmap *buf_pixmap; 967 QPixmap *buf_pixmap;
962 Focus focusIndicator; 968 Focus focusIndicator;
963 int minw; 969 int minw;
964 int wused; 970 int wused;
965 int leftmargin; 971 int leftmargin;
966 int rightmargin; 972 int rightmargin;
967 QTextParagraph *minwParag, *curParag; 973 QTextParagraph *minwParag, *curParag;
968 QStyleSheet* sheet_; 974 QStyleSheet* sheet_;
969#ifndef QT_NO_MIME 975#ifndef QT_NO_MIME
970 QMimeSourceFactory* factory_; 976 QMimeSourceFactory* factory_;
971#endif 977#endif
972 QString contxt; 978 QString contxt;
973 QMap<QString, QString> attribs; 979 QMap<QString, QString> attribs;
974 int *tArray; 980 int *tArray;
975 int tStopWidth; 981 int tStopWidth;
976 int uDepth; 982 int uDepth;
977 QString oText; 983 QString oText;
978 QPtrList<QTextDocument> childList; 984 QPtrList<QTextDocument> childList;
979 QColor linkColor; 985 QColor linkColor;
980 double scaleFontsFactor; 986 double scaleFontsFactor;
981 987
982 short list_tm,list_bm, list_lm, li_tm, li_bm, par_tm, par_bm; 988 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= 989#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
984 QTextDocument( const QTextDocument & ); 990 QTextDocument( const QTextDocument & );
985 QTextDocument &operator=( const QTextDocument & ); 991 QTextDocument &operator=( const QTextDocument & );
986#endif 992#endif
987}; 993};
988 994
989// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 995// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
990 996
991 997
992class Q_EXPORT QTextDeleteCommand : public QTextCommand 998class Q_EXPORT QTextDeleteCommand : public QTextCommand
993{ 999{
994public: 1000public:
995 QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, 1001 QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str,
996 const QByteArray& oldStyle ); 1002 const QByteArray& oldStyle );
997 QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ); 1003 QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str );
998 virtual ~QTextDeleteCommand(); 1004 virtual ~QTextDeleteCommand();
999 1005
1000 Commands type() const { return Delete; } 1006 Commands type() const { return Delete; }
1001 QTextCursor *execute( QTextCursor *c ); 1007 QTextCursor *execute( QTextCursor *c );
1002 QTextCursor *unexecute( QTextCursor *c ); 1008 QTextCursor *unexecute( QTextCursor *c );
1003 1009
1004protected: 1010protected:
1005 int id, index; 1011 int id, index;
1006 QTextParagraph *parag; 1012 QTextParagraph *parag;
1007 QMemArray<QTextStringChar> text; 1013 QMemArray<QTextStringChar> text;
1008 QByteArray styleInformation; 1014 QByteArray styleInformation;
1009 1015
1010}; 1016};
1011 1017
1012class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand 1018class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand
1013{ 1019{
1014public: 1020public:
1015 QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, 1021 QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str,
1016 const QByteArray& oldStyleInfo ) 1022 const QByteArray& oldStyleInfo )
1017 : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} 1023 : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {}
1018 QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ) 1024 QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str )
1019 : QTextDeleteCommand( p, idx, str ) {} 1025 : QTextDeleteCommand( p, idx, str ) {}
1020 virtual ~QTextInsertCommand() {} 1026 virtual ~QTextInsertCommand() {}
1021 1027
1022 Commands type() const { return Insert; } 1028 Commands type() const { return Insert; }
1023 QTextCursor *execute( QTextCursor *c ) { return QTextDeleteCommand::unexecute( c ); } 1029 QTextCursor *execute( QTextCursor *c ) { return QTextDeleteCommand::unexecute( c ); }
1024 QTextCursor *unexecute( QTextCursor *c ) { return QTextDeleteCommand::execute( c ); } 1030 QTextCursor *unexecute( QTextCursor *c ) { return QTextDeleteCommand::execute( c ); }
1025 1031
1026}; 1032};
1027 1033
1028class Q_EXPORT QTextFormatCommand : public QTextCommand 1034class Q_EXPORT QTextFormatCommand : public QTextCommand
1029{ 1035{
1030public: 1036public:
1031 QTextFormatCommand( QTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<QTextStringChar> &old, QTextFormat *f, int fl ); 1037 QTextFormatCommand( QTextDocument *d, int sid, int sidx, int eid, int eidx, const QMemArray<QTextStringChar> &old, QTextFormat *f, int fl );
1032 virtual ~QTextFormatCommand(); 1038 virtual ~QTextFormatCommand();
1033 1039
1034 Commands type() const { return Format; } 1040 Commands type() const { return Format; }
1035 QTextCursor *execute( QTextCursor *c ); 1041 QTextCursor *execute( QTextCursor *c );
1036 QTextCursor *unexecute( QTextCursor *c ); 1042 QTextCursor *unexecute( QTextCursor *c );
1037 1043
1038protected: 1044protected:
1039 int startId, startIndex, endId, endIndex; 1045 int startId, startIndex, endId, endIndex;
1040 QTextFormat *format; 1046 QTextFormat *format;
1041 QMemArray<QTextStringChar> oldFormats; 1047 QMemArray<QTextStringChar> oldFormats;
1042 int flags; 1048 int flags;
1043 1049
1044}; 1050};
1045 1051
1046class Q_EXPORT QTextStyleCommand : public QTextCommand 1052class Q_EXPORT QTextStyleCommand : public QTextCommand
1047{ 1053{
1048public: 1054public:
1049 QTextStyleCommand( QTextDocument *d, int fParag, int lParag, const QByteArray& beforeChange ); 1055 QTextStyleCommand( QTextDocument *d, int fParag, int lParag, const QByteArray& beforeChange );
1050 virtual ~QTextStyleCommand() {} 1056 virtual ~QTextStyleCommand() {}
1051 1057
1052 Commands type() const { return Style; } 1058 Commands type() const { return Style; }
1053 QTextCursor *execute( QTextCursor *c ); 1059 QTextCursor *execute( QTextCursor *c );
1054 QTextCursor *unexecute( QTextCursor *c ); 1060 QTextCursor *unexecute( QTextCursor *c );
1055 1061
1056 static QByteArray readStyleInformation( QTextDocument* d, int fParag, int lParag ); 1062 static QByteArray readStyleInformation( QTextDocument* d, int fParag, int lParag );
1057 static void writeStyleInformation( QTextDocument* d, int fParag, const QByteArray& style ); 1063 static void writeStyleInformation( QTextDocument* d, int fParag, const QByteArray& style );
1058 1064
1059private: 1065private:
1060 int firstParag, lastParag; 1066 int firstParag, lastParag;
1061 QByteArray before; 1067 QByteArray before;
1062 QByteArray after; 1068 QByteArray after;
1063}; 1069};
1064 1070
1065// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1071// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1066 1072
1067struct Q_EXPORT QTextParagraphSelection 1073struct Q_EXPORT QTextParagraphSelection
1068{ 1074{
1069 int start, end; 1075 int start, end;
1076 Q_DUMMY_COMPARISON_OPERATOR(QTextParagraphSelection)
1070}; 1077};
1071 1078
1072struct Q_EXPORT QTextLineStart 1079struct Q_EXPORT QTextLineStart
1073{ 1080{
1074 QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 ) 1081 QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 )
1075#ifndef QT_NO_COMPLEXTEXT 1082#ifndef QT_NO_COMPLEXTEXT
1076 , bidicontext( 0 ) 1083 , bidicontext( 0 )
1077#endif 1084#endif
1078 { } 1085 { }
1079 QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ), 1086 QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ),
1080 w( 0 ) 1087 w( 0 )
1081#ifndef QT_NO_COMPLEXTEXT 1088#ifndef QT_NO_COMPLEXTEXT
1082 , bidicontext( 0 ) 1089 , bidicontext( 0 )
1083#endif 1090#endif
1084 { } 1091 { }
1085#ifndef QT_NO_COMPLEXTEXT 1092#ifndef QT_NO_COMPLEXTEXT
1086 QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0), 1093 QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0),
1087 status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } 1094 status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); }
1088#endif 1095#endif
1089 1096
1090 virtual ~QTextLineStart() 1097 virtual ~QTextLineStart()
1091 { 1098 {
1092#ifndef QT_NO_COMPLEXTEXT 1099#ifndef QT_NO_COMPLEXTEXT
1093 if ( bidicontext && bidicontext->deref() ) 1100 if ( bidicontext && bidicontext->deref() )
1094 delete bidicontext; 1101 delete bidicontext;
1095#endif 1102#endif
1096 } 1103 }
1097 1104
1098#ifndef QT_NO_COMPLEXTEXT 1105#ifndef QT_NO_COMPLEXTEXT
1099 void setContext( QBidiContext *c ) { 1106 void setContext( QBidiContext *c ) {
1100 if ( c == bidicontext ) 1107 if ( c == bidicontext )
1101 return; 1108 return;
1102 if ( bidicontext && bidicontext->deref() ) 1109 if ( bidicontext && bidicontext->deref() )
1103 delete bidicontext; 1110 delete bidicontext;
1104 bidicontext = c; 1111 bidicontext = c;
1105 if ( bidicontext ) 1112 if ( bidicontext )
1106 bidicontext->ref(); 1113 bidicontext->ref();
1107 } 1114 }
1108 QBidiContext *context() const { return bidicontext; } 1115 QBidiContext *context() const { return bidicontext; }
1109#endif 1116#endif
1110 1117
1111public: 1118public:
1112 ushort y, baseLine, h; 1119 ushort y, baseLine, h;
1113#ifndef QT_NO_COMPLEXTEXT 1120#ifndef QT_NO_COMPLEXTEXT
1114 QBidiStatus status; 1121 QBidiStatus status;
1115#endif 1122#endif
1116 int w; 1123 int w;
1117 1124
1118private: 1125private:
1119#ifndef QT_NO_COMPLEXTEXT 1126#ifndef QT_NO_COMPLEXTEXT
1120 QBidiContext *bidicontext; 1127 QBidiContext *bidicontext;
1121#endif 1128#endif
1122}; 1129};
1123 1130
1124#if defined(Q_TEMPLATEDLL) 1131#if defined(Q_TEMPLATEDLL)
1125// MOC_SKIP_BEGIN 1132// MOC_SKIP_BEGIN
1126Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextParagraphSelection>; 1133Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextParagraphSelection>;
1127Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextLineStart*>; 1134Q_TEMPLATE_EXTERN template class Q_EXPORT QMap<int, QTextLineStart*>;
1128// MOC_SKIP_END 1135// MOC_SKIP_END
1129#endif 1136#endif
1130 1137
1131class Q_EXPORT QTextParagraphData 1138class Q_EXPORT QTextParagraphData
1132{ 1139{
1133public: 1140public:
1134 QTextParagraphData() {} 1141 QTextParagraphData() {}
1135 virtual ~QTextParagraphData(); 1142 virtual ~QTextParagraphData();
1136 virtual void join( QTextParagraphData * ); 1143 virtual void join( QTextParagraphData * );
1137}; 1144};
1138 1145
1139class Q_EXPORT QTextParagraphPseudoDocument 1146class QTextParagraphPseudoDocument;
1140{ 1147
1141public: 1148class QSyntaxHighlighter;
1142 QTextParagraphPseudoDocument();
1143 ~QTextParagraphPseudoDocument();
1144 QRect docRect;
1145 QTextFormatter *pFormatter;
1146 QTextCommandHistory *commandHistory;
1147 int minw;
1148 int wused;
1149};
1150 1149
1151//nase
1152class Q_EXPORT QTextParagraph 1150class Q_EXPORT QTextParagraph
1153{ 1151{
1154 friend class QTextDocument; 1152 friend class QTextDocument;
1155 friend class QTextCursor; 1153 friend class QTextCursor;
1154 friend class QSyntaxHighlighter;
1156 1155
1157public: 1156public:
1158 QTextParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE ); 1157 QTextParagraph( QTextDocument *d, QTextParagraph *pr = 0, QTextParagraph *nx = 0, bool updateIds = TRUE );
1159 virtual ~QTextParagraph(); 1158 virtual ~QTextParagraph();
1160 1159
1161 QTextString *string() const; 1160 QTextString *string() const;
1162 QTextStringChar *at( int i ) const; // maybe remove later 1161 QTextStringChar *at( int i ) const; // maybe remove later
1163 int leftGap() const; 1162 int leftGap() const;
1164 int length() const; // maybe remove later 1163 int length() const; // maybe remove later
1165 1164
1166 void setListStyle( QStyleSheetItem::ListStyle ls ) { lstyle = ls; changed = TRUE; } 1165 void setListStyle( QStyleSheetItem::ListStyle ls ) { lstyle = ls; changed = TRUE; }
1167 QStyleSheetItem::ListStyle listStyle() const { return lstyle; } 1166 QStyleSheetItem::ListStyle listStyle() const { return lstyle; }
1168 void setListItem( bool li ); 1167 void setListItem( bool li );
1169 bool isListItem() const { return litem; } 1168 bool isListItem() const { return litem; }
1170 void setListValue( int v ) { list_val = v; } 1169 void setListValue( int v ) { list_val = v; }
1171 int listValue() const { return list_val > 0 ? list_val : -1; } 1170 int listValue() const { return list_val > 0 ? list_val : -1; }
1172 1171
1173 void setListDepth( int depth ); 1172 void setListDepth( int depth );
1174 int listDepth() const { return ldepth; } 1173 int listDepth() const { return ldepth; }
1175 1174
1176// void setFormat( QTextFormat *fm ); 1175// void setFormat( QTextFormat *fm );
1177// QTextFormat *paragFormat() const; 1176// QTextFormat *paragFormat() const;
1178 1177
1178#if defined(Q_STRICT_INLINING_RULES)
1179 // This is for the IRIX MIPSpro o32 ABI - it fails, claiming the
1180 // implementation to be a redefinition.
1181 inline QTextDocument *document() const;
1182#else
1179 QTextDocument *document() const; 1183 QTextDocument *document() const;
1184#endif
1180 QTextParagraphPseudoDocument *pseudoDocument() const; 1185 QTextParagraphPseudoDocument *pseudoDocument() const;
1181 1186
1182 QRect rect() const; 1187 QRect rect() const;
1183 void setHeight( int h ) { r.setHeight( h ); } 1188 void setHeight( int h ) { r.setHeight( h ); }
1184 void show(); 1189 void show();
1185 void hide(); 1190 void hide();
1186 bool isVisible() const { return visible; } 1191 bool isVisible() const { return visible; }
1187 1192
1188 QTextParagraph *prev() const; 1193 QTextParagraph *prev() const;
1189 QTextParagraph *next() const; 1194 QTextParagraph *next() const;
1190 void setPrev( QTextParagraph *s ); 1195 void setPrev( QTextParagraph *s );
1191 void setNext( QTextParagraph *s ); 1196 void setNext( QTextParagraph *s );
1192 1197
1193 void insert( int index, const QString &s ); 1198 void insert( int index, const QString &s );
1194 void insert( int index, const QChar *unicode, int len ); 1199 void insert( int index, const QChar *unicode, int len );
1195 void append( const QString &s, bool reallyAtEnd = FALSE ); 1200 void append( const QString &s, bool reallyAtEnd = FALSE );
1196 void truncate( int index ); 1201 void truncate( int index );
1197 void remove( int index, int len ); 1202 void remove( int index, int len );
1198 void join( QTextParagraph *s ); 1203 void join( QTextParagraph *s );
1199 1204
1200 void invalidate( int chr ); 1205 void invalidate( int chr );
1201 1206
1202 void move( int &dy ); 1207 void move( int &dy );
1203 void format( int start = -1, bool doMove = TRUE ); 1208 void format( int start = -1, bool doMove = TRUE );
1204 1209
1205 bool isValid() const; 1210 bool isValid() const;
1206 bool hasChanged() const; 1211 bool hasChanged() const;
1207 void setChanged( bool b, bool recursive = FALSE ); 1212 void setChanged( bool b, bool recursive = FALSE );
1208 1213
1209 int lineHeightOfChar( int i, int *bl = 0, int *y = 0 ) const; 1214 int lineHeightOfChar( int i, int *bl = 0, int *y = 0 ) const;
1210 QTextStringChar *lineStartOfChar( int i, int *index = 0, int *line = 0 ) const; 1215 QTextStringChar *lineStartOfChar( int i, int *index = 0, int *line = 0 ) const;
1211 int lines() const; 1216 int lines() const;
1212 QTextStringChar *lineStartOfLine( int line, int *index = 0 ) const; 1217 QTextStringChar *lineStartOfLine( int line, int *index = 0 ) const;
1213 int lineY( int l ) const; 1218 int lineY( int l ) const;
1214 int lineBaseLine( int l ) const; 1219 int lineBaseLine( int l ) const;
1215 int lineHeight( int l ) const; 1220 int lineHeight( int l ) const;
1216 void lineInfo( int l, int &y, int &h, int &bl ) const; 1221 void lineInfo( int l, int &y, int &h, int &bl ) const;
1217 1222
1218 void setSelection( int id, int start, int end ); 1223 void setSelection( int id, int start, int end );
1219 void removeSelection( int id ); 1224 void removeSelection( int id );
1220 int selectionStart( int id ) const; 1225 int selectionStart( int id ) const;
1221 int selectionEnd( int id ) const; 1226 int selectionEnd( int id ) const;
1222 bool hasSelection( int id ) const; 1227 bool hasSelection( int id ) const;
1223 bool hasAnySelection() const; 1228 bool hasAnySelection() const;
1224 bool fullSelected( int id ) const; 1229 bool fullSelected( int id ) const;
1225 1230
1226 void setEndState( int s ); 1231 void setEndState( int s );
1227 int endState() const; 1232 int endState() const;
1228 1233
1229 void setParagId( int i ); 1234 void setParagId( int i );
1230 int paragId() const; 1235 int paragId() const;
1231 1236
1232 bool firstPreProcess() const; 1237 bool firstPreProcess() const;
1233 void setFirstPreProcess( bool b ); 1238 void setFirstPreProcess( bool b );
1234 1239
1235 void indent( int *oldIndent = 0, int *newIndent = 0 ); 1240 void indent( int *oldIndent = 0, int *newIndent = 0 );
1236 1241
1237 void setExtraData( QTextParagraphData *data ); 1242 void setExtraData( QTextParagraphData *data );
1238 QTextParagraphData *extraData() const; 1243 QTextParagraphData *extraData() const;
1239 1244
1240 QMap<int, QTextLineStart*> &lineStartList(); 1245 QMap<int, QTextLineStart*> &lineStartList();
1241 1246
1242 void setFormat( int index, int len, QTextFormat *f, bool useCollection = TRUE, int flags = -1 ); 1247 void setFormat( int index, int len, QTextFormat *f, bool useCollection = TRUE, int flags = -1 );
1243 1248
1244 void setAlignment( int a ); 1249 void setAlignment( int a );
1245 int alignment() const; 1250 int alignment() const;
1246 1251
1247 virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE, 1252 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 ); 1253 int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 );
1249 1254
1250 virtual int topMargin() const; 1255 virtual int topMargin() const;
1251 virtual int bottomMargin() const; 1256 virtual int bottomMargin() const;
1252 virtual int leftMargin() const; 1257 virtual int leftMargin() const;
1253 virtual int firstLineMargin() const; 1258 virtual int firstLineMargin() const;
1254 virtual int rightMargin() const; 1259 virtual int rightMargin() const;
1255 virtual int lineSpacing() const; 1260 virtual int lineSpacing() const;
1256 1261
1257#ifndef QT_NO_TEXTCUSTOMITEM 1262#ifndef QT_NO_TEXTCUSTOMITEM
1258 void registerFloatingItem( QTextCustomItem *i ); 1263 void registerFloatingItem( QTextCustomItem *i );
1259 void unregisterFloatingItem( QTextCustomItem *i ); 1264 void unregisterFloatingItem( QTextCustomItem *i );
1260#endif 1265#endif
1261 1266
1262 void setFullWidth( bool b ) { fullWidth = b; } 1267 void setFullWidth( bool b ) { fullWidth = b; }
1263 bool isFullWidth() const { return fullWidth; } 1268 bool isFullWidth() const { return fullWidth; }
1264 1269
1265#ifndef QT_NO_TEXTCUSTOMITEM 1270#ifndef QT_NO_TEXTCUSTOMITEM
1266 QTextTableCell *tableCell() const; 1271 QTextTableCell *tableCell() const;
1267#endif 1272#endif
1268 1273
1269 QBrush *background() const; 1274 QBrush *background() const;
1270 1275
1271 int documentWidth() const; 1276 int documentWidth() const;
1272 int documentVisibleWidth() const; 1277 int documentVisibleWidth() const;
1273 int documentX() const; 1278 int documentX() const;
1274 int documentY() const; 1279 int documentY() const;
1275 QTextFormatCollection *formatCollection() const; 1280 QTextFormatCollection *formatCollection() const;
1276 QTextFormatter *formatter() const; 1281 QTextFormatter *formatter() const;
1277 1282
1278 virtual int nextTab( int i, int x ); 1283 virtual int nextTab( int i, int x );
1279 int *tabArray() const; 1284 int *tabArray() const;
1280 void setTabArray( int *a ); 1285 void setTabArray( int *a );
1281 void setTabStops( int tw ); 1286 void setTabStops( int tw );
1282 1287
1283 void adjustToPainter( QPainter *p ); 1288 void adjustToPainter( QPainter *p );
1284 1289
1285 void setNewLinesAllowed( bool b ); 1290 void setNewLinesAllowed( bool b );
1286 bool isNewLinesAllowed() const; 1291 bool isNewLinesAllowed() const;
1287 1292
1288 QString richText() const; 1293 QString richText() const;
1289 1294
1290 void addCommand( QTextCommand *cmd ); 1295 void addCommand( QTextCommand *cmd );
1291 QTextCursor *undo( QTextCursor *c = 0 ); 1296 QTextCursor *undo( QTextCursor *c = 0 );
1292 QTextCursor *redo( QTextCursor *c = 0 ); 1297 QTextCursor *redo( QTextCursor *c = 0 );
1293 QTextCommandHistory *commands() const; 1298 QTextCommandHistory *commands() const;
1294 virtual void copyParagData( QTextParagraph *parag ); 1299 virtual void copyParagData( QTextParagraph *parag );
1295 1300
1296 void setBreakable( bool b ) { breakable = b; } 1301 void setBreakable( bool b ) { breakable = b; }
1297 bool isBreakable() const { return breakable; } 1302 bool isBreakable() const { return breakable; }
1298 1303
1299 void setBackgroundColor( const QColor &c ); 1304 void setBackgroundColor( const QColor &c );
1300 QColor *backgroundColor() const { return bgcol; } 1305 QColor *backgroundColor() const { return bgcol; }
1301 void clearBackgroundColor(); 1306 void clearBackgroundColor();
1302 1307
1303 void setMovedDown( bool b ) { movedDown = b; } 1308 void setMovedDown( bool b ) { movedDown = b; }
1304 bool wasMovedDown() const { return movedDown; } 1309 bool wasMovedDown() const { return movedDown; }
1305 1310
1306 void setDirection( QChar::Direction d ); 1311 void setDirection( QChar::Direction d );
1307 QChar::Direction direction() const; 1312 QChar::Direction direction() const;
1308 void setPaintDevice( QPaintDevice *pd ) { paintdevice = pd; } 1313 void setPaintDevice( QPaintDevice *pd ) { paintdevice = pd; }
1309 1314
1310 void readStyleInformation( QDataStream& stream ); 1315 void readStyleInformation( QDataStream& stream );
1311 void writeStyleInformation( QDataStream& stream ) const; 1316 void writeStyleInformation( QDataStream& stream ) const;
1312 1317
1313protected: 1318protected:
1314 virtual void setColorForSelection( QColor &c, QPainter &p, const QColorGroup& cg, int selection ); 1319 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 ); 1320 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, 1321 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, 1322 int y, int baseLine, int w, int h, int selection,
1318 QTextStringChar *formatChar, const QColorGroup& cg, 1323 QTextStringChar *formatChar, const QColorGroup& cg,
1319 bool rightToLeft ); 1324 bool rightToLeft );
1320 1325
1321private: 1326private:
1322 QMap<int, QTextParagraphSelection> &selections() const; 1327 QMap<int, QTextParagraphSelection> &selections() const;
1323#ifndef QT_NO_TEXTCUSTOMITEM 1328#ifndef QT_NO_TEXTCUSTOMITEM
1324 QPtrList<QTextCustomItem> &floatingItems() const; 1329 QPtrList<QTextCustomItem> &floatingItems() const;
1325#endif 1330#endif
1326 QBrush backgroundBrush( const QColorGroup&cg ) { if ( bgcol ) return *bgcol; return cg.brush( QColorGroup::Base ); } 1331 QBrush backgroundBrush( const QColorGroup&cg ) { if ( bgcol ) return *bgcol; return cg.brush( QColorGroup::Base ); }
1327 void invalidateStyleCache(); 1332 void invalidateStyleCache();
1328 1333
1329 QMap<int, QTextLineStart*> lineStarts; 1334 QMap<int, QTextLineStart*> lineStarts;
1330 int invalid; 1335 int invalid;
1331 QRect r; 1336 QRect r;
1332 QTextParagraph *p, *n; 1337 QTextParagraph *p, *n;
1333 void *docOrPseudo; 1338 void *docOrPseudo;
1334 uint changed : 1; 1339 uint changed : 1;
1335 uint firstFormat : 1; 1340 uint firstFormat : 1;
1336 uint firstPProcess : 1; 1341 uint firstPProcess : 1;
1337 uint needPreProcess : 1; 1342 uint needPreProcess : 1;
1338 uint fullWidth : 1; 1343 uint fullWidth : 1;
1339 uint lastInFrame : 1; 1344 uint lastInFrame : 1;
1340 uint visible : 1; 1345 uint visible : 1;
1341 uint breakable : 1; 1346 uint breakable : 1;
1342 uint movedDown : 1; 1347 uint movedDown : 1;
1343 uint mightHaveCustomItems : 1; 1348 uint mightHaveCustomItems : 1;
1344 uint hasdoc : 1; 1349 uint hasdoc : 1;
1345 uint litem : 1; // whether the paragraph is a list item 1350 uint litem : 1; // whether the paragraph is a list item
1346 uint rtext : 1; // whether the paragraph needs rich text margin 1351 uint rtext : 1; // whether the paragraph needs rich text margin
1347 int align : 4; 1352 int align : 4;
1348 int state, id; 1353 int state, id;
1349 QTextString *str; 1354 QTextString *str;
1350 QMap<int, QTextParagraphSelection> *mSelections; 1355 QMap<int, QTextParagraphSelection> *mSelections;
1351#ifndef QT_NO_TEXTCUSTOMITEM 1356#ifndef QT_NO_TEXTCUSTOMITEM
1352 QPtrList<QTextCustomItem> *mFloatingItems; 1357 QPtrList<QTextCustomItem> *mFloatingItems;
1353#endif 1358#endif
1354 QStyleSheetItem::ListStyle lstyle; 1359 QStyleSheetItem::ListStyle lstyle;
1355 short utm, ubm, ulm, urm, uflm, ulinespacing; 1360 short utm, ubm, ulm, urm, uflm, ulinespacing;
1356 int *tArray; 1361 int *tArray;
1357 short tabStopWidth; 1362 short tabStopWidth;
1358 QTextParagraphData *eData; 1363 QTextParagraphData *eData;
1359 short list_val; 1364 short list_val;
1360 QColor *bgcol; 1365 QColor *bgcol;
1361 ushort ldepth; 1366 ushort ldepth;
1362 QPaintDevice *paintdevice; 1367 QPaintDevice *paintdevice;
1363}; 1368};
1364 1369
1365// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1370// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1366 1371
1367class Q_EXPORT QTextFormatter 1372class Q_EXPORT QTextFormatter
1368{ 1373{
1369public: 1374public:
1370 QTextFormatter(); 1375 QTextFormatter();
1371 virtual ~QTextFormatter(); 1376 virtual ~QTextFormatter();
1372 1377
1373 virtual int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ) = 0; 1378 virtual int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ) = 0;
1374 virtual int formatVertically( QTextDocument* doc, QTextParagraph* parag ); 1379 virtual int formatVertically( QTextDocument* doc, QTextParagraph* parag );
1375 1380
1376 bool isWrapEnabled( QTextParagraph *p ) const { if ( !wrapEnabled ) return FALSE; if ( p && !p->isBreakable() ) return FALSE; return TRUE;} 1381 bool isWrapEnabled( QTextParagraph *p ) const { if ( !wrapEnabled ) return FALSE; if ( p && !p->isBreakable() ) return FALSE; return TRUE;}
1377 int wrapAtColumn() const { return wrapColumn;} 1382 int wrapAtColumn() const { return wrapColumn;}
1378 virtual void setWrapEnabled( bool b ); 1383 virtual void setWrapEnabled( bool b );
1379 virtual void setWrapAtColumn( int c ); 1384 virtual void setWrapAtColumn( int c );
1380 virtual void setAllowBreakInWords( bool b ) { biw = b; } 1385 virtual void setAllowBreakInWords( bool b ) { biw = b; }
1381 bool allowBreakInWords() const { return biw; } 1386 bool allowBreakInWords() const { return biw; }
1382 1387
1383 int minimumWidth() const { return thisminw; } 1388 int minimumWidth() const { return thisminw; }
1384 int widthUsed() const { return thiswused; } 1389 int widthUsed() const { return thiswused; }
1385 1390
1386 static bool isBreakable( QTextString *string, int pos ); 1391 static bool isBreakable( QTextString *string, int pos );
1387 1392
1388protected: 1393protected:
1389 virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, 1394 virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start,
1390 QTextStringChar *last, int align = Qt::AlignAuto, int space = 0 ); 1395 QTextStringChar *last, int align = Qt::AlignAuto, int space = 0 );
1391#ifndef QT_NO_COMPLEXTEXT 1396#ifndef QT_NO_COMPLEXTEXT
1392 virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, 1397 virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start,
1393 QTextStringChar *last, int align, int space ); 1398 QTextStringChar *last, int align, int space );
1394#endif 1399#endif
1395 void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls ); 1400 void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls );
1396 1401
1397 int thisminw; 1402 int thisminw;
1398 int thiswused; 1403 int thiswused;
1399 1404
1400private: 1405private:
1401 bool wrapEnabled; 1406 bool wrapEnabled;
1402 int wrapColumn; 1407 int wrapColumn;
1403 bool biw; 1408 bool biw;
1404 1409
1405#ifdef HAVE_THAI_BREAKS 1410#ifdef HAVE_THAI_BREAKS
1406 static QCString *thaiCache; 1411 static QCString *thaiCache;
1407 static QTextString *cachedString; 1412 static QTextString *cachedString;
1408 static ThBreakIterator *thaiIt; 1413 static ThBreakIterator *thaiIt;
1409#endif 1414#endif
1410}; 1415};
1411 1416
1412// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1417// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1413 1418
1414class Q_EXPORT QTextFormatterBreakInWords : public QTextFormatter 1419class Q_EXPORT QTextFormatterBreakInWords : public QTextFormatter
1415{ 1420{
1416public: 1421public:
1417 QTextFormatterBreakInWords(); 1422 QTextFormatterBreakInWords();
1418 virtual ~QTextFormatterBreakInWords() {} 1423 virtual ~QTextFormatterBreakInWords() {}
1419 1424
1420 int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ); 1425 int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts );
1421 1426
1422}; 1427};
1423 1428
1424// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1429// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1425 1430
1426class Q_EXPORT QTextFormatterBreakWords : public QTextFormatter 1431class Q_EXPORT QTextFormatterBreakWords : public QTextFormatter
1427{ 1432{
1428public: 1433public:
1429 QTextFormatterBreakWords(); 1434 QTextFormatterBreakWords();
1430 virtual ~QTextFormatterBreakWords() {} 1435 virtual ~QTextFormatterBreakWords() {}
1431 1436
1432 int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts ); 1437 int format( QTextDocument *doc, QTextParagraph *parag, int start, const QMap<int, QTextLineStart*> &oldLineStarts );
1433 1438
1434}; 1439};
1435 1440
1436// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1441// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1437 1442
1438class Q_EXPORT QTextIndent 1443class Q_EXPORT QTextIndent
1439{ 1444{
1440public: 1445public:
1441 QTextIndent(); 1446 QTextIndent();
1442 virtual ~QTextIndent() {} 1447 virtual ~QTextIndent() {}
1443 1448
1444 virtual void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent = 0, int *newIndent = 0 ) = 0; 1449 virtual void indent( QTextDocument *doc, QTextParagraph *parag, int *oldIndent = 0, int *newIndent = 0 ) = 0;
1445 1450
1446}; 1451};
1447 1452
1448// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1453// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1449 1454
1450class Q_EXPORT QTextPreProcessor 1455class Q_EXPORT QTextPreProcessor
1451{ 1456{
1452public: 1457public:
1453 enum Ids { 1458 enum Ids {
1454 Standard = 0 1459 Standard = 0
1455 }; 1460 };
1456 1461
1457 QTextPreProcessor(); 1462 QTextPreProcessor();
1458 virtual ~QTextPreProcessor() {} 1463 virtual ~QTextPreProcessor() {}
1459 1464
1460 virtual void process( QTextDocument *doc, QTextParagraph *, int, bool = TRUE ) = 0; 1465 virtual void process( QTextDocument *doc, QTextParagraph *, int, bool = TRUE ) = 0;
1461 virtual QTextFormat *format( int id ) = 0; 1466 virtual QTextFormat *format( int id ) = 0;
1462 1467
1463}; 1468};
1464 1469
1465// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1470// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1466 1471
1467class Q_EXPORT QTextFormat 1472class Q_EXPORT QTextFormat
1468{ 1473{
1469 friend class QTextFormatCollection; 1474 friend class QTextFormatCollection;
1470 friend class QTextDocument; 1475 friend class QTextDocument;
1471 1476
1472public: 1477public:
1473 enum Flags { 1478 enum Flags {
1474 NoFlags, 1479 NoFlags,
1475 Bold = 1, 1480 Bold = 1,
1476 Italic = 2, 1481 Italic = 2,
1477 Underline = 4, 1482 Underline = 4,
1478 Family = 8, 1483 Family = 8,
1479 Size = 16, 1484 Size = 16,
1480 Color = 32, 1485 Color = 32,
1481 Misspelled = 64, 1486 Misspelled = 64,
1482 VAlign = 128, 1487 VAlign = 128,
1483 StrikeOut= 256, 1488 StrikeOut= 256,
1484 Font = Bold | Italic | Underline | Family | Size | StrikeOut, 1489 Font = Bold | Italic | Underline | Family | Size | StrikeOut,
1485 Format = Font | Color | Misspelled | VAlign 1490 Format = Font | Color | Misspelled | VAlign
1486 }; 1491 };
1487 1492
1488 enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript }; 1493 enum VerticalAlignment { AlignNormal, AlignSuperScript, AlignSubScript };
1489 1494
1490 QTextFormat(); 1495 QTextFormat();
1491 virtual ~QTextFormat(); 1496 virtual ~QTextFormat();
1492 1497
1493 QTextFormat( const QStyleSheetItem *s ); 1498 QTextFormat( const QStyleSheetItem *s );
1494 QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent = 0 ); 1499 QTextFormat( const QFont &f, const QColor &c, QTextFormatCollection *parent = 0 );
1495 QTextFormat( const QTextFormat &fm ); 1500 QTextFormat( const QTextFormat &fm );
1496 QTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr, double scaleFontsFactor ) const; 1501 QTextFormat makeTextFormat( const QStyleSheetItem *style, const QMap<QString,QString>& attr, double scaleFontsFactor ) const;
1497 QTextFormat& operator=( const QTextFormat &fm ); 1502 QTextFormat& operator=( const QTextFormat &fm );
1498 QColor color() const; 1503 QColor color() const;
1499 QFont font() const; 1504 QFont font() const;
1500 bool isMisspelled() const; 1505 bool isMisspelled() const;
1501 VerticalAlignment vAlign() const; 1506 VerticalAlignment vAlign() const;
1502 int minLeftBearing() const; 1507 int minLeftBearing() const;
1503 int minRightBearing() const; 1508 int minRightBearing() const;
1504 int width( const QChar &c ) const; 1509 int width( const QChar &c ) const;
1505 int width( const QString &str, int pos ) const; 1510 int width( const QString &str, int pos ) const;
1506 int height() const; 1511 int height() const;
1507 int ascent() const; 1512 int ascent() const;
1508 int descent() const; 1513 int descent() const;
1509 int leading() const; 1514 int leading() const;
1510 bool useLinkColor() const; 1515 bool useLinkColor() const;
1511 1516
1512 void setBold( bool b ); 1517 void setBold( bool b );
1513 void setItalic( bool b ); 1518 void setItalic( bool b );
1514 void setUnderline( bool b ); 1519 void setUnderline( bool b );
1515 void setStrikeOut( bool b ); 1520 void setStrikeOut( bool b );
1516 void setFamily( const QString &f ); 1521 void setFamily( const QString &f );
1517 void setPointSize( int s ); 1522 void setPointSize( int s );
1518 void setFont( const QFont &f ); 1523 void setFont( const QFont &f );
1519 void setColor( const QColor &c ); 1524 void setColor( const QColor &c );
1520 void setMisspelled( bool b ); 1525 void setMisspelled( bool b );
1521 void setVAlign( VerticalAlignment a ); 1526 void setVAlign( VerticalAlignment a );
1522 1527
1523 bool operator==( const QTextFormat &f ) const; 1528 bool operator==( const QTextFormat &f ) const;
1524 QTextFormatCollection *parent() const; 1529 QTextFormatCollection *parent() const;
1525 const QString &key() const; 1530 const QString &key() const;
1526 1531
1527 static QString getKey( const QFont &f, const QColor &c, bool misspelled, VerticalAlignment vAlign ); 1532 static QString getKey( const QFont &f, const QColor &c, bool misspelled, VerticalAlignment vAlign );
1528 1533
1529 void addRef(); 1534 void addRef();
1530 void removeRef(); 1535 void removeRef();
1531 1536
1532 QString makeFormatChangeTags( QTextFormat* defaultFormat, QTextFormat *f, const QString& oldAnchorHref, const QString& anchorHref ) const; 1537 QString makeFormatChangeTags( QTextFormat* defaultFormat, QTextFormat *f, const QString& oldAnchorHref, const QString& anchorHref ) const;
1533 QString makeFormatEndTags( QTextFormat* defaultFormat, const QString& anchorHref ) const; 1538 QString makeFormatEndTags( QTextFormat* defaultFormat, const QString& anchorHref ) const;
1534 1539
1535 static void setPainter( QPainter *p ); 1540 static void setPainter( QPainter *p );
1536 static QPainter* painter(); 1541 static QPainter* painter();
1537 1542
1538 bool fontSizesInPixels() { return usePixelSizes; } 1543 bool fontSizesInPixels() { return usePixelSizes; }
1539 1544
1540protected: 1545protected:
1541 virtual void generateKey(); 1546 virtual void generateKey();
1542 1547
1543private: 1548private:
1544 void update(); 1549 void update();
1545 static void applyFont( const QFont &f ); 1550 static void applyFont( const QFont &f );
1546 1551
1547private: 1552private:
1548 QFont fn; 1553 QFont fn;
1549 QColor col; 1554 QColor col;
1550 QFontMetrics fm; 1555 QFontMetrics fm;
1551 uint missp : 1; 1556 uint missp : 1;
1552 uint linkColor : 1; 1557 uint linkColor : 1;
1553 uint usePixelSizes : 1; 1558 uint usePixelSizes : 1;
1554 int leftBearing, rightBearing; 1559 int leftBearing, rightBearing;
1555 VerticalAlignment ha; 1560 VerticalAlignment ha;
1556 uchar widths[ 256 ]; 1561 uchar widths[ 256 ];
1557 int hei, asc, dsc; 1562 int hei, asc, dsc;
1558 QTextFormatCollection *collection; 1563 QTextFormatCollection *collection;
1559 int ref; 1564 int ref;
1560 QString k; 1565 QString k;
1561 int logicalFontSize; 1566 int logicalFontSize;
1562 int stdSize; 1567 int stdSize;
1563 static QPainter *pntr; 1568 static QPainter *pntr;
1564 static QFontMetrics *pntr_fm; 1569 static QFontMetrics *pntr_fm;
1565 static int pntr_asc; 1570 static int pntr_asc;
1566 static int pntr_hei; 1571 static int pntr_hei;
1567 static int pntr_ldg; 1572 static int pntr_ldg;
1568 static int pntr_dsc; 1573 static int pntr_dsc;
1569 1574
1570}; 1575};
1571 1576
1572// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1577// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1573 1578
1574#if defined(Q_TEMPLATEDLL) 1579#if defined(Q_TEMPLATEDLL)
1575// MOC_SKIP_BEGIN 1580// MOC_SKIP_BEGIN
1576Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QTextFormat>; 1581Q_TEMPLATE_EXTERN template class Q_EXPORT QDict<QTextFormat>;
1577// MOC_SKIP_END 1582// MOC_SKIP_END
1578#endif 1583#endif
1579 1584
1580class Q_EXPORT QTextFormatCollection 1585class Q_EXPORT QTextFormatCollection
1581{ 1586{
1582 friend class QTextDocument; 1587 friend class QTextDocument;
1583 friend class QTextFormat; 1588 friend class QTextFormat;
1584 1589
1585public: 1590public:
1586 QTextFormatCollection(); 1591 QTextFormatCollection();
1587 virtual ~QTextFormatCollection(); 1592 virtual ~QTextFormatCollection();
1588 1593
1589 void setDefaultFormat( QTextFormat *f ); 1594 void setDefaultFormat( QTextFormat *f );
1590 QTextFormat *defaultFormat() const; 1595 QTextFormat *defaultFormat() const;
1591 virtual QTextFormat *format( QTextFormat *f ); 1596 virtual QTextFormat *format( QTextFormat *f );
1592 virtual QTextFormat *format( QTextFormat *of, QTextFormat *nf, int flags ); 1597 virtual QTextFormat *format( QTextFormat *of, QTextFormat *nf, int flags );
1593 virtual QTextFormat *format( const QFont &f, const QColor &c ); 1598 virtual QTextFormat *format( const QFont &f, const QColor &c );
1594 virtual void remove( QTextFormat *f ); 1599 virtual void remove( QTextFormat *f );
1595 virtual QTextFormat *createFormat( const QTextFormat &f ) { return new QTextFormat( f ); } 1600 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 ); } 1601 virtual QTextFormat *createFormat( const QFont &f, const QColor &c ) { return new QTextFormat( f, c, this ); }
1597 1602
1598 void updateDefaultFormat( const QFont &font, const QColor &c, QStyleSheet *sheet ); 1603 void updateDefaultFormat( const QFont &font, const QColor &c, QStyleSheet *sheet );
1599 QDict<QTextFormat> dict() const { return cKey; }
1600 1604
1601 QPaintDevice *paintDevice() const { return paintdevice; } 1605 QPaintDevice *paintDevice() const { return paintdevice; }
1602 void setPaintDevice( QPaintDevice * ); 1606 void setPaintDevice( QPaintDevice * );
1603 1607
1604private: 1608private:
1605 void updateKeys(); 1609 void updateKeys();
1606 1610
1607private: 1611private:
1608 QTextFormat *defFormat, *lastFormat, *cachedFormat; 1612 QTextFormat *defFormat, *lastFormat, *cachedFormat;
1609 QDict<QTextFormat> cKey; 1613 QDict<QTextFormat> cKey;
1610 QTextFormat *cres; 1614 QTextFormat *cres;
1611 QFont cfont; 1615 QFont cfont;
1612 QColor ccol; 1616 QColor ccol;
1613 QString kof, knf; 1617 QString kof, knf;
1614 int cflags; 1618 int cflags;
1615 1619
1616 QPaintDevice *paintdevice; 1620 QPaintDevice *paintdevice;
1617}; 1621};
1618 1622
1623class Q_EXPORT QTextParagraphPseudoDocument
1624{
1625public:
1626 QTextParagraphPseudoDocument();
1627 ~QTextParagraphPseudoDocument();
1628 QRect docRect;
1629 QTextFormatter *pFormatter;
1630 QTextCommandHistory *commandHistory;
1631 int minw;
1632 int wused;
1633 QTextFormatCollection collection;
1634};
1635
1619// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1636// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1620 1637
1621inline int QTextString::length() const 1638inline int QTextString::length() const
1622{ 1639{
1623 return data.size(); 1640 return data.size();
1624} 1641}
1625 1642
1626inline int QTextParagraph::length() const 1643inline int QTextParagraph::length() const
1627{ 1644{
1628 return str->length(); 1645 return str->length();
1629} 1646}
1630 1647
1631inline QRect QTextParagraph::rect() const 1648inline QRect QTextParagraph::rect() const
1632{ 1649{
1633 return r; 1650 return r;
1634} 1651}
1635 1652
1636inline QTextParagraph *QTextCursor::paragraph() const 1653inline QTextParagraph *QTextCursor::paragraph() const
1637{ 1654{
1638 return para; 1655 return para;
1639} 1656}
1640 1657
1641inline int QTextCursor::index() const 1658inline int QTextCursor::index() const
1642{ 1659{
1643 return idx; 1660 return idx;
1644} 1661}
1645 1662
1646 1663
1647// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1664// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1648 1665
1649inline int QTextDocument::x() const 1666inline int QTextDocument::x() const
1650{ 1667{
1651 return cx; 1668 return cx;
1652} 1669}
1653 1670
1654inline int QTextDocument::y() const 1671inline int QTextDocument::y() const
1655{ 1672{
1656 return cy; 1673 return cy;
1657} 1674}
1658 1675
1659inline int QTextDocument::width() const 1676inline int QTextDocument::width() const
1660{ 1677{
1661 return QMAX( cw, flow_->width() ); 1678 return QMAX( cw, flow_->width() );
1662} 1679}
1663 1680
1664inline int QTextDocument::visibleWidth() const 1681inline int QTextDocument::visibleWidth() const
1665{ 1682{
1666 return vw; 1683 return vw;
1667} 1684}
1668 1685
1669inline QTextParagraph *QTextDocument::firstParagraph() const 1686inline QTextParagraph *QTextDocument::firstParagraph() const
1670{ 1687{
1671 return fParag; 1688 return fParag;
1672} 1689}
1673 1690
1674inline QTextParagraph *QTextDocument::lastParagraph() const 1691inline QTextParagraph *QTextDocument::lastParagraph() const
1675{ 1692{
1676 return lParag; 1693 return lParag;
1677} 1694}
1678 1695
1679inline void QTextDocument::setFirstParagraph( QTextParagraph *p ) 1696inline void QTextDocument::setFirstParagraph( QTextParagraph *p )
1680{ 1697{
1681 fParag = p; 1698 fParag = p;
1682} 1699}
1683 1700
1684inline void QTextDocument::setLastParagraph( QTextParagraph *p ) 1701inline void QTextDocument::setLastParagraph( QTextParagraph *p )
1685{ 1702{
1686 lParag = p; 1703 lParag = p;
1687} 1704}
1688 1705
1689inline void QTextDocument::setWidth( int w ) 1706inline void QTextDocument::setWidth( int w )
1690{ 1707{
1691 cw = QMAX( w, minw ); 1708 cw = QMAX( w, minw );
1692 flow_->setWidth( cw ); 1709 flow_->setWidth( cw );
1693 vw = w; 1710 vw = w;
1694} 1711}
1695 1712
1696inline int QTextDocument::minimumWidth() const 1713inline int QTextDocument::minimumWidth() const
1697{ 1714{
1698 return minw; 1715 return minw;
1699} 1716}
1700 1717
1701inline void QTextDocument::setY( int y ) 1718inline void QTextDocument::setY( int y )
1702{ 1719{
1703 cy = y; 1720 cy = y;
1704} 1721}
1705 1722
1706inline int QTextDocument::leftMargin() const 1723inline int QTextDocument::leftMargin() const
1707{ 1724{
1708 return leftmargin; 1725 return leftmargin;
1709} 1726}
1710 1727
1711inline void QTextDocument::setLeftMargin( int lm ) 1728inline void QTextDocument::setLeftMargin( int lm )
1712{ 1729{
1713 leftmargin = lm; 1730 leftmargin = lm;
1714} 1731}
1715 1732
1716inline int QTextDocument::rightMargin() const 1733inline int QTextDocument::rightMargin() const
1717{ 1734{
1718 return rightmargin; 1735 return rightmargin;
1719} 1736}
1720 1737
1721inline void QTextDocument::setRightMargin( int rm ) 1738inline void QTextDocument::setRightMargin( int rm )
1722{ 1739{
1723 rightmargin = rm; 1740 rightmargin = rm;
1724} 1741}
1725 1742
1726inline QTextPreProcessor *QTextDocument::preProcessor() const 1743inline QTextPreProcessor *QTextDocument::preProcessor() const
1727{ 1744{
1728 return pProcessor; 1745 return pProcessor;
1729} 1746}
1730 1747
1731inline void QTextDocument::setPreProcessor( QTextPreProcessor * sh ) 1748inline void QTextDocument::setPreProcessor( QTextPreProcessor * sh )
1732{ 1749{
1733 pProcessor = sh; 1750 pProcessor = sh;
1734} 1751}
1735 1752
1736inline void QTextDocument::setFormatter( QTextFormatter *f ) 1753inline void QTextDocument::setFormatter( QTextFormatter *f )
1737{ 1754{
1738 delete pFormatter; 1755 delete pFormatter;
1739 pFormatter = f; 1756 pFormatter = f;
1740} 1757}
1741 1758
1742inline QTextFormatter *QTextDocument::formatter() const 1759inline QTextFormatter *QTextDocument::formatter() const
1743{ 1760{
1744 return pFormatter; 1761 return pFormatter;
1745} 1762}
1746 1763
1747inline void QTextDocument::setIndent( QTextIndent *i ) 1764inline void QTextDocument::setIndent( QTextIndent *i )
1748{ 1765{
1749 indenter = i; 1766 indenter = i;
1750} 1767}
1751 1768
1752inline QTextIndent *QTextDocument::indent() const 1769inline QTextIndent *QTextDocument::indent() const
1753{ 1770{
1754 return indenter; 1771 return indenter;
1755} 1772}
1756 1773
1757inline QColor QTextDocument::selectionColor( int id ) const 1774inline QColor QTextDocument::selectionColor( int id ) const
1758{ 1775{
1759 return selectionColors[ id ]; 1776 return selectionColors[ id ];
1760} 1777}
1761 1778
1762inline bool QTextDocument::invertSelectionText( int id ) const 1779inline bool QTextDocument::invertSelectionText( int id ) const
1763{ 1780{
1764 return selectionText[ id ]; 1781 return selectionText[ id ];
1765} 1782}
1766 1783
1767inline void QTextDocument::setSelectionColor( int id, const QColor &c ) 1784inline void QTextDocument::setSelectionColor( int id, const QColor &c )
1768{ 1785{
1769 selectionColors[ id ] = c; 1786 selectionColors[ id ] = c;
1770} 1787}
1771 1788
1772inline void QTextDocument::setInvertSelectionText( int id, bool b ) 1789inline void QTextDocument::setInvertSelectionText( int id, bool b )
1773{ 1790{
1774 selectionText[ id ] = b; 1791 selectionText[ id ] = b;
1775} 1792}
1776 1793
1777inline QTextFormatCollection *QTextDocument::formatCollection() const 1794inline QTextFormatCollection *QTextDocument::formatCollection() const
1778{ 1795{
1779 return fCollection; 1796 return fCollection;
1780} 1797}
1781 1798
1782inline int QTextDocument::alignment() const 1799inline int QTextDocument::alignment() const
1783{ 1800{
1784 return align; 1801 return align;
1785} 1802}
1786 1803
1787inline void QTextDocument::setAlignment( int a ) 1804inline void QTextDocument::setAlignment( int a )
1788{ 1805{
1789 align = a; 1806 align = a;
1790} 1807}
1791 1808
1792inline int *QTextDocument::tabArray() const 1809inline int *QTextDocument::tabArray() const
1793{ 1810{
1794 return tArray; 1811 return tArray;
1795} 1812}
1796 1813
1797inline int QTextDocument::tabStopWidth() const 1814inline int QTextDocument::tabStopWidth() const
1798{ 1815{
1799 return tStopWidth; 1816 return tStopWidth;
1800} 1817}
1801 1818
1802inline void QTextDocument::setTabArray( int *a ) 1819inline void QTextDocument::setTabArray( int *a )
1803{ 1820{
1804 tArray = a; 1821 tArray = a;
1805} 1822}
1806 1823
1807inline void QTextDocument::setTabStops( int tw ) 1824inline void QTextDocument::setTabStops( int tw )
1808{ 1825{
1809 tStopWidth = tw; 1826 tStopWidth = tw;
1810} 1827}
1811 1828
1812inline QString QTextDocument::originalText() const 1829inline QString QTextDocument::originalText() const
1813{ 1830{
1814 if ( oTextValid ) 1831 if ( oTextValid )
1815 return oText; 1832 return oText;
1816 return text(); 1833 return text();
1817} 1834}
1818 1835
1819inline void QTextDocument::setFlow( QTextFlow *f ) 1836inline void QTextDocument::setFlow( QTextFlow *f )
1820{ 1837{
1821 if ( flow_ ) 1838 if ( flow_ )
1822 delete flow_; 1839 delete flow_;
1823 flow_ = f; 1840 flow_ = f;
1824} 1841}
1825 1842
1826inline void QTextDocument::takeFlow() 1843inline void QTextDocument::takeFlow()
1827{ 1844{
1828 flow_ = 0; 1845 flow_ = 0;
1829} 1846}
1830 1847
1848inline bool QTextDocument::useDoubleBuffer( QTextParagraph *parag, QPainter *p )
1849{
1850 return ( !parag->document()->parent() || parag->document()->nextDoubleBuffered ) &&
1851 ( !p || !p->device() || p->device()->devType() != QInternal::Printer );
1852}
1853
1831// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1854// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1832 1855
1833inline QColor QTextFormat::color() const 1856inline QColor QTextFormat::color() const
1834{ 1857{
1835 return col; 1858 return col;
1836} 1859}
1837 1860
1838inline QFont QTextFormat::font() const 1861inline QFont QTextFormat::font() const
1839{ 1862{
1840 return fn; 1863 return fn;
1841} 1864}
1842 1865
1843inline bool QTextFormat::isMisspelled() const 1866inline bool QTextFormat::isMisspelled() const
1844{ 1867{
1845 return missp; 1868 return missp;
1846} 1869}
1847 1870
1848inline QTextFormat::VerticalAlignment QTextFormat::vAlign() const 1871inline QTextFormat::VerticalAlignment QTextFormat::vAlign() const
1849{ 1872{
1850 return ha; 1873 return ha;
1851} 1874}
1852 1875
1853inline bool QTextFormat::operator==( const QTextFormat &f ) const 1876inline bool QTextFormat::operator==( const QTextFormat &f ) const
1854{ 1877{
1855 return k == f.k; 1878 return k == f.k;
1856} 1879}
1857 1880
1858inline QTextFormatCollection *QTextFormat::parent() const 1881inline QTextFormatCollection *QTextFormat::parent() const
1859{ 1882{
1860 return collection; 1883 return collection;
1861} 1884}
1862 1885
1863inline void QTextFormat::addRef() 1886inline void QTextFormat::addRef()
1864{ 1887{
1865 ref++; 1888 ref++;
1866} 1889}
1867 1890
1868inline void QTextFormat::removeRef() 1891inline void QTextFormat::removeRef()
1869{ 1892{
1870 ref--; 1893 ref--;
1871 if ( !collection ) 1894 if ( !collection )
1872 return; 1895 return;
1873 if ( this == collection->defFormat ) 1896 if ( this == collection->defFormat )
1874 return; 1897 return;
1875 if ( ref == 0 ) 1898 if ( ref == 0 )
1876 collection->remove( this ); 1899 collection->remove( this );
1877} 1900}
1878 1901
1879inline const QString &QTextFormat::key() const 1902inline const QString &QTextFormat::key() const
1880{ 1903{
1881 return k; 1904 return k;
1882} 1905}
1883 1906
1884inline bool QTextFormat::useLinkColor() const 1907inline bool QTextFormat::useLinkColor() const
1885{ 1908{
1886 return linkColor; 1909 return linkColor;
1887} 1910}
1888 1911
1889 1912
1890// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1913// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1891 1914
1892inline QTextStringChar &QTextString::at( int i ) const 1915inline QTextStringChar &QTextString::at( int i ) const
1893{ 1916{
1894 return data[ i ]; 1917 return data[ i ];
1895} 1918}
1896 1919
1897// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1920// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1898 1921
1899inline QTextStringChar *QTextParagraph::at( int i ) const 1922inline QTextStringChar *QTextParagraph::at( int i ) const
1900{ 1923{
1901 return &str->at( i ); 1924 return &str->at( i );
1902} 1925}
1903 1926
1904inline bool QTextParagraph::isValid() const 1927inline bool QTextParagraph::isValid() const
1905{ 1928{
1906 return invalid == -1; 1929 return invalid == -1;
1907} 1930}
1908 1931
1909inline bool QTextParagraph::hasChanged() const 1932inline bool QTextParagraph::hasChanged() const
1910{ 1933{
1911 return changed; 1934 return changed;
1912} 1935}
1913 1936
1914inline void QTextParagraph::setBackgroundColor( const QColor & c ) 1937inline void QTextParagraph::setBackgroundColor( const QColor & c )
1915{ 1938{
1916 delete bgcol; 1939 delete bgcol;
1917 bgcol = new QColor( c ); 1940 bgcol = new QColor( c );
1918 setChanged( TRUE ); 1941 setChanged( TRUE );
1919} 1942}
1920 1943
1921inline void QTextParagraph::clearBackgroundColor() 1944inline void QTextParagraph::clearBackgroundColor()
1922{ 1945{
1923 delete bgcol; bgcol = 0; setChanged( TRUE ); 1946 delete bgcol; bgcol = 0; setChanged( TRUE );
1924} 1947}
1925 1948
1926inline void QTextParagraph::append( const QString &s, bool reallyAtEnd ) 1949inline void QTextParagraph::append( const QString &s, bool reallyAtEnd )
1927{ 1950{
1928 if ( reallyAtEnd ) 1951 if ( reallyAtEnd )
1929 insert( str->length(), s ); 1952 insert( str->length(), s );
1930 else 1953 else
1931 insert( QMAX( str->length() - 1, 0 ), s ); 1954 insert( QMAX( str->length() - 1, 0 ), s );
1932} 1955}
1933 1956
1934inline QTextParagraph *QTextParagraph::prev() const 1957inline QTextParagraph *QTextParagraph::prev() const
1935{ 1958{
1936 return p; 1959 return p;
1937} 1960}
1938 1961
1939inline QTextParagraph *QTextParagraph::next() const 1962inline QTextParagraph *QTextParagraph::next() const
1940{ 1963{
1941 return n; 1964 return n;
1942} 1965}
1943 1966
1944inline bool QTextParagraph::hasAnySelection() const 1967inline bool QTextParagraph::hasAnySelection() const
1945{ 1968{
1946 return mSelections ? !selections().isEmpty() : FALSE; 1969 return mSelections ? !selections().isEmpty() : FALSE;
1947} 1970}
1948 1971
1949inline void QTextParagraph::setEndState( int s ) 1972inline void QTextParagraph::setEndState( int s )
1950{ 1973{
1951 if ( s == state ) 1974 if ( s == state )
1952 return; 1975 return;
1953 state = s; 1976 state = s;
1954} 1977}
1955 1978
1956inline int QTextParagraph::endState() const 1979inline int QTextParagraph::endState() const
1957{ 1980{
1958 return state; 1981 return state;
1959} 1982}
1960 1983
1961inline void QTextParagraph::setParagId( int i ) 1984inline void QTextParagraph::setParagId( int i )
1962{ 1985{
1963 id = i; 1986 id = i;
1964} 1987}
1965 1988
1966inline int QTextParagraph::paragId() const 1989inline int QTextParagraph::paragId() const
1967{ 1990{
1968 if ( id == -1 ) 1991 if ( id == -1 )
1969 qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this ); 1992 qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this );
1970 return id; 1993 return id;
1971} 1994}
1972 1995
1973inline bool QTextParagraph::firstPreProcess() const 1996inline bool QTextParagraph::firstPreProcess() const
1974{ 1997{
1975 return firstPProcess; 1998 return firstPProcess;
1976} 1999}
1977 2000
1978inline void QTextParagraph::setFirstPreProcess( bool b ) 2001inline void QTextParagraph::setFirstPreProcess( bool b )
1979{ 2002{
1980 firstPProcess = b; 2003 firstPProcess = b;
1981} 2004}
1982 2005
1983inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList() 2006inline QMap<int, QTextLineStart*> &QTextParagraph::lineStartList()
1984{ 2007{
1985 return lineStarts; 2008 return lineStarts;
1986} 2009}
1987 2010
1988inline QTextString *QTextParagraph::string() const 2011inline QTextString *QTextParagraph::string() const
1989{ 2012{
1990 return str; 2013 return str;
1991} 2014}
1992 2015
1993inline QTextDocument *QTextParagraph::document() const 2016inline QTextDocument *QTextParagraph::document() const
1994{ 2017{
1995 if ( hasdoc ) 2018 if ( hasdoc )
1996 return (QTextDocument*) docOrPseudo; 2019 return (QTextDocument*) docOrPseudo;
1997 return 0; 2020 return 0;
1998} 2021}
1999 2022
2000inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const 2023inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const
2001{ 2024{
2002 if ( hasdoc ) 2025 if ( hasdoc )
2003 return 0; 2026 return 0;
2004 return (QTextParagraphPseudoDocument*) docOrPseudo; 2027 return (QTextParagraphPseudoDocument*) docOrPseudo;
2005} 2028}
2006 2029
2007 2030
2008#ifndef QT_NO_TEXTCUSTOMITEM 2031#ifndef QT_NO_TEXTCUSTOMITEM
2009inline QTextTableCell *QTextParagraph::tableCell() const 2032inline QTextTableCell *QTextParagraph::tableCell() const
2010{ 2033{
2011 return hasdoc ? document()->tableCell () : 0; 2034 return hasdoc ? document()->tableCell () : 0;
2012} 2035}
2013#endif 2036#endif
2014 2037
2015inline QTextCommandHistory *QTextParagraph::commands() const 2038inline QTextCommandHistory *QTextParagraph::commands() const
2016{ 2039{
2017 return hasdoc ? document()->commands() : pseudoDocument()->commandHistory; 2040 return hasdoc ? document()->commands() : pseudoDocument()->commandHistory;
2018} 2041}
2019 2042
2020 2043
2021inline int QTextParagraph::alignment() const 2044inline int QTextParagraph::alignment() const
2022{ 2045{
2023 return align; 2046 return align;
2024} 2047}
2025 2048
2026#ifndef QT_NO_TEXTCUSTOMITEM 2049#ifndef QT_NO_TEXTCUSTOMITEM
2027inline void QTextParagraph::registerFloatingItem( QTextCustomItem *i ) 2050inline void QTextParagraph::registerFloatingItem( QTextCustomItem *i )
2028{ 2051{
2029 floatingItems().append( i ); 2052 floatingItems().append( i );
2030} 2053}
2031 2054
2032inline void QTextParagraph::unregisterFloatingItem( QTextCustomItem *i ) 2055inline void QTextParagraph::unregisterFloatingItem( QTextCustomItem *i )
2033{ 2056{
2034 floatingItems().removeRef( i ); 2057 floatingItems().removeRef( i );
2035} 2058}
2036#endif 2059#endif
2037 2060
2038inline QBrush *QTextParagraph::background() const 2061inline QBrush *QTextParagraph::background() const
2039{ 2062{
2040#ifndef QT_NO_TEXTCUSTOMITEM 2063#ifndef QT_NO_TEXTCUSTOMITEM
2041 return tableCell() ? tableCell()->backGround() : 0; 2064 return tableCell() ? tableCell()->backGround() : 0;
2042#else 2065#else
2043 return 0; 2066 return 0;
2044#endif 2067#endif
2045} 2068}
2046 2069
2047inline int QTextParagraph::documentWidth() const 2070inline int QTextParagraph::documentWidth() const
2048{ 2071{
2049 return hasdoc ? document()->width() : pseudoDocument()->docRect.width(); 2072 return hasdoc ? document()->width() : pseudoDocument()->docRect.width();
2050} 2073}
2051 2074
2052inline int QTextParagraph::documentVisibleWidth() const 2075inline int QTextParagraph::documentVisibleWidth() const
2053{ 2076{
2054 return hasdoc ? document()->visibleWidth() : pseudoDocument()->docRect.width(); 2077 return hasdoc ? document()->visibleWidth() : pseudoDocument()->docRect.width();
2055} 2078}
2056 2079
2057inline int QTextParagraph::documentX() const 2080inline int QTextParagraph::documentX() const
2058{ 2081{
2059 return hasdoc ? document()->x() : pseudoDocument()->docRect.x(); 2082 return hasdoc ? document()->x() : pseudoDocument()->docRect.x();
2060} 2083}
2061 2084
2062inline int QTextParagraph::documentY() const 2085inline int QTextParagraph::documentY() const
2063{ 2086{
2064 return hasdoc ? document()->y() : pseudoDocument()->docRect.y(); 2087 return hasdoc ? document()->y() : pseudoDocument()->docRect.y();
2065} 2088}
2066 2089
2067inline void QTextParagraph::setExtraData( QTextParagraphData *data ) 2090inline void QTextParagraph::setExtraData( QTextParagraphData *data )
2068{ 2091{
2069 eData = data; 2092 eData = data;
2070} 2093}
2071 2094
2072inline QTextParagraphData *QTextParagraph::extraData() const 2095inline QTextParagraphData *QTextParagraph::extraData() const
2073{ 2096{
2074 return eData; 2097 return eData;
2075} 2098}
2076 2099
2077// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2100// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2078 2101
2079inline void QTextFormatCollection::setDefaultFormat( QTextFormat *f ) 2102inline void QTextFormatCollection::setDefaultFormat( QTextFormat *f )
2080{ 2103{
2081 defFormat = f; 2104 defFormat = f;
2082} 2105}
2083 2106
2084inline QTextFormat *QTextFormatCollection::defaultFormat() const 2107inline QTextFormat *QTextFormatCollection::defaultFormat() const
2085{ 2108{
2086 return defFormat; 2109 return defFormat;
2087} 2110}
2088 2111
2089// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2112// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2090 2113
2091inline QTextFormat *QTextStringChar::format() const 2114inline QTextFormat *QTextStringChar::format() const
2092{ 2115{
2093 return (type == Regular) ? d.format : d.custom->format; 2116 return (type == Regular) ? d.format : d.custom->format;
2094} 2117}
2095 2118
2096 2119
2097#ifndef QT_NO_TEXTCUSTOMITEM 2120#ifndef QT_NO_TEXTCUSTOMITEM
2098inline QTextCustomItem *QTextStringChar::customItem() const 2121inline QTextCustomItem *QTextStringChar::customItem() const
2099{ 2122{
2100 return isCustom() ? d.custom->custom : 0; 2123 return isCustom() ? d.custom->custom : 0;
2101} 2124}
2102#endif 2125#endif
2103 2126
2104inline int QTextStringChar::height() const 2127inline int QTextStringChar::height() const
2105{ 2128{
2106#ifndef QT_NO_TEXTCUSTOMITEM 2129#ifndef QT_NO_TEXTCUSTOMITEM
2107 return !isCustom() ? format()->height() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->height : 0 ); 2130 return !isCustom() ? format()->height() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->height : 0 );
2108#else 2131#else
2109 return format()->height(); 2132 return format()->height();
2110#endif 2133#endif
2111} 2134}
2112 2135
2113inline int QTextStringChar::ascent() const 2136inline int QTextStringChar::ascent() const
2114{ 2137{
2115#ifndef QT_NO_TEXTCUSTOMITEM 2138#ifndef QT_NO_TEXTCUSTOMITEM
2116 return !isCustom() ? format()->ascent() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->ascent() : 0 ); 2139 return !isCustom() ? format()->ascent() : ( customItem()->placement() == QTextCustomItem::PlaceInline ? customItem()->ascent() : 0 );
2117#else 2140#else
2118 return format()->ascent(); 2141 return format()->ascent();
2119#endif 2142#endif
2120} 2143}
2121 2144
2122inline int QTextStringChar::descent() const 2145inline int QTextStringChar::descent() const
2123{ 2146{
2124#ifndef QT_NO_TEXTCUSTOMITEM 2147#ifndef QT_NO_TEXTCUSTOMITEM
2125 return !isCustom() ? format()->descent() : 0; 2148 return !isCustom() ? format()->descent() : 0;
2126#else 2149#else
2127 return format()->descent(); 2150 return format()->descent();
2128#endif 2151#endif
2129} 2152}
2130 2153
2131#endif //QT_NO_RICHTEXT 2154#endif //QT_NO_RICHTEXT
2132 2155
2133#endif 2156#endif
diff --git a/qmake/include/private/qsettings_p.h b/qmake/include/private/qsettings_p.h
index 18d118b..095291c 100644
--- a/qmake/include/private/qsettings_p.h
+++ b/qmake/include/private/qsettings_p.h
@@ -1,133 +1,133 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QSettings related classes 4** Definition of QSettings related classes
5** 5**
6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the tools module of the Qt GUI Toolkit. 8** This file is part of the tools module of the Qt GUI Toolkit.
9** 9**
10** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 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 11** licenses for Windows may use this file in accordance with the Qt Commercial
12** License Agreement provided with the Software. 12** License Agreement provided with the Software.
13** 13**
14** This file is not available for use under any other license without 14** This file is not available for use under any other license without
15** express written permission from the copyright holder. 15** express written permission from the copyright holder.
16** 16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19** 19**
20** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 20** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
21** information about Qt Commercial License Agreements. 21** information about Qt Commercial License Agreements.
22** 22**
23** Contact info@trolltech.com if any conditions of this licensing are 23** Contact info@trolltech.com if any conditions of this licensing are
24** not clear to you. 24** not clear to you.
25** 25**
26**********************************************************************/ 26**********************************************************************/
27 27
28#ifndef QSETTINGS_P_H 28#ifndef QSETTINGS_P_H
29#define QSETTINGS_P_H 29#define QSETTINGS_P_H
30 30
31// 31//
32// W A R N I N G 32// W A R N I N G
33// ------------- 33// -------------
34// 34//
35// This file is not part of the Qt API. It exists for the convenience 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 36// of QSettings. This header file may change from version to
37// version without notice, or even be removed. 37// version without notice, or even be removed.
38// 38//
39// We mean it. 39// We mean it.
40// 40//
41// 41//
42 42
43#ifndef QT_H 43#ifndef QT_H
44#include "qstringlist.h" 44#include "qstringlist.h"
45#include "qmap.h" 45#include "qmap.h"
46#include "qvaluestack.h" 46#include "qvaluestack.h"
47#endif // QT_H 47#endif // QT_H
48 48
49class QSettingsSysPrivate; 49class QSettingsSysPrivate;
50 50
51// QSettingsGroup is a map of key/value pairs 51// QSettingsGroup is a map of key/value pairs
52class QSettingsGroup : public QMap<QString,QString> 52class QSettingsGroup : public QMap<QString,QString>
53{ 53{
54public: 54public:
55 QSettingsGroup(); 55 QSettingsGroup();
56 56
57 bool modified; 57 bool modified;
58}; 58};
59 59
60// QSettingsHeading is a map of heading/group pairs 60// QSettingsHeading is a map of heading/group pairs
61class QSettingsHeading : public QMap<QString,QSettingsGroup> 61class QSettingsHeading : public QMap<QString,QSettingsGroup>
62{ 62{
63public: 63public:
64 QSettingsHeading::Iterator git; 64 QSettingsHeading::Iterator git;
65 void read(const QString &); 65 void read(const QString &);
66 void parseLine(QTextStream &); 66 void parseLine(QTextStream &);
67}; 67};
68 68
69 69
70class QSettingsPrivate 70class QSettingsPrivate
71{ 71{
72public: 72public:
73 QSettingsPrivate( QSettings::Format format ); 73 QSettingsPrivate( QSettings::Format format );
74 ~QSettingsPrivate(); 74 ~QSettingsPrivate();
75 75
76 QSettingsGroup readGroup(); 76 QSettingsGroup readGroup();
77 void removeGroup(const QString &); 77 void removeGroup(const QString &);
78 void writeGroup(const QString &, const QString &); 78 void writeGroup(const QString &, const QString &);
79 QDateTime modificationTime(); 79 QDateTime modificationTime();
80 80
81 QStringList searchPaths; 81 QStringList searchPaths;
82 QMap<QString,QSettingsHeading> headings; 82 QMap<QString,QSettingsHeading> headings;
83 QString group; 83 QString group;
84 QString heading; 84 QString heading;
85 85
86 /*### static data brings threading trouble 86 /*### static data brings threading trouble
87 static QString *defProduct; 87 static QString *defProduct;
88 static QString *defDomain; 88 static QString *defDomain;
89 */ 89 */
90 QValueStack<QString> groupStack; 90 QValueStack<QString> groupStack;
91 QString groupPrefix; 91 QString groupPrefix;
92 92
93 bool groupDirty :1; 93 bool groupDirty :1;
94 bool modified :1; 94 bool modified :1;
95 bool globalScope :1; 95 bool globalScope :1;
96 96
97#if defined(Q_WS_WIN) || defined(Q_OS_MAC) 97#if !defined(QWS) && (defined(Q_WS_WIN) || defined(Q_OS_MAC))
98 // system dependent implementations to use the 98 // system dependent implementations to use the
99 // system specific setting database (ie. registry on Windows) 99 // system specific setting database (ie. registry on Windows)
100 100
101 QSettingsSysPrivate *sysd; 101 QSettingsSysPrivate *sysd;
102 voidsysInit(); 102 voidsysInit();
103 voidsysClear(); 103 voidsysClear();
104 104
105#if !defined(Q_NO_BOOL_TYPE) 105#if !defined(Q_NO_BOOL_TYPE)
106 boolsysWriteEntry( const QString &, bool ); 106 boolsysWriteEntry( const QString &, bool );
107#endif 107#endif
108 boolsysWriteEntry( const QString &, double ); 108 boolsysWriteEntry( const QString &, double );
109 boolsysWriteEntry( const QString &, int ); 109 boolsysWriteEntry( const QString &, int );
110 boolsysWriteEntry( const QString &, const QString & ); 110 boolsysWriteEntry( const QString &, const QString & );
111 boolsysWriteEntry( const QString &, const QStringList & ); 111 boolsysWriteEntry( const QString &, const QStringList & );
112 boolsysWriteEntry( const QString &, const QStringList &, const QChar& sep ); 112 boolsysWriteEntry( const QString &, const QStringList &, const QChar& sep );
113 113
114 QStringList sysEntryList(const QString &) const; 114 QStringList sysEntryList(const QString &) const;
115 QStringList sysSubkeyList(const QString &) const; 115 QStringList sysSubkeyList(const QString &) const;
116 116
117 QStringList sysReadListEntry( const QString &, bool * = 0 ) const; 117 QStringList sysReadListEntry( const QString &, bool * = 0 ) const;
118 QStringList sysReadListEntry( const QString &, const QChar& sep, 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; 119 QStringsysReadEntry( const QString &, const QString &def = QString::null, bool * = 0 ) const;
120 int sysReadNumEntry( const QString &, int def = 0, bool * = 0 ) const; 120 int sysReadNumEntry( const QString &, int def = 0, bool * = 0 ) const;
121 doublesysReadDoubleEntry( const QString &, double 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; 122 boolsysReadBoolEntry( const QString &, bool def = 0, bool * = 0 ) const;
123 123
124 boolsysRemoveEntry( const QString & ); 124 boolsysRemoveEntry( const QString & );
125 125
126 boolsysSync(); 126 boolsysSync();
127 127
128 voidsysInsertSearchPath( QSettings::System, const QString & ); 128 voidsysInsertSearchPath( QSettings::System, const QString & );
129 voidsysRemoveSearchPath( QSettings::System, const QString & ); 129 voidsysRemoveSearchPath( QSettings::System, const QString & );
130#endif 130#endif
131}; 131};
132 132
133#endif // QSETTINGS_P_H 133#endif // QSETTINGS_P_H
diff --git a/qmake/include/private/qsharedmemory_p.h b/qmake/include/private/qsharedmemory_p.h
index 4a8339d..927de89 100644
--- a/qmake/include/private/qsharedmemory_p.h
+++ b/qmake/include/private/qsharedmemory_p.h
@@ -1,84 +1,87 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Includes system files for shared memory 4** Includes system files for shared memory
5** 5**
6** Created : 020124 6** Created : 020124
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed and/or modified under the terms of the 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 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 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the 18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software. 19** Qt Embedded Commercial License Agreement provided with the Software.
20** 20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23** 23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements. 25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information. 26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27** 27**
28** Contact info@trolltech.com if any conditions of this licensing are 28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you. 29** not clear to you.
30** 30**
31**********************************************************************/ 31**********************************************************************/
32 32
33#ifndef QSHAREDMEMORY_P_H
34#define QSHAREDMEMORY_P_H
35
33// 36//
34// W A R N I N G 37// W A R N I N G
35// ------------- 38// -------------
36// 39//
37// This file is not part of the Qt API. It exists for the convenience 40// 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 41// of qapplication_qws.cpp and qgfxvnc_qws.cpp. This header file may
39// change from version to version without notice, or even be removed. 42// change from version to version without notice, or even be removed.
40// 43//
44// We mean it.
45//
41// 46//
42
43#if !defined(QT_QSHM_H)
44#define QT_QSHM_H
45 47
46#include <qstring.h> 48#include <qstring.h>
47 49
48#if !defined (QT_QWS_NO_SHM) 50#if !defined (QT_QWS_NO_SHM)
49 51
50#include <sys/types.h> 52#include <sys/types.h>
51#include <sys/ipc.h> 53#include <sys/ipc.h>
52 54
53class QSharedMemory { 55class QSharedMemory {
54public: 56public:
55 QSharedMemory(){}; 57 QSharedMemory(){};
56 QSharedMemory(int, QString, char c = 'Q'); 58 QSharedMemory(int, QString, char c = 'Q');
57 ~QSharedMemory(){}; 59 ~QSharedMemory(){};
58 60
59 bool create(); 61 bool create();
60 void destroy(); 62 void destroy();
61 63
62 bool attach(); 64 bool attach();
63 void detach(); 65 void detach();
64 66
65 void setPermissions(mode_t mode); 67 void setPermissions(mode_t mode);
66 int size(); 68 int size();
67 void * base() { return shmBase; }; 69 void * base() { return shmBase; };
68 70
69private: 71private:
70 void *shmBase; 72 void *shmBase;
71 int shmSize; 73 int shmSize;
72 QString shmFile; 74 QString shmFile;
73 char character; 75 char character;
74#if defined(QT_POSIX_QSHM) 76#if defined(QT_POSIX_QSHM)
75 int shmFD; 77 int shmFD;
76#else 78#else
77 int shmId; 79 int shmId;
78 key_t key; 80 key_t key;
79 int idInitted; 81 int idInitted;
80#endif 82#endif
81}; 83};
82 84
83#endif 85#endif
86
84#endif 87#endif
diff --git a/qmake/include/private/qsqldriverinterface_p.h b/qmake/include/private/qsqldriverinterface_p.h
index 8957b86..8a39ddf 100644
--- a/qmake/include/private/qsqldriverinterface_p.h
+++ b/qmake/include/private/qsqldriverinterface_p.h
@@ -1,69 +1,82 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$
2** 3**
3** Definition of QSqlDriverInterface class 4** Definition of QSqlDriverInterface class
4** 5**
5** Created : 2000-11-03 6** Created : 2000-11-03
6** 7**
7** Copyright (C) 2000 Trolltech AS. All rights reserved. 8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
8** 9**
9** This file is part of the sql module of the Qt GUI Toolkit. 10** This file is part of the sql module of the Qt GUI Toolkit.
10** 11**
11** This file may be distributed under the terms of the Q Public License 12** 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** as defined by Trolltech AS of Norway and appearing in the file
13** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
14** 15**
15** This file may be distributed and/or modified under the terms of the 16** 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** 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** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file. 19** packaging of this file.
19** 20**
20** Licensees holding valid Qt Enterprise Edition licenses may use this 21** Licensees holding valid Qt Enterprise Edition licenses may use this
21** file in accordance with the Qt Commercial License Agreement provided 22** file in accordance with the Qt Commercial License Agreement provided
22** with the Software. 23** with the Software.
23** 24**
24** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 25** 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** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26** 27**
27** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
28** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
29** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
30** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
31** 32**
32** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
33** not clear to you. 34** not clear to you.
34** 35**
35**********************************************************************/ 36**********************************************************************/
36 37
37#ifndef QSQLDRIVERINTERFACE_H 38#ifndef QSQLDRIVERINTERFACE_H
38#define QSQLDRIVERINTERFACE_H 39#define QSQLDRIVERINTERFACE_H
39 40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. This header file may
46// change from version to version without notice, or even be
47// removed.
48//
49// We mean it.
50//
51//
52
40#ifndef QT_H 53#ifndef QT_H
41#include <private/qcom_p.h> 54#include <private/qcom_p.h>
42#endif // QT_H 55#endif // QT_H
43 56
44#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) 57#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
45#define QM_EXPORT_SQL 58#define QM_EXPORT_SQL
46#else 59#else
47#define QM_EXPORT_SQL Q_EXPORT 60#define QM_EXPORT_SQL Q_EXPORT
48#endif 61#endif
49 62
50#ifndef QT_NO_SQL 63#ifndef QT_NO_SQL
51 64
52#ifndef QT_NO_COMPONENT 65#ifndef QT_NO_COMPONENT
53 66
54// {EDDD5AD5-DF3C-400c-A711-163B72FE5F61} 67// {EDDD5AD5-DF3C-400c-A711-163B72FE5F61}
55#ifndef IID_QSqlDriverFactory 68#ifndef IID_QSqlDriverFactory
56#define IID_QSqlDriverFactory QUuid(0xeddd5ad5, 0xdf3c, 0x400c, 0xa7, 0x11, 0x16, 0x3b, 0x72, 0xfe, 0x5f, 0x61) 69#define IID_QSqlDriverFactory QUuid(0xeddd5ad5, 0xdf3c, 0x400c, 0xa7, 0x11, 0x16, 0x3b, 0x72, 0xfe, 0x5f, 0x61)
57#endif 70#endif
58 71
59class QSqlDriver; 72class QSqlDriver;
60 73
61struct QM_EXPORT_SQL QSqlDriverFactoryInterface : public QFeatureListInterface 74struct QM_EXPORT_SQL QSqlDriverFactoryInterface : public QFeatureListInterface
62{ 75{
63 virtual QSqlDriver* create( const QString& name ) = 0; 76 virtual QSqlDriver* create( const QString& name ) = 0;
64}; 77};
65 78
66#endif //QT_NO_COMPONENT 79#endif //QT_NO_COMPONENT
67#endif // QT_NO_SQL 80#endif // QT_NO_SQL
68 81
69#endif // QSQLDRIVERINTERFACE_H 82#endif // QSQLDRIVERINTERFACE_P_H
diff --git a/qmake/include/private/qsqlextension_p.h b/qmake/include/private/qsqlextension_p.h
index 597b266..3445b47 100644
--- a/qmake/include/private/qsqlextension_p.h
+++ b/qmake/include/private/qsqlextension_p.h
@@ -1,101 +1,128 @@
1/**************************************************************************** 1/****************************************************************************
2** 2**
3** Definition of the QSqlExtension class 3** Definition of the QSqlExtension class
4** 4**
5** Created : 2002-06-03 5** Created : 2002-06-03
6** 6**
7** Copyright (C) 2002 Trolltech AS. All rights reserved. 7** Copyright (C) 2002 Trolltech AS. All rights reserved.
8** 8**
9** This file is part of the sql module of the Qt GUI Toolkit. 9** This file is part of the sql module of the Qt GUI Toolkit.
10** 10**
11** This file may be distributed under the terms of the Q Public License 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 12** as defined by Trolltech AS of Norway and appearing in the file
13** LICENSE.QPL included in the packaging of this file. 13** LICENSE.QPL included in the packaging of this file.
14** 14**
15** This file may be distributed and/or modified under the terms of the 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 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 17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file. 18** packaging of this file.
19** 19**
20** Licensees holding valid Qt Enterprise Edition licenses may use this 20** Licensees holding valid Qt Enterprise Edition licenses may use this
21** file in accordance with the Qt Commercial License Agreement provided 21** file in accordance with the Qt Commercial License Agreement provided
22** with the Software. 22** with the Software.
23** 23**
24** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 25** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26** 26**
27** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 27** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
28** information about Qt Commercial License Agreements. 28** information about Qt Commercial License Agreements.
29** See http://www.trolltech.com/qpl/ for QPL licensing information. 29** See http://www.trolltech.com/qpl/ for QPL licensing information.
30** See http://www.trolltech.com/gpl/ for GPL licensing information. 30** See http://www.trolltech.com/gpl/ for GPL licensing information.
31** 31**
32** Contact info@trolltech.com if any conditions of this licensing are 32** Contact info@trolltech.com if any conditions of this licensing are
33** not clear to you. 33** not clear to you.
34** 34**
35**********************************************************************/ 35**********************************************************************/
36 36
37#ifndef QSQLEXTENSION_P_H 37#ifndef QSQLEXTENSION_P_H
38#define QSQLEXTENSION_P_H 38#define QSQLEXTENSION_P_H
39 39
40// 40//
41// W A R N I N G 41// W A R N I N G
42// ------------- 42// -------------
43// 43//
44// This file is not part of the Qt API. It exists for the convenience 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 45// of other Qt classes. This header file may change from version to
46// version without notice, or even be removed. 46// version without notice, or even be removed.
47// 47//
48// We mean it. 48// We mean it.
49// 49//
50// 50//
51 51
52#ifndef QT_H 52#ifndef QT_H
53#include "qmap.h" 53#include "qmap.h"
54#include "qvaluevector.h"
54#include "qstring.h" 55#include "qstring.h"
55#include "qvariant.h" 56#include "qvariant.h"
57#include "qsql.h"
56#endif // QT_H 58#endif // QT_H
57 59
58#ifndef QT_NO_SQL 60#ifndef QT_NO_SQL
59 61
60#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL ) 62#if !defined( QT_MODULE_SQL ) || defined( QT_LICENSE_PROFESSIONAL )
61#define QM_EXPORT_SQL 63#define QM_EXPORT_SQL
64#define QM_TEMPLATE_EXTERN_SQL
62#else 65#else
63#define QM_EXPORT_SQL Q_EXPORT 66#define QM_EXPORT_SQL Q_EXPORT
67#define QM_TEMPLATE_EXTERN_SQL Q_TEMPLATE_EXTERN
64#endif 68#endif
65 69
70struct Param {
71 Param( const QVariant& v = QVariant(), QSql::ParameterType t = QSql::In ): value( v ), typ( t ) {}
72 QVariant value;
73 QSql::ParameterType typ;
74 Q_DUMMY_COMPARISON_OPERATOR(Param)
75};
76
77struct Holder {
78 Holder( const QString& hldr = QString::null, int pos = -1 ): holderName( hldr ), holderPos( pos ) {}
79 bool operator==( const Holder& h ) const { return h.holderPos == holderPos && h.holderName == holderName; }
80 bool operator!=( const Holder& h ) const { return h.holderPos != holderPos || h.holderName != holderName; }
81 QString holderName;
82 int holderPos;
83};
84
66#if defined(Q_TEMPLATEDLL) 85#if defined(Q_TEMPLATEDLL)
67Q_TEMPLATE_EXTERN template class QM_EXPORT_SQL QMap<QString,QVariant>; 86QM_TEMPLATE_EXTERN_SQL template class QM_EXPORT_SQL QMap<QString,Param>;
68Q_TEMPLATE_EXTERN template class QM_EXPORT_SQL QMap<int,QString>; 87QM_TEMPLATE_EXTERN_SQL template class QM_EXPORT_SQL QMap<int,QString>;
88QM_TEMPLATE_EXTERN_SQL template class QM_EXPORT_SQL QValueVector<Holder>;
69#endif 89#endif
70 90
71class QM_EXPORT_SQL QSqlExtension { 91class QM_EXPORT_SQL QSqlExtension {
72public: 92public:
73 QSqlExtension(); 93 QSqlExtension();
74 virtual ~QSqlExtension(); 94 virtual ~QSqlExtension();
75 virtual bool prepare( const QString& query ); 95 virtual bool prepare( const QString& query );
76 virtual bool exec(); 96 virtual bool exec();
77 virtual void bindValue( const QString& holder, const QVariant& value ); 97 virtual void bindValue( const QString& holder, const QVariant& value, QSql::ParameterType = QSql::In );
78 virtual void bindValue( int pos, const QVariant& value ); 98 virtual void bindValue( int pos, const QVariant& value, QSql::ParameterType = QSql::In );
79 virtual void addBindValue( const QVariant& value ); 99 virtual void addBindValue( const QVariant& value, QSql::ParameterType = QSql::In );
100 virtual QVariant parameterValue( const QString& holder );
101 virtual QVariant parameterValue( int pos );
80 void clearValues(); 102 void clearValues();
81 void clearIndex(); 103 void clearIndex();
82 104
83 enum BindMethod { BindByPosition, BindByName }; 105 enum BindMethod { BindByPosition, BindByName };
84 BindMethod bindMethod(); 106 BindMethod bindMethod();
85 BindMethod bindm; 107 BindMethod bindm;
86 int bindCount; 108 int bindCount;
87 109
88 QMap<int, QString> index; 110 QMap<int, QString> index;
89 QMap<QString, QVariant> values; 111 typedef QMap<QString, Param> ValueMap;
112 ValueMap values;
113
114 // convenience container for QSqlQuery
115 // to map holders <-> positions
116 typedef QValueVector<Holder> HolderVector;
117 HolderVector holders;
90}; 118};
91 119
92class QM_EXPORT_SQL QSqlDriverExtension 120class QM_EXPORT_SQL QSqlDriverExtension
93{ 121{
94public: 122public:
95 QSqlDriverExtension(); 123 QSqlDriverExtension();
96 virtual ~QSqlDriverExtension(); 124 virtual ~QSqlDriverExtension();
97 virtual bool isOpen() const = 0; 125 virtual bool isOpen() const = 0;
98}; 126};
99
100#endif 127#endif
101#endif 128#endif
diff --git a/qmake/include/private/qstyleinterface_p.h b/qmake/include/private/qstyleinterface_p.h
index 4aaedc7..24a43ad 100644
--- a/qmake/include/private/qstyleinterface_p.h
+++ b/qmake/include/private/qstyleinterface_p.h
@@ -1,61 +1,73 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** ... 4** ...
5** 5**
6** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the widgets module of the Qt GUI Toolkit. 8** This file is part of the widgets module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QSTYLEINTERFACE_H 36#ifndef QSTYLEINTERFACE_P_H
37#define QSTYLEINTERFACE_H 37#define QSTYLEINTERFACE_P_H
38
39//
40// W A R N I N G
41// -------------
42//
43// This file is not part of the Qt API. This header file may
44// change from version to version without notice, or even be
45// removed.
46//
47// We mean it.
48//
49//
38 50
39#ifndef QT_H 51#ifndef QT_H
40#include <private/qcom_p.h> 52#include <private/qcom_p.h>
41#endif // QT_H 53#endif // QT_H
42 54
43#ifndef QT_NO_STYLE 55#ifndef QT_NO_STYLE
44#ifndef QT_NO_COMPONENT 56#ifndef QT_NO_COMPONENT
45 57
46class QStyle; 58class QStyle;
47 59
48// {FC1B6EBE-053C-49c1-A483-C377739AB9A5} 60// {FC1B6EBE-053C-49c1-A483-C377739AB9A5}
49#ifndef IID_QStyleFactory 61#ifndef IID_QStyleFactory
50#define IID_QStyleFactory QUuid(0xfc1b6ebe, 0x53c, 0x49c1, 0xa4, 0x83, 0xc3, 0x77, 0x73, 0x9a, 0xb9, 0xa5) 62#define IID_QStyleFactory QUuid(0xfc1b6ebe, 0x53c, 0x49c1, 0xa4, 0x83, 0xc3, 0x77, 0x73, 0x9a, 0xb9, 0xa5)
51#endif 63#endif
52 64
53struct Q_EXPORT QStyleFactoryInterface : public QFeatureListInterface 65struct Q_EXPORT QStyleFactoryInterface : public QFeatureListInterface
54{ 66{
55 virtual QStyle* create( const QString& style ) = 0; 67 virtual QStyle* create( const QString& style ) = 0;
56}; 68};
57 69
58#endif //QT_NO_COMPONENT 70#endif //QT_NO_COMPONENT
59#endif //QT_NO_STYLE 71#endif //QT_NO_STYLE
60 72
61#endif //QSTYLEINTERFACE_H 73#endif //QSTYLEINTERFACE_P_H
diff --git a/qmake/include/private/qsvgdevice_p.h b/qmake/include/private/qsvgdevice_p.h
index c1cc389..3407705 100644
--- a/qmake/include/private/qsvgdevice_p.h
+++ b/qmake/include/private/qsvgdevice_p.h
@@ -1,134 +1,134 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of the QSvgDevice class 4** Definition of the QSvgDevice class
5** 5**
6** Created : 20001024 6** Created : 001024
7** 7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the xml module of the Qt GUI Toolkit. 10** This file is part of the xml module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition licenses may use this 21** Licensees holding valid Qt Enterprise Edition licenses may use this
22** file in accordance with the Qt Commercial License Agreement provided 22** file in accordance with the Qt Commercial License Agreement provided
23** with the Software. 23** with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36*****************************************************************************/ 36*****************************************************************************/
37 37
38#ifndef QSVGDEVICE_H 38#ifndef QSVGDEVICE_P_H
39#define QSVGDEVICE_H 39#define QSVGDEVICE_P_H
40 40
41// 41//
42// W A R N I N G 42// W A R N I N G
43// ------------- 43// -------------
44// 44//
45// This file is not part of the Qt API. It exists for the convenience 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 46// of the QPicture class. This header file may change from
47// version to version without notice, or even be removed. 47// version to version without notice, or even be removed.
48// 48//
49// We mean it. 49// We mean it.
50// 50//
51// 51//
52 52
53#ifndef QT_H 53#ifndef QT_H
54#include "qpaintdevice.h" 54#include "qpaintdevice.h"
55#include "qrect.h" 55#include "qrect.h"
56#include "qdom.h" 56#include "qdom.h"
57#endif // QT_H 57#endif // QT_H
58 58
59#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML ) 59#if !defined(QT_MODULE_XML) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_XML )
60#define QM_EXPORT_SVG 60#define QM_EXPORT_SVG
61#else 61#else
62#define QM_EXPORT_SVG Q_EXPORT 62#define QM_EXPORT_SVG Q_EXPORT
63#endif 63#endif
64 64
65#ifndef QT_NO_SVG 65#ifndef QT_NO_SVG
66 66
67class QPainter; 67class QPainter;
68class QDomNode; 68class QDomNode;
69class QDomNamedNodeMap; 69class QDomNamedNodeMap;
70struct QSvgDeviceState; 70struct QSvgDeviceState;
71class QSvgDevicePrivate; 71class QSvgDevicePrivate;
72 72
73class QM_EXPORT_SVG QSvgDevice : public QPaintDevice 73class QM_EXPORT_SVG QSvgDevice : public QPaintDevice
74{ 74{
75public: 75public:
76 QSvgDevice(); 76 QSvgDevice();
77 ~QSvgDevice(); 77 ~QSvgDevice();
78 78
79 bool play( QPainter *p ); 79 bool play( QPainter *p );
80 80
81 QString toString() const; 81 QString toString() const;
82 82
83 bool load( QIODevice *dev ); 83 bool load( QIODevice *dev );
84 bool save( QIODevice *dev ); 84 bool save( QIODevice *dev );
85 bool save( const QString &fileName ); 85 bool save( const QString &fileName );
86 86
87 QRect boundingRect() const; 87 QRect boundingRect() const;
88 void setBoundingRect( const QRect &r ); 88 void setBoundingRect( const QRect &r );
89 89
90protected: 90protected:
91 virtual bool cmd ( int, QPainter*, QPDevCmdParam* ); 91 virtual bool cmd ( int, QPainter*, QPDevCmdParam* );
92 virtual int metric( int ) const; 92 virtual int metric( int ) const;
93 93
94private: 94private:
95 // reading 95 // reading
96 bool play( const QDomNode &node ); 96 bool play( const QDomNode &node );
97 void saveAttributes(); 97 void saveAttributes();
98 void restoreAttributes(); 98 void restoreAttributes();
99 QColor parseColor( const QString &col ); 99 QColor parseColor( const QString &col );
100 double parseLen( const QString &str, bool *ok=0, bool horiz=TRUE ) const; 100 double parseLen( const QString &str, bool *ok=0, bool horiz=TRUE ) const;
101 int lenToInt( const QDomNamedNodeMap &map, const QString &attr, 101 int lenToInt( const QDomNamedNodeMap &map, const QString &attr,
102 int def=0 ) const; 102 int def=0 ) const;
103 void setStyleProperty( const QString &prop, const QString &val, 103 void setStyleProperty( const QString &prop, const QString &val,
104 QPen *pen, QFont *font, int *talign ); 104 QPen *pen, QFont *font, int *talign );
105 void setStyle( const QString &s ); 105 void setStyle( const QString &s );
106 void setTransform( const QString &tr ); 106 void setTransform( const QString &tr );
107 void drawPath( const QString &data ); 107 void drawPath( const QString &data );
108 108
109 // writing 109 // writing
110 void applyStyle( QDomElement *e, int c ) const; 110 void applyStyle( QDomElement *e, int c ) const;
111 void applyTransform( QDomElement *e ) const; 111 void applyTransform( QDomElement *e ) const;
112 112
113 // reading 113 // reading
114 QRect brect; // bounding rectangle 114 QRect brect; // bounding rectangle
115 QDomDocument doc; // document tree 115 QDomDocument doc; // document tree
116 QDomNode current; 116 QDomNode current;
117 QPoint curPt; 117 QPoint curPt;
118 QSvgDeviceState *curr; 118 QSvgDeviceState *curr;
119 QPainter *pt; // used by play() et al 119 QPainter *pt; // used by play() et al
120 120
121 // writing 121 // writing
122 bool dirtyTransform, dirtyStyle; 122 bool dirtyTransform, dirtyStyle;
123 123
124 QSvgDevicePrivate *d; 124 QSvgDevicePrivate *d;
125}; 125};
126 126
127inline QRect QSvgDevice::boundingRect() const 127inline QRect QSvgDevice::boundingRect() const
128{ 128{
129 return brect; 129 return brect;
130} 130}
131 131
132#endif // QT_NO_SVG 132#endif // QT_NO_SVG
133 133
134#endif // QSVGDEVICE_H 134#endif // QSVGDEVICE_P_H
diff --git a/qmake/include/private/qtextcodecinterface_p.h b/qmake/include/private/qtextcodecinterface_p.h
index d2a2cb9..76e77f7 100644
--- a/qmake/include/private/qtextcodecinterface_p.h
+++ b/qmake/include/private/qtextcodecinterface_p.h
@@ -1,79 +1,77 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QTextCodecFactoryInterface interface 4** Definition of QTextCodecFactoryInterface interface
5** 5**
6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved. 6** Copyright (C) 2001-2002 Trolltech AS. All rights reserved.
7** 7**
8** This file is part of the tools module of the Qt GUI Toolkit. 8** This file is part of the tools module of the Qt GUI Toolkit.
9** 9**
10** This file may be distributed under the terms of the Q Public License 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 11** as defined by Trolltech AS of Norway and appearing in the file
12** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
13** 13**
14** This file may be distributed and/or modified under the terms of the 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 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 16** Foundation and appearing in the file LICENSE.GPL included in the
17** packaging of this file. 17** packaging of this file.
18** 18**
19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
21** Agreement provided with the Software. 21** Agreement provided with the Software.
22** 22**
23** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25** 25**
26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
28** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
29** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
30** 30**
31** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
32** not clear to you. 32** not clear to you.
33** 33**
34**********************************************************************/ 34**********************************************************************/
35 35
36#ifndef QTEXTCODECINTERFACE_P_H 36#ifndef QTEXTCODECINTERFACE_P_H
37#define QTEXTCODECINTERFACE_P_H 37#define QTEXTCODECINTERFACE_P_H
38 38
39
40// 39//
41// W A R N I N G 40// W A R N I N G
42// ------------- 41// -------------
43// 42//
44// This file is not part of the Qt API. It exists for the convenience 43// This file is not part of the Qt API. It exists for the convenience
45// of qpsprinter.cpp and qprinter_x11.cpp. 44// of qpsprinter.cpp and qprinter_x11.cpp.
46// This header file may change from version to version without notice, 45// This header file may change from version to version without notice,
47// or even be removed. 46// or even be removed.
48// 47//
49// We mean it. 48// We mean it.
50// 49//
51// 50//
52 51
53
54#ifndef QT_H 52#ifndef QT_H
55#include <private/qcom_p.h> 53#include <private/qcom_p.h>
56#endif // QT_H 54#endif // QT_H
57 55
58#ifndef QT_NO_TEXTCODEC 56#ifndef QT_NO_TEXTCODEC
59#ifndef QT_NO_COMPONENT 57#ifndef QT_NO_COMPONENT
60 58
61class QTextCodec; 59class QTextCodec;
62 60
63 61
64// {F55BFA60-F695-11D4-823E-009027DC0F37} 62// {F55BFA60-F695-11D4-823E-009027DC0F37}
65#ifndef IID_QTextCodecFactory 63#ifndef IID_QTextCodecFactory
66#define IID_QTextCodecFactory QUuid( 0xf55bfa60, 0xf695, 0x11d4, 0x82, 0x3e, 0x00, 0x90, 0x27, 0xdc, 0x0f, 0x37) 64#define IID_QTextCodecFactory QUuid( 0xf55bfa60, 0xf695, 0x11d4, 0x82, 0x3e, 0x00, 0x90, 0x27, 0xdc, 0x0f, 0x37)
67#endif 65#endif
68 66
69 67
70struct Q_EXPORT QTextCodecFactoryInterface : public QFeatureListInterface 68struct Q_EXPORT QTextCodecFactoryInterface : public QFeatureListInterface
71{ 69{
72 virtual QTextCodec *createForMib( int mib ) = 0; 70 virtual QTextCodec *createForMib( int mib ) = 0;
73 virtual QTextCodec *createForName( const QString &name ) = 0; 71 virtual QTextCodec *createForName( const QString &name ) = 0;
74}; 72};
75 73
76#endif // QT_NO_COMPONENT 74#endif // QT_NO_COMPONENT
77#endif // QT_NO_TEXTCODEC 75#endif // QT_NO_TEXTCODEC
78 76
79#endif // QTEXTCODECINTERFACE_P_H 77#endif // QTEXTCODECINTERFACE_P_H
diff --git a/qmake/include/private/qtitlebar_p.h b/qmake/include/private/qtitlebar_p.h
index dabb6bf..091845f 100644
--- a/qmake/include/private/qtitlebar_p.h
+++ b/qmake/include/private/qtitlebar_p.h
@@ -1,136 +1,136 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of some Qt private functions. 4** Definition of some Qt private functions.
5** 5**
6** Created : 2000-01-01 6** Created : 000101
7** 7**
8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the widgets module of the Qt GUI Toolkit. 10** This file is part of the widgets module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QTITLEBAR_P_H 38#ifndef QTITLEBAR_P_H
39#define QTITLEBAR_P_H 39#define QTITLEBAR_P_H
40 40
41 41
42// 42//
43// W A R N I N G 43// W A R N I N G
44// ------------- 44// -------------
45// 45//
46// This file is not part of the Qt API. It exists for the convenience 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 47// of qworkspace.cpp and qdockwindow.cpp. This header file may change
48// from version to version without notice, or even be removed. 48// from version to version without notice, or even be removed.
49// 49//
50// We mean it. 50// We mean it.
51// 51//
52// 52//
53 53
54 54
55#ifndef QT_H 55#ifndef QT_H
56#include "qbutton.h" 56#include "qbutton.h"
57#include "qlabel.h" 57#include "qlabel.h"
58#endif // QT_H 58#endif // QT_H
59 59
60#if !defined(QT_NO_TITLEBAR) 60#if !defined(QT_NO_TITLEBAR)
61 61
62class QToolTip; 62class QToolTip;
63class QTitleBarPrivate; 63class QTitleBarPrivate;
64class QPixmap; 64class QPixmap;
65 65
66class Q_EXPORT QTitleBar : public QWidget 66class Q_EXPORT QTitleBar : public QWidget
67{ 67{
68 Q_OBJECT 68 Q_OBJECT
69 Q_PROPERTY( bool autoRaise READ autoRaise WRITE setAutoRaise ) 69 Q_PROPERTY( bool autoRaise READ autoRaise WRITE setAutoRaise )
70 Q_PROPERTY( bool movable READ isMovable WRITE setMovable ) 70 Q_PROPERTY( bool movable READ isMovable WRITE setMovable )
71 71
72public: 72public:
73 QTitleBar (QWidget* w, QWidget* parent, const char* name=0); 73 QTitleBar (QWidget* w, QWidget* parent, const char* name=0);
74 ~QTitleBar(); 74 ~QTitleBar();
75 75
76 bool isActive() const; 76 bool isActive() const;
77 bool usesActiveColor() const; 77 bool usesActiveColor() const;
78 virtual QString visibleText() const; 78 virtual QString visibleText() const;
79 79
80 bool isMovable() const; 80 bool isMovable() const;
81 void setMovable(bool); 81 void setMovable(bool);
82 82
83 bool autoRaise() const; 83 bool autoRaise() const;
84 void setAutoRaise(bool); 84 void setAutoRaise(bool);
85 85
86 QWidget *window() const; 86 QWidget *window() const;
87 87
88 QSize sizeHint() const; 88 QSize sizeHint() const;
89 89
90#ifdef QT_NO_WIDGET_TOPEXTRA 90#ifdef QT_NO_WIDGET_TOPEXTRA
91 // We provide one, since titlebar is useless otherwise. 91 // We provide one, since titlebar is useless otherwise.
92 QString caption() const; 92 QString caption() const;
93#endif 93#endif
94 94
95public slots: 95public slots:
96 void setActive( bool ); 96 void setActive( bool );
97 void setCaption( const QString& title ); 97 void setCaption( const QString& title );
98 void setIcon( const QPixmap& icon ); 98 void setIcon( const QPixmap& icon );
99 99
100signals: 100signals:
101 void doActivate(); 101 void doActivate();
102 void doNormal(); 102 void doNormal();
103 void doClose(); 103 void doClose();
104 void doMaximize(); 104 void doMaximize();
105 void doMinimize(); 105 void doMinimize();
106 void doShade(); 106 void doShade();
107 void showOperationMenu(); 107 void showOperationMenu();
108 void popupOperationMenu( const QPoint& ); 108 void popupOperationMenu( const QPoint& );
109 void doubleClicked(); 109 void doubleClicked();
110 110
111protected: 111protected:
112 bool event( QEvent *); 112 bool event( QEvent *);
113 void resizeEvent( QResizeEvent *); 113 void resizeEvent( QResizeEvent *);
114 void contextMenuEvent( QContextMenuEvent * ); 114 void contextMenuEvent( QContextMenuEvent * );
115 void mousePressEvent( QMouseEvent * ); 115 void mousePressEvent( QMouseEvent * );
116 void mouseDoubleClickEvent( QMouseEvent * ); 116 void mouseDoubleClickEvent( QMouseEvent * );
117 void mouseReleaseEvent( QMouseEvent * ); 117 void mouseReleaseEvent( QMouseEvent * );
118 void mouseMoveEvent( QMouseEvent * ); 118 void mouseMoveEvent( QMouseEvent * );
119 void enterEvent( QEvent *e ); 119 void enterEvent( QEvent *e );
120 void leaveEvent( QEvent *e ); 120 void leaveEvent( QEvent *e );
121 void paintEvent( QPaintEvent *p ); 121 void paintEvent( QPaintEvent *p );
122 122
123 virtual void cutText(); 123 virtual void cutText();
124 124
125private: 125private:
126 void readColors(); 126 void readColors();
127 127
128 QTitleBarPrivate *d; 128 QTitleBarPrivate *d;
129#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator= 129#if defined(Q_DISABLE_COPY) // Disabled copy constructor and operator=
130 QTitleBar( const QTitleBar & ); 130 QTitleBar( const QTitleBar & );
131 QTitleBar &operator=( const QTitleBar & ); 131 QTitleBar &operator=( const QTitleBar & );
132#endif 132#endif
133}; 133};
134 134
135#endif 135#endif
136#endif //QTITLEBAR_P_H 136#endif //QTITLEBAR_P_H
diff --git a/qmake/include/private/qucom_p.h b/qmake/include/private/qucom_p.h
index d2ff48e..6b6ad40 100644
--- a/qmake/include/private/qucom_p.h
+++ b/qmake/include/private/qucom_p.h
@@ -1,499 +1,463 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of the QUcom interfaces 4** Definition of the QUcom interfaces
5** 5**
6** Created : 990101 6** Created : 990101
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QUCOM_H 38#ifndef QUCOM_P_H
39#define QUCOM_H 39#define QUCOM_P_H
40
41#ifndef QT_H
42#include <qstring.h>
43#include "quuid.h"
44#endif // QT_H
45 40
46// 41//
47// W A R N I N G 42// W A R N I N G
48// ------------- 43// -------------
49// 44//
50// This file is not part of the Qt API. It exists for the convenience 45// 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 46// of a number of Qt sources files. This header file may change from
52// version to version without notice, or even be removed. 47// version to version without notice, or even be removed.
53// 48//
54// We mean it. 49// We mean it.
55// 50//
56// 51//
57 52
53#ifndef QT_H
54#include <qstring.h>
55#include "quuid.h"
56#endif // QT_H
57
58#ifdef check 58#ifdef check
59#undef check 59#undef check
60#endif 60#endif
61 61
62struct QUObject; 62struct QUObject;
63struct QUInterfaceDescription; 63struct QUInterfaceDescription;
64struct QUnknownInterface; 64struct QUnknownInterface;
65struct QDispatchInterface; 65struct QDispatchInterface;
66 66
67 67
68struct Q_EXPORT QUBuffer 68struct Q_EXPORT QUBuffer
69{ 69{
70 virtual long read( char *data, ulong maxlen ) = 0; 70 virtual long read( char *data, ulong maxlen ) = 0;
71 virtual long write( const char *data, ulong len ) = 0; 71 virtual long write( const char *data, ulong len ) = 0;
72}; 72};
73 73
74 74
75// A type for a QUObject 75// A type for a QUObject
76struct Q_EXPORT QUType 76struct Q_EXPORT QUType
77{ 77{
78 virtual const QUuid *uuid() const = 0; 78 virtual const QUuid *uuid() const = 0;
79 virtual const char *desc() const = 0; 79 virtual const char *desc() const = 0;
80 80
81 81
82 virtual bool canConvertFrom( QUObject *, QUType * ) = 0; 82 virtual bool canConvertFrom( QUObject *, QUType * ) = 0;
83 // virtual private, only called by canConvertFrom 83 // virtual private, only called by canConvertFrom
84 virtual bool canConvertTo( QUObject *, QUType * ) = 0; 84 virtual bool canConvertTo( QUObject *, QUType * ) = 0;
85 85
86 86
87 virtual bool convertFrom( QUObject *, QUType * ) = 0; 87 virtual bool convertFrom( QUObject *, QUType * ) = 0;
88 // virtual private, only called by convertFrom 88 // virtual private, only called by convertFrom
89 virtual bool convertTo( QUObject *, QUType * ) = 0; 89 virtual bool convertTo( QUObject *, QUType * ) = 0;
90 90
91 virtual void clear( QUObject * ) = 0; 91 virtual void clear( QUObject * ) = 0;
92 92
93 virtual int serializeTo( QUObject *, QUBuffer * ) = 0; 93 virtual int serializeTo( QUObject *, QUBuffer * ) = 0;
94 virtual int serializeFrom( QUObject *, QUBuffer * ) = 0; 94 virtual int serializeFrom( QUObject *, QUBuffer * ) = 0;
95 95
96 static bool isEqual( const QUType *t1, const QUType *t2 ); 96 static bool isEqual( const QUType *t1, const QUType *t2 );
97 static bool check( QUObject* o, QUType* t ); 97 static bool check( QUObject* o, QUType* t );
98}; 98};
99 99
100 100
101// {DE56510E-4E9F-4b76-A3C2-D1E2EF42F1AC} 101// {DE56510E-4E9F-4b76-A3C2-D1E2EF42F1AC}
102extern Q_EXPORT const QUuid TID_QUType_Null; 102extern Q_EXPORT const QUuid TID_QUType_Null;
103struct Q_EXPORT QUType_Null : public QUType 103struct Q_EXPORT QUType_Null : public QUType
104{ 104{
105 const QUuid *uuid() const; 105 const QUuid *uuid() const;
106 const char *desc() const; 106 const char *desc() const;
107 107
108 bool canConvertFrom( QUObject *, QUType * ); 108 bool canConvertFrom( QUObject *, QUType * );
109 bool canConvertTo( QUObject *, QUType * ); 109 bool canConvertTo( QUObject *, QUType * );
110 bool convertFrom( QUObject *, QUType * ); 110 bool convertFrom( QUObject *, QUType * );
111 bool convertTo( QUObject *, QUType * ); 111 bool convertTo( QUObject *, QUType * );
112 void clear( QUObject * ); 112 void clear( QUObject * );
113 int serializeTo( QUObject *, QUBuffer * ); 113 int serializeTo( QUObject *, QUBuffer * );
114 int serializeFrom( QUObject *, QUBuffer * ); 114 int serializeFrom( QUObject *, QUBuffer * );
115}; 115};
116extern Q_EXPORT QUType_Null static_QUType_Null; 116extern Q_EXPORT QUType_Null static_QUType_Null;
117 117
118 118
119// The magic QUObject 119// The magic QUObject
120struct Q_EXPORT QUObject 120struct Q_EXPORT QUObject
121{ 121{
122public: // scary MSVC bug makes this necessary 122public: // scary MSVC bug makes this necessary
123 QUObject() : type( &static_QUType_Null ) {} 123 QUObject() : type( &static_QUType_Null ) {}
124 ~QUObject() { type->clear( this ); } 124 ~QUObject() { type->clear( this ); }
125 125
126 QUType *type; 126 QUType *type;
127 127
128 // the unavoidable union 128 // the unavoidable union
129 union 129 union
130 { 130 {
131 bool b; 131 bool b;
132 132
133 char c; 133 char c;
134 short s; 134 short s;
135 int i; 135 int i;
136 long l; 136 long l;
137 137
138 unsigned char uc; 138 unsigned char uc;
139 unsigned short us; 139 unsigned short us;
140 unsigned int ui; 140 unsigned int ui;
141 unsigned long ul; 141 unsigned long ul;
142 142
143 float f; 143 float f;
144 double d; 144 double d;
145 145
146 char byte[16]; 146 char byte[16];
147 147
148 struct { 148 struct {
149 char* data; 149 char* data;
150 unsigned long size; 150 unsigned long size;
151 } bytearray; 151 } bytearray;
152 152
153 void* ptr; 153 void* ptr;
154 154
155 struct { 155 struct {
156 void *ptr; 156 void *ptr;
157 bool owner; 157 bool owner;
158 } voidstar; 158 } voidstar;
159 159
160 struct { 160 struct {
161 char *ptr; 161 char *ptr;
162 bool owner; 162 bool owner;
163 } charstar; 163 } charstar;
164 164
165 struct { 165 struct {
166 char *ptr; 166 char *ptr;
167 bool owner; 167 bool owner;
168 } utf8; 168 } utf8;
169 169
170 struct { 170 struct {
171 char *ptr; 171 char *ptr;
172 bool owner; 172 bool owner;
173 } local8bit; 173 } local8bit;
174 174
175 QUnknownInterface* iface; 175 QUnknownInterface* iface;
176 QDispatchInterface* idisp; 176 QDispatchInterface* idisp;
177 177
178 } payload; 178 } payload;
179 179
180}; 180};
181 181
182 182
183// A parameter description describes one method parameters. A 183// A parameter description describes one method parameters. A
184// parameter has a name, a type and a flag describing whether it's an 184// parameter has a name, a type and a flag describing whether it's an
185// in parameter, an out parameter, or both ways 185// in parameter, an out parameter, or both ways
186struct Q_EXPORT QUParameter 186struct Q_EXPORT QUParameter
187{ 187{
188 const char* name; 188 const char* name;
189 QUType *type; 189 QUType *type;
190 const void* typeExtra; //Usually 0, UEnum* for QUType_enum, const char* for QUType_ptr, int* for QUType_varptr 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 }; 191 enum { In = 1, Out = 2, InOut = In | Out };
192 int inOut; 192 int inOut;
193}; 193};
194 194
195// A method description describes one method. A method has a name and 195// A method description describes one method. A method has a name and
196// an array of parameters. 196// an array of parameters.
197struct Q_EXPORT QUMethod 197struct Q_EXPORT QUMethod
198{ 198{
199 const char* name; 199 const char* name;
200 int count; 200 int count;
201 const QUParameter* parameters; 201 const QUParameter* parameters;
202}; 202};
203 203
204// A Property description. Not used yet in the example. 204// A Property description. Not used yet in the example.
205struct Q_EXPORT QUProperty 205struct Q_EXPORT QUProperty
206{ 206{
207 const char* name; 207 const char* name;
208 QUType* type; 208 QUType* type;
209 const void* typeExtra; //type dependend. Usually 0, but UEnum for QUTypeenum or const char* for QUTypeptr 209 const void* typeExtra; //type dependend. Usually 0, but UEnum for QUTypeenum or const char* for QUTypeptr
210 210
211 int set; // -1 undefined 211 int set; // -1 undefined
212 int get; // -1 undefined 212 int get; // -1 undefined
213 213
214 int designable; // -1 FALSE, -2 TRUE, else method 214 int designable; // -1 FALSE, -2 TRUE, else method
215 int stored; // -1 FALSE, -2 TRUE, else method 215 int stored; // -1 FALSE, -2 TRUE, else method
216}; 216};
217 217
218// An interface description describes one interface, that is all its 218// An interface description describes one interface, that is all its
219// methods and properties. 219// methods and properties.
220struct Q_EXPORT QUInterfaceDescription 220struct Q_EXPORT QUInterfaceDescription
221{ 221{
222 int methodCount; 222 int methodCount;
223 const QUMethod* methods; 223 const QUMethod* methods;
224 int propertyCount; 224 int propertyCount;
225 const QUProperty* properties; 225 const QUProperty* properties;
226}; 226};
227 227
228 228
229// A component description describe one component, that is its name, 229// A component description describe one component, that is its name,
230// vendor, release, info, its component uuid and all its interface 230// vendor, release, info, its component uuid and all its interface
231// uuids. 231// uuids.
232struct Q_EXPORT QUComponentDescription 232struct Q_EXPORT QUComponentDescription
233{ 233{
234 const char* name; 234 const char* name;
235 const char* vendor; 235 const char* vendor;
236 const char* release; 236 const char* release;
237 const char* info; 237 const char* info;
238 QUuid cid; 238 QUuid cid;
239 int count; 239 int count;
240 const QUuid* interfaces; 240 const QUuid* interfaces;
241}; 241};
242 242
243 243
244// A component server description describe one component server, that 244// A component server description describe one component server, that
245// is its name, vendor, release, info and the descriptions of all 245// is its name, vendor, release, info and the descriptions of all
246// components it can instantiate. 246// components it can instantiate.
247struct Q_EXPORT QUComponentServerDescription 247struct Q_EXPORT QUComponentServerDescription
248{ 248{
249 const char* name; 249 const char* name;
250 const char* vendor; 250 const char* vendor;
251 const char* release; 251 const char* release;
252 const char* info; 252 const char* info;
253 int count; 253 int count;
254 const QUComponentDescription* components; 254 const QUComponentDescription* components;
255}; 255};
256 256
257 257
258 258
259 struct Q_EXPORT QUEnumItem // - a name/value pair 259 struct Q_EXPORT QUEnumItem // - a name/value pair
260{ 260{
261 const char *key; 261 const char *key;
262 int value; 262 int value;
263}; 263};
264 264
265struct Q_EXPORT QUEnum 265struct Q_EXPORT QUEnum
266 { 266{
267 const char *name; // - enumerator name 267 const char *name; // - enumerator name
268 unsigned int count; // - number of values 268 unsigned int count; // - number of values
269 const QUEnumItem *items; // - the name/value pairs 269 const QUEnumItem *items; // - the name/value pairs
270 bool set; // whether enum has to be treated as a set 270 bool set; // whether enum has to be treated as a set
271}; 271};
272 272
273inline bool QUType::isEqual( const QUType *t1, const QUType *t2 ) { 273inline bool QUType::isEqual( const QUType *t1, const QUType *t2 ) {
274 return t1 == t2 || t1->uuid() == t2->uuid() || 274 return t1 == t2 || t1->uuid() == t2->uuid() ||
275 *(t1->uuid()) == *(t2->uuid()); 275 *(t1->uuid()) == *(t2->uuid());
276} 276}
277 277
278inline bool QUType::check( QUObject* o, QUType* t ) { 278inline bool QUType::check( QUObject* o, QUType* t ) {
279 return isEqual( o->type, t ) || t->convertFrom( o, o->type ); 279 return isEqual( o->type, t ) || t->convertFrom( o, o->type );
280} 280}
281 281
282 282
283 283
284// {7EE17B08-5419-47e2-9776-8EEA112DCAEC} 284// {7EE17B08-5419-47e2-9776-8EEA112DCAEC}
285extern Q_EXPORT const QUuid TID_QUType_enum; 285extern Q_EXPORT const QUuid TID_QUType_enum;
286struct Q_EXPORT QUType_enum : public QUType 286struct Q_EXPORT QUType_enum : public QUType
287{ 287{
288 const QUuid *uuid() const; 288 const QUuid *uuid() const;
289 const char *desc() const; 289 const char *desc() const;
290 290
291 void set( QUObject *, int ); 291 void set( QUObject *, int );
292 int &get( QUObject * o ) { return o->payload.i; } 292 int &get( QUObject * o ) { return o->payload.i; }
293 bool canConvertFrom( QUObject *, QUType * ); 293 bool canConvertFrom( QUObject *, QUType * );
294 bool canConvertTo( QUObject *, QUType * ); 294 bool canConvertTo( QUObject *, QUType * );
295 bool convertFrom( QUObject *, QUType * ); 295 bool convertFrom( QUObject *, QUType * );
296 bool convertTo( QUObject *, QUType * ); 296 bool convertTo( QUObject *, QUType * );
297 void clear( QUObject * ) {} 297 void clear( QUObject * ) {}
298 int serializeTo( QUObject *, QUBuffer * ); 298 int serializeTo( QUObject *, QUBuffer * );
299 int serializeFrom( QUObject *, QUBuffer * ); 299 int serializeFrom( QUObject *, QUBuffer * );
300}; 300};
301extern Q_EXPORT QUType_enum static_QUType_enum; 301extern Q_EXPORT QUType_enum static_QUType_enum;
302 302
303 303
304// {8AC26448-5AB4-49eb-968C-8F30AB13D732} 304// {8AC26448-5AB4-49eb-968C-8F30AB13D732}
305extern Q_EXPORT const QUuid TID_QUType_ptr; 305extern Q_EXPORT const QUuid TID_QUType_ptr;
306struct Q_EXPORT QUType_ptr : public QUType 306struct Q_EXPORT QUType_ptr : public QUType
307{ 307{
308 const QUuid *uuid() const; 308 const QUuid *uuid() const;
309 const char *desc() const; 309 const char *desc() const;
310 310
311 void set( QUObject *, const void* ); 311 void set( QUObject *, const void* );
312 void* &get( QUObject * o ) { return o->payload.ptr; } 312 void* &get( QUObject * o ) { return o->payload.ptr; }
313 bool canConvertFrom( QUObject *, QUType * ); 313 bool canConvertFrom( QUObject *, QUType * );
314 bool canConvertTo( QUObject *, QUType * ); 314 bool canConvertTo( QUObject *, QUType * );
315 bool convertFrom( QUObject *, QUType * ); 315 bool convertFrom( QUObject *, QUType * );
316 bool convertTo( QUObject *, QUType * ); 316 bool convertTo( QUObject *, QUType * );
317 void clear( QUObject * ) {} 317 void clear( QUObject * ) {}
318 int serializeTo( QUObject *, QUBuffer * ); 318 int serializeTo( QUObject *, QUBuffer * );
319 int serializeFrom( QUObject *, QUBuffer * ); 319 int serializeFrom( QUObject *, QUBuffer * );
320}; 320};
321extern Q_EXPORT QUType_ptr static_QUType_ptr; 321extern Q_EXPORT QUType_ptr static_QUType_ptr;
322 322
323// {97A2594D-6496-4402-A11E-55AEF2D4D25C} 323// {97A2594D-6496-4402-A11E-55AEF2D4D25C}
324extern Q_EXPORT const QUuid TID_QUType_iface; 324extern Q_EXPORT const QUuid TID_QUType_iface;
325struct Q_EXPORT QUType_iface : public QUType 325struct Q_EXPORT QUType_iface : public QUType
326{ 326{
327 const QUuid *uuid() const; 327 const QUuid *uuid() const;
328 const char *desc() const; 328 const char *desc() const;
329 329
330 void set( QUObject *, QUnknownInterface* ); 330 void set( QUObject *, QUnknownInterface* );
331 QUnknownInterface* &get( QUObject *o ){ return o->payload.iface; } 331 QUnknownInterface* &get( QUObject *o ){ return o->payload.iface; }
332 bool canConvertFrom( QUObject *, QUType * ); 332 bool canConvertFrom( QUObject *, QUType * );
333 bool canConvertTo( QUObject *, QUType * ); 333 bool canConvertTo( QUObject *, QUType * );
334 bool convertFrom( QUObject *, QUType * ); 334 bool convertFrom( QUObject *, QUType * );
335 bool convertTo( QUObject *, QUType * ); 335 bool convertTo( QUObject *, QUType * );
336 void clear( QUObject * ) {} 336 void clear( QUObject * ) {}
337 int serializeTo( QUObject *, QUBuffer * ); 337 int serializeTo( QUObject *, QUBuffer * );
338 int serializeFrom( QUObject *, QUBuffer * ); 338 int serializeFrom( QUObject *, QUBuffer * );
339}; 339};
340extern Q_EXPORT QUType_iface static_QUType_iface; 340extern Q_EXPORT QUType_iface static_QUType_iface;
341 341
342// {2F358164-E28F-4bf4-9FA9-4E0CDCABA50B} 342// {2F358164-E28F-4bf4-9FA9-4E0CDCABA50B}
343extern Q_EXPORT const QUuid TID_QUType_idisp; 343extern Q_EXPORT const QUuid TID_QUType_idisp;
344struct Q_EXPORT QUType_idisp : public QUType 344struct Q_EXPORT QUType_idisp : public QUType
345{ 345{
346 const QUuid *uuid() const; 346 const QUuid *uuid() const;
347 const char *desc() const; 347 const char *desc() const;
348 348
349 void set( QUObject *, QDispatchInterface* ); 349 void set( QUObject *, QDispatchInterface* );
350 QDispatchInterface* &get( QUObject *o ){ return o->payload.idisp; } 350 QDispatchInterface* &get( QUObject *o ){ return o->payload.idisp; }
351 bool canConvertFrom( QUObject *, QUType * ); 351 bool canConvertFrom( QUObject *, QUType * );
352 bool canConvertTo( QUObject *, QUType * ); 352 bool canConvertTo( QUObject *, QUType * );
353 bool convertFrom( QUObject *, QUType * ); 353 bool convertFrom( QUObject *, QUType * );
354 bool convertTo( QUObject *, QUType * ); 354 bool convertTo( QUObject *, QUType * );
355 void clear( QUObject * ) {} 355 void clear( QUObject * ) {}
356 int serializeTo( QUObject *, QUBuffer * ); 356 int serializeTo( QUObject *, QUBuffer * );
357 int serializeFrom( QUObject *, QUBuffer * ); 357 int serializeFrom( QUObject *, QUBuffer * );
358}; 358};
359extern Q_EXPORT QUType_idisp static_QUType_idisp; 359extern Q_EXPORT QUType_idisp static_QUType_idisp;
360 360
361// {CA42115D-13D0-456c-82B5-FC10187F313E} 361// {CA42115D-13D0-456c-82B5-FC10187F313E}
362extern Q_EXPORT const QUuid TID_QUType_bool; 362extern Q_EXPORT const QUuid TID_QUType_bool;
363struct Q_EXPORT QUType_bool : public QUType 363struct Q_EXPORT QUType_bool : public QUType
364{ 364{
365 const QUuid *uuid() const; 365 const QUuid *uuid() const;
366 const char *desc() const; 366 const char *desc() const;
367 367
368 void set( QUObject *, bool ); 368 void set( QUObject *, bool );
369 bool &get( QUObject *o ) { return o->payload.b; } 369 bool &get( QUObject *o ) { return o->payload.b; }
370 bool canConvertFrom( QUObject *, QUType * ); 370 bool canConvertFrom( QUObject *, QUType * );
371 bool canConvertTo( QUObject *, QUType * ); 371 bool canConvertTo( QUObject *, QUType * );
372 bool convertFrom( QUObject *, QUType * ); 372 bool convertFrom( QUObject *, QUType * );
373 bool convertTo( QUObject *, QUType * ); 373 bool convertTo( QUObject *, QUType * );
374 void clear( QUObject * ) {} 374 void clear( QUObject * ) {}
375 int serializeTo( QUObject *, QUBuffer * ); 375 int serializeTo( QUObject *, QUBuffer * );
376 int serializeFrom( QUObject *, QUBuffer * ); 376 int serializeFrom( QUObject *, QUBuffer * );
377}; 377};
378extern Q_EXPORT QUType_bool static_QUType_bool; 378extern Q_EXPORT QUType_bool static_QUType_bool;
379 379
380// {53C1F3BE-73C3-4c7d-9E05-CCF09EB676B5} 380// {53C1F3BE-73C3-4c7d-9E05-CCF09EB676B5}
381extern Q_EXPORT const QUuid TID_QUType_int; 381extern Q_EXPORT const QUuid TID_QUType_int;
382struct Q_EXPORT QUType_int : public QUType 382struct Q_EXPORT QUType_int : public QUType
383{ 383{
384 const QUuid *uuid() const; 384 const QUuid *uuid() const;
385 const char *desc() const; 385 const char *desc() const;
386 386
387 void set( QUObject *, int ); 387 void set( QUObject *, int );
388 int &get( QUObject *o ) { return o->payload.i; } 388 int &get( QUObject *o ) { return o->payload.i; }
389 bool canConvertFrom( QUObject *, QUType * ); 389 bool canConvertFrom( QUObject *, QUType * );
390 bool canConvertTo( QUObject *, QUType * ); 390 bool canConvertTo( QUObject *, QUType * );
391 bool convertFrom( QUObject *, QUType * ); 391 bool convertFrom( QUObject *, QUType * );
392 bool convertTo( QUObject *, QUType * ); 392 bool convertTo( QUObject *, QUType * );
393 void clear( QUObject * ) {} 393 void clear( QUObject * ) {}
394 int serializeTo( QUObject *, QUBuffer * ); 394 int serializeTo( QUObject *, QUBuffer * );
395 int serializeFrom( QUObject *, QUBuffer * ); 395 int serializeFrom( QUObject *, QUBuffer * );
396}; 396};
397extern Q_EXPORT QUType_int static_QUType_int; 397extern Q_EXPORT QUType_int static_QUType_int;
398 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 399
418// {2D0974E5-0BA6-4ec2-8837-C198972CB48C} 400// {2D0974E5-0BA6-4ec2-8837-C198972CB48C}
419extern Q_EXPORT const QUuid TID_QUType_double; 401extern Q_EXPORT const QUuid TID_QUType_double;
420struct Q_EXPORT QUType_double : public QUType 402struct Q_EXPORT QUType_double : public QUType
421{ 403{
422 const QUuid *uuid() const; 404 const QUuid *uuid() const;
423 const char *desc() const; 405 const char *desc() const;
424 406
425 void set( QUObject *, double ); 407 void set( QUObject *, double );
426 double &get( QUObject *o ) { return o->payload.d; } 408 double &get( QUObject *o ) { return o->payload.d; }
427 bool canConvertFrom( QUObject *, QUType * ); 409 bool canConvertFrom( QUObject *, QUType * );
428 bool canConvertTo( QUObject *, QUType * ); 410 bool canConvertTo( QUObject *, QUType * );
429 bool convertFrom( QUObject *, QUType * ); 411 bool convertFrom( QUObject *, QUType * );
430 bool convertTo( QUObject *, QUType * ); 412 bool convertTo( QUObject *, QUType * );
431 void clear( QUObject * ) {} 413 void clear( QUObject * ) {}
432 int serializeTo( QUObject *, QUBuffer * ); 414 int serializeTo( QUObject *, QUBuffer * );
433 int serializeFrom( QUObject *, QUBuffer * ); 415 int serializeFrom( QUObject *, QUBuffer * );
434}; 416};
435extern Q_EXPORT QUType_double static_QUType_double; 417extern Q_EXPORT QUType_double static_QUType_double;
436 418
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 419
456// {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9} 420// {EFCDD1D4-77A3-4b8e-8D46-DC14B8D393E9}
457extern Q_EXPORT const QUuid TID_QUType_charstar; 421extern Q_EXPORT const QUuid TID_QUType_charstar;
458struct Q_EXPORT QUType_charstar : public QUType 422struct Q_EXPORT QUType_charstar : public QUType
459{ 423{
460 const QUuid *uuid() const; 424 const QUuid *uuid() const;
461 const char *desc() const; 425 const char *desc() const;
462 426
463 void set( QUObject *, const char*, bool take = FALSE ); 427 void set( QUObject *, const char*, bool take = FALSE );
464 char* get( QUObject *o ){ return o->payload.charstar.ptr; } 428 char* get( QUObject *o ){ return o->payload.charstar.ptr; }
465 bool canConvertFrom( QUObject *, QUType * ); 429 bool canConvertFrom( QUObject *, QUType * );
466 bool canConvertTo( QUObject *, QUType * ); 430 bool canConvertTo( QUObject *, QUType * );
467 bool convertFrom( QUObject *, QUType * ); 431 bool convertFrom( QUObject *, QUType * );
468 bool convertTo( QUObject *, QUType * ); 432 bool convertTo( QUObject *, QUType * );
469 void clear( QUObject * ); 433 void clear( QUObject * );
470 int serializeTo( QUObject *, QUBuffer * ); 434 int serializeTo( QUObject *, QUBuffer * );
471 int serializeFrom( QUObject *, QUBuffer * ); 435 int serializeFrom( QUObject *, QUBuffer * );
472 436
473}; 437};
474extern Q_EXPORT QUType_charstar static_QUType_charstar; 438extern Q_EXPORT QUType_charstar static_QUType_charstar;
475 439
476// {44C2A547-01E7-4e56-8559-35AF9D2F42B7} 440// {44C2A547-01E7-4e56-8559-35AF9D2F42B7}
477extern const QUuid TID_QUType_QString; 441extern const QUuid TID_QUType_QString;
478 442
479struct Q_EXPORT QUType_QString : public QUType 443struct Q_EXPORT QUType_QString : public QUType
480{ 444{
481 const QUuid *uuid() const; 445 const QUuid *uuid() const;
482 const char *desc() const; 446 const char *desc() const;
483 447
484 void set( QUObject *, const QString & ); 448 void set( QUObject *, const QString & );
485 QString &get( QUObject * o ) { return *(QString*)o->payload.ptr; } 449 QString &get( QUObject * o ) { return *(QString*)o->payload.ptr; }
486 450
487 bool canConvertFrom( QUObject *, QUType * ); 451 bool canConvertFrom( QUObject *, QUType * );
488 bool canConvertTo( QUObject *, QUType * ); 452 bool canConvertTo( QUObject *, QUType * );
489 bool convertFrom( QUObject *, QUType * ); 453 bool convertFrom( QUObject *, QUType * );
490 bool convertTo( QUObject *, QUType * ); 454 bool convertTo( QUObject *, QUType * );
491 void clear( QUObject * ); 455 void clear( QUObject * );
492 int serializeTo( QUObject *, QUBuffer * ); 456 int serializeTo( QUObject *, QUBuffer * );
493 int serializeFrom( QUObject *, QUBuffer * ); 457 int serializeFrom( QUObject *, QUBuffer * );
494 458
495}; 459};
496extern Q_EXPORT QUType_QString static_QUType_QString; 460extern Q_EXPORT QUType_QString static_QUType_QString;
497 461
498 462
499#endif // QUCOM_H 463#endif // QUCOM_P_H
diff --git a/qmake/include/private/qucomextra_p.h b/qmake/include/private/qucomextra_p.h
index 3de6104..fe39692 100644
--- a/qmake/include/private/qucomextra_p.h
+++ b/qmake/include/private/qucomextra_p.h
@@ -1,93 +1,105 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of extra QUcom classes 4** Definition of extra QUcom classes
5** 5**
6** Created : 990101 6** Created : 990101
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QUCOMEXTRA_H 38#ifndef QUCOMEXTRA_P_H
39#define QUCOMEXTRA_H 39#define QUCOMEXTRA_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. This header file may
46// change from version to version without notice, or even be
47// removed.
48//
49// We mean it.
50//
51//
40 52
41#ifndef QT_H 53#ifndef QT_H
42#include <private/qucom_p.h> 54#include <private/qucom_p.h>
43#endif // QT_H 55#endif // QT_H
44 56
45 57
46class QVariant; 58class QVariant;
47 59
48#ifndef QT_NO_VARIANT 60#ifndef QT_NO_VARIANT
49// 6dc75d58-a1d9-4417-b591-d45c63a3a4ea 61// 6dc75d58-a1d9-4417-b591-d45c63a3a4ea
50extern const QUuid TID_QUType_QVariant; 62extern const QUuid TID_QUType_QVariant;
51 63
52struct Q_EXPORT QUType_QVariant : public QUType 64struct Q_EXPORT QUType_QVariant : public QUType
53{ 65{
54 const QUuid *uuid() const; 66 const QUuid *uuid() const;
55 const char *desc() const; 67 const char *desc() const;
56 68
57 void set( QUObject *, const QVariant & ); 69 void set( QUObject *, const QVariant & );
58 QVariant &get( QUObject * o ); 70 QVariant &get( QUObject * o );
59 71
60 bool canConvertFrom( QUObject *, QUType * ); 72 bool canConvertFrom( QUObject *, QUType * );
61 bool canConvertTo( QUObject *, QUType * ); 73 bool canConvertTo( QUObject *, QUType * );
62 bool convertFrom( QUObject *, QUType * ); 74 bool convertFrom( QUObject *, QUType * );
63 bool convertTo( QUObject *, QUType * ); 75 bool convertTo( QUObject *, QUType * );
64 void clear( QUObject * ); 76 void clear( QUObject * );
65 int serializeTo( QUObject *, QUBuffer * ); 77 int serializeTo( QUObject *, QUBuffer * );
66 int serializeFrom( QUObject *, QUBuffer * ); 78 int serializeFrom( QUObject *, QUBuffer * );
67}; 79};
68extern Q_EXPORT QUType_QVariant static_QUType_QVariant; 80extern Q_EXPORT QUType_QVariant static_QUType_QVariant;
69#endif //QT_NO_VARIANT 81#endif //QT_NO_VARIANT
70 82
71 83
72// {0x8d48b3a8, 0xbd7f, 0x11d5, 0x8d, 0x74, 0x00, 0xc0, 0xf0, 0x3b, 0xc0, 0xf3 } 84// {0x8d48b3a8, 0xbd7f, 0x11d5, 0x8d, 0x74, 0x00, 0xc0, 0xf0, 0x3b, 0xc0, 0xf3 }
73extern Q_EXPORT const QUuid TID_QUType_varptr; 85extern Q_EXPORT const QUuid TID_QUType_varptr;
74struct Q_EXPORT QUType_varptr : public QUType 86struct Q_EXPORT QUType_varptr : public QUType
75{ 87{
76 const QUuid *uuid() const; 88 const QUuid *uuid() const;
77 const char *desc() const; 89 const char *desc() const;
78 90
79 void set( QUObject *, const void* ); 91 void set( QUObject *, const void* );
80 void* &get( QUObject * o ) { return o->payload.ptr; } 92 void* &get( QUObject * o ) { return o->payload.ptr; }
81 bool canConvertFrom( QUObject *, QUType * ); 93 bool canConvertFrom( QUObject *, QUType * );
82 bool canConvertTo( QUObject *, QUType * ); 94 bool canConvertTo( QUObject *, QUType * );
83 bool convertFrom( QUObject *, QUType * ); 95 bool convertFrom( QUObject *, QUType * );
84 bool convertTo( QUObject *, QUType * ); 96 bool convertTo( QUObject *, QUType * );
85 void clear( QUObject * ) {} 97 void clear( QUObject * ) {}
86 int serializeTo( QUObject *, QUBuffer * ); 98 int serializeTo( QUObject *, QUBuffer * );
87 int serializeFrom( QUObject *, QUBuffer * ); 99 int serializeFrom( QUObject *, QUBuffer * );
88}; 100};
89extern Q_EXPORT QUType_varptr static_QUType_varptr; 101extern Q_EXPORT QUType_varptr static_QUType_varptr;
90 102
91 103
92#endif // QUCOMEXTRA_H 104#endif // QUCOMEXTRA_P_H
93 105
diff --git a/qmake/include/private/qwidgetinterface_p.h b/qmake/include/private/qwidgetinterface_p.h
index 5b5776b..78e9aad 100644
--- a/qmake/include/private/qwidgetinterface_p.h
+++ b/qmake/include/private/qwidgetinterface_p.h
@@ -1,111 +1,140 @@
1 /********************************************************************** 1/****************************************************************************
2** Copyright (C) 2000-2001 Trolltech AS. All rights reserved. 2** $Id$
3** 3**
4** This file is part of Qt Designer. 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.
5** 13**
6** This file may be distributed and/or modified under the terms of the 14** 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 15** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 16** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 17** packaging of this file.
10** 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**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 23** 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 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.
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 30**
16** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 32** not clear to you.
18** 33**
19**********************************************************************/ 34**********************************************************************/
20 35
21#ifndef QWIDGETINTERFACE_H 36#ifndef QWIDGETINTERFACE_P_H
22#define QWIDGETINTERFACE_H 37#define QWIDGETINTERFACE_P_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 38
32// 39//
33// W A R N I N G 40// W A R N I N G
34// ------------- 41// -------------
35// 42//
36// This file is not part of the Qt API. It exists for the convenience 43// 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 44// of a number of Qt sources files. This header file may change from
38// version to version without notice, or even be removed. 45// version to version without notice, or even be removed.
39// 46//
40// We mean it. 47// We mean it.
41// 48//
42// 49//
43 50
51#ifndef QT_H
52#include <private/qcom_p.h>
53#include <qiconset.h>
54#endif // QT_H
55
56#ifndef QT_NO_WIDGETPLUGIN
57
44class QWidget; 58class QWidget;
45 59
46// {55184143-f18f-42c0-a8eb-71c01516019a} 60// {55184143-f18f-42c0-a8eb-71c01516019a}
47#ifndef IID_QWidgetFactory 61#ifndef IID_QWidgetFactory
48#define IID_QWidgetFactory QUuid( 0x55184143, 0xf18f, 0x42c0, 0xa8, 0xeb, 0x71, 0xc0, 0x15, 0x16, 0x1, 0x9a ) 62#define IID_QWidgetFactory QUuid( 0x55184143, 0xf18f, 0x42c0, 0xa8, 0xeb, 0x71, 0xc0, 0x15, 0x16, 0x1, 0x9a )
49#endif 63#endif
50 64
51/*! To add custom widgets to the Qt Designer, implement that interface 65/*! To add custom widgets to the Qt Designer, implement that interface
52 in your custom widget plugin. 66 in your custom widget plugin.
53 67
54 You also have to implement the function featureList() (\sa 68 You also have to implement the function featureList() (\sa
55 QFeatureListInterface) and return there all widgets (names of it) 69 QFeatureListInterface) and return there all widgets (names of it)
56 which this interface provides. 70 which this interface provides.
57*/ 71*/
58 72
59struct QWidgetFactoryInterface : public QFeatureListInterface 73struct QWidgetFactoryInterface : public QFeatureListInterface
60{ 74{
61public: 75public:
62 76
63 /*! In the implementation create and return the widget \a widget 77 /*! In the implementation create and return the widget \a widget
64 here, use \a parent and \a name when creating the widget */ 78 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; 79 virtual QWidget* create( const QString &widget, QWidget* parent = 0, const char* name = 0 ) = 0;
66 80
67 /*! In the implementation return the name of the group of the 81 /*! In the implementation return the name of the group of the
68 widget \a widget */ 82 widget \a widget */
69 virtual QString group( const QString &widget ) const = 0; 83 virtual QString group( const QString &widget ) const = 0;
70 84
71 /*! In the implementation return the iconset, which should be used 85 /*! In the implementation return the iconset, which should be used
72 in the Qt Designer menubar and toolbar to represent the widget 86 in the Qt Designer menubar and toolbar to represent the widget
73 \a widget */ 87 \a widget */
74 virtual QIconSet iconSet( const QString &widget ) const = 0; 88 virtual QIconSet iconSet( const QString &widget ) const = 0;
75 89
76 /*! In the implementation return the include file which is needed 90 /*! In the implementation return the include file which is needed
77 for the widget \a widget in the generated code which uic 91 for the widget \a widget in the generated code which uic
78 generates. */ 92 generates. */
79 virtual QString includeFile( const QString &widget ) const = 0; 93 virtual QString includeFile( const QString &widget ) const = 0;
80 94
81 /*! In the implementation return the text which should be 95 /*! In the implementation return the text which should be
82 displayed as tooltip for the widget \a widget */ 96 displayed as tooltip for the widget \a widget */
83 virtual QString toolTip( const QString &widget ) const = 0; 97 virtual QString toolTip( const QString &widget ) const = 0;
84 98
85 /*! In the implementation return the text which should be used for 99 /*! In the implementation return the text which should be used for
86 what's this help for the widget \a widget. */ 100 what's this help for the widget \a widget. */
87 virtual QString whatsThis( const QString &widget ) const = 0; 101 virtual QString whatsThis( const QString &widget ) const = 0;
88 102
89 /*! In the implementation return TRUE here, of the \a widget 103 /*! In the implementation return TRUE here, of the \a widget
90 should be able to contain other widget in the Qt Designer, else 104 should be able to contain other widget in the Qt Designer, else
91 FALSE. */ 105 FALSE. */
92 virtual bool isContainer( const QString &widget ) const = 0; 106 virtual bool isContainer( const QString &widget ) const = 0;
93}; 107};
94 108
95#if CONTAINER_CUSTOM_WIDGETS 109#ifdef QT_CONTAINER_CUSTOM_WIDGETS
96// {15976628-e3c3-47f4-b525-d124a3caf30e} 110// {15976628-e3c3-47f4-b525-d124a3caf30e}
97#ifndef IID_QWidgetContainer 111#ifndef IID_QWidgetContainer
98#define IID_QWidgetContainer QUuid( 0x15976628, 0xe3c3, 0x47f4, 0xb5, 0x25, 0xd1, 0x24, 0xa3, 0xca, 0xf3, 0x0e ) 112#define IID_QWidgetContainer QUuid( 0x15976628, 0xe3c3, 0x47f4, 0xb5, 0x25, 0xd1, 0x24, 0xa3, 0xca, 0xf3, 0x0e )
99#endif 113#endif
100 114
101struct QWidgetContainerInterfacePrivate : public QUnknownInterface 115struct QWidgetContainerInterfacePrivate : public QUnknownInterface
102{ 116{
103public: 117public:
104 virtual QWidget *containerOfWidget( QWidget *widget ) const = 0; 118 virtual QWidget *containerOfWidget( const QString &f, QWidget *container ) const = 0;
105 virtual QWidgetList containersOf( QWidget *widget ) const = 0; 119 virtual bool isPassiveInteractor( const QString &f, QWidget *container ) const = 0;
106 virtual bool isPassiveInteractor( QWidget *widget ) const = 0; 120
121 virtual bool supportsPages( const QString &f ) const = 0;
122
123 virtual QWidget *addPage( const QString &f, QWidget *container,
124 const QString &name, int index ) const = 0;
125 virtual void insertPage( const QString &f, QWidget *container,
126 const QString &name, int index, QWidget *page ) const = 0;
127 virtual void removePage( const QString &f, QWidget *container, int index ) const = 0;
128 virtual void movePage( const QString &f, QWidget *container, int fromIndex, int toIndex ) const = 0;
129 virtual int count( const QString &key, QWidget *container ) const = 0;
130 virtual int currentIndex( const QString &key, QWidget *container ) const = 0;
131 virtual QString pageLabel( const QString &key, QWidget *container, int index ) const = 0;
132 virtual QWidget *page( const QString &key, QWidget *container, int index ) const = 0;
133 virtual void renamePage( const QString &key, QWidget *container,
134 int index, const QString &newName ) const = 0;
135 virtual QWidgetList pages( const QString &f, QWidget *container ) const = 0;
107}; 136};
108#endif 137#endif
109 138
110#endif // QT_NO_WIDGETPLUGIN 139#endif // QT_NO_WIDGETPLUGIN
111#endif // QWIDGETINTERFACE_H 140#endif // QWIDGETINTERFACE_P_H
diff --git a/qmake/include/private/qwidgetresizehandler_p.h b/qmake/include/private/qwidgetresizehandler_p.h
index ca229db..9297832 100644
--- a/qmake/include/private/qwidgetresizehandler_p.h
+++ b/qmake/include/private/qwidgetresizehandler_p.h
@@ -1,113 +1,125 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of the QWidgetResizeHandler class 4** Definition of the QWidgetResizeHandler class
5** 5**
6** Created : 001010 6** Created : 001010
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the workspace module of the Qt GUI Toolkit. 10** This file is part of the workspace module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition licenses may use this 21** Licensees holding valid Qt Enterprise Edition licenses may use this
22** file in accordance with the Qt Commercial License Agreement provided 22** file in accordance with the Qt Commercial License Agreement provided
23** with the Software. 23** with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QWIDGETRESIZEHANDLER_H 38#ifndef QWIDGETRESIZEHANDLER_P_H
39#define QWIDGETRESIZEHANDLER_H 39#define QWIDGETRESIZEHANDLER_P_H
40
41//
42// W A R N I N G
43// -------------
44//
45// This file is not part of the Qt API. This header file may
46// change from version to version without notice, or even be
47// removed.
48//
49// We mean it.
50//
51//
40 52
41#ifndef QT_H 53#ifndef QT_H
42#include "qobject.h" 54#include "qobject.h"
43#endif // QT_H 55#endif // QT_H
44#ifndef QT_NO_RESIZEHANDLER 56#ifndef QT_NO_RESIZEHANDLER
45class QMouseEvent; 57class QMouseEvent;
46class QKeyEvent; 58class QKeyEvent;
47 59
48class Q_EXPORT QWidgetResizeHandler : public QObject 60class Q_EXPORT QWidgetResizeHandler : public QObject
49{ 61{
50 Q_OBJECT 62 Q_OBJECT
51 63
52public: 64public:
53 QWidgetResizeHandler( QWidget *parent, QWidget *cw = 0, const char *name = 0 ); 65 QWidgetResizeHandler( QWidget *parent, QWidget *cw = 0, const char *name = 0 );
54 void setActive( bool b ) { active = b; if ( !active ) setMouseCursor( Nowhere ); } 66 void setActive( bool b ) { active = b; if ( !active ) setMouseCursor( Nowhere ); }
55 bool isActive() const { return active; } 67 bool isActive() const { return active; }
56 void setMovingEnabled( bool b ) { moving = b; } 68 void setMovingEnabled( bool b ) { moving = b; }
57 bool isMovingEnabled() const { return moving; } 69 bool isMovingEnabled() const { return moving; }
58 70
59 bool isButtonDown() const { return buttonDown; } 71 bool isButtonDown() const { return buttonDown; }
60 72
61 void setExtraHeight( int h ) { extrahei = h; } 73 void setExtraHeight( int h ) { extrahei = h; }
62 void setSizeProtection( bool b ) { sizeprotect = b; } 74 void setSizeProtection( bool b ) { sizeprotect = b; }
63 75
64 void doResize(); 76 void doResize();
65 void doMove(); 77 void doMove();
66 78
67signals: 79signals:
68 void activate(); 80 void activate();
69 81
70protected: 82protected:
71 bool eventFilter( QObject *o, QEvent *e ); 83 bool eventFilter( QObject *o, QEvent *e );
72 void mouseMoveEvent( QMouseEvent *e ); 84 void mouseMoveEvent( QMouseEvent *e );
73 void keyPressEvent( QKeyEvent *e ); 85 void keyPressEvent( QKeyEvent *e );
74 86
75private: 87private:
76 enum MousePosition { 88 enum MousePosition {
77 Nowhere, 89 Nowhere,
78 TopLeft, BottomRight, BottomLeft, TopRight, 90 TopLeft, BottomRight, BottomLeft, TopRight,
79 Top, Bottom, Left, Right, 91 Top, Bottom, Left, Right,
80 Center 92 Center
81 }; 93 };
82 94
83 QWidget *widget; 95 QWidget *widget;
84 QWidget *childWidget; 96 QWidget *childWidget;
85 QPoint moveOffset; 97 QPoint moveOffset;
86 QPoint invertedMoveOffset; 98 QPoint invertedMoveOffset;
87 MousePosition mode; 99 MousePosition mode;
88 int extrahei; 100 int extrahei;
89 int range; 101 int range;
90 uint buttonDown :1; 102 uint buttonDown :1;
91 uint moveResizeMode :1; 103 uint moveResizeMode :1;
92 uint active :1; 104 uint active :1;
93 uint sizeprotect :1; 105 uint sizeprotect :1;
94 uint moving :1; 106 uint moving :1;
95 107
96 void setMouseCursor( MousePosition m ); 108 void setMouseCursor( MousePosition m );
97 bool isMove() const { 109 bool isMove() const {
98 return moveResizeMode && mode == Center; 110 return moveResizeMode && mode == Center;
99 } 111 }
100 bool isResize() const { 112 bool isResize() const {
101 return moveResizeMode && !isMove(); 113 return moveResizeMode && !isMove();
102 } 114 }
103 115
104 private:// Disabled copy constructor and operator= 116 private:// Disabled copy constructor and operator=
105#if defined(Q_DISABLE_COPY) 117#if defined(Q_DISABLE_COPY)
106 QWidgetResizeHandler( const QWidgetResizeHandler & ); 118 QWidgetResizeHandler( const QWidgetResizeHandler & );
107 QWidgetResizeHandler& operator=( const QWidgetResizeHandler & ); 119 QWidgetResizeHandler& operator=( const QWidgetResizeHandler & );
108#endif 120#endif
109 121
110}; 122};
111 123
112#endif //QT_NO_RESIZEHANDLER 124#endif //QT_NO_RESIZEHANDLER
113#endif 125#endif
diff --git a/qmake/include/qasciidict.h b/qmake/include/qasciidict.h
index 8f344cd..ecd9c9f 100644
--- a/qmake/include/qasciidict.h
+++ b/qmake/include/qasciidict.h
@@ -1,118 +1,122 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QAsciiDict template class 4** Definition of QAsciiDict template class
5** 5**
6** Created : 920821 6** Created : 920821
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QASCIIDICT_H 38#ifndef QASCIIDICT_H
39#define QASCIIDICT_H 39#define QASCIIDICT_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qgdict.h" 42#include "qgdict.h"
43#endif // QT_H 43#endif // QT_H
44 44
45template<class type> 45template<class type>
46class QAsciiDict 46class QAsciiDict
47#ifdef Q_QDOC 47#ifdef Q_QDOC
48 : public QPtrCollection 48 : public QPtrCollection
49#else 49#else
50 : public QGDict 50 : public QGDict
51#endif 51#endif
52{ 52{
53public: 53public:
54 QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE ) 54 QAsciiDict(int size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE )
55 : QGDict(size,AsciiKey,caseSensitive,copyKeys) {} 55 : QGDict(size,AsciiKey,caseSensitive,copyKeys) {}
56 QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {} 56 QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {}
57 ~QAsciiDict() { clear(); } 57 ~QAsciiDict() { clear(); }
58 QAsciiDict<type> &operator=(const QAsciiDict<type> &d) 58 QAsciiDict<type> &operator=(const QAsciiDict<type> &d)
59 { return (QAsciiDict<type>&)QGDict::operator=(d); } 59 { return (QAsciiDict<type>&)QGDict::operator=(d); }
60 uint count() const { return QGDict::count(); } 60 uint count() const { return QGDict::count(); }
61 uint size() const { return QGDict::size(); } 61 uint size() const { return QGDict::size(); }
62 bool isEmpty() const { return QGDict::count() == 0; } 62 bool isEmpty() const { return QGDict::count() == 0; }
63 63
64 void insert( const char *k, const type *d ) 64 void insert( const char *k, const type *d )
65 { QGDict::look_ascii(k,(Item)d,1); } 65 { QGDict::look_ascii(k,(Item)d,1); }
66 void replace( const char *k, const type *d ) 66 void replace( const char *k, const type *d )
67 { QGDict::look_ascii(k,(Item)d,2); } 67 { QGDict::look_ascii(k,(Item)d,2); }
68 bool remove( const char *k ){ return QGDict::remove_ascii(k); } 68 bool remove( const char *k ){ return QGDict::remove_ascii(k); }
69 type *take( const char *k ) { return (type *)QGDict::take_ascii(k); } 69 type *take( const char *k ) { return (type *)QGDict::take_ascii(k); }
70 type *find( const char *k ) const 70 type *find( const char *k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); } 71 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
72 type *operator[]( const char *k ) const 72 type *operator[]( const char *k ) const
73 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); } 73 { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
74 74
75 void clear() { QGDict::clear(); } 75 void clear() { QGDict::clear(); }
76 void resize( uint n ) { QGDict::resize(n); } 76 void resize( uint n ) { QGDict::resize(n); }
77 void statistics() const { QGDict::statistics(); } 77 void statistics() const { QGDict::statistics(); }
78 78
79#ifdef Q_QDOC 79#ifdef Q_QDOC
80protected: 80protected:
81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & ); 81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const; 82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
83#endif 83#endif
84 84
85private: 85private:
86 void deleteItem( Item d ); 86 void deleteItem( Item d );
87}; 87};
88 88
89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) 89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
90template<> inline void QAsciiDict<void>::deleteItem( QPtrCollection::Item ) 90template<> inline void QAsciiDict<void>::deleteItem( QPtrCollection::Item )
91{ 91{
92} 92}
93#endif 93#endif
94 94
95template<class type> inline void QAsciiDict<type>::deleteItem( QPtrCollection::Item d ) 95template<class type> inline void QAsciiDict<type>::deleteItem( QPtrCollection::Item d )
96{ 96{
97 if ( del_item ) delete (type *)d; 97 if ( del_item ) delete (type *)d;
98} 98}
99 99
100template<class type> 100template<class type>
101class QAsciiDictIterator : public QGDictIterator 101class QAsciiDictIterator : public QGDictIterator
102{ 102{
103public: 103public:
104 QAsciiDictIterator(const QAsciiDict<type> &d) 104 QAsciiDictIterator(const QAsciiDict<type> &d)
105 : QGDictIterator((QGDict &)d) {} 105 : QGDictIterator((QGDict &)d) {}
106 ~QAsciiDictIterator() {} 106 ~QAsciiDictIterator() {}
107 uint count() const { return dict->count(); } 107 uint count() const { return dict->count(); }
108 bool isEmpty() const { return dict->count() == 0; } 108 bool isEmpty() const { return dict->count() == 0; }
109 type *toFirst() { return (type *)QGDictIterator::toFirst(); } 109 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
110 operator type *() const { return (type *)QGDictIterator::get(); } 110 operator type *() const { return (type *)QGDictIterator::get(); }
111 type *current() const { return (type *)QGDictIterator::get(); } 111 type *current() const { return (type *)QGDictIterator::get(); }
112 const char *currentKey() const { return QGDictIterator::getKeyAscii(); } 112 const char *currentKey() const { return QGDictIterator::getKeyAscii(); }
113 type *operator()() { return (type *)QGDictIterator::operator()(); } 113 type *operator()() { return (type *)QGDictIterator::operator()(); }
114 type *operator++() { return (type *)QGDictIterator::operator++(); } 114 type *operator++() { return (type *)QGDictIterator::operator++(); }
115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);} 115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
116}; 116};
117 117
118#ifdef QT_QWINEXPORT
119#define Q_DEFINED_QASCIIDICT
120#include "qwinexport.h"
121#endif /* QT_QWINEXPORT */
118#endif // QASCIIDICT_H 122#endif // QASCIIDICT_H
diff --git a/qmake/include/qcstring.h b/qmake/include/qcstring.h
index 004bb3b..6b7352a 100644
--- a/qmake/include/qcstring.h
+++ b/qmake/include/qcstring.h
@@ -1,391 +1,398 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of the extended char array operations, 4** Definition of the extended char array operations,
5** and QByteArray and QCString classes 5** and QByteArray and QCString classes
6** 6**
7** Created : 920609 7** Created : 920609
8** 8**
9** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 9** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
10** 10**
11** This file is part of the tools module of the Qt GUI Toolkit. 11** This file is part of the tools module of the Qt GUI Toolkit.
12** 12**
13** This file may be distributed under the terms of the Q Public License 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 14** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file. 15** LICENSE.QPL included in the packaging of this file.
16** 16**
17** This file may be distributed and/or modified under the terms of the 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 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 19** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file. 20** packaging of this file.
21** 21**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License 23** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software. 24** Agreement provided with the Software.
25** 25**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 27** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28** 28**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements. 30** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information. 31** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information. 32** See http://www.trolltech.com/gpl/ for GPL licensing information.
33** 33**
34** Contact info@trolltech.com if any conditions of this licensing are 34** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you. 35** not clear to you.
36** 36**
37**********************************************************************/ 37**********************************************************************/
38 38
39#ifndef QCSTRING_H 39#ifndef QCSTRING_H
40#define QCSTRING_H 40#define QCSTRING_H
41 41
42#ifndef QT_H 42#ifndef QT_H
43#include "qmemarray.h" 43#include "qmemarray.h"
44#endif // QT_H 44#endif // QT_H
45 45
46#include <string.h> 46#include <string.h>
47 47
48 48
49/***************************************************************************** 49/*****************************************************************************
50 Safe and portable C string functions; extensions to standard string.h 50 Safe and portable C string functions; extensions to standard string.h
51 *****************************************************************************/ 51 *****************************************************************************/
52 52
53Q_EXPORT void *qmemmove( void *dst, const void *src, uint len ); 53Q_EXPORT void *qmemmove( void *dst, const void *src, uint len );
54 54
55Q_EXPORT char *qstrdup( const char * ); 55Q_EXPORT char *qstrdup( const char * );
56 56
57Q_EXPORT inline uint qstrlen( const char *str ) 57Q_EXPORT inline uint qstrlen( const char *str )
58{ return str ? (uint)strlen(str) : 0; } 58{ return str ? (uint)strlen(str) : 0; }
59 59
60Q_EXPORT inline char *qstrcpy( char *dst, const char *src ) 60Q_EXPORT inline char *qstrcpy( char *dst, const char *src )
61{ return src ? strcpy(dst, src) : 0; } 61{ return src ? strcpy(dst, src) : 0; }
62 62
63Q_EXPORT char *qstrncpy( char *dst, const char *src, uint len ); 63Q_EXPORT char *qstrncpy( char *dst, const char *src, uint len );
64 64
65Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 ) 65Q_EXPORT inline int qstrcmp( const char *str1, const char *str2 )
66{ 66{
67 return ( str1 && str2 ) ? strcmp( str1, str2 ) 67 return ( str1 && str2 ) ? strcmp( str1, str2 )
68 : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); 68 : ( str1 ? 1 : ( str2 ? -1 : 0 ) );
69} 69}
70 70
71Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len ) 71Q_EXPORT inline int qstrncmp( const char *str1, const char *str2, uint len )
72{ 72{
73 return ( str1 && str2 ) ? strncmp( str1, str2, len ) 73 return ( str1 && str2 ) ? strncmp( str1, str2, len )
74 : ( str1 ? 1 : ( str2 ? -1 : 0 ) ); 74 : ( str1 ? 1 : ( str2 ? -1 : 0 ) );
75} 75}
76 76
77Q_EXPORT int qstricmp( const char *, const char * ); 77Q_EXPORT int qstricmp( const char *, const char * );
78 78
79Q_EXPORT int qstrnicmp( const char *, const char *, uint len ); 79Q_EXPORT int qstrnicmp( const char *, const char *, uint len );
80 80
81#ifndef QT_CLEAN_NAMESPACE 81#ifndef QT_CLEAN_NAMESPACE
82Q_EXPORT inline uint cstrlen( const char *str ) 82Q_EXPORT inline uint cstrlen( const char *str )
83{ return (uint)strlen(str); } 83{ return (uint)strlen(str); }
84 84
85Q_EXPORT inline char *cstrcpy( char *dst, const char *src ) 85Q_EXPORT inline char *cstrcpy( char *dst, const char *src )
86{ return strcpy(dst,src); } 86{ return strcpy(dst,src); }
87 87
88Q_EXPORT inline int cstrcmp( const char *str1, const char *str2 ) 88Q_EXPORT inline int cstrcmp( const char *str1, const char *str2 )
89{ return strcmp(str1,str2); } 89{ return strcmp(str1,str2); }
90 90
91Q_EXPORT inline int cstrncmp( const char *str1, const char *str2, uint len ) 91Q_EXPORT inline int cstrncmp( const char *str1, const char *str2, uint len )
92{ return strncmp(str1,str2,len); } 92{ return strncmp(str1,str2,len); }
93#endif 93#endif
94 94
95 95
96// qChecksum: Internet checksum 96// qChecksum: Internet checksum
97 97
98Q_EXPORT Q_UINT16 qChecksum( const char *s, uint len ); 98Q_EXPORT Q_UINT16 qChecksum( const char *s, uint len );
99 99
100/***************************************************************************** 100/*****************************************************************************
101 QByteArray class 101 QByteArray class
102 *****************************************************************************/ 102 *****************************************************************************/
103 103
104#ifndef QT_QWINEXPORT
104#if defined(Q_TEMPLATEDLL) 105#if defined(Q_TEMPLATEDLL)
105Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<char>; 106Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<char>;
106#endif 107#endif
108#endif /* QT_QWINEXPORT */
107 109
108#if defined(Q_QDOC) 110#if defined(Q_QDOC)
109/* 111/*
110 We want qdoc to document QByteArray as a real class that inherits 112 We want qdoc to document QByteArray as a real class that inherits
111 QMemArray<char> and that is inherited by QBitArray. 113 QMemArray<char> and that is inherited by QBitArray.
112*/ 114*/
113class QByteArray : public QMemArray<char> 115class QByteArray : public QMemArray<char>
114{ 116{
115public: 117public:
116 QByteArray(); 118 QByteArray();
117 QByteArray( int size ); 119 QByteArray( int size );
118}; 120};
119#else 121#else
120typedef QMemArray<char> QByteArray; 122typedef QMemArray<char> QByteArray;
121#endif 123#endif
122 124
123#ifndef QT_NO_COMPRESS 125#ifndef QT_NO_COMPRESS
124Q_EXPORT QByteArray qCompress( const uchar* data, int nbytes ); 126Q_EXPORT QByteArray qCompress( const uchar* data, int nbytes );
125Q_EXPORT QByteArray qUncompress( const uchar* data, int nbytes ); 127Q_EXPORT QByteArray qUncompress( const uchar* data, int nbytes );
126Q_EXPORT inline QByteArray qCompress( const QByteArray& data) 128Q_EXPORT inline QByteArray qCompress( const QByteArray& data)
127{ return qCompress( (const uchar*)data.data(), data.size() ); } 129{ return qCompress( (const uchar*)data.data(), data.size() ); }
128Q_EXPORT inline QByteArray qUncompress( const QByteArray& data ) 130Q_EXPORT inline QByteArray qUncompress( const QByteArray& data )
129{ return qUncompress( (const uchar*)data.data(), data.size() ); } 131{ return qUncompress( (const uchar*)data.data(), data.size() ); }
130#endif 132#endif
131 133
132/***************************************************************************** 134/*****************************************************************************
133 QByteArray stream functions 135 QByteArray stream functions
134 *****************************************************************************/ 136 *****************************************************************************/
135#ifndef QT_NO_DATASTREAM 137#ifndef QT_NO_DATASTREAM
136Q_EXPORT QDataStream &operator<<( QDataStream &, const QByteArray & ); 138Q_EXPORT QDataStream &operator<<( QDataStream &, const QByteArray & );
137Q_EXPORT QDataStream &operator>>( QDataStream &, QByteArray & ); 139Q_EXPORT QDataStream &operator>>( QDataStream &, QByteArray & );
138#endif 140#endif
139 141
140/***************************************************************************** 142/*****************************************************************************
141 QCString class 143 QCString class
142 *****************************************************************************/ 144 *****************************************************************************/
143 145
144class QRegExp; 146class QRegExp;
145 147
146 class Q_EXPORT QCString : public QByteArray// C string class 148 class Q_EXPORT QCString : public QByteArray// C string class
147{ 149{
148public: 150public:
149 QCString() {} // make null string 151 QCString() {} // make null string
150 QCString( int size ); // allocate size incl. \0 152 QCString( int size ); // allocate size incl. \0
151 QCString( const QCString &s ) : QByteArray( s ) {} 153 QCString( const QCString &s ) : QByteArray( s ) {}
152 QCString( const char *str ); // deep copy 154 QCString( const char *str ); // deep copy
153 QCString( const char *str, uint maxlen );// deep copy, max length 155 QCString( const char *str, uint maxlen );// deep copy, max length
154 ~QCString(); 156 ~QCString();
155 157
156 QCString &operator=( const QCString &s );// shallow copy 158 QCString &operator=( const QCString &s );// shallow copy
157 QCString &operator=( const char *str );// deep copy 159 QCString &operator=( const char *str );// deep copy
158 160
159 bool isNull()const; 161 bool isNull()const;
160 bool isEmpty()const; 162 bool isEmpty()const;
161 uint length()const; 163 uint length()const;
162 boolresize( uint newlen ); 164 boolresize( uint newlen );
163 booltruncate( uint pos ); 165 booltruncate( uint pos );
164 boolfill( char c, int len = -1 ); 166 boolfill( char c, int len = -1 );
165 167
166 QCString copy()const; 168 QCString copy()const;
167 169
168 QCString &sprintf( const char *format, ... ); 170 QCString &sprintf( const char *format, ... );
169 171
170 int find( char c, int index=0, bool cs=TRUE ) const; 172 int find( char c, int index=0, bool cs=TRUE ) const;
171 int find( const char *str, int index=0, bool cs=TRUE ) const; 173 int find( const char *str, int index=0, bool cs=TRUE ) const;
172#ifndef QT_NO_REGEXP 174#ifndef QT_NO_REGEXP
173 int find( const QRegExp &, int index=0 ) const; 175 int find( const QRegExp &, int index=0 ) const;
174#endif 176#endif
175 int findRev( char c, int index=-1, bool cs=TRUE) const; 177 int findRev( char c, int index=-1, bool cs=TRUE) const;
176 int findRev( const char *str, int index=-1, bool cs=TRUE) const; 178 int findRev( const char *str, int index=-1, bool cs=TRUE) const;
177#ifndef QT_NO_REGEXP_CAPTURE 179#ifndef QT_NO_REGEXP_CAPTURE
178 int findRev( const QRegExp &, int index=-1 ) const; 180 int findRev( const QRegExp &, int index=-1 ) const;
179#endif 181#endif
180 int contains( char c, bool cs=TRUE ) const; 182 int contains( char c, bool cs=TRUE ) const;
181 int contains( const char *str, bool cs=TRUE ) const; 183 int contains( const char *str, bool cs=TRUE ) const;
182#ifndef QT_NO_REGEXP 184#ifndef QT_NO_REGEXP
183 int contains( const QRegExp & ) const; 185 int contains( const QRegExp & ) const;
184#endif 186#endif
185 QCStringleft( uint len ) const; 187 QCStringleft( uint len ) const;
186 QCStringright( uint len ) const; 188 QCStringright( uint len ) const;
187 QCStringmid( uint index, uint len=0xffffffff) const; 189 QCStringmid( uint index, uint len=0xffffffff) const;
188 190
189 QCStringleftJustify( uint width, char fill=' ', bool trunc=FALSE)const; 191 QCStringleftJustify( uint width, char fill=' ', bool trunc=FALSE)const;
190 QCStringrightJustify( uint width, char fill=' ',bool trunc=FALSE)const; 192 QCStringrightJustify( uint width, char fill=' ',bool trunc=FALSE)const;
191 193
192 QCStringlower() const; 194 QCStringlower() const;
193 QCStringupper() const; 195 QCStringupper() const;
194 196
195 QCString stripWhiteSpace()const; 197 QCString stripWhiteSpace()const;
196 QCString simplifyWhiteSpace()const; 198 QCString simplifyWhiteSpace()const;
197 199
198 QCString &insert( uint index, const char * ); 200 QCString &insert( uint index, const char * );
199 QCString &insert( uint index, char ); 201 QCString &insert( uint index, char );
200 QCString &append( const char * ); 202 QCString &append( const char * );
201 QCString &prepend( const char * ); 203 QCString &prepend( const char * );
202 QCString &remove( uint index, uint len ); 204 QCString &remove( uint index, uint len );
203 QCString &replace( uint index, uint len, const char * ); 205 QCString &replace( uint index, uint len, const char * );
204#ifndef QT_NO_REGEXP 206#ifndef QT_NO_REGEXP
205 QCString &replace( const QRegExp &, const char * ); 207 QCString &replace( const QRegExp &, const char * );
206#endif 208#endif
207 QCString &replace( char c, const char *after ); 209 QCString &replace( char c, const char *after );
208 QCString &replace( const char *, const char * ); 210 QCString &replace( const char *, const char * );
209 QCString &replace( char, char ); 211 QCString &replace( char, char );
210 212
211 short toShort( bool *ok=0 )const; 213 short toShort( bool *ok=0 )const;
212 ushort toUShort( bool *ok=0 )const; 214 ushort toUShort( bool *ok=0 )const;
213 int toInt( bool *ok=0 )const; 215 int toInt( bool *ok=0 )const;
214 uint toUInt( bool *ok=0 )const; 216 uint toUInt( bool *ok=0 )const;
215 long toLong( bool *ok=0 )const; 217 long toLong( bool *ok=0 )const;
216 ulong toULong( bool *ok=0 )const; 218 ulong toULong( bool *ok=0 )const;
217 float toFloat( bool *ok=0 )const; 219 float toFloat( bool *ok=0 )const;
218 double toDouble( bool *ok=0 )const; 220 double toDouble( bool *ok=0 )const;
219 221
220 QCString &setStr( const char *s ); 222 QCString &setStr( const char *s );
221 QCString &setNum( short ); 223 QCString &setNum( short );
222 QCString &setNum( ushort ); 224 QCString &setNum( ushort );
223 QCString &setNum( int ); 225 QCString &setNum( int );
224 QCString &setNum( uint ); 226 QCString &setNum( uint );
225 QCString &setNum( long ); 227 QCString &setNum( long );
226 QCString &setNum( ulong ); 228 QCString &setNum( ulong );
227 QCString &setNum( float, char f='g', int prec=6 ); 229 QCString &setNum( float, char f='g', int prec=6 );
228 QCString &setNum( double, char f='g', int prec=6 ); 230 QCString &setNum( double, char f='g', int prec=6 );
229 231
230 boolsetExpand( uint index, char c ); 232 boolsetExpand( uint index, char c );
231 233
232 operator const char *() const; 234 operator const char *() const;
233 QCString &operator+=( const char *str ); 235 QCString &operator+=( const char *str );
234 QCString &operator+=( char c ); 236 QCString &operator+=( char c );
237private:
238 intfind( const char *str, int index, bool cs, uint l ) const;
235}; 239};
236 240
237 241
238/***************************************************************************** 242/*****************************************************************************
239 QCString stream functions 243 QCString stream functions
240 *****************************************************************************/ 244 *****************************************************************************/
241#ifndef QT_NO_DATASTREAM 245#ifndef QT_NO_DATASTREAM
242Q_EXPORT QDataStream &operator<<( QDataStream &, const QCString & ); 246Q_EXPORT QDataStream &operator<<( QDataStream &, const QCString & );
243Q_EXPORT QDataStream &operator>>( QDataStream &, QCString & ); 247Q_EXPORT QDataStream &operator>>( QDataStream &, QCString & );
244#endif 248#endif
245 249
246/***************************************************************************** 250/*****************************************************************************
247 QCString inline functions 251 QCString inline functions
248 *****************************************************************************/ 252 *****************************************************************************/
249 253
250inline QCString &QCString::operator=( const QCString &s ) 254inline QCString &QCString::operator=( const QCString &s )
251{ return (QCString&)assign( s ); } 255{ return (QCString&)assign( s ); }
252 256
253inline QCString &QCString::operator=( const char *str ) 257inline QCString &QCString::operator=( const char *str )
254{ return (QCString&)duplicate( str, qstrlen(str)+1 ); } 258{ return (QCString&)duplicate( str, qstrlen(str)+1 ); }
255 259
256inline bool QCString::isNull() const 260inline bool QCString::isNull() const
257{ return data() == 0; } 261{ return data() == 0; }
258 262
259inline bool QCString::isEmpty() const 263inline bool QCString::isEmpty() const
260{ return data() == 0 || *data() == '\0'; } 264{ return data() == 0 || *data() == '\0'; }
261 265
262inline uint QCString::length() const 266inline uint QCString::length() const
263{ return qstrlen( data() ); } 267{ return qstrlen( data() ); }
264 268
265inline bool QCString::truncate( uint pos ) 269inline bool QCString::truncate( uint pos )
266{ return resize(pos+1); } 270{ return resize(pos+1); }
267 271
268inline QCString QCString::copy() const 272inline QCString QCString::copy() const
269{ return QCString( data() ); } 273{ return QCString( data() ); }
270 274
271inline QCString &QCString::prepend( const char *s ) 275inline QCString &QCString::prepend( const char *s )
272{ return insert(0,s); } 276{ return insert(0,s); }
273 277
274inline QCString &QCString::append( const char *s ) 278inline QCString &QCString::append( const char *s )
275{ return operator+=(s); } 279{ return operator+=(s); }
276 280
277inline QCString &QCString::setNum( short n ) 281inline QCString &QCString::setNum( short n )
278{ return setNum((long)n); } 282{ return setNum((long)n); }
279 283
280inline QCString &QCString::setNum( ushort n ) 284inline QCString &QCString::setNum( ushort n )
281{ return setNum((ulong)n); } 285{ return setNum((ulong)n); }
282 286
283inline QCString &QCString::setNum( int n ) 287inline QCString &QCString::setNum( int n )
284{ return setNum((long)n); } 288{ return setNum((long)n); }
285 289
286inline QCString &QCString::setNum( uint n ) 290inline QCString &QCString::setNum( uint n )
287{ return setNum((ulong)n); } 291{ return setNum((ulong)n); }
288 292
289inline QCString &QCString::setNum( float n, char f, int prec ) 293inline QCString &QCString::setNum( float n, char f, int prec )
290{ return setNum((double)n,f,prec); } 294{ return setNum((double)n,f,prec); }
291 295
292inline QCString::operator const char *() const 296inline QCString::operator const char *() const
293{ return (const char *)data(); } 297{ return (const char *)data(); }
294 298
295 299
296/***************************************************************************** 300/*****************************************************************************
297 QCString non-member operators 301 QCString non-member operators
298 *****************************************************************************/ 302 *****************************************************************************/
299 303
300Q_EXPORT inline bool operator==( const QCString &s1, const QCString &s2 ) 304Q_EXPORT inline bool operator==( const QCString &s1, const QCString &s2 )
301{ return qstrcmp( s1.data(), s2.data() ) == 0; } 305{ return qstrcmp( s1.data(), s2.data() ) == 0; }
302 306
303Q_EXPORT inline bool operator==( const QCString &s1, const char *s2 ) 307Q_EXPORT inline bool operator==( const QCString &s1, const char *s2 )
304{ return qstrcmp( s1.data(), s2 ) == 0; } 308{ return qstrcmp( s1.data(), s2 ) == 0; }
305 309
306Q_EXPORT inline bool operator==( const char *s1, const QCString &s2 ) 310Q_EXPORT inline bool operator==( const char *s1, const QCString &s2 )
307{ return qstrcmp( s1, s2.data() ) == 0; } 311{ return qstrcmp( s1, s2.data() ) == 0; }
308 312
309Q_EXPORT inline bool operator!=( const QCString &s1, const QCString &s2 ) 313Q_EXPORT inline bool operator!=( const QCString &s1, const QCString &s2 )
310{ return qstrcmp( s1.data(), s2.data() ) != 0; } 314{ return qstrcmp( s1.data(), s2.data() ) != 0; }
311 315
312Q_EXPORT inline bool operator!=( const QCString &s1, const char *s2 ) 316Q_EXPORT inline bool operator!=( const QCString &s1, const char *s2 )
313{ return qstrcmp( s1.data(), s2 ) != 0; } 317{ return qstrcmp( s1.data(), s2 ) != 0; }
314 318
315Q_EXPORT inline bool operator!=( const char *s1, const QCString &s2 ) 319Q_EXPORT inline bool operator!=( const char *s1, const QCString &s2 )
316{ return qstrcmp( s1, s2.data() ) != 0; } 320{ return qstrcmp( s1, s2.data() ) != 0; }
317 321
318Q_EXPORT inline bool operator<( const QCString &s1, const QCString& s2 ) 322Q_EXPORT inline bool operator<( const QCString &s1, const QCString& s2 )
319{ return qstrcmp( s1.data(), s2.data() ) < 0; } 323{ return qstrcmp( s1.data(), s2.data() ) < 0; }
320 324
321Q_EXPORT inline bool operator<( const QCString &s1, const char *s2 ) 325Q_EXPORT inline bool operator<( const QCString &s1, const char *s2 )
322{ return qstrcmp( s1.data(), s2 ) < 0; } 326{ return qstrcmp( s1.data(), s2 ) < 0; }
323 327
324Q_EXPORT inline bool operator<( const char *s1, const QCString &s2 ) 328Q_EXPORT inline bool operator<( const char *s1, const QCString &s2 )
325{ return qstrcmp( s1, s2.data() ) < 0; } 329{ return qstrcmp( s1, s2.data() ) < 0; }
326 330
327Q_EXPORT inline bool operator<=( const QCString &s1, const QCString &s2 ) 331Q_EXPORT inline bool operator<=( const QCString &s1, const QCString &s2 )
328{ return qstrcmp( s1.data(), s2.data() ) <= 0; } 332{ return qstrcmp( s1.data(), s2.data() ) <= 0; }
329 333
330Q_EXPORT inline bool operator<=( const QCString &s1, const char *s2 ) 334Q_EXPORT inline bool operator<=( const QCString &s1, const char *s2 )
331{ return qstrcmp( s1.data(), s2 ) <= 0; } 335{ return qstrcmp( s1.data(), s2 ) <= 0; }
332 336
333Q_EXPORT inline bool operator<=( const char *s1, const QCString &s2 ) 337Q_EXPORT inline bool operator<=( const char *s1, const QCString &s2 )
334{ return qstrcmp( s1, s2.data() ) <= 0; } 338{ return qstrcmp( s1, s2.data() ) <= 0; }
335 339
336Q_EXPORT inline bool operator>( const QCString &s1, const QCString &s2 ) 340Q_EXPORT inline bool operator>( const QCString &s1, const QCString &s2 )
337{ return qstrcmp( s1.data(), s2.data() ) > 0; } 341{ return qstrcmp( s1.data(), s2.data() ) > 0; }
338 342
339Q_EXPORT inline bool operator>( const QCString &s1, const char *s2 ) 343Q_EXPORT inline bool operator>( const QCString &s1, const char *s2 )
340{ return qstrcmp( s1.data(), s2 ) > 0; } 344{ return qstrcmp( s1.data(), s2 ) > 0; }
341 345
342Q_EXPORT inline bool operator>( const char *s1, const QCString &s2 ) 346Q_EXPORT inline bool operator>( const char *s1, const QCString &s2 )
343{ return qstrcmp( s1, s2.data() ) > 0; } 347{ return qstrcmp( s1, s2.data() ) > 0; }
344 348
345Q_EXPORT inline bool operator>=( const QCString &s1, const QCString& s2 ) 349Q_EXPORT inline bool operator>=( const QCString &s1, const QCString& s2 )
346{ return qstrcmp( s1.data(), s2.data() ) >= 0; } 350{ return qstrcmp( s1.data(), s2.data() ) >= 0; }
347 351
348Q_EXPORT inline bool operator>=( const QCString &s1, const char *s2 ) 352Q_EXPORT inline bool operator>=( const QCString &s1, const char *s2 )
349{ return qstrcmp( s1.data(), s2 ) >= 0; } 353{ return qstrcmp( s1.data(), s2 ) >= 0; }
350 354
351Q_EXPORT inline bool operator>=( const char *s1, const QCString &s2 ) 355Q_EXPORT inline bool operator>=( const char *s1, const QCString &s2 )
352{ return qstrcmp( s1, s2.data() ) >= 0; } 356{ return qstrcmp( s1, s2.data() ) >= 0; }
353 357
354Q_EXPORT inline const QCString operator+( const QCString &s1, 358Q_EXPORT inline const QCString operator+( const QCString &s1,
355 const QCString &s2 ) 359 const QCString &s2 )
356{ 360{
357 QCString tmp( s1.data() ); 361 QCString tmp( s1.data() );
358 tmp += s2; 362 tmp += s2;
359 return tmp; 363 return tmp;
360} 364}
361 365
362Q_EXPORT inline const QCString operator+( const QCString &s1, const char *s2 ) 366Q_EXPORT inline const QCString operator+( const QCString &s1, const char *s2 )
363{ 367{
364 QCString tmp( s1.data() ); 368 QCString tmp( s1.data() );
365 tmp += s2; 369 tmp += s2;
366 return tmp; 370 return tmp;
367} 371}
368 372
369Q_EXPORT inline const QCString operator+( const char *s1, const QCString &s2 ) 373Q_EXPORT inline const QCString operator+( const char *s1, const QCString &s2 )
370{ 374{
371 QCString tmp( s1 ); 375 QCString tmp( s1 );
372 tmp += s2; 376 tmp += s2;
373 return tmp; 377 return tmp;
374} 378}
375 379
376Q_EXPORT inline const QCString operator+( const QCString &s1, char c2 ) 380Q_EXPORT inline const QCString operator+( const QCString &s1, char c2 )
377{ 381{
378 QCString tmp( s1.data() ); 382 QCString tmp( s1.data() );
379 tmp += c2; 383 tmp += c2;
380 return tmp; 384 return tmp;
381} 385}
382 386
383Q_EXPORT inline const QCString operator+( char c1, const QCString &s2 ) 387Q_EXPORT inline const QCString operator+( char c1, const QCString &s2 )
384{ 388{
385 QCString tmp; 389 QCString tmp;
386 tmp += c1; 390 tmp += c1;
387 tmp += s2; 391 tmp += s2;
388 return tmp; 392 return tmp;
389} 393}
390 394
395#ifdef QT_QWINEXPORT
396#include <qwinexport.h>
397#endif /* QT_QWINEXPORT */
391#endif // QCSTRING_H 398#endif // QCSTRING_H
diff --git a/qmake/include/qdict.h b/qmake/include/qdict.h
index 04ae7bf..d8943ad 100644
--- a/qmake/include/qdict.h
+++ b/qmake/include/qdict.h
@@ -1,118 +1,122 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QDict template class 4** Definition of QDict template class
5** 5**
6** Created : 920821 6** Created : 920821
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QDICT_H 38#ifndef QDICT_H
39#define QDICT_H 39#define QDICT_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qgdict.h" 42#include "qgdict.h"
43#endif // QT_H 43#endif // QT_H
44 44
45template<class type> 45template<class type>
46class QDict 46class QDict
47#ifdef Q_QDOC 47#ifdef Q_QDOC
48 : public QPtrCollection 48 : public QPtrCollection
49#else 49#else
50 : public QGDict 50 : public QGDict
51#endif 51#endif
52{ 52{
53public: 53public:
54 QDict( int size = 17, bool caseSensitive = TRUE ) 54 QDict( int size = 17, bool caseSensitive = TRUE )
55 : QGDict( size, StringKey, caseSensitive, FALSE ) { } 55 : QGDict( size, StringKey, caseSensitive, FALSE ) { }
56 QDict( const QDict<type> &d ) : QGDict( d ) { } 56 QDict( const QDict<type> &d ) : QGDict( d ) { }
57 ~QDict() { clear(); } 57 ~QDict() { clear(); }
58 QDict<type> &operator=(const QDict<type> &d) 58 QDict<type> &operator=(const QDict<type> &d)
59 { return (QDict<type>&)QGDict::operator=(d); } 59 { return (QDict<type>&)QGDict::operator=(d); }
60 uint count() const { return QGDict::count(); } 60 uint count() const { return QGDict::count(); }
61 uint size() const { return QGDict::size(); } 61 uint size() const { return QGDict::size(); }
62 bool isEmpty() const { return QGDict::count() == 0; } 62 bool isEmpty() const { return QGDict::count() == 0; }
63 63
64 void insert( const QString &k, const type *d ) 64 void insert( const QString &k, const type *d )
65 { QGDict::look_string(k,(Item)d,1); } 65 { QGDict::look_string(k,(Item)d,1); }
66 void replace( const QString &k, const type *d ) 66 void replace( const QString &k, const type *d )
67 { QGDict::look_string(k,(Item)d,2); } 67 { QGDict::look_string(k,(Item)d,2); }
68 bool remove( const QString &k ){ return QGDict::remove_string(k); } 68 bool remove( const QString &k ){ return QGDict::remove_string(k); }
69 type *take( const QString &k ){ return (type *)QGDict::take_string(k); } 69 type *take( const QString &k ){ return (type *)QGDict::take_string(k); }
70 type *find( const QString &k ) const 70 type *find( const QString &k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); } 71 { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
72 type *operator[]( const QString &k ) const 72 type *operator[]( const QString &k ) const
73 { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); } 73 { return (type *)((QGDict*)this)->QGDict::look_string(k,0,0); }
74 74
75 void clear() { QGDict::clear(); } 75 void clear() { QGDict::clear(); }
76 void resize( uint n ) { QGDict::resize(n); } 76 void resize( uint n ) { QGDict::resize(n); }
77 void statistics() const { QGDict::statistics(); } 77 void statistics() const { QGDict::statistics(); }
78 78
79#ifdef Q_QDOC 79#ifdef Q_QDOC
80protected: 80protected:
81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & ); 81 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const; 82 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
83#endif 83#endif
84 84
85private: 85private:
86 void deleteItem( Item d ); 86 void deleteItem( Item d );
87}; 87};
88 88
89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) 89#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
90template<> inline void QDict<void>::deleteItem( Item ) 90template<> inline void QDict<void>::deleteItem( Item )
91{ 91{
92} 92}
93#endif 93#endif
94 94
95template<class type> inline void QDict<type>::deleteItem( QPtrCollection::Item d ) 95template<class type> inline void QDict<type>::deleteItem( QPtrCollection::Item d )
96{ 96{
97 if ( del_item ) delete (type *)d; 97 if ( del_item ) delete (type *)d;
98} 98}
99 99
100template<class type> 100template<class type>
101class QDictIterator : public QGDictIterator 101class QDictIterator : public QGDictIterator
102{ 102{
103public: 103public:
104 QDictIterator(const QDict<type> &d) : QGDictIterator((QGDict &)d) { } 104 QDictIterator(const QDict<type> &d) : QGDictIterator((QGDict &)d) { }
105 ~QDictIterator() {} 105 ~QDictIterator() {}
106 uint count() const { return dict->count(); } 106 uint count() const { return dict->count(); }
107 bool isEmpty() const { return dict->count() == 0; } 107 bool isEmpty() const { return dict->count() == 0; }
108 type *toFirst() { return (type *)QGDictIterator::toFirst(); } 108 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
109 operator type *() const { return (type *)QGDictIterator::get(); } 109 operator type *() const { return (type *)QGDictIterator::get(); }
110 type *operator*() { return (type *)QGDictIterator::get(); } 110 type *operator*() { return (type *)QGDictIterator::get(); }
111 type *current() const { return (type *)QGDictIterator::get(); } 111 type *current() const { return (type *)QGDictIterator::get(); }
112 QString currentKey() const{ return QGDictIterator::getKeyString(); } 112 QString currentKey() const{ return QGDictIterator::getKeyString(); }
113 type *operator()() { return (type *)QGDictIterator::operator()(); } 113 type *operator()() { return (type *)QGDictIterator::operator()(); }
114 type *operator++() { return (type *)QGDictIterator::operator++(); } 114 type *operator++() { return (type *)QGDictIterator::operator++(); }
115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j); } 115 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j); }
116}; 116};
117 117
118#ifdef QT_QWINEXPORT
119#define Q_DEFINED_QDICT
120#include "qwinexport.h"
121#endif /* QT_QWINEXPORT */
118#endif // QDICT_H 122#endif // QDICT_H
diff --git a/qmake/include/qdir.h b/qmake/include/qdir.h
index 6e9f1ab..4b08b79 100644
--- a/qmake/include/qdir.h
+++ b/qmake/include/qdir.h
@@ -1,241 +1,242 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QDir class 4** Definition of QDir class
5** 5**
6** Created : 950427 6** Created : 950427
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QDIR_H 38#ifndef QDIR_H
39#define QDIR_H 39#define QDIR_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qglobal.h" 42#include "qglobal.h"
43#include "qstrlist.h" 43#include "qstrlist.h"
44#include "qfileinfo.h" 44#include "qfileinfo.h"
45#endif // QT_H 45#endif // QT_H
46 46
47 47
48#ifndef QT_NO_DIR 48#ifndef QT_NO_DIR
49typedef QPtrList<QFileInfo> QFileInfoList; 49typedef QPtrList<QFileInfo> QFileInfoList;
50typedef QPtrListIterator<QFileInfo> QFileInfoListIterator; 50typedef QPtrListIterator<QFileInfo> QFileInfoListIterator;
51class QStringList; 51class QStringList;
52 52
53 53
54class Q_EXPORT QDir 54class Q_EXPORT QDir
55{ 55{
56public: 56public:
57 enum FilterSpec { Dirs = 0x001, 57 enum FilterSpec { Dirs = 0x001,
58 Files = 0x002, 58 Files = 0x002,
59 Drives = 0x004, 59 Drives = 0x004,
60 NoSymLinks = 0x008, 60 NoSymLinks = 0x008,
61 All = 0x007, 61 All = 0x007,
62 TypeMask = 0x00F, 62 TypeMask = 0x00F,
63 63
64 Readable = 0x010, 64 Readable = 0x010,
65 Writable = 0x020, 65 Writable = 0x020,
66 Executable = 0x040, 66 Executable = 0x040,
67 RWEMask = 0x070, 67 RWEMask = 0x070,
68 68
69 Modified = 0x080, 69 Modified = 0x080,
70 Hidden = 0x100, 70 Hidden = 0x100,
71 System = 0x200, 71 System = 0x200,
72 AccessMask = 0x3F0, 72 AccessMask = 0x3F0,
73 73
74 DefaultFilter = -1 }; 74 DefaultFilter = -1 };
75 75
76 enum SortSpec { Name = 0x00, 76 enum SortSpec { Name = 0x00,
77 Time = 0x01, 77 Time = 0x01,
78 Size = 0x02, 78 Size = 0x02,
79 Unsorted = 0x03, 79 Unsorted = 0x03,
80 SortByMask = 0x03, 80 SortByMask = 0x03,
81 81
82 DirsFirst = 0x04, 82 DirsFirst = 0x04,
83 Reversed = 0x08, 83 Reversed = 0x08,
84 IgnoreCase = 0x10, 84 IgnoreCase = 0x10,
85 DefaultSort = -1 }; 85 DefaultSort = -1 };
86 86
87 QDir(); 87 QDir();
88 QDir( const QString &path, const QString &nameFilter = QString::null, 88 QDir( const QString &path, const QString &nameFilter = QString::null,
89 int sortSpec = Name | IgnoreCase, int filterSpec = All ); 89 int sortSpec = Name | IgnoreCase, int filterSpec = All );
90 QDir( const QDir & ); 90 QDir( const QDir & );
91 91
92 virtual ~QDir(); 92 virtual ~QDir();
93 93
94 QDir &operator=( const QDir & ); 94 QDir &operator=( const QDir & );
95 QDir &operator=( const QString &path ); 95 QDir &operator=( const QString &path );
96 96
97 virtual void setPath( const QString &path ); 97 virtual void setPath( const QString &path );
98 virtual QString path() const; 98 virtual QString path() const;
99 virtual QString absPath()const; 99 virtual QString absPath()const;
100 virtual QString canonicalPath()const; 100 virtual QString canonicalPath()const;
101 101
102 virtual QString dirName() const; 102 virtual QString dirName() const;
103 virtual QString filePath( const QString &fileName, 103 virtual QString filePath( const QString &fileName,
104 bool acceptAbsPath = TRUE ) const; 104 bool acceptAbsPath = TRUE ) const;
105 virtual QString absFilePath( const QString &fileName, 105 virtual QString absFilePath( const QString &fileName,
106 bool acceptAbsPath = TRUE ) const; 106 bool acceptAbsPath = TRUE ) const;
107 107
108 static QString convertSeparators( const QString &pathName ); 108 static QString convertSeparators( const QString &pathName );
109 109
110 virtual bool cd( const QString &dirName, bool acceptAbsPath = TRUE ); 110 virtual bool cd( const QString &dirName, bool acceptAbsPath = TRUE );
111 virtual bool cdUp(); 111 virtual bool cdUp();
112 112
113 QStringnameFilter() const; 113 QStringnameFilter() const;
114 virtual void setNameFilter( const QString &nameFilter ); 114 virtual void setNameFilter( const QString &nameFilter );
115 FilterSpec filter() const; 115 FilterSpec filter() const;
116 virtual void setFilter( int filterSpec ); 116 virtual void setFilter( int filterSpec );
117 SortSpec sorting() const; 117 SortSpec sorting() const;
118 virtual void setSorting( int sortSpec ); 118 virtual void setSorting( int sortSpec );
119 119
120 boolmatchAllDirs() const; 120 boolmatchAllDirs() const;
121 virtual void setMatchAllDirs( bool ); 121 virtual void setMatchAllDirs( bool );
122 122
123 uint count() const; 123 uint count() const;
124 QStringoperator[]( int ) const; 124 QStringoperator[]( int ) const;
125 125
126 virtual QStrList encodedEntryList( int filterSpec = DefaultFilter, 126 virtual QStrList encodedEntryList( int filterSpec = DefaultFilter,
127 int sortSpec = DefaultSort ) const; 127 int sortSpec = DefaultSort ) const;
128 virtual QStrList encodedEntryList( const QString &nameFilter, 128 virtual QStrList encodedEntryList( const QString &nameFilter,
129 int filterSpec = DefaultFilter, 129 int filterSpec = DefaultFilter,
130 int sortSpec = DefaultSort ) const; 130 int sortSpec = DefaultSort ) const;
131 virtual QStringList entryList( int filterSpec = DefaultFilter, 131 virtual QStringList entryList( int filterSpec = DefaultFilter,
132 int sortSpec = DefaultSort ) const; 132 int sortSpec = DefaultSort ) const;
133 virtual QStringList entryList( const QString &nameFilter, 133 virtual QStringList entryList( const QString &nameFilter,
134 int filterSpec = DefaultFilter, 134 int filterSpec = DefaultFilter,
135 int sortSpec = DefaultSort ) const; 135 int sortSpec = DefaultSort ) const;
136 136
137 virtual const QFileInfoList *entryInfoList( int filterSpec = DefaultFilter, 137 virtual const QFileInfoList *entryInfoList( int filterSpec = DefaultFilter,
138 int sortSpec = DefaultSort ) const; 138 int sortSpec = DefaultSort ) const;
139 virtual const QFileInfoList *entryInfoList( const QString &nameFilter, 139 virtual const QFileInfoList *entryInfoList( const QString &nameFilter,
140 int filterSpec = DefaultFilter, 140 int filterSpec = DefaultFilter,
141 int sortSpec = DefaultSort ) const; 141 int sortSpec = DefaultSort ) const;
142 142
143 static const QFileInfoList *drives(); 143 static const QFileInfoList *drives();
144 144
145 virtual bool mkdir( const QString &dirName, 145 virtual bool mkdir( const QString &dirName,
146 bool acceptAbsPath = TRUE ) const; 146 bool acceptAbsPath = TRUE ) const;
147 virtual bool rmdir( const QString &dirName, 147 virtual bool rmdir( const QString &dirName,
148 bool acceptAbsPath = TRUE ) const; 148 bool acceptAbsPath = TRUE ) const;
149 149
150 virtual bool isReadable() const; 150 virtual bool isReadable() const;
151 virtual bool exists() const; 151 virtual bool exists() const;
152 virtual bool isRoot() const; 152 virtual bool isRoot() const;
153 153
154 virtual bool isRelative() const; 154 virtual bool isRelative() const;
155 virtual void convertToAbs(); 155 virtual void convertToAbs();
156 156
157 virtual bool operator==( const QDir & ) const; 157 virtual bool operator==( const QDir & ) const;
158 virtual bool operator!=( const QDir & ) const; 158 virtual bool operator!=( const QDir & ) const;
159 159
160 virtual bool remove( const QString &fileName, 160 virtual bool remove( const QString &fileName,
161 bool acceptAbsPath = TRUE ); 161 bool acceptAbsPath = TRUE );
162 virtual bool rename( const QString &name, const QString &newName, 162 virtual bool rename( const QString &name, const QString &newName,
163 bool acceptAbsPaths = TRUE ); 163 bool acceptAbsPaths = TRUE );
164 virtual bool exists( const QString &name, 164 virtual bool exists( const QString &name,
165 bool acceptAbsPath = TRUE ); 165 bool acceptAbsPath = TRUE );
166 166
167 static char separator(); 167 static char separator();
168 168
169 static bool setCurrent( const QString &path ); 169 static bool setCurrent( const QString &path );
170 static QDir current(); 170 static QDir current();
171 static QDir home(); 171 static QDir home();
172 static QDir root(); 172 static QDir root();
173 static QString currentDirPath(); 173 static QString currentDirPath();
174 static QString homeDirPath(); 174 static QString homeDirPath();
175 static QString rootDirPath(); 175 static QString rootDirPath();
176 176
177 static bool match( const QStringList &filters, const QString &fileName ); 177 static bool match( const QStringList &filters, const QString &fileName );
178 static bool match( const QString &filter, const QString &fileName ); 178 static bool match( const QString &filter, const QString &fileName );
179 static QString cleanDirPath( const QString &dirPath ); 179 static QString cleanDirPath( const QString &dirPath );
180 static bool isRelativePath( const QString &path ); 180 static bool isRelativePath( const QString &path );
181 void refresh() const;
181 182
182private: 183private:
183#ifdef Q_OS_MAC 184#ifdef Q_OS_MAC
184 typedef struct FSSpec FSSpec; 185 typedef struct FSSpec FSSpec;
185 static FSSpec *make_spec(const QString &); 186 static FSSpec *make_spec(const QString &);
186#endif 187#endif
187 void init(); 188 void init();
188 virtual bool readDirEntries( const QString &nameFilter, 189 virtual bool readDirEntries( const QString &nameFilter,
189 int FilterSpec, int SortSpec ); 190 int FilterSpec, int SortSpec );
190 191
191 static void slashify ( QString &); 192 static void slashify( QString & );
192 193
193 QStringdPath; 194 QStringdPath;
194 QStringList *fList; 195 QStringList *fList;
195 QFileInfoList *fiList; 196 QFileInfoList *fiList;
196 QStringnameFilt; 197 QStringnameFilt;
197 FilterSpecfiltS; 198 FilterSpecfiltS;
198 SortSpecsortS; 199 SortSpecsortS;
199 uint dirty: 1; 200 uint dirty: 1;
200 uintallDirs : 1; 201 uintallDirs : 1;
201}; 202};
202 203
203 204
204inline QString QDir::path() const 205inline QString QDir::path() const
205{ 206{
206 return dPath; 207 return dPath;
207} 208}
208 209
209inline QString QDir::nameFilter() const 210inline QString QDir::nameFilter() const
210{ 211{
211 return nameFilt; 212 return nameFilt;
212} 213}
213 214
214inline QDir::FilterSpec QDir::filter() const 215inline QDir::FilterSpec QDir::filter() const
215{ 216{
216 return filtS; 217 return filtS;
217} 218}
218 219
219inline QDir::SortSpec QDir::sorting() const 220inline QDir::SortSpec QDir::sorting() const
220{ 221{
221 return sortS; 222 return sortS;
222} 223}
223 224
224inline bool QDir::matchAllDirs() const 225inline bool QDir::matchAllDirs() const
225{ 226{
226 return allDirs; 227 return allDirs;
227} 228}
228 229
229inline bool QDir::operator!=( const QDir &d ) const 230inline bool QDir::operator!=( const QDir &d ) const
230{ 231{
231 return !(*this == d); 232 return !(*this == d);
232} 233}
233 234
234 235
235struct QDirSortItem { 236struct QDirSortItem {
236 QString filename_cache; 237 QString filename_cache;
237 QFileInfo* item; 238 QFileInfo* item;
238}; 239};
239 240
240#endif // QT_NO_DIR 241#endif // QT_NO_DIR
241#endif // QDIR_H 242#endif // QDIR_H
diff --git a/qmake/include/qfeatures.h b/qmake/include/qfeatures.h
index 57502f9..270a6de 100644
--- a/qmake/include/qfeatures.h
+++ b/qmake/include/qfeatures.h
@@ -1,589 +1,589 @@
1// All feature and their dependencies 1// All feature and their dependencies
2// 2//
3// This list is generated from $QTDIR/src/tools/qfeatures.txt 3// This list is generated from $QTDIR/src/tools/qfeatures.txt
4// 4//
5// Asynchronous I/O 5// Asynchronous I/O
6//#define QT_NO_ASYNC_IO 6//#define QT_NO_ASYNC_IO
7 7
8// Bezier curves 8// Bezier curves
9//#define QT_NO_BEZIER 9//#define QT_NO_BEZIER
10 10
11// Buttons 11// Buttons
12//#define QT_NO_BUTTON 12//#define QT_NO_BUTTON
13 13
14// Named colors 14// Named colors
15//#define QT_NO_COLORNAMES 15//#define QT_NO_COLORNAMES
16 16
17// Cursors 17// Cursors
18//#define QT_NO_CURSOR 18//#define QT_NO_CURSOR
19 19
20// QDataStream 20// QDataStream
21//#define QT_NO_DATASTREAM 21//#define QT_NO_DATASTREAM
22 22
23// QDate/QTime/QDateTime toString() and fromString() 23// QDate/QTime/QDateTime toString() and fromString()
24//#define QT_NO_DATESTRING 24//#define QT_NO_DATESTRING
25 25
26// Dialogs 26// Dialogs
27//#define QT_NO_DIALOG 27//#define QT_NO_DIALOG
28 28
29// QDirectPainter 29// QDirectPainter
30//#define QT_NO_DIRECTPAINTER 30//#define QT_NO_DIRECTPAINTER
31 31
32// Special widget effects (fading, scrolling) 32// Special widget effects (fading, scrolling)
33//#define QT_NO_EFFECTS 33//#define QT_NO_EFFECTS
34 34
35// Freetype font engine 35// Freetype font engine
36//#define QT_NO_FREETYPE 36//#define QT_NO_FREETYPE
37 37
38// Dither QImage to 1-bit image 38// Dither QImage to 1-bit image
39//#define QT_NO_IMAGE_DITHER_TO_1 39//#define QT_NO_IMAGE_DITHER_TO_1
40 40
41// QImage::createHeuristicMask() 41// QImage::createHeuristicMask()
42//#define QT_NO_IMAGE_HEURISTIC_MASK 42//#define QT_NO_IMAGE_HEURISTIC_MASK
43 43
44// QImage mirroring 44// QImage mirroring
45//#define QT_NO_IMAGE_MIRROR 45//#define QT_NO_IMAGE_MIRROR
46 46
47// Smooth QImage scaling 47// Smooth QImage scaling
48//#define QT_NO_IMAGE_SMOOTHSCALE 48//#define QT_NO_IMAGE_SMOOTHSCALE
49 49
50// TrueColor QImage 50// TrueColor QImage
51//#define QT_NO_IMAGE_TRUECOLOR 51//#define QT_NO_IMAGE_TRUECOLOR
52 52
53// Automatic widget layout 53// Automatic widget layout
54//#define QT_NO_LAYOUT 54//#define QT_NO_LAYOUT
55 55
56// Networking 56// Networking
57//#define QT_NO_NETWORK 57//#define QT_NO_NETWORK
58 58
59// Palettes 59// Palettes
60//#define QT_NO_PALETTE 60//#define QT_NO_PALETTE
61 61
62// Alpha-blended cursor 62// Alpha-blended cursor
63//#define QT_NO_QWS_ALPHA_CURSOR 63//#define QT_NO_QWS_ALPHA_CURSOR
64 64
65// 1-bit monochrome 65// 1-bit monochrome
66//#define QT_NO_QWS_DEPTH_1 66//#define QT_NO_QWS_DEPTH_1
67 67
68// 15 or 16-bit color 68// 15 or 16-bit color
69//#define QT_NO_QWS_DEPTH_16 69//#define QT_NO_QWS_DEPTH_16
70 70
71// 24-bit color 71// 24-bit color
72//#define QT_NO_QWS_DEPTH_24 72//#define QT_NO_QWS_DEPTH_24
73 73
74// 32-bit color 74// 32-bit color
75//#define QT_NO_QWS_DEPTH_32 75//#define QT_NO_QWS_DEPTH_32
76 76
77// 4-bit greyscale 77// 4-bit grayscale
78//#define QT_NO_QWS_DEPTH_4 78//#define QT_NO_QWS_DEPTH_4
79 79
80// 8-bit color 80// 8-bit color
81//#define QT_NO_QWS_DEPTH_8 81//#define QT_NO_QWS_DEPTH_8
82 82
83// 8-bit grayscale 83// 8-bit grayscale
84//#define QT_NO_QWS_DEPTH_8GRAYSCALE 84//#define QT_NO_QWS_DEPTH_8GRAYSCALE
85 85
86// Favour code size over graphics speed 86// Favour code size over graphics speed
87//#define QT_NO_QWS_GFX_SPEED 87//#define QT_NO_QWS_GFX_SPEED
88 88
89// Console keyboard 89// Console keyboard
90//#define QT_NO_QWS_KEYBOARD 90//#define QT_NO_QWS_KEYBOARD
91 91
92// Linux framebuffer 92// Linux framebuffer
93//#define QT_NO_QWS_LINUXFB 93//#define QT_NO_QWS_LINUXFB
94 94
95// Mach64 acceleration 95// Mach64 acceleration
96//#define QT_NO_QWS_MACH64 96//#define QT_NO_QWS_MACH64
97 97
98// Window Manager 98// Window Manager
99//#define QT_NO_QWS_MANAGER 99//#define QT_NO_QWS_MANAGER
100 100
101// Matrox MGA acceleration 101// Matrox MGA acceleration
102//#define QT_NO_QWS_MATROX 102//#define QT_NO_QWS_MATROX
103 103
104// Autodetecting mouse driver 104// Autodetecting mouse driver
105//#define QT_NO_QWS_MOUSE_AUTO 105//#define QT_NO_QWS_MOUSE_AUTO
106 106
107// Non-autodetecting mouse driver 107// Non-autodetecting mouse driver
108//#define QT_NO_QWS_MOUSE_MANUAL 108//#define QT_NO_QWS_MOUSE_MANUAL
109 109
110// Qt/Embedded window system properties. 110// Qt/Embedded window system properties.
111//#define QT_NO_QWS_PROPERTIES 111//#define QT_NO_QWS_PROPERTIES
112 112
113// Repeater display 113// Repeater display
114//#define QT_NO_QWS_REPEATER 114//#define QT_NO_QWS_REPEATER
115 115
116// Saving of fonts 116// Saving of fonts
117//#define QT_NO_QWS_SAVEFONTS 117//#define QT_NO_QWS_SAVEFONTS
118 118
119// Shadow frame buffer 119// Shadow frame buffer
120//#define QT_NO_QWS_SHADOWFB 120//#define QT_NO_QWS_SHADOWFB
121 121
122// Virtual frame buffer 122// Virtual frame buffer
123//#define QT_NO_QWS_VFB 123//#define QT_NO_QWS_VFB
124 124
125// 4-bit VGA 125// 4-bit VGA
126//#define QT_NO_QWS_VGA_16 126//#define QT_NO_QWS_VGA_16
127 127
128// Voodoo3 acceleration 128// Voodoo3 acceleration
129//#define QT_NO_QWS_VOODOO3 129//#define QT_NO_QWS_VOODOO3
130 130
131// Range-control widgets 131// Range-control widgets
132//#define QT_NO_RANGECONTROL 132//#define QT_NO_RANGECONTROL
133 133
134// Regular expression capture 134// Regular expression capture
135//#define QT_NO_REGEXP 135//#define QT_NO_REGEXP
136 136
137// QSignalMapper 137// QSignalMapper
138//#define QT_NO_SIGNALMAPPER 138//#define QT_NO_SIGNALMAPPER
139 139
140// Playing sounds 140// Playing sounds
141//#define QT_NO_SOUND 141//#define QT_NO_SOUND
142 142
143// Standard template library compatiblity 143// Standard template library compatiblity
144//#define QT_NO_STL 144//#define QT_NO_STL
145 145
146// QStringList 146// QStringList
147//#define QT_NO_STRINGLIST 147//#define QT_NO_STRINGLIST
148 148
149// Character set conversions 149// Character set conversions
150//#define QT_NO_TEXTCODEC 150//#define QT_NO_TEXTCODEC
151 151
152// QTextStream 152// QTextStream
153//#define QT_NO_TEXTSTREAM 153//#define QT_NO_TEXTSTREAM
154 154
155// Unicode property tables 155// Unicode property tables
156//#define QT_NO_UNICODETABLES 156//#define QT_NO_UNICODETABLES
157 157
158// Input validators 158// Input validators
159//#define QT_NO_VALIDATOR 159//#define QT_NO_VALIDATOR
160 160
161// QVariant 161// QVariant
162//#define QT_NO_VARIANT 162//#define QT_NO_VARIANT
163 163
164// Wheel-mouse events 164// Wheel-mouse events
165//#define QT_NO_WHEELEVENT 165//#define QT_NO_WHEELEVENT
166 166
167// QWMatrix 167// QWMatrix
168//#define QT_NO_WMATRIX 168//#define QT_NO_WMATRIX
169 169
170// Non-Unicode text conversions 170// Non-Unicode text conversions
171#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) 171#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC))
172#define QT_NO_CODECS 172#define QT_NO_CODECS
173#endif 173#endif
174 174
175// QCop IPC 175// QCop IPC
176#if !defined(QT_NO_COP) && (defined(QT_NO_DATASTREAM)) 176#if !defined(QT_NO_COP) && (defined(QT_NO_DATASTREAM))
177#define QT_NO_COP 177#define QT_NO_COP
178#endif 178#endif
179 179
180// QFontDatabase 180// QFontDatabase
181#if !defined(QT_NO_FONTDATABASE) && (defined(QT_NO_STRINGLIST)) 181#if !defined(QT_NO_FONTDATABASE) && (defined(QT_NO_STRINGLIST))
182#define QT_NO_FONTDATABASE 182#define QT_NO_FONTDATABASE
183#endif 183#endif
184 184
185// Image formats 185// Image formats
186#if !defined(QT_NO_IMAGEIO) && (defined(QT_NO_REGEXP)) 186#if !defined(QT_NO_IMAGEIO) && (defined(QT_NO_REGEXP))
187#define QT_NO_IMAGEIO 187#define QT_NO_IMAGEIO
188#endif 188#endif
189 189
190// 16-bit QImage 190// 16-bit QImage
191#if !defined(QT_NO_IMAGE_16_BIT) && (defined(QT_NO_IMAGE_TRUECOLOR)) 191#if !defined(QT_NO_IMAGE_16_BIT) && (defined(QT_NO_IMAGE_TRUECOLOR))
192#define QT_NO_IMAGE_16_BIT 192#define QT_NO_IMAGE_16_BIT
193#endif 193#endif
194 194
195// Image file text strings 195// Image file text strings
196#if !defined(QT_NO_IMAGE_TEXT) && (defined(QT_NO_STRINGLIST)) 196#if !defined(QT_NO_IMAGE_TEXT) && (defined(QT_NO_STRINGLIST))
197#define QT_NO_IMAGE_TEXT 197#define QT_NO_IMAGE_TEXT
198#endif 198#endif
199 199
200// Shared library wrapper 200// Shared library wrapper
201#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_REGEXP)) 201#if !defined(QT_NO_LIBRARY) && (defined(QT_NO_REGEXP))
202#define QT_NO_LIBRARY 202#define QT_NO_LIBRARY
203#endif 203#endif
204 204
205// Pixmap transformations 205// Pixmap transformations
206#if !defined(QT_NO_PIXMAP_TRANSFORMATION) && (defined(QT_NO_WMATRIX)) 206#if !defined(QT_NO_PIXMAP_TRANSFORMATION) && (defined(QT_NO_WMATRIX))
207#define QT_NO_PIXMAP_TRANSFORMATION 207#define QT_NO_PIXMAP_TRANSFORMATION
208#endif 208#endif
209 209
210// Convert UUID to/from string 210// Convert UUID to/from string
211#if !defined(QT_NO_QUUID_STRING) && (defined(QT_NO_STRINGLIST)) 211#if !defined(QT_NO_QUUID_STRING) && (defined(QT_NO_STRINGLIST))
212#define QT_NO_QUUID_STRING 212#define QT_NO_QUUID_STRING
213#endif 213#endif
214 214
215// The "BeOS" style 215// The "BeOS" style
216#if !defined(QT_NO_QWS_BEOS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) 216#if !defined(QT_NO_QWS_BEOS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
217#define QT_NO_QWS_BEOS_WM_STYLE 217#define QT_NO_QWS_BEOS_WM_STYLE
218#endif 218#endif
219 219
220// Visible cursor 220// Visible cursor
221#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR)) 221#if !defined(QT_NO_QWS_CURSOR) && (defined(QT_NO_CURSOR))
222#define QT_NO_QWS_CURSOR 222#define QT_NO_QWS_CURSOR
223#endif 223#endif
224 224
225// 32-bit color, BGR order 225// 32-bit color, BGR order
226#if !defined(QT_NO_QWS_DEPTH_32_BGR) && (defined(QT_NO_QWS_DEPTH_32)) 226#if !defined(QT_NO_QWS_DEPTH_32_BGR) && (defined(QT_NO_QWS_DEPTH_32))
227#define QT_NO_QWS_DEPTH_32_BGR 227#define QT_NO_QWS_DEPTH_32_BGR
228#endif 228#endif
229 229
230// The "Hydro" style 230// The "Hydro" style
231#if !defined(QT_NO_QWS_HYDRO_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) 231#if !defined(QT_NO_QWS_HYDRO_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
232#define QT_NO_QWS_HYDRO_WM_STYLE 232#define QT_NO_QWS_HYDRO_WM_STYLE
233#endif 233#endif
234 234
235// The "KDE2" style 235// The "KDE2" style
236#if !defined(QT_NO_QWS_KDE2_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) 236#if !defined(QT_NO_QWS_KDE2_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
237#define QT_NO_QWS_KDE2_WM_STYLE 237#define QT_NO_QWS_KDE2_WM_STYLE
238#endif 238#endif
239 239
240// The "KDE" style 240// The "KDE" style
241#if !defined(QT_NO_QWS_KDE_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) 241#if !defined(QT_NO_QWS_KDE_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
242#define QT_NO_QWS_KDE_WM_STYLE 242#define QT_NO_QWS_KDE_WM_STYLE
243#endif 243#endif
244 244
245// Multi-process architecture 245// Multi-process architecture
246#if !defined(QT_NO_QWS_MULTIPROCESS) && (defined(QT_NO_NETWORK)) 246#if !defined(QT_NO_QWS_MULTIPROCESS) && (defined(QT_NO_NETWORK))
247#define QT_NO_QWS_MULTIPROCESS 247#define QT_NO_QWS_MULTIPROCESS
248#endif 248#endif
249 249
250// Transformed frame buffer 250// Transformed frame buffer
251#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_LINUXFB)) 251#if !defined(QT_NO_QWS_TRANSFORMED) && (defined(QT_NO_QWS_LINUXFB))
252#define QT_NO_QWS_TRANSFORMED 252#define QT_NO_QWS_TRANSFORMED
253#endif 253#endif
254 254
255// Remote frame buffer (VNC) 255// Remote frame buffer (VNC)
256#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_NETWORK)) 256#if !defined(QT_NO_QWS_VNC) && (defined(QT_NO_NETWORK))
257#define QT_NO_QWS_VNC 257#define QT_NO_QWS_VNC
258#endif 258#endif
259 259
260// The "Windows" style 260// The "Windows" style
261#if !defined(QT_NO_QWS_WINDOWS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER)) 261#if !defined(QT_NO_QWS_WINDOWS_WM_STYLE) && (defined(QT_NO_QWS_MANAGER))
262#define QT_NO_QWS_WINDOWS_WM_STYLE 262#define QT_NO_QWS_WINDOWS_WM_STYLE
263#endif 263#endif
264 264
265// Regular expression anchors 265// Regular expression anchors
266#if !defined(QT_NO_REGEXP_ANCHOR_ALT) && (defined(QT_NO_REGEXP)) 266#if !defined(QT_NO_REGEXP_ANCHOR_ALT) && (defined(QT_NO_REGEXP))
267#define QT_NO_REGEXP_ANCHOR_ALT 267#define QT_NO_REGEXP_ANCHOR_ALT
268#endif 268#endif
269 269
270// Regular expression back-reference 270// Regular expression back-reference
271#if !defined(QT_NO_REGEXP_BACKREF) && (defined(QT_NO_REGEXP)) 271#if !defined(QT_NO_REGEXP_BACKREF) && (defined(QT_NO_REGEXP))
272#define QT_NO_REGEXP_BACKREF 272#define QT_NO_REGEXP_BACKREF
273#endif 273#endif
274 274
275// Regular expression character-class 275// Regular expression character-class
276#if !defined(QT_NO_REGEXP_CCLASS) && (defined(QT_NO_REGEXP)) 276#if !defined(QT_NO_REGEXP_CCLASS) && (defined(QT_NO_REGEXP))
277#define QT_NO_REGEXP_CCLASS 277#define QT_NO_REGEXP_CCLASS
278#endif 278#endif
279 279
280// Regular expression escape 280// Regular expression escape
281#if !defined(QT_NO_REGEXP_ESCAPE) && (defined(QT_NO_REGEXP)) 281#if !defined(QT_NO_REGEXP_ESCAPE) && (defined(QT_NO_REGEXP))
282#define QT_NO_REGEXP_ESCAPE 282#define QT_NO_REGEXP_ESCAPE
283#endif 283#endif
284 284
285// Regular expression interval 285// Regular expression interval
286#if !defined(QT_NO_REGEXP_INTERVAL) && (defined(QT_NO_REGEXP)) 286#if !defined(QT_NO_REGEXP_INTERVAL) && (defined(QT_NO_REGEXP))
287#define QT_NO_REGEXP_INTERVAL 287#define QT_NO_REGEXP_INTERVAL
288#endif 288#endif
289 289
290// Regular expression lookahead 290// Regular expression lookahead
291#if !defined(QT_NO_REGEXP_LOOKAHEAD) && (defined(QT_NO_REGEXP)) 291#if !defined(QT_NO_REGEXP_LOOKAHEAD) && (defined(QT_NO_REGEXP))
292#define QT_NO_REGEXP_LOOKAHEAD 292#define QT_NO_REGEXP_LOOKAHEAD
293#endif 293#endif
294 294
295// Regular expression optimization 295// Regular expression optimization
296#if !defined(QT_NO_REGEXP_OPTIM) && (defined(QT_NO_REGEXP)) 296#if !defined(QT_NO_REGEXP_OPTIM) && (defined(QT_NO_REGEXP))
297#define QT_NO_REGEXP_OPTIM 297#define QT_NO_REGEXP_OPTIM
298#endif 298#endif
299 299
300// Regular expression wildcard 300// Regular expression wildcard
301#if !defined(QT_NO_REGEXP_WILDCARD) && (defined(QT_NO_REGEXP)) 301#if !defined(QT_NO_REGEXP_WILDCARD) && (defined(QT_NO_REGEXP))
302#define QT_NO_REGEXP_WILDCARD 302#define QT_NO_REGEXP_WILDCARD
303#endif 303#endif
304 304
305// Semi-modal dialogs 305// Semi-modal dialogs
306#if !defined(QT_NO_SEMIMODAL) && (defined(QT_NO_DIALOG)) 306#if !defined(QT_NO_SEMIMODAL) && (defined(QT_NO_DIALOG))
307#define QT_NO_SEMIMODAL 307#define QT_NO_SEMIMODAL
308#endif 308#endif
309 309
310// Session management 310// Session management
311#if !defined(QT_NO_SESSIONMANAGER) && (defined(QT_NO_STRINGLIST)) 311#if !defined(QT_NO_SESSIONMANAGER) && (defined(QT_NO_STRINGLIST))
312#define QT_NO_SESSIONMANAGER 312#define QT_NO_SESSIONMANAGER
313#endif 313#endif
314 314
315// QString::sprintf() 315// QString::sprintf()
316#if !defined(QT_NO_SPRINTF) && (defined(QT_NO_REGEXP)) 316#if !defined(QT_NO_SPRINTF) && (defined(QT_NO_REGEXP))
317#define QT_NO_SPRINTF 317#define QT_NO_SPRINTF
318#endif 318#endif
319 319
320// Scaling and rotation 320// Scaling and rotation
321#if !defined(QT_NO_TRANSFORMATIONS) && (defined(QT_NO_WMATRIX)) 321#if !defined(QT_NO_TRANSFORMATIONS) && (defined(QT_NO_WMATRIX))
322#define QT_NO_TRANSFORMATIONS 322#define QT_NO_TRANSFORMATIONS
323#endif 323#endif
324 324
325// Translations via QObject::tr() 325// Translations via QObject::tr()
326#if !defined(QT_NO_TRANSLATION) && (defined(QT_NO_DATASTREAM)) 326#if !defined(QT_NO_TRANSLATION) && (defined(QT_NO_DATASTREAM))
327#define QT_NO_TRANSLATION 327#define QT_NO_TRANSLATION
328#endif 328#endif
329 329
330// Window icon and caption 330// Window icon and caption
331#if !defined(QT_NO_WIDGET_TOPEXTRA) && (defined(QT_NO_IMAGE_HEURISTIC_MASK)) 331#if !defined(QT_NO_WIDGET_TOPEXTRA) && (defined(QT_NO_IMAGE_HEURISTIC_MASK))
332#define QT_NO_WIDGET_TOPEXTRA 332#define QT_NO_WIDGET_TOPEXTRA
333#endif 333#endif
334 334
335// Keyboard accelerators and shortcuts 335// Keyboard accelerators and shortcuts
336#if !defined(QT_NO_ACCEL) && (defined(QT_NO_SPRINTF)) 336#if !defined(QT_NO_ACCEL) && (defined(QT_NO_SPRINTF))
337#define QT_NO_ACCEL 337#define QT_NO_ACCEL
338#endif 338#endif
339 339
340// Asynchronous image I/O 340// Asynchronous image I/O
341#if !defined(QT_NO_ASYNC_IMAGE_IO) && (defined(QT_NO_IMAGEIO)) 341#if !defined(QT_NO_ASYNC_IMAGE_IO) && (defined(QT_NO_IMAGEIO))
342#define QT_NO_ASYNC_IMAGE_IO 342#define QT_NO_ASYNC_IMAGE_IO
343#endif 343#endif
344 344
345// BDF font files 345// BDF font files
346#if !defined(QT_NO_BDF) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_STRINGLIST)) 346#if !defined(QT_NO_BDF) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_STRINGLIST))
347#define QT_NO_BDF 347#define QT_NO_BDF
348#endif 348#endif
349 349
350// QDir 350// QDir
351#if !defined(QT_NO_DIR) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP)) 351#if !defined(QT_NO_DIR) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP))
352#define QT_NO_DIR 352#define QT_NO_DIR
353#endif 353#endif
354 354
355// JPEG image I/O 355// JPEG image I/O
356#if !defined(QT_NO_IMAGEIO_JPEG) && (defined(QT_NO_IMAGEIO)) 356#if !defined(QT_NO_IMAGEIO_JPEG) && (defined(QT_NO_IMAGEIO))
357#define QT_NO_IMAGEIO_JPEG 357#define QT_NO_IMAGEIO_JPEG
358#endif 358#endif
359 359
360// MNG image I/O 360// MNG image I/O
361#if !defined(QT_NO_IMAGEIO_MNG) && (defined(QT_NO_IMAGEIO)) 361#if !defined(QT_NO_IMAGEIO_MNG) && (defined(QT_NO_IMAGEIO))
362#define QT_NO_IMAGEIO_MNG 362#define QT_NO_IMAGEIO_MNG
363#endif 363#endif
364 364
365// PNG image I/O 365// PNG image I/O
366#if !defined(QT_NO_IMAGEIO_PNG) && (defined(QT_NO_IMAGEIO)) 366#if !defined(QT_NO_IMAGEIO_PNG) && (defined(QT_NO_IMAGEIO))
367#define QT_NO_IMAGEIO_PNG 367#define QT_NO_IMAGEIO_PNG
368#endif 368#endif
369 369
370// PPM image I/O 370// PPM image I/O
371#if !defined(QT_NO_IMAGEIO_PPM) && (defined(QT_NO_IMAGEIO)) 371#if !defined(QT_NO_IMAGEIO_PPM) && (defined(QT_NO_IMAGEIO))
372#define QT_NO_IMAGEIO_PPM 372#define QT_NO_IMAGEIO_PPM
373#endif 373#endif
374 374
375// XBM image I/O 375// XBM image I/O
376#if !defined(QT_NO_IMAGEIO_XBM) && (defined(QT_NO_IMAGEIO)) 376#if !defined(QT_NO_IMAGEIO_XBM) && (defined(QT_NO_IMAGEIO))
377#define QT_NO_IMAGEIO_XBM 377#define QT_NO_IMAGEIO_XBM
378#endif 378#endif
379 379
380// Image transformations 380// Image transformations
381#if !defined(QT_NO_IMAGE_TRANSFORMATION) && (defined(QT_NO_PIXMAP_TRANSFORMATION)) 381#if !defined(QT_NO_IMAGE_TRANSFORMATION) && (defined(QT_NO_PIXMAP_TRANSFORMATION))
382#define QT_NO_IMAGE_TRANSFORMATION 382#define QT_NO_IMAGE_TRANSFORMATION
383#endif 383#endif
384 384
385// External process invocation. 385// External process invocation.
386#if !defined(QT_NO_PROCESS) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP)) 386#if !defined(QT_NO_PROCESS) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_REGEXP))
387#define QT_NO_PROCESS 387#define QT_NO_PROCESS
388#endif 388#endif
389 389
390// Regular expression capture 390// Regular expression capture
391#if !defined(QT_NO_REGEXP_CAPTURE) && (defined(QT_NO_REGEXP) || defined(QT_NO_STRINGLIST)) 391#if !defined(QT_NO_REGEXP_CAPTURE) && (defined(QT_NO_REGEXP) || defined(QT_NO_STRINGLIST))
392#define QT_NO_REGEXP_CAPTURE 392#define QT_NO_REGEXP_CAPTURE
393#endif 393#endif
394 394
395// Template classes in QVariant 395// Template classes in QVariant
396#if !defined(QT_NO_TEMPLATE_VARIANT) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST)) 396#if !defined(QT_NO_TEMPLATE_VARIANT) && (defined(QT_NO_VARIANT) || defined(QT_NO_STRINGLIST))
397#define QT_NO_TEMPLATE_VARIANT 397#define QT_NO_TEMPLATE_VARIANT
398#endif 398#endif
399 399
400// Month and day names in dates 400// Month and day names in dates
401#if !defined(QT_NO_TEXTDATE) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_DATESTRING)) 401#if !defined(QT_NO_TEXTDATE) && (defined(QT_NO_STRINGLIST) || defined(QT_NO_DATESTRING))
402#define QT_NO_TEXTDATE 402#define QT_NO_TEXTDATE
403#endif 403#endif
404 404
405// Drawing utility functions 405// Drawing utility functions
406#if !defined(QT_NO_DRAWUTIL) && (defined(QT_NO_SPRINTF) || defined(QT_NO_PALETTE)) 406#if !defined(QT_NO_DRAWUTIL) && (defined(QT_NO_SPRINTF) || defined(QT_NO_PALETTE))
407#define QT_NO_DRAWUTIL 407#define QT_NO_DRAWUTIL
408#endif 408#endif
409 409
410// BMP image I/O 410// BMP image I/O
411#if !defined(QT_NO_IMAGEIO_BMP) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_DATASTREAM)) 411#if !defined(QT_NO_IMAGEIO_BMP) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_DATASTREAM))
412#define QT_NO_IMAGEIO_BMP 412#define QT_NO_IMAGEIO_BMP
413#endif 413#endif
414 414
415// QPicture 415// QPicture
416#if !defined(QT_NO_PICTURE) && (defined(QT_NO_DATASTREAM) || defined(QT_NO_IMAGEIO)) 416#if !defined(QT_NO_PICTURE) && (defined(QT_NO_DATASTREAM) || defined(QT_NO_IMAGEIO))
417#define QT_NO_PICTURE 417#define QT_NO_PICTURE
418#endif 418#endif
419 419
420// Translations via QObject::trUtf8() 420// Translations via QObject::trUtf8()
421#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) 421#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC))
422#define QT_NO_TRANSLATION_UTF8 422#define QT_NO_TRANSLATION_UTF8
423#endif 423#endif
424 424
425// URL parser 425// URL parser
426#if !defined(QT_NO_URL) && (defined(QT_NO_DIR)) 426#if !defined(QT_NO_URL) && (defined(QT_NO_DIR))
427#define QT_NO_URL 427#define QT_NO_URL
428#endif 428#endif
429 429
430// Animated images 430// Animated images
431#if !defined(QT_NO_MOVIE) && (defined(QT_NO_ASYNC_IO) || defined(QT_NO_ASYNC_IMAGE_IO)) 431#if !defined(QT_NO_MOVIE) && (defined(QT_NO_ASYNC_IO) || defined(QT_NO_ASYNC_IMAGE_IO))
432#define QT_NO_MOVIE 432#define QT_NO_MOVIE
433#endif 433#endif
434 434
435// Persistent application settings 435// Persistent application settings
436#if !defined(QT_NO_SETTINGS) && (defined(QT_NO_DIR) || defined(QT_NO_TEXTSTREAM)) 436#if !defined(QT_NO_SETTINGS) && (defined(QT_NO_DIR) || defined(QT_NO_TEXTSTREAM))
437#define QT_NO_SETTINGS 437#define QT_NO_SETTINGS
438#endif 438#endif
439 439
440// QStyle 440// QStyle
441#if !defined(QT_NO_STYLE) && (defined(QT_NO_DRAWUTIL)) 441#if !defined(QT_NO_STYLE) && (defined(QT_NO_DRAWUTIL))
442#define QT_NO_STYLE 442#define QT_NO_STYLE
443#endif 443#endif
444 444
445// DNS 445// DNS
446#if !defined(QT_NO_DNS) && (defined(QT_NO_NETWORK) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF)) 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 447#define QT_NO_DNS
448#endif 448#endif
449 449
450// Framed widgets 450// Framed widgets
451#if !defined(QT_NO_FRAME) && (defined(QT_NO_STYLE)) 451#if !defined(QT_NO_FRAME) && (defined(QT_NO_STYLE))
452#define QT_NO_FRAME 452#define QT_NO_FRAME
453#endif 453#endif
454 454
455// QIconSet 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)) 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 457#define QT_NO_ICONSET
458#endif 458#endif
459 459
460// XPM image I/O 460// XPM image I/O
461#if !defined(QT_NO_IMAGEIO_XPM) && (defined(QT_NO_IMAGEIO) || defined(QT_NO_SPRINTF) || defined(QT_NO_TEXTSTREAM)) 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 462#define QT_NO_IMAGEIO_XPM
463#endif 463#endif
464 464
465// QSizeGrip 465// QSizeGrip
466#if !defined(QT_NO_SIZEGRIP) && (defined(QT_NO_STYLE)) 466#if !defined(QT_NO_SIZEGRIP) && (defined(QT_NO_STYLE))
467#define QT_NO_SIZEGRIP 467#define QT_NO_SIZEGRIP
468#endif 468#endif
469 469
470// Motif style 470// Motif style
471#if !defined(QT_NO_STYLE_MOTIF) && (defined(QT_NO_STYLE)) 471#if !defined(QT_NO_STYLE_MOTIF) && (defined(QT_NO_STYLE))
472#define QT_NO_STYLE_MOTIF 472#define QT_NO_STYLE_MOTIF
473#endif 473#endif
474 474
475// Windows style 475// Windows style
476#if !defined(QT_NO_STYLE_WINDOWS) && (defined(QT_NO_STYLE)) 476#if !defined(QT_NO_STYLE_WINDOWS) && (defined(QT_NO_STYLE))
477#define QT_NO_STYLE_WINDOWS 477#define QT_NO_STYLE_WINDOWS
478#endif 478#endif
479 479
480// Internal titlebar widget 480// Internal titlebar widget
481#if !defined(QT_NO_TITLEBAR) && (defined(QT_NO_STYLE)) 481#if !defined(QT_NO_TITLEBAR) && (defined(QT_NO_STYLE))
482#define QT_NO_TITLEBAR 482#define QT_NO_TITLEBAR
483#endif 483#endif
484 484
485// XML 485// XML
486#if !defined(QT_NO_XML) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC) || defined(QT_NO_REGEXP_CAPTURE)) 486#if !defined(QT_NO_XML) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC) || defined(QT_NO_REGEXP_CAPTURE))
487#define QT_NO_XML 487#define QT_NO_XML
488#endif 488#endif
489 489
490// Check-boxes 490// Check-boxes
491#if !defined(QT_NO_CHECKBOX) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) 491#if !defined(QT_NO_CHECKBOX) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE))
492#define QT_NO_CHECKBOX 492#define QT_NO_CHECKBOX
493#endif 493#endif
494 494
495// Dials 495// Dials
496#if !defined(QT_NO_DIAL) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) 496#if !defined(QT_NO_DIAL) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE))
497#define QT_NO_DIAL 497#define QT_NO_DIAL
498#endif 498#endif
499 499
500// QLabel 500// QLabel
501#if !defined(QT_NO_LABEL) && (defined(QT_NO_FRAME)) 501#if !defined(QT_NO_LABEL) && (defined(QT_NO_FRAME))
502#define QT_NO_LABEL 502#define QT_NO_LABEL
503#endif 503#endif
504 504
505// QLCDNumber 505// QLCDNumber
506#if !defined(QT_NO_LCDNUMBER) && (defined(QT_NO_FRAME)) 506#if !defined(QT_NO_LCDNUMBER) && (defined(QT_NO_FRAME))
507#define QT_NO_LCDNUMBER 507#define QT_NO_LCDNUMBER
508#endif 508#endif
509 509
510// MIME 510// MIME
511#if !defined(QT_NO_MIME) && (defined(QT_NO_DIR) || defined(QT_NO_IMAGEIO) || defined(QT_NO_TEXTCODEC)) 511#if !defined(QT_NO_MIME) && (defined(QT_NO_DIR) || defined(QT_NO_IMAGEIO) || defined(QT_NO_TEXTCODEC))
512#define QT_NO_MIME 512#define QT_NO_MIME
513#endif 513#endif
514 514
515// Printing 515// Printing
516#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_SPRINTF) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_DATESTRING)) 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 517#define QT_NO_PRINTER
518#endif 518#endif
519 519
520// Progress bars 520// Progress bars
521#if !defined(QT_NO_PROGRESSBAR) && (defined(QT_NO_FRAME)) 521#if !defined(QT_NO_PROGRESSBAR) && (defined(QT_NO_FRAME))
522#define QT_NO_PROGRESSBAR 522#define QT_NO_PROGRESSBAR
523#endif 523#endif
524 524
525// Radio-buttons 525// Radio-buttons
526#if !defined(QT_NO_RADIOBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)) 526#if !defined(QT_NO_RADIOBUTTON) && (defined(QT_NO_BUTTON) || defined(QT_NO_STYLE))
527#define QT_NO_RADIOBUTTON 527#define QT_NO_RADIOBUTTON
528#endif 528#endif
529 529
530// Internal resize handler 530// Internal resize handler
531#if !defined(QT_NO_RESIZEHANDLER) && (defined(QT_NO_FRAME)) 531#if !defined(QT_NO_RESIZEHANDLER) && (defined(QT_NO_FRAME))
532#define QT_NO_RESIZEHANDLER 532#define QT_NO_RESIZEHANDLER
533#endif 533#endif
534 534
535// Scroll bars 535// Scroll bars
536#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) 536#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE))
537#define QT_NO_SCROLLBAR 537#define QT_NO_SCROLLBAR
538#endif 538#endif
539 539
540// Sliders 540// Sliders
541#if !defined(QT_NO_SLIDER) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)) 541#if !defined(QT_NO_SLIDER) && (defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE))
542#define QT_NO_SLIDER 542#define QT_NO_SLIDER
543#endif 543#endif
544 544
545// Spinbox control widget 545// Spinbox control widget
546#if !defined(QT_NO_SPINWIDGET) && (defined(QT_NO_FRAME)) 546#if !defined(QT_NO_SPINWIDGET) && (defined(QT_NO_FRAME))
547#define QT_NO_SPINWIDGET 547#define QT_NO_SPINWIDGET
548#endif 548#endif
549 549
550// Status bars 550// Status bars
551#if !defined(QT_NO_STATUSBAR) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE)) 551#if !defined(QT_NO_STATUSBAR) && (defined(QT_NO_LAYOUT) || defined(QT_NO_STYLE))
552#define QT_NO_STATUSBAR 552#define QT_NO_STATUSBAR
553#endif 553#endif
554 554
555// Compact Windows style 555// Compact Windows style
556#if !defined(QT_NO_STYLE_COMPACT) && (defined(QT_NO_STYLE_WINDOWS)) 556#if !defined(QT_NO_STYLE_COMPACT) && (defined(QT_NO_STYLE_WINDOWS))
557#define QT_NO_STYLE_COMPACT 557#define QT_NO_STYLE_COMPACT
558#endif 558#endif
559 559
560// Interlace-friendly style 560// Interlace-friendly style
561#if !defined(QT_NO_STYLE_INTERLACE) && (defined(QT_NO_STYLE_MOTIF)) 561#if !defined(QT_NO_STYLE_INTERLACE) && (defined(QT_NO_STYLE_MOTIF))
562#define QT_NO_STYLE_INTERLACE 562#define QT_NO_STYLE_INTERLACE
563#endif 563#endif
564 564
565// Platinum style 565// Platinum style
566#if !defined(QT_NO_STYLE_PLATINUM) && (defined(QT_NO_STYLE_WINDOWS)) 566#if !defined(QT_NO_STYLE_PLATINUM) && (defined(QT_NO_STYLE_WINDOWS))
567#define QT_NO_STYLE_PLATINUM 567#define QT_NO_STYLE_PLATINUM
568#endif 568#endif
569 569
570// Widget stacks 570// Widget stacks
571#if !defined(QT_NO_WIDGETSTACK) && (defined(QT_NO_FRAME)) 571#if !defined(QT_NO_WIDGETSTACK) && (defined(QT_NO_FRAME))
572#define QT_NO_WIDGETSTACK 572#define QT_NO_WIDGETSTACK
573#endif 573#endif
574 574
575// Grid layout widgets 575// Grid layout widgets
576#if !defined(QT_NO_GRID) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME)) 576#if !defined(QT_NO_GRID) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME))
577#define QT_NO_GRID 577#define QT_NO_GRID
578#endif 578#endif
579 579
580// Group boxes 580// Group boxes
581#if !defined(QT_NO_GROUPBOX) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT)) 581#if !defined(QT_NO_GROUPBOX) && (defined(QT_NO_FRAME) || defined(QT_NO_LAYOUT))
582#define QT_NO_GROUPBOX 582#define QT_NO_GROUPBOX
583#endif 583#endif
584 584
585// Horizonal box layout widgets 585// Horizonal box layout widgets
586#if !defined(QT_NO_HBOX) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME)) 586#if !defined(QT_NO_HBOX) && (defined(QT_NO_LAYOUT) || defined(QT_NO_FRAME))
587#define QT_NO_HBOX 587#define QT_NO_HBOX
588#endif 588#endif
589 589
diff --git a/qmake/include/qgarray.h b/qmake/include/qgarray.h
index 12edea6..40720a6 100644
--- a/qmake/include/qgarray.h
+++ b/qmake/include/qgarray.h
@@ -1,121 +1,130 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QGArray class 4** Definition of QGArray class
5** 5**
6** Created : 930906 6** Created : 930906
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QGARRAY_H 38#ifndef QGARRAY_H
39#define QGARRAY_H 39#define QGARRAY_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qshared.h" 42#include "qshared.h"
43#endif // QT_H 43#endif // QT_H
44 44
45 45
46 class Q_EXPORT QGArray // generic array 46 class Q_EXPORT QGArray // generic array
47{ 47{
48friend class QBuffer; 48friend class QBuffer;
49public: 49public:
50 //### DO NOT USE THIS. IT IS PUBLIC BUT DO NOT USE IT IN NEW CODE. 50 //### DO NOT USE THIS. IT IS PUBLIC BUT DO NOT USE IT IN NEW CODE.
51 struct array_data : public QShared {// shared array 51 struct array_data : public QShared {// shared array
52 array_data(){ data=0; len=0; } 52 array_data():data(0),len(0)
53#ifdef QT_QGARRAY_SPEED_OPTIM
54 ,maxl(0)
55#endif
56 {}
53 char *data; // actual array data 57 char *data; // actual array data
54 uint len; 58 uint len;
59#ifdef QT_QGARRAY_SPEED_OPTIM
60 uint maxl;
61#endif
55 }; 62 };
56 QGArray(); 63 QGArray();
64 enum Optimization { MemOptim, SpeedOptim };
57protected: 65protected:
58 QGArray( int, int ); // dummy; does not alloc 66 QGArray( int, int ); // dummy; does not alloc
59 QGArray( int size ); // allocate 'size' bytes 67 QGArray( int size ); // allocate 'size' bytes
60 QGArray( const QGArray &a ); // shallow copy 68 QGArray( const QGArray &a ); // shallow copy
61 virtual ~QGArray(); 69 virtual ~QGArray();
62 70
63 QGArray &operator=( const QGArray &a ) { return assign( a ); } 71 QGArray &operator=( const QGArray &a ) { return assign( a ); }
64 72
65 virtual void detach(){ duplicate(*this); } 73 virtual void detach(){ duplicate(*this); }
66 74
67 // ### Qt 4.0: maybe provide two versions of data(), at(), etc. 75 // ### Qt 4.0: maybe provide two versions of data(), at(), etc.
68 char *data() const{ return shd->data; } 76 char *data() const{ return shd->data; }
69 uint nrefs() const{ return shd->count; } 77 uint nrefs() const{ return shd->count; }
70 uint size() const{ return shd->len; } 78 uint size() const{ return shd->len; }
71 boolisEqual( const QGArray &a ) const; 79 boolisEqual( const QGArray &a ) const;
72 80
81 boolresize( uint newsize, Optimization optim );
73 boolresize( uint newsize ); 82 boolresize( uint newsize );
74 83
75 boolfill( const char *d, int len, uint sz ); 84 boolfill( const char *d, int len, uint sz );
76 85
77 QGArray &assign( const QGArray &a ); 86 QGArray &assign( const QGArray &a );
78 QGArray &assign( const char *d, uint len ); 87 QGArray &assign( const char *d, uint len );
79 QGArray &duplicate( const QGArray &a ); 88 QGArray &duplicate( const QGArray &a );
80 QGArray &duplicate( const char *d, uint len ); 89 QGArray &duplicate( const char *d, uint len );
81 voidstore( const char *d, uint len ); 90 voidstore( const char *d, uint len );
82 91
83 array_data *sharedBlock() const { return shd; } 92 array_data *sharedBlock() const { return shd; }
84 voidsetSharedBlock( array_data *p ) { shd=(array_data*)p; } 93 voidsetSharedBlock( array_data *p ) { shd=(array_data*)p; }
85 94
86 QGArray &setRawData( const char *d, uint len ); 95 QGArray &setRawData( const char *d, uint len );
87 voidresetRawData( const char *d, uint len ); 96 voidresetRawData( const char *d, uint len );
88 97
89 int find( const char *d, uint index, uint sz ) const; 98 int find( const char *d, uint index, uint sz ) const;
90 int contains( const char *d, uint sz ) const; 99 int contains( const char *d, uint sz ) const;
91 100
92 voidsort( uint sz ); 101 voidsort( uint sz );
93 int bsearch( const char *d, uint sz ) const; 102 int bsearch( const char *d, uint sz ) const;
94 103
95 char *at( uint index ) const; 104 char *at( uint index ) const;
96 105
97 boolsetExpand( uint index, const char *d, uint sz ); 106 boolsetExpand( uint index, const char *d, uint sz );
98 107
99protected: 108protected:
100 virtual array_data *newData(); 109 virtual array_data *newData();
101 virtual void deleteData( array_data *p ); 110 virtual void deleteData( array_data *p );
102 111
103private: 112private:
104 static void msg_index( uint ); 113 static void msg_index( uint );
105 array_data *shd; 114 array_data *shd;
106}; 115};
107 116
108 117
109inline char *QGArray::at( uint index ) const 118inline char *QGArray::at( uint index ) const
110{ 119{
111#if defined(QT_CHECK_RANGE) 120#if defined(QT_CHECK_RANGE)
112 if ( index >= size() ) { 121 if ( index >= size() ) {
113 msg_index( index ); 122 msg_index( index );
114 index = 0; 123 index = 0;
115 } 124 }
116#endif 125#endif
117 return &shd->data[index]; 126 return &shd->data[index];
118} 127}
119 128
120 129
121#endif // QGARRAY_H 130#endif // QGARRAY_H
diff --git a/qmake/include/qglobal.h b/qmake/include/qglobal.h
index 13cff64..d212bff 100644
--- a/qmake/include/qglobal.h
+++ b/qmake/include/qglobal.h
@@ -1,1006 +1,1065 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Global type declarations and definitions 4** Global type declarations and definitions
5** 5**
6** Created : 920529 6** Created : 920529
7** 7**
8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QGLOBAL_H 38#ifndef QGLOBAL_H
39#define QGLOBAL_H 39#define QGLOBAL_H
40 40
41#define QT_VERSION_STR "3.1.0-b2" 41#define QT_VERSION_STR "3.1.2"
42/* 42/*
43 QT_VERSION is (major << 16) + (minor << 8) + patch. 43 QT_VERSION is (major << 16) + (minor << 8) + patch.
44 */ 44 */
45#define QT_VERSION 0x030100 45#define QT_VERSION 0x030102
46 46
47/* 47/*
48 The operating system, must be one of: (Q_OS_x) 48 The operating system, must be one of: (Q_OS_x)
49 49
50 MACX- Mac OS X 50 MACX- Mac OS X
51 MAC9- Mac OS 9 51 MAC9- Mac OS 9
52 MSDOS- MS-DOS and Windows 52 MSDOS- MS-DOS and Windows
53 OS2- OS/2 53 OS2- OS/2
54 OS2EMX- XFree86 on OS/2 (not PM) 54 OS2EMX- XFree86 on OS/2 (not PM)
55 WIN32- Win32 (Windows 95/98/ME and Windows NT/2000/XP) 55 WIN32- Win32 (Windows 95/98/ME and Windows NT/2000/XP)
56 CYGWIN- Cygwin 56 CYGWIN- Cygwin
57 SOLARIS- Sun Solaris 57 SOLARIS- Sun Solaris
58 HPUX- HP-UX 58 HPUX- HP-UX
59 ULTRIX- DEC Ultrix 59 ULTRIX- DEC Ultrix
60 LINUX- Linux 60 LINUX- Linux
61 FREEBSD- FreeBSD 61 FREEBSD- FreeBSD
62 NETBSD- NetBSD 62 NETBSD- NetBSD
63 OPENBSD- OpenBSD 63 OPENBSD- OpenBSD
64 BSDI- BSD/OS 64 BSDI- BSD/OS
65 IRIX- SGI Irix 65 IRIX- SGI Irix
66 OSF- HP Tru64 UNIX 66 OSF- HP Tru64 UNIX
67 SCO- SCO OpenServer 5 67 SCO- SCO OpenServer 5
68 UNIXWARE- UnixWare 7, Open UNIX 8 68 UNIXWARE- UnixWare 7, Open UNIX 8
69 AIX- AIX 69 AIX- AIX
70 HURD- GNU Hurd 70 HURD- GNU Hurd
71 DGUX- DG/UX 71 DGUX- DG/UX
72 RELIANT- Reliant UNIX 72 RELIANT- Reliant UNIX
73 DYNIX- DYNIX/ptx 73 DYNIX- DYNIX/ptx
74 QNX- QNX 74 QNX- QNX
75 QNX6- QNX RTP 6.1 75 QNX6- QNX RTP 6.1
76 LYNX- LynxOS 76 LYNX- LynxOS
77 BSD4- Any BSD 4.4 system 77 BSD4- Any BSD 4.4 system
78 UNIX- Any UNIX BSD/SYSV system 78 UNIX- Any UNIX BSD/SYSV system
79*/ 79*/
80 80
81#if defined(__APPLE__) && defined(__GNUC__) 81#if defined(__APPLE__) && defined(__GNUC__)
82# define Q_OS_MACX 82# define Q_OS_MACX
83#elif defined(__MACOSX__) 83#elif defined(__MACOSX__)
84# define Q_OS_MACX 84# define Q_OS_MACX
85#elif defined(macintosh) 85#elif defined(macintosh)
86# define Q_OS_MAC9 86# define Q_OS_MAC9
87#elif defined(__CYGWIN__) 87#elif defined(__CYGWIN__)
88# define Q_OS_CYGWIN 88# define Q_OS_CYGWIN
89#elif defined(MSDOS) || defined(_MSDOS) 89#elif defined(MSDOS) || defined(_MSDOS)
90# define Q_OS_MSDOS 90# define Q_OS_MSDOS
91#elif defined(__OS2__) 91#elif defined(__OS2__)
92# if defined(__EMX__) 92# if defined(__EMX__)
93# define Q_OS_OS2EMX 93# define Q_OS_OS2EMX
94# else 94# else
95# define Q_OS_OS2 95# define Q_OS_OS2
96# endif 96# endif
97#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) 97#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
98# define Q_OS_WIN32 98# define Q_OS_WIN32
99# define Q_OS_WIN64 99# define Q_OS_WIN64
100#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) 100#elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
101# define Q_OS_WIN32 101# define Q_OS_WIN32
102#elif defined(__MWERKS__) && defined(__INTEL__) 102#elif defined(__MWERKS__) && defined(__INTEL__)
103# define Q_OS_WIN32 103# define Q_OS_WIN32
104#elif defined(__sun) || defined(sun) 104#elif defined(__sun) || defined(sun)
105# define Q_OS_SOLARIS 105# define Q_OS_SOLARIS
106#elif defined(hpux) || defined(__hpux) 106#elif defined(hpux) || defined(__hpux)
107# define Q_OS_HPUX 107# define Q_OS_HPUX
108#elif defined(__ultrix) || defined(ultrix) 108#elif defined(__ultrix) || defined(ultrix)
109# define Q_OS_ULTRIX 109# define Q_OS_ULTRIX
110#elif defined(sinix) 110#elif defined(sinix)
111# define Q_OS_RELIANT 111# define Q_OS_RELIANT
112#elif defined(__linux__) || defined(__linux) 112#elif defined(__linux__) || defined(__linux)
113# define Q_OS_LINUX 113# define Q_OS_LINUX
114#elif defined(__FreeBSD__) 114#elif defined(__FreeBSD__)
115# define Q_OS_FREEBSD 115# define Q_OS_FREEBSD
116# define Q_OS_BSD4 116# define Q_OS_BSD4
117#elif defined(__NetBSD__) 117#elif defined(__NetBSD__)
118# define Q_OS_NETBSD 118# define Q_OS_NETBSD
119# define Q_OS_BSD4 119# define Q_OS_BSD4
120#elif defined(__OpenBSD__) 120#elif defined(__OpenBSD__)
121# define Q_OS_OPENBSD 121# define Q_OS_OPENBSD
122# define Q_OS_BSD4 122# define Q_OS_BSD4
123#elif defined(__bsdi__) 123#elif defined(__bsdi__)
124# define Q_OS_BSDI 124# define Q_OS_BSDI
125# define Q_OS_BSD4 125# define Q_OS_BSD4
126#elif defined(__sgi) 126#elif defined(__sgi)
127# define Q_OS_IRIX 127# define Q_OS_IRIX
128#elif defined(__osf__) 128#elif defined(__osf__)
129# define Q_OS_OSF 129# define Q_OS_OSF
130#elif defined(_AIX) 130#elif defined(_AIX)
131# define Q_OS_AIX 131# define Q_OS_AIX
132#elif defined(__Lynx__) 132#elif defined(__Lynx__)
133# define Q_OS_LYNX 133# define Q_OS_LYNX
134#elif defined(__GNU_HURD__) 134#elif defined(__GNU_HURD__)
135# define Q_OS_HURD 135# define Q_OS_HURD
136#elif defined(__DGUX__) 136#elif defined(__DGUX__)
137# define Q_OS_DGUX 137# define Q_OS_DGUX
138#elif defined(__QNXNTO__) 138#elif defined(__QNXNTO__)
139# define Q_OS_QNX6 139# define Q_OS_QNX6
140#elif defined(__QNX__) 140#elif defined(__QNX__)
141# define Q_OS_QNX 141# define Q_OS_QNX
142#elif defined(_SEQUENT_) 142#elif defined(_SEQUENT_)
143# define Q_OS_DYNIX 143# define Q_OS_DYNIX
144#elif defined(_SCO_DS) /* SCO OpenServer 5 */ 144#elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */
145# define Q_OS_SCO 145# define Q_OS_SCO
146#elif defined(__UNIXWARE__) /* UnixWare 7 + GCC, Open UNIX 8 + GCC */ 146#elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */
147# define Q_OS_UNIXWARE 147# define Q_OS_UNIXWARE
148# define Q_OS_UNIXWARE7 148# define Q_OS_UNIXWARE7
149#elif defined(__USLC__) /* UnixWare 7 + UDK, Open UNIX 8 + OUDK */ 149#elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */
150# define Q_OS_UNIXWARE 150# define Q_OS_UNIXWARE
151# define Q_OS_UNIXWARE7 151# define Q_OS_UNIXWARE7
152#else 152#else
153# error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com" 153# error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
154#endif 154#endif
155 155
156#if defined(Q_OS_MAC9) || defined(Q_OS_MACX) 156#if defined(Q_OS_MAC9) || defined(Q_OS_MACX)
157# define Q_OS_MAC 157# define Q_OS_MAC
158#endif 158#endif
159 159
160#if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 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 161# undef Q_OS_UNIX
162#elif !defined(Q_OS_UNIX) 162#elif !defined(Q_OS_UNIX)
163# define Q_OS_UNIX 163# define Q_OS_UNIX
164#endif 164#endif
165 165
166 166
167/* 167/*
168 The compiler, must be one of: (Q_CC_x) 168 The compiler, must be one of: (Q_CC_x)
169 169
170 SYM- Symantec C++ for both PC and Macintosh 170 SYM- Symantec C++ for both PC and Macintosh
171 MPW- MPW C++ 171 MPW- MPW C++
172 MWERKS- Metrowerks CodeWarrior 172 MWERKS- Metrowerks CodeWarrior
173 MSVC- Microsoft Visual C/C++ 173 MSVC- Microsoft Visual C/C++
174 BOR- Borland/Turbo C++ 174 BOR- Borland/Turbo C++
175 WAT- Watcom C++ 175 WAT- Watcom C++
176 GNU- GNU C++ 176 GNU- GNU C++
177 COMEAU- Comeau C++ 177 COMEAU- Comeau C++
178 EDG- Edison Design Group C++ 178 EDG- Edison Design Group C++
179 OC - CenterLine C++ 179 OC - CenterLine C++
180 SUN- Sun WorkShop, Forte Developer, or Sun ONE Studio C++ 180 SUN- Sun WorkShop, Forte Developer, or Sun ONE Studio C++
181 MIPS- MIPSpro C++ 181 MIPS- MIPSpro C++
182 DEC- DEC C++ 182 DEC- DEC C++
183 HP - HPUX C++ 183 HP - HPUX C++
184 HPACC- HPUX ANSI C++ 184 HPACC- HPUX ANSI C++
185 USLC- SCO OUDK, UDK, and UnixWare 2.X C++ 185 USLC- SCO OUDK, UDK, and UnixWare 2.X C++
186 CDS- Reliant C++ 186 CDS- Reliant C++
187 KAI- KAI C++ 187 KAI- KAI C++
188 INTEL- Intel C++ 188 INTEL- Intel C++
189 HIGHC- MetaWare High C/C++ 189 HIGHC- MetaWare High C/C++
190 PGI- Portland Group C++ 190 PGI- Portland Group C++
191 GHS- Green Hills Optimizing C++ Compilers 191 GHS- Green Hills Optimizing C++ Compilers
192 192
193 Should be sorted most to least authoritative. 193 Should be sorted most to least authoritative.
194*/ 194*/
195 195
196/* Symantec C++ is now Digital Mars */ 196/* Symantec C++ is now Digital Mars */
197#if defined(__DMC__) || defined(__SC__) 197#if defined(__DMC__) || defined(__SC__)
198# define Q_CC_SYM 198# define Q_CC_SYM
199/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */ 199/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
200# if defined(__SC__) && __SC__ < 0x750 200# if defined(__SC__) && __SC__ < 0x750
201# define Q_NO_EXPLICIT_KEYWORD 201# define Q_NO_EXPLICIT_KEYWORD
202# endif 202# endif
203# define Q_NO_USING_KEYWORD 203# define Q_NO_USING_KEYWORD
204# if !defined(_CPPUNWIND) 204# if !defined(_CPPUNWIND)
205# define Q_NO_EXCEPTIONS 205# define Q_NO_EXCEPTIONS
206# endif 206# endif
207 207
208#elif defined(applec) 208#elif defined(applec)
209# define Q_CC_MPW 209# define Q_CC_MPW
210# define Q_NO_BOOL_TYPE 210# define Q_NO_BOOL_TYPE
211# define Q_NO_EXPLICIT_KEYWORD 211# define Q_NO_EXPLICIT_KEYWORD
212# define Q_NO_USING_KEYWORD 212# define Q_NO_USING_KEYWORD
213 213
214#elif defined(__MWERKS__) 214#elif defined(__MWERKS__)
215# define Q_CC_MWERKS 215# define Q_CC_MWERKS
216/* "explicit" recognized since 4.0d1 */ 216/* "explicit" recognized since 4.0d1 */
217# define QMAC_PASCAL pascal 217# define QMAC_PASCAL pascal
218# define Q_NO_USING_KEYWORD /* ### check "using" status */ 218# define Q_NO_USING_KEYWORD /* ### check "using" status */
219 219
220#elif defined(_MSC_VER) 220#elif defined(_MSC_VER)
221# define Q_CC_MSVC 221# define Q_CC_MSVC
222/* proper support of bool for _MSC_VER >= 1100 */ 222/* proper support of bool for _MSC_VER >= 1100 */
223# define Q_CANNOT_DELETE_CONSTANT 223# define Q_CANNOT_DELETE_CONSTANT
224# define Q_INLINE_TEMPLATES inline 224# define Q_INLINE_TEMPLATES inline
225/* Visual C++.Net issues for _MSC_VER >= 1300 */ 225/* Visual C++.Net issues for _MSC_VER >= 1300 */
226# if _MSC_VER >= 1300 226# if _MSC_VER >= 1300
227# define Q_CC_MSVC_NET 227# define Q_CC_MSVC_NET
228# define Q_TYPENAME 228# if _MSC_VER < 1310
229# define Q_TYPENAME
230# endif
229# endif 231# endif
230# define Q_NO_USING_KEYWORD /* ### check "using" status */ 232# define Q_NO_USING_KEYWORD /* ### check "using" status */
231 233
232#elif defined(__BORLANDC__) || defined(__TURBOC__) 234#elif defined(__BORLANDC__) || defined(__TURBOC__)
233# define Q_CC_BOR 235# define Q_CC_BOR
234# if __BORLANDC__ < 0x502 236# if __BORLANDC__ < 0x502
235# define Q_NO_BOOL_TYPE 237# define Q_NO_BOOL_TYPE
236# define Q_NO_EXPLICIT_KEYWORD 238# define Q_NO_EXPLICIT_KEYWORD
237# endif 239# endif
238# define Q_NO_USING_KEYWORD /* ### check "using" status */ 240# define Q_NO_USING_KEYWORD /* ### check "using" status */
239 241
240#elif defined(__WATCOMC__) 242#elif defined(__WATCOMC__)
241# define Q_CC_WAT 243# define Q_CC_WAT
242# if defined(Q_OS_QNX4) 244# if defined(Q_OS_QNX4)
243/* compiler flags */ 245/* compiler flags */
244# define Q_TYPENAME 246# define Q_TYPENAME
245# define Q_NO_BOOL_TYPE 247# define Q_NO_BOOL_TYPE
246# define Q_CANNOT_DELETE_CONSTANT 248# define Q_CANNOT_DELETE_CONSTANT
247# define mutable 249# define mutable
248/* ??? */ 250/* ??? */
249# define Q_BROKEN_TEMPLATE_SPECIALIZATION 251# define Q_BROKEN_TEMPLATE_SPECIALIZATION
250/* no template classes in QVariant */ 252/* no template classes in QVariant */
251# define QT_NO_TEMPLATE_VARIANT 253# define QT_NO_TEMPLATE_VARIANT
252/* Wcc does not fill in functions needed by valuelists, maps, and 254/* Wcc does not fill in functions needed by valuelists, maps, and
253 valuestacks implicitly */ 255 valuestacks implicitly */
254# define Q_FULL_TEMPLATE_INSTANTIATION 256# define Q_FULL_TEMPLATE_INSTANTIATION
255/* can we just compare the structures? */ 257/* can we just compare the structures? */
256# define Q_FULL_TEMPLATE_INSTANTIATION_MEMCMP 258# define Q_FULL_TEMPLATE_INSTANTIATION_MEMCMP
257/* these are not useful to our customers */ 259/* these are not useful to our customers */
258# define QT_QWS_NO_SHM 260# define QT_QWS_NO_SHM
259# define QT_NO_QWS_MULTIPROCESS 261# define QT_NO_QWS_MULTIPROCESS
260# define QT_NO_SQL 262# define QT_NO_SQL
261# define QT_NO_QWS_CURSOR 263# define QT_NO_QWS_CURSOR
262# endif 264# endif
263 265
264#elif defined(__GNUC__) 266#elif defined(__GNUC__)
265# define Q_CC_GNU 267# define Q_CC_GNU
266# define Q_C_CALLBACKS 268# define Q_C_CALLBACKS
267# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7 269# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
268# define Q_FULL_TEMPLATE_INSTANTIATION 270# define Q_FULL_TEMPLATE_INSTANTIATION
269# endif 271# endif
270/* GCC 2.95 knows "using" but does not support it correctly */ 272/* GCC 2.95 knows "using" but does not support it correctly */
271# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 273# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
272# define Q_NO_USING_KEYWORD 274# define Q_NO_USING_KEYWORD
273# endif 275# endif
276/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
277# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
278# define Q_WRONG_SB_CTYPE_MACROS
279# endif
274# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP) 280# if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
275# define Q_PACKED __attribute__ ((packed)) 281# define Q_PACKED __attribute__ ((packed))
276# endif 282# endif
277# if !defined(__EXCEPTIONS) 283# if !defined(__EXCEPTIONS)
278# define Q_NO_EXCEPTIONS 284# define Q_NO_EXCEPTIONS
279# endif 285# endif
280 286
281/* IBM compiler versions are a bit messy. There are actually two products: 287/* 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 288 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 289 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: 290 match. This little table (I'm not sure it's accurate) should be helpful:
285 291
286 C++ product C product 292 C++ product C product
287 293
288 C Set 3.1 C Compiler 3.0 294 C Set 3.1 C Compiler 3.0
289 ... ... 295 ... ...
290 C++ Compiler 3.6.6 C Compiler 4.3 296 C++ Compiler 3.6.6 C Compiler 4.3
291 ... ... 297 ... ...
292 Visual Age C++ 4.0 ... 298 Visual Age C++ 4.0 ...
293 ... ... 299 ... ...
294 Visual Age C++ 5.0 C Compiler 5.0 300 Visual Age C++ 5.0 C Compiler 5.0
295 301
296 Now: 302 Now:
297 __xlC__ is the version of the C compiler in hexadecimal notation 303 __xlC__ is the version of the C compiler in hexadecimal notation
298 is only an approximation of the C++ compiler version 304 is only an approximation of the C++ compiler version
299 __IBMCPP__ is the version of the C++ compiler in decimal notation 305 __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 */ 306 but it is not defined on older compilers like C Set 3.1 */
301#elif defined(__xlC__) 307#elif defined(__xlC__)
302# define Q_CC_XLC 308# define Q_CC_XLC
303# define Q_FULL_TEMPLATE_INSTANTIATION 309# define Q_FULL_TEMPLATE_INSTANTIATION
304# if __xlC__ < 0x400 310# if __xlC__ < 0x400
305# define Q_NO_BOOL_TYPE 311# define Q_NO_BOOL_TYPE
306# define Q_NO_EXPLICIT_KEYWORD 312# define Q_NO_EXPLICIT_KEYWORD
307# define Q_NO_USING_KEYWORD 313# define Q_NO_USING_KEYWORD
308# define Q_TYPENAME 314# define Q_TYPENAME
309# define Q_INLINE_TEMPLATES inline 315# define Q_INLINE_TEMPLATES inline
310# define Q_BROKEN_TEMPLATE_SPECIALIZATION 316# define Q_BROKEN_TEMPLATE_SPECIALIZATION
311# define Q_CANNOT_DELETE_CONSTANT 317# define Q_CANNOT_DELETE_CONSTANT
312# endif 318# endif
313 319
314/* Older versions of DEC C++ do not define __EDG__ or __EDG - observed 320/* 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 321 on DEC C++ V5.5-004. New versions do define __EDG__ - observed on
316 Compaq C++ V6.3-002. 322 Compaq C++ V6.3-002.
317 This compiler is different enough from other EDG compilers to handle 323 This compiler is different enough from other EDG compilers to handle
318 it separately anyway. */ 324 it separately anyway. */
319#elif defined(__DECCXX) 325#elif defined(__DECCXX)
320# define Q_CC_DEC 326# define Q_CC_DEC
321/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older 327/* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
322 DEC C++ V5 compilers. */ 328 DEC C++ V5 compilers. */
323# if defined(__EDG__) 329# if defined(__EDG__)
324# define Q_CC_EDG 330# define Q_CC_EDG
325# endif 331# endif
326/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead 332/* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead
327 - observed on Compaq C++ V6.3-002. 333 - observed on Compaq C++ V6.3-002.
328 In any case versions prior to Compaq C++ V6.0-005 do not have bool. */ 334 In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
329# if !defined(_BOOL_EXISTS) 335# if !defined(_BOOL_EXISTS)
330# define Q_NO_BOOL_TYPE 336# define Q_NO_BOOL_TYPE
331# endif 337# endif
332/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */ 338/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
333# define Q_NO_USING_KEYWORD 339# define Q_NO_USING_KEYWORD
334/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on 340/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
335 DEC C++ V5.5-004. */ 341 DEC C++ V5.5-004. */
336# if __DECCXX_VER < 60060000 342# if __DECCXX_VER < 60060000
337# define Q_TYPENAME 343# define Q_TYPENAME
338# define Q_BROKEN_TEMPLATE_SPECIALIZATION 344# define Q_BROKEN_TEMPLATE_SPECIALIZATION
339# define Q_CANNOT_DELETE_CONSTANT 345# define Q_CANNOT_DELETE_CONSTANT
340# endif 346# endif
341/* avoid undefined symbol problems with out-of-line template members */ 347/* avoid undefined symbol problems with out-of-line template members */
342# define Q_INLINE_TEMPLATES inline 348# define Q_INLINE_TEMPLATES inline
343 349
344/* Compilers with EDG front end are similar. To detect them we test: 350/* 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 351 __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 */ 352 __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 */
347#elif defined(__EDG) || defined(__EDG__) 353#elif defined(__EDG) || defined(__EDG__)
348# define Q_CC_EDG 354# define Q_CC_EDG
349/* From the EDG documentation (does not seem to apply to Compaq C++): 355/* From the EDG documentation (does not seem to apply to Compaq C++):
350 _BOOL 356 _BOOL
351 Defined in C++ mode when bool is a keyword. The name of this 357 Defined in C++ mode when bool is a keyword. The name of this
352 predefined macro is specified by a configuration flag. _BOOL 358 predefined macro is specified by a configuration flag. _BOOL
353 is the default. 359 is the default.
354 __BOOL_DEFINED 360 __BOOL_DEFINED
355 Defined in Microsoft C++ mode when bool is a keyword. */ 361 Defined in Microsoft C++ mode when bool is a keyword. */
356# if !defined(_BOOL) && !defined(__BOOL_DEFINED) 362# if !defined(_BOOL) && !defined(__BOOL_DEFINED)
357# define Q_NO_BOOL_TYPE 363# define Q_NO_BOOL_TYPE
358# endif 364# endif
359 365
360/* The Portland Group compiler is based on EDG and does define __EDG__ */ 366/* The Portland Group compiler is based on EDG and does define __EDG__ */
361# if defined(__COMO__) 367# if defined(__COMO__)
362# define Q_CC_COMEAU 368# define Q_CC_COMEAU
363# define Q_C_CALLBACKS 369# define Q_C_CALLBACKS
364 370
365/* Using the `using' keyword avoids KAI C++ warnings */ 371/* Using the `using' keyword avoids KAI C++ warnings */
366# elif defined(__KCC) 372# elif defined(__KCC)
367# define Q_CC_KAI 373# define Q_CC_KAI
368# if !defined(_EXCEPTIONS) 374# if !defined(_EXCEPTIONS)
369# define Q_NO_EXCEPTIONS 375# define Q_NO_EXCEPTIONS
370# endif 376# endif
371 377
372/* Using the `using' keyword avoids Intel C++ warnings */ 378/* Using the `using' keyword avoids Intel C++ warnings */
373# elif defined(__INTEL_COMPILER) 379# elif defined(__INTEL_COMPILER)
374# define Q_CC_INTEL 380# define Q_CC_INTEL
375# if !defined(__EXCEPTIONS) 381# if !defined(__EXCEPTIONS)
376# define Q_NO_EXCEPTIONS 382# define Q_NO_EXCEPTIONS
377# endif 383# endif
378 384
379/* The Portland Group compiler is based on EDG and does define __EDG__ */ 385/* The Portland Group compiler is based on EDG and does define __EDG__ */
380# elif defined(__PGI) 386# elif defined(__PGI)
381# define Q_CC_PGI 387# define Q_CC_PGI
382# if !defined(__EXCEPTIONS) 388# if !defined(__EXCEPTIONS)
383# define Q_NO_EXCEPTIONS 389# define Q_NO_EXCEPTIONS
384# endif 390# endif
385 391
386/* Never tested! */ 392/* Never tested! */
387# elif defined(__ghs) 393# elif defined(__ghs)
388# define Q_CC_GHS 394# define Q_CC_GHS
389 395
390/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */ 396/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
391# elif defined(__USLC__) && defined(__SCO_VERSION__) 397# elif defined(__USLC__) && defined(__SCO_VERSION__)
392# define Q_CC_USLC 398# define Q_CC_USLC
399/* The latest UDK 7.1.1b does not need this, but previous versions do */
400# if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
401# define Q_INLINE_TEMPLATES inline
402# endif
393# define Q_NO_USING_KEYWORD /* ### check "using" status */ 403# define Q_NO_USING_KEYWORD /* ### check "using" status */
394 404
395/* Never tested! */ 405/* Never tested! */
396# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER) 406# elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
397# define Q_CC_OC 407# define Q_CC_OC
398# define Q_NO_USING_KEYWORD 408# define Q_NO_USING_KEYWORD
399 409
400/* CDS++ is not documented to define __EDG__ or __EDG in the Reliant 410/* CDS++ defines __EDG__ although this is not documented in the Reliant
401 documentation but we suppose it does, in any case it does follow 411 documentation. It also follows conventions like _BOOL and this documented */
402 conventions like _BOOL */
403# elif defined(sinix) 412# elif defined(sinix)
404# define Q_CC_CDS 413# define Q_CC_CDS
405# define Q_NO_USING_KEYWORD 414# define Q_NO_USING_KEYWORD
406# if defined(__cplusplus) && (__cplusplus < 2) /* Cfront C++ mode */ 415# if defined(__cplusplus) && (__cplusplus < 2) /* Cfront C++ mode */
407# define Q_NO_EXCEPTIONS 416# define Q_NO_EXCEPTIONS
408# endif 417# endif
409 418
410/* The MIPSpro compiler in o32 mode is based on EDG but disables features 419/* The MIPSpro compiler in o32 mode is based on EDG but disables features
411 such as template specialization nevertheless */ 420 such as template specialization nevertheless */
412# elif defined(__sgi) 421# elif defined(__sgi)
413# define Q_CC_MIPS 422# define Q_CC_MIPS
414# if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */ 423# if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */
415# define Q_TYPENAME 424# define Q_TYPENAME
416# define Q_BROKEN_TEMPLATE_SPECIALIZATION 425# define Q_BROKEN_TEMPLATE_SPECIALIZATION
417# define Q_STRICT_INLINING_RULES 426# define Q_STRICT_INLINING_RULES
427# define Q_NO_EXPLICIT_KEYWORD
428# define Q_INLINE_TEMPLATES inline
418# elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */ 429# elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */
419# define Q_TYPENAME 430# define Q_TYPENAME
420# define Q_BROKEN_TEMPLATE_SPECIALIZATION 431# define Q_BROKEN_TEMPLATE_SPECIALIZATION
421# endif 432# endif
422# define Q_NO_USING_KEYWORD /* ### check "using" status */ 433# define Q_NO_USING_KEYWORD /* ### check "using" status */
423# endif 434# endif
424 435
425/* The older UnixWare 2.X compiler? */ 436/* The older UnixWare 2.X compiler? */
426#elif defined(__USLC__) && !defined(__SCO_VERSION__) 437#elif defined(__USLC__)
427# define Q_CC_USLC 438# define Q_CC_USLC
439# define Q_TYPENAME
428# define Q_NO_BOOL_TYPE 440# define Q_NO_BOOL_TYPE
429# define Q_NO_EXPLICIT_KEYWORD 441# define Q_NO_EXPLICIT_KEYWORD
430# define Q_NO_USING_KEYWORD 442# define Q_NO_USING_KEYWORD
443# define Q_INLINE_TEMPLATES inline
431 444
432/* Never tested! */ 445/* Never tested! */
433#elif defined(__HIGHC__) 446#elif defined(__HIGHC__)
434# define Q_CC_HIGHC 447# define Q_CC_HIGHC
435 448
436#elif defined(__SUNPRO_CC) 449#elif defined(__SUNPRO_CC)
437# define Q_CC_SUN 450# define Q_CC_SUN
438/* 5.0 compiler or better 451/* 5.0 compiler or better
439 'bool' is enabled by default but can be disabled using -features=nobool 452 'bool' is enabled by default but can be disabled using -features=nobool
440 in which case _BOOL is not defined 453 in which case _BOOL is not defined
441 this is the default in 4.2 compatibility mode triggered by -compat=4 */ 454 this is the default in 4.2 compatibility mode triggered by -compat=4 */
442# if __SUNPRO_CC >= 0x500 455# if __SUNPRO_CC >= 0x500
443# if !defined(_BOOL) 456# if !defined(_BOOL)
444# define Q_NO_BOOL_TYPE 457# define Q_NO_BOOL_TYPE
445# endif 458# endif
446# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4) 459# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
447# define Q_NO_USING_KEYWORD 460# define Q_NO_USING_KEYWORD
448# endif 461# endif
449# define Q_C_CALLBACKS 462# define Q_C_CALLBACKS
450/* 4.2 compiler or older */ 463/* 4.2 compiler or older */
451# else 464# else
452# define Q_NO_BOOL_TYPE 465# define Q_NO_BOOL_TYPE
453# define Q_NO_EXPLICIT_KEYWORD 466# define Q_NO_EXPLICIT_KEYWORD
454# define Q_NO_USING_KEYWORD 467# define Q_NO_USING_KEYWORD
455# endif 468# endif
456 469
470/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
471 documentation but nevertheless uses EDG conventions like _BOOL */
472#elif defined(sinix)
473# define Q_CC_EDG
474# define Q_CC_CDS
475# if !defined(_BOOL)
476# define Q_NO_BOOL_TYPE
477# endif
478# define Q_BROKEN_TEMPLATE_SPECIALIZATION
479
457#elif defined(Q_OS_HPUX) 480#elif defined(Q_OS_HPUX)
458/* __HP_aCC was not defined in first aCC releases */ 481/* __HP_aCC was not defined in first aCC releases */
459# if defined(__HP_aCC) || __cplusplus >= 199707L 482# if defined(__HP_aCC) || __cplusplus >= 199707L
460# define Q_CC_HPACC 483# define Q_CC_HPACC
461# else 484# else
462# define Q_CC_HP 485# define Q_CC_HP
463# define Q_NO_BOOL_TYPE 486# define Q_NO_BOOL_TYPE
464# define Q_FULL_TEMPLATE_INSTANTIATION 487# define Q_FULL_TEMPLATE_INSTANTIATION
465# define Q_BROKEN_TEMPLATE_SPECIALIZATION 488# define Q_BROKEN_TEMPLATE_SPECIALIZATION
466# define Q_NO_EXPLICIT_KEYWORD 489# define Q_NO_EXPLICIT_KEYWORD
467# endif 490# endif
468# define Q_NO_USING_KEYWORD /* ### check "using" status */ 491# define Q_NO_USING_KEYWORD /* ### check "using" status */
469 492
470#else 493#else
471# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com" 494# error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
472#endif 495#endif
473 496
474#ifndef Q_PACKED 497#ifndef Q_PACKED
475# define Q_PACKED 498# define Q_PACKED
476#endif 499#endif
477 500
478 501
479/* 502/*
480 The window system, must be one of: (Q_WS_x) 503 The window system, must be one of: (Q_WS_x)
481 504
482 MACX- Mac OS X 505 MACX- Mac OS X
483 MAC9- Mac OS 9 506 MAC9- Mac OS 9
484 QWS- Qt/Embedded 507 QWS- Qt/Embedded
485 WIN32- Windows 508 WIN32- Windows
486 X11- X Window System 509 X11- X Window System
487 PM - unsupported 510 PM - unsupported
488 WIN16- unsupported 511 WIN16- unsupported
489*/ 512*/
490 513
491#if defined(Q_OS_MAC9) 514#if defined(Q_OS_MAC9)
492# define Q_WS_MAC9 515# define Q_WS_MAC9
493#elif defined(Q_OS_MSDOS) 516#elif defined(Q_OS_MSDOS)
494# define Q_WS_WIN16 517# define Q_WS_WIN16
495# error "Qt requires Win32 and does not work with Windows 3.x" 518# error "Qt requires Win32 and does not work with Windows 3.x"
496#elif defined(_WIN32_X11_) 519#elif defined(_WIN32_X11_)
497# define Q_WS_X11 520# define Q_WS_X11
498#elif defined(Q_OS_WIN32) 521#elif defined(Q_OS_WIN32)
499# define Q_WS_WIN32 522# define Q_WS_WIN32
500# if defined(Q_OS_WIN64) 523# if defined(Q_OS_WIN64)
501# define Q_WS_WIN64 524# define Q_WS_WIN64
502# endif 525# endif
503#elif defined(Q_OS_OS2) 526#elif defined(Q_OS_OS2)
504# define Q_WS_PM 527# define Q_WS_PM
505# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell" 528# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
506#elif defined(Q_OS_UNIX) 529#elif defined(Q_OS_UNIX)
507# if defined(QWS) 530# if defined(QWS)
508# define Q_WS_QWS 531# define Q_WS_QWS
532# define QT_NO_QWS_IM
509# elif defined(Q_OS_MACX) 533# elif defined(Q_OS_MACX)
510# define Q_WS_MACX 534# define Q_WS_MACX
511# else 535# else
512# define Q_WS_X11 536# define Q_WS_X11
513# endif 537# endif
514#endif 538#endif
515#if defined(Q_OS_MAC) && !defined(QMAC_PASCAL) 539#if defined(Q_OS_MAC) && !defined(QMAC_PASCAL)
516# define QMAC_PASCAL 540# define QMAC_PASCAL
517#endif 541#endif
518 542
519#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) 543#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32)
520# define Q_WS_WIN 544# define Q_WS_WIN
521#endif 545#endif
522 546
523#if (defined(Q_WS_MAC9) || defined(Q_WS_MACX)) && !defined(Q_WS_QWS) && !defined(Q_WS_X11) 547#if (defined(Q_WS_MAC9) || defined(Q_WS_MACX)) && !defined(Q_WS_QWS) && !defined(Q_WS_X11)
524# define Q_WS_MAC 548# define Q_WS_MAC
525#endif 549#endif
526 550
527 551
528/* 552/*
529 Some classes do not permit copies to be made of an object. 553 Some classes do not permit copies to be made of an object.
530 These classes contains a private copy constructor and operator= 554 These classes contains a private copy constructor and operator=
531 to disable copying (the compiler gives an error message). 555 to disable copying (the compiler gives an error message).
532 Undefine Q_DISABLE_COPY to turn off this checking. 556 Undefine Q_DISABLE_COPY to turn off this checking.
533*/ 557*/
534 558
535#define Q_DISABLE_COPY 559#define Q_DISABLE_COPY
536 560
537#if defined(__cplusplus) 561#if defined(__cplusplus)
538 562
539 563
540// 564//
541// Useful type definitions for Qt 565// Useful type definitions for Qt
542// 566//
543 567
544#if defined(Q_NO_BOOL_TYPE) 568#if defined(Q_NO_BOOL_TYPE)
545#if defined(Q_CC_HP) 569#if defined(Q_CC_HP)
546// bool is an unsupported reserved keyword in later versions 570// bool is an unsupported reserved keyword in later versions
547#define bool int 571#define bool int
548#else 572#else
549typedef int bool; 573typedef int bool;
550#endif 574#endif
551#endif 575#endif
552 576
553typedef unsigned char uchar; 577typedef unsigned char uchar;
554typedef unsigned short ushort; 578typedef unsigned short ushort;
555 typedef unsigneduint; 579 typedef unsigneduint;
556typedef unsigned long ulong; 580typedef unsigned long ulong;
557 typedef char *pchar; 581 typedef char *pchar;
558 typedef uchar *puchar; 582 typedef uchar *puchar;
559typedef const char *pcchar; 583typedef const char *pcchar;
560 584
561 585
562// 586//
563// Constant bool values 587// Constant bool values
564// 588//
565 589
566#ifndef TRUE 590#ifndef TRUE
567const bool FALSE = 0; 591const bool FALSE = 0;
568const bool TRUE = !0; 592const bool TRUE = !0;
569#endif 593#endif
570#if defined(__WATCOMC__) 594#if defined(__WATCOMC__)
571# if defined(Q_OS_QNX4) 595# if defined(Q_OS_QNX4)
572const bool false = FALSE; 596const bool false = FALSE;
573const bool true = TRUE; 597const bool true = TRUE;
574# endif 598# endif
575#endif 599#endif
576 600
577 601
578// 602//
579// Use the "explicit" keyword on platforms that support it. 603// Use the "explicit" keyword on platforms that support it.
580// 604//
581 605
582#if !defined(Q_NO_EXPLICIT_KEYWORD) 606#if !defined(Q_NO_EXPLICIT_KEYWORD)
583# define Q_EXPLICIT explicit 607# define Q_EXPLICIT explicit
584#else 608#else
585# define Q_EXPLICIT 609# define Q_EXPLICIT
586#endif 610#endif
587 611
588 612
589// 613//
590// Workaround for static const members on MSVC++. 614// Workaround for static const members on MSVC++.
591// 615//
592 616
593#if defined(Q_CC_MSVC) 617#if defined(Q_CC_MSVC)
594# define QT_STATIC_CONST static 618# define QT_STATIC_CONST static
595# define QT_STATIC_CONST_IMPL 619# define QT_STATIC_CONST_IMPL
596#else 620#else
597# define QT_STATIC_CONST static const 621# define QT_STATIC_CONST static const
598# define QT_STATIC_CONST_IMPL const 622# define QT_STATIC_CONST_IMPL const
599#endif 623#endif
600 624
601 625
602// 626//
603// Utility macros and inline functions 627// Utility macros and inline functions
604// 628//
605 629
606 #define QMAX(a, b)((b) < (a) ? (a) : (b)) 630 #define QMAX(a, b)((b) < (a) ? (a) : (b))
607 #define QMIN(a, b)((a) < (b) ? (a) : (b)) 631 #define QMIN(a, b)((a) < (b) ? (a) : (b))
608 #define QABS(a)((a) >= 0 ? (a) : -(a)) 632 #define QABS(a)((a) >= 0 ? (a) : -(a))
609 633
610inline int qRound( double d ) 634inline int qRound( double d )
611{ 635{
612 return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1); 636 return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1);
613} 637}
614 638
615 639
616// 640//
617// Size-dependent types (architechture-dependent byte order) 641// Size-dependent types (architechture-dependent byte order)
618// 642//
619 643
620#if !defined(QT_CLEAN_NAMESPACE) 644#if !defined(QT_CLEAN_NAMESPACE)
621// source compatibility with Qt 1.x 645// source compatibility with Qt 1.x
622 typedef signed char INT8; // 8 bit signed 646 typedef signed char INT8; // 8 bit signed
623 typedef unsigned char UINT8; // 8 bit unsigned 647 typedef unsigned char UINT8; // 8 bit unsigned
624 typedef short INT16; // 16 bit signed 648 typedef short INT16; // 16 bit signed
625 typedef unsigned short UINT16; // 16 bit unsigned 649 typedef unsigned short UINT16; // 16 bit unsigned
626 typedef int INT32; // 32 bit signed 650 typedef int INT32; // 32 bit signed
627 typedef unsigned int UINT32; // 32 bit unsigned 651 typedef unsigned int UINT32; // 32 bit unsigned
628#endif 652#endif
629 653
630 typedef signed char Q_INT8; // 8 bit signed 654 typedef signed char Q_INT8; // 8 bit signed
631 typedef unsigned char Q_UINT8;// 8 bit unsigned 655 typedef unsigned char Q_UINT8;// 8 bit unsigned
632 typedef short Q_INT16;// 16 bit signed 656 typedef short Q_INT16;// 16 bit signed
633 typedef unsigned short Q_UINT16;// 16 bit unsigned 657 typedef unsigned short Q_UINT16;// 16 bit unsigned
634 typedef int Q_INT32;// 32 bit signed 658 typedef int Q_INT32;// 32 bit signed
635 typedef unsigned int Q_UINT32;// 32 bit unsigned 659 typedef unsigned int Q_UINT32;// 32 bit unsigned
636#if defined(Q_OS_WIN64) 660#if defined(Q_OS_WIN64)
637// LLP64 64-bit model on Windows 661// LLP64 64-bit model on Windows
638 typedef __int64 Q_LONG; // word up to 64 bit signed 662 typedef __int64 Q_LONG; // word up to 64 bit signed
639 typedef unsigned __int64 Q_ULONG;// word up to 64 bit unsigned 663 typedef unsigned __int64 Q_ULONG;// word up to 64 bit unsigned
640#else 664#else
641// LP64 64-bit model on Linux 665// LP64 64-bit model on Linux
642 typedef long Q_LONG; 666 typedef long Q_LONG;
643 typedef unsigned long Q_ULONG; 667 typedef unsigned long Q_ULONG;
644#endif 668#endif
645 669
646#if !defined(QT_CLEAN_NAMESPACE) 670#if !defined(QT_CLEAN_NAMESPACE)
647// mininum size of 64 bits is not guaranteed 671// mininum size of 64 bits is not guaranteed
648 #define Q_INT64 Q_LONG 672 #define Q_INT64 Q_LONG
649 #define Q_UINT64 Q_ULONG 673 #define Q_UINT64 Q_ULONG
650#endif 674#endif
651 675
652#if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT) 676#if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT)
653# define QT_LARGEFILE_SUPPORT 64 677# define QT_LARGEFILE_SUPPORT 64
654#endif 678#endif
655#if defined(QT_LARGEFILE_SUPPORT) 679#if defined(QT_LARGEFILE_SUPPORT)
656 typedef unsigned long long QtOffset; 680 typedef unsigned long long QtOffset;
657#else 681#else
658 typedef Q_ULONG QtOffset; 682 typedef Q_ULONG QtOffset;
659#endif 683#endif
660 684
661 685
662// 686//
663// Data stream functions is provided by many classes (defined in qdatastream.h) 687// Data stream functions is provided by many classes (defined in qdatastream.h)
664// 688//
665 689
666class QDataStream; 690class QDataStream;
667 691
668 692
669// 693//
670// Feature subsetting 694// Feature subsetting
671// 695//
672// Note that disabling some features will produce a libqt that is not 696// Note that disabling some features will produce a libqt that is not
673// compatible with other libqt builds. Such modifications are only 697// compatible with other libqt builds. Such modifications are only
674// supported on Qt/Embedded where reducing the library size is important 698// supported on Qt/Embedded where reducing the library size is important
675// and where the application-suite is often a fixed set. 699// and where the application-suite is often a fixed set.
676// 700//
677 701
678#if !defined(QT_MOC) 702#if !defined(QT_MOC)
679#if defined(QCONFIG_LOCAL) 703#if defined(QCONFIG_LOCAL)
680#include <qconfig-local.h> 704#include <qconfig-local.h>
681#elif defined(QCONFIG_MINIMAL) 705#elif defined(QCONFIG_MINIMAL)
682#include <qconfig-minimal.h> 706#include <qconfig-minimal.h>
683#elif defined(QCONFIG_SMALL) 707#elif defined(QCONFIG_SMALL)
684#include <qconfig-small.h> 708#include <qconfig-small.h>
685#elif defined(QCONFIG_MEDIUM) 709#elif defined(QCONFIG_MEDIUM)
686#include <qconfig-medium.h> 710#include <qconfig-medium.h>
687#elif defined(QCONFIG_LARGE) 711#elif defined(QCONFIG_LARGE)
688#include <qconfig-large.h> 712#include <qconfig-large.h>
689#else // everything... 713#else // everything...
690#include <qconfig.h> 714#include <qconfig.h>
691#endif 715#endif
692#endif 716#endif
693 717
694 718
695#ifndef QT_BUILD_KEY 719#ifndef QT_BUILD_KEY
696#define QT_BUILD_KEY "unspecified" 720#define QT_BUILD_KEY "unspecified"
697#endif 721#endif
698 722
699// prune to local config 723// prune to local config
700#include "qmodules.h" 724#include "qmodules.h"
701#ifndef QT_MODULE_ICONVIEW 725#ifndef QT_MODULE_ICONVIEW
702# define QT_NO_ICONVIEW 726# define QT_NO_ICONVIEW
703#endif 727#endif
704#ifndef QT_MODULE_WORKSPACE 728#ifndef QT_MODULE_WORKSPACE
705# define QT_NO_WORKSPACE 729# define QT_NO_WORKSPACE
706#endif 730#endif
707#ifndef QT_MODULE_NETWORK 731#ifndef QT_MODULE_NETWORK
708#define QT_NO_NETWORK 732#define QT_NO_NETWORK
709#endif 733#endif
710#ifndef QT_MODULE_CANVAS 734#ifndef QT_MODULE_CANVAS
711# define QT_NO_CANVAS 735# define QT_NO_CANVAS
712#endif 736#endif
713#ifndef QT_MODULE_TABLE 737#ifndef QT_MODULE_TABLE
714#define QT_NO_TABLE 738#define QT_NO_TABLE
715#endif 739#endif
716#ifndef QT_MODULE_XML 740#ifndef QT_MODULE_XML
717# define QT_NO_XML 741# define QT_NO_XML
718#endif 742#endif
719#ifndef QT_MODULE_OPENGL 743#ifndef QT_MODULE_OPENGL
720# define QT_NO_OPENGL 744# define QT_NO_OPENGL
721#endif 745#endif
722#if !defined(QT_MODULE_SQL) 746#if !defined(QT_MODULE_SQL)
723# define QT_NO_SQL 747# define QT_NO_SQL
724#endif 748#endif
725 749
726#if defined(Q_WS_MAC9) 750#if defined(Q_WS_MAC9)
727//No need for menu merging 751//No need for menu merging
728# ifndef QMAC_QMENUBAR_NO_MERGE 752# ifndef QMAC_QMENUBAR_NO_MERGE
729# define QMAC_QMENUBAR_NO_MERGE 753# define QMAC_QMENUBAR_NO_MERGE
730# endif 754# endif
731//Mac9 does not use quartz 755//Mac9 does not use quartz
732# ifndef QMAC_NO_QUARTZ 756# ifndef QMAC_NO_QUARTZ
733# define QMAC_NO_QUARTZ 757# define QMAC_NO_QUARTZ
734# endif 758# endif
735# ifndef QMAC_QMENUBAR_NO_EVENT 759# ifndef QMAC_QMENUBAR_NO_EVENT
736# define QMAC_QMENUBAR_NO_EVENT 760# define QMAC_QMENUBAR_NO_EVENT
737# endif 761# endif
738#endif 762#endif
739#if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks 763#if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks
740# ifndef QMAC_NO_QUARTZ 764# ifndef QMAC_NO_QUARTZ
741# define QMAC_NO_QUARTZ 765# define QMAC_NO_QUARTZ
742# endif 766# endif
743# ifndef QMAC_QMENUBAR_NO_EVENT 767# ifndef QMAC_QMENUBAR_NO_EVENT
744# define QMAC_QMENUBAR_NO_EVENT 768# define QMAC_QMENUBAR_NO_EVENT
745# endif 769# endif
746#endif 770#endif
747 771
772#if !defined(Q_WS_QWS) && !defined(QT_NO_COP)
773# define QT_NO_COP
774#endif
775
748#ifndef QT_H 776#ifndef QT_H
749#include <qfeatures.h> 777#include <qfeatures.h>
750#endif // QT_H 778#endif // QT_H
751 779
752 780
753// 781//
754// Create Qt DLL if QT_DLL is defined (Windows only) 782// Create Qt DLL if QT_DLL is defined (Windows only)
783// or QT_SHARED is defined (Kylix only)
755// 784//
756 785
757#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) 786#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
758# if defined(QT_NODLL) 787# if defined(QT_NODLL)
759# undef QT_MAKEDLL 788# undef QT_MAKEDLL
760# undef QT_DLL 789# undef QT_DLL
761 # elif defined(QT_MAKEDLL)/* create a Qt DLL library */ 790 # elif defined(QT_MAKEDLL)/* create a Qt DLL library */
762# if defined(QT_DLL) 791# if defined(QT_DLL)
763# undef QT_DLL 792# undef QT_DLL
764# endif 793# endif
765# define Q_EXPORT __declspec(dllexport) 794# define Q_EXPORT __declspec(dllexport)
766# define Q_TEMPLATEDLL 795# define Q_TEMPLATEDLL
767# define Q_TEMPLATE_EXTERN 796# define Q_TEMPLATE_EXTERN
768 # undef Q_DISABLE_COPY/* avoid unresolved externals */ 797 # undef Q_DISABLE_COPY/* avoid unresolved externals */
769 # elif defined(QT_DLL) /* use a Qt DLL library */ 798 # elif defined(QT_DLL) /* use a Qt DLL library */
770# define Q_EXPORT __declspec(dllimport) 799# define Q_EXPORT __declspec(dllimport)
771# define Q_TEMPLATEDLL 800# define Q_TEMPLATEDLL
772# ifndef Q_TEMPLATE_EXTERN 801# ifndef Q_TEMPLATE_EXTERN
773# if defined(Q_CC_MSVC) 802# if defined(Q_CC_MSVC_NET)
774# define Q_TEMPLATE_EXTERN /*extern*/ //### too many warnings, even though disabled 803# define Q_TEMPLATE_EXTERN extern
775# else 804# else
776# define Q_TEMPLATE_EXTERN 805# define Q_TEMPLATE_EXTERN
777# endif 806# endif
778# endif 807# endif
779# undef Q_DISABLE_COPY /* avoid unresolved externals */ 808 # undef Q_DISABLE_COPY/* avoid unresolved externals */
809# endif
810#elif defined(Q_OS_LINUX) && defined(Q_CC_BOR)
811 # if defined(QT_SHARED)/* create a Qt shared library */
812# define Q_EXPORT __declspec(dllexport)
813# define Q_TEMPLATEDLL
814# define Q_TEMPLATE_EXTERN
815 # undef Q_DISABLE_COPY/* avoid unresolved externals */
816# else
817# define Q_TEMPLATEDLL
818# define Q_TEMPLATE_EXTERN
819 # undef Q_DISABLE_COPY /* avoid unresolved externals */
780# endif 820# endif
781#else 821#else
782 # undef QT_MAKEDLL /* ignore these for other platforms */ 822 # undef QT_MAKEDLL /* ignore these for other platforms */
783# undef QT_DLL 823# undef QT_DLL
784#endif 824#endif
785 825
786#ifndef Q_EXPORT 826#ifndef Q_EXPORT
787# define Q_EXPORT 827# define Q_EXPORT
788#endif 828#endif
789 829
790 830
791// 831//
792// Some platform specific stuff 832// Some platform specific stuff
793// 833//
794 834
795#if defined(Q_WS_WIN) 835#if defined(Q_WS_WIN)
796extern Q_EXPORT bool qt_winunicode; 836extern Q_EXPORT bool qt_winunicode;
797#endif 837#endif
798 838
799 839
800// 840//
801// System information 841// System information
802// 842//
803 843
804Q_EXPORT const char *qVersion(); 844Q_EXPORT const char *qVersion();
805Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian ); 845Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
806#if defined(Q_WS_WIN) 846#if defined(Q_OS_MAC)
847int qMacVersion();
848#elif defined(Q_WS_WIN)
807Q_EXPORT int qWinVersion(); 849Q_EXPORT int qWinVersion();
808#if defined(UNICODE) 850#if defined(UNICODE)
809#define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi } 851#define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi }
810#define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi ) 852#define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi )
811#else 853#else
812#define QT_WA( uni, ansi ) ansi 854#define QT_WA( uni, ansi ) ansi
813#define QT_WA_INLINE( uni, ansi ) ansi 855#define QT_WA_INLINE( uni, ansi ) ansi
814#endif 856#endif
815#endif 857#endif
816 858
817#ifdef Q_OS_TEMP 859#ifdef Q_OS_TEMP
818#ifdef QT_WA 860#ifdef QT_WA
819#undef QT_WA 861#undef QT_WA
820#undef QT_WA_INLINE 862#undef QT_WA_INLINE
821#endif 863#endif
822#define QT_WA( uni, ansi ) uni 864#define QT_WA( uni, ansi ) uni
823#define QT_WA_INLINE( uni, ansi ) ( uni ) 865#define QT_WA_INLINE( uni, ansi ) ( uni )
824#endif 866#endif
825 867
826#ifndef Q_INLINE_TEMPLATES 868#ifndef Q_INLINE_TEMPLATES
827# define Q_INLINE_TEMPLATES 869# define Q_INLINE_TEMPLATES
828#endif 870#endif
829 871
830#ifndef Q_TYPENAME 872#ifndef Q_TYPENAME
831# define Q_TYPENAME typename 873# define Q_TYPENAME typename
832#endif 874#endif
833 875
834// 876//
835// Use to avoid "unused parameter" warnings 877// Use to avoid "unused parameter" warnings
836// 878//
837 879
838#define Q_UNUSED(x) (void)x; 880#define Q_UNUSED(x) (void)x;
839 881
840// 882//
841// Debugging and error handling 883// Debugging and error handling
842// 884//
843 885
844#if !defined(QT_NO_CHECK) 886#if !defined(QT_NO_CHECK)
845 # define QT_CHECK_STATE // check state of objects etc. 887 # define QT_CHECK_STATE // check state of objects etc.
846 # define QT_CHECK_RANGE // check range of indexes etc. 888 # define QT_CHECK_RANGE // check range of indexes etc.
847 # define QT_CHECK_NULL // check null pointers 889 # define QT_CHECK_NULL // check null pointers
848 # define QT_CHECK_MATH // check math functions 890 # define QT_CHECK_MATH // check math functions
849#endif 891#endif
850 892
851#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG) 893#if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
852 # define QT_DEBUG // display debug messages 894 # define QT_DEBUG // display debug messages
853 # if !defined(QT_NO_COMPAT) // compatibility with Qt 2 895 # if !defined(QT_NO_COMPAT) // compatibility with Qt 2
854# if !defined(NO_DEBUG) && !defined(DEBUG) 896# if !defined(NO_DEBUG) && !defined(DEBUG)
855 # if !defined(Q_OS_MACX) // clash with MacOS X headers 897 # if !defined(Q_OS_MACX) // clash with MacOS X headers
856# define DEBUG 898# define DEBUG
857# endif 899# endif
858# endif 900# endif
859# endif 901# endif
860#endif 902#endif
861 903
862 904
863 Q_EXPORT void qDebug( const char *, ... )// print debug message 905 Q_EXPORT void qDebug( const char *, ... )// print debug message
864#if defined(Q_CC_GNU) && !defined(__INSURE__) 906#if defined(Q_CC_GNU) && !defined(__INSURE__)
865 __attribute__ ((format (printf, 1, 2))) 907 __attribute__ ((format (printf, 1, 2)))
866#endif 908#endif
867; 909;
868 910
869 Q_EXPORT void qWarning( const char *, ... )// print warning message 911 Q_EXPORT void qWarning( const char *, ... )// print warning message
870#if defined(Q_CC_GNU) && !defined(__INSURE__) 912#if defined(Q_CC_GNU) && !defined(__INSURE__)
871 __attribute__ ((format (printf, 1, 2))) 913 __attribute__ ((format (printf, 1, 2)))
872#endif 914#endif
873; 915;
874 916
875 Q_EXPORT void qFatal( const char *, ... )// print fatal message and exit 917 Q_EXPORT void qFatal( const char *, ... )// print fatal message and exit
876#if defined(Q_CC_GNU) 918#if defined(Q_CC_GNU)
877 __attribute__ ((format (printf, 1, 2))) 919 __attribute__ ((format (printf, 1, 2)))
878#endif 920#endif
879; 921;
880 922
881Q_EXPORT void qSystemWarning( const char *, int code = -1 ); 923Q_EXPORT void qSystemWarning( const char *, int code = -1 );
882 924
883 #if !defined(QT_CLEAN_NAMESPACE) // compatibility with Qt 1 925 #if !defined(QT_CLEAN_NAMESPACE) // compatibility with Qt 1
884 926
885 Q_EXPORT void debug( const char *, ... )// print debug message 927 Q_EXPORT void debug( const char *, ... )// print debug message
886#if defined(Q_CC_GNU) && !defined(__INSURE__) 928#if defined(Q_CC_GNU) && !defined(__INSURE__)
887 __attribute__ ((format (printf, 1, 2))) 929 __attribute__ ((format (printf, 1, 2)))
888#endif 930#endif
889; 931;
890 932
891 Q_EXPORT void warning( const char *, ... )// print warning message 933 Q_EXPORT void warning( const char *, ... )// print warning message
892#if defined(Q_CC_GNU) && !defined(__INSURE__) 934#if defined(Q_CC_GNU) && !defined(__INSURE__)
893 __attribute__ ((format (printf, 1, 2))) 935 __attribute__ ((format (printf, 1, 2)))
894#endif 936#endif
895; 937;
896 938
897 Q_EXPORT void fatal( const char *, ... )// print fatal message and exit 939 Q_EXPORT void fatal( const char *, ... )// print fatal message and exit
898#if defined(Q_CC_GNU) && !defined(__INSURE__) 940#if defined(Q_CC_GNU) && !defined(__INSURE__)
899 __attribute__ ((format (printf, 1, 2))) 941 __attribute__ ((format (printf, 1, 2)))
900#endif 942#endif
901; 943;
902 944
903#endif // QT_CLEAN_NAMESPACE 945#endif // QT_CLEAN_NAMESPACE
904 946
905 947
906#if !defined(Q_ASSERT) 948#if !defined(Q_ASSERT)
907# if defined(QT_CHECK_STATE) 949# if defined(QT_CHECK_STATE)
908# if defined(QT_FATAL_ASSERT) 950# if defined(QT_FATAL_ASSERT)
909# define Q_ASSERT(x) ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)) 951# define Q_ASSERT(x) ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
910# else 952# else
911# define Q_ASSERT(x) ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)) 953# define Q_ASSERT(x) ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
912# endif 954# endif
913# else 955# else
914# define Q_ASSERT(x) 956# define Q_ASSERT(x)
915# endif 957# endif
916#endif 958#endif
917 959
918 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2 960 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2
919# if !defined(ASSERT) 961# if !defined(ASSERT)
920# if !defined(Q_OS_TEMP) 962# if !defined(Q_OS_TEMP)
921# define ASSERT(x) Q_ASSERT(x) 963# define ASSERT(x) Q_ASSERT(x)
922# endif 964# endif
923# endif 965# endif
924#endif // QT_NO_COMPAT 966#endif // QT_NO_COMPAT
925 967
926 968
927Q_EXPORT bool qt_check_pointer( bool c, const char *, int ); 969Q_EXPORT bool qt_check_pointer( bool c, const char *, int );
928 970
929#if defined(QT_CHECK_NULL) 971#if defined(QT_CHECK_NULL)
930# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__)) 972# define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))
931#else 973#else
932# define Q_CHECK_PTR(p) 974# define Q_CHECK_PTR(p)
933#endif 975#endif
934 976
935 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2 977 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2
936# if !defined(CHECK_PTR) 978# if !defined(CHECK_PTR)
937# define CHECK_PTR(x) Q_CHECK_PTR(x) 979# define CHECK_PTR(x) Q_CHECK_PTR(x)
938# endif 980# endif
939#endif // QT_NO_COMPAT 981#endif // QT_NO_COMPAT
940 982
941enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg }; 983enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
942 984
943typedef void (*QtMsgHandler)(QtMsgType, const char *); 985typedef void (*QtMsgHandler)(QtMsgType, const char *);
944Q_EXPORT QtMsgHandler qInstallMsgHandler( QtMsgHandler ); 986Q_EXPORT QtMsgHandler qInstallMsgHandler( QtMsgHandler );
945 987
946 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2 988 #if !defined(QT_NO_COMPAT) // compatibility with Qt 2
947typedef QtMsgHandler msg_handler; 989typedef QtMsgHandler msg_handler;
948#endif // QT_NO_COMPAT 990#endif // QT_NO_COMPAT
949 991
950Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE ); 992Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );
951 993
952Q_EXPORT void qObsolete( const char *obj, const char *oldfunc, 994Q_EXPORT void qObsolete( const char *obj, const char *oldfunc,
953 const char *newfunc ); 995 const char *newfunc );
954Q_EXPORT void qObsolete( const char *obj, const char *oldfunc ); 996Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );
955Q_EXPORT void qObsolete( const char *message ); 997Q_EXPORT void qObsolete( const char *message );
956 998
957 999
958// 1000//
959// Install paths from configure 1001// Install paths from configure
960// 1002//
961 1003
962Q_EXPORT const char *qInstallPath(); 1004Q_EXPORT const char *qInstallPath();
963Q_EXPORT const char *qInstallPathDocs(); 1005Q_EXPORT const char *qInstallPathDocs();
964Q_EXPORT const char *qInstallPathHeaders(); 1006Q_EXPORT const char *qInstallPathHeaders();
965Q_EXPORT const char *qInstallPathLibs(); 1007Q_EXPORT const char *qInstallPathLibs();
966Q_EXPORT const char *qInstallPathBins(); 1008Q_EXPORT const char *qInstallPathBins();
967Q_EXPORT const char *qInstallPathPlugins(); 1009Q_EXPORT const char *qInstallPathPlugins();
968Q_EXPORT const char *qInstallPathData(); 1010Q_EXPORT const char *qInstallPathData();
969 1011
970#endif // __cplusplus 1012#endif // __cplusplus
971 1013
1014// compilers which follow outdated template instantiation rules
1015// require a class to have a comparison operator to exist when
1016// a QValueList of this type is instantiated. It's not actually
1017// used in the list, though. Hence the dummy implementation.
1018// Just in case other code relies on it we better trigger a warning
1019// mandating a real implementation.
1020#ifdef Q_FULL_TEMPLATE_INSTANTIATION
1021# define Q_DUMMY_COMPARISON_OPERATOR(C) \
1022 bool operator==( const C& ) const { \
1023 qWarning( #C"::operator==( const "#C"& ) got called." ); \
1024 return FALSE; \
1025 }
1026#else
1027# define Q_DUMMY_COMPARISON_OPERATOR(C)
1028#endif
1029
972#endif // QGLOBAL_H 1030#endif // QGLOBAL_H
973 1031
974// 1032//
975// Avoid some particularly useless warnings from some stupid compilers. 1033// Avoid some particularly useless warnings from some stupid compilers.
976// To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out 1034// To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
977// the line "#define QT_NO_WARNINGS" 1035// the line "#define QT_NO_WARNINGS"
978// 1036//
979 1037
980#if !defined(QT_CC_WARNINGS) 1038#if !defined(QT_CC_WARNINGS)
981# define QT_NO_WARNINGS 1039# define QT_NO_WARNINGS
982#endif 1040#endif
983#if defined(QT_NO_WARNINGS) 1041#if defined(QT_NO_WARNINGS)
984# if defined(Q_CC_MSVC) 1042# if defined(Q_CC_MSVC)
985# pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data 1043# 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' 1044# 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 1045# 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) 1046# 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' 1047# pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2'
990# pragma warning(disable: 4706) // assignment within conditional expression 1048# pragma warning(disable: 4706) // assignment within conditional expression
991# pragma warning(disable: 4786) // truncating debug info after 255 characters 1049# pragma warning(disable: 4786) // truncating debug info after 255 characters
992# pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated 1050# pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated
993# pragma warning(disable: 4355) // 'this' : used in base member initializer list 1051# pragma warning(disable: 4355) // 'this' : used in base member initializer list
994# pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation 1052# pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation
1053# pragma warning(disable: 4710) // function not inlined
995# elif defined(Q_CC_BOR) 1054# elif defined(Q_CC_BOR)
996# pragma option -w-inl 1055# pragma option -w-inl
997# pragma option -w-aus 1056# pragma option -w-aus
998# pragma warn -inl 1057# pragma warn -inl
999# pragma warn -pia 1058# pragma warn -pia
1000# pragma warn -ccc 1059# pragma warn -ccc
1001# pragma warn -rch 1060# pragma warn -rch
1002# pragma warn -sig 1061# pragma warn -sig
1003# elif defined(Q_CC_MWERKS) 1062# elif defined(Q_CC_MWERKS)
1004# pragma warn_possunwant off 1063# pragma warn_possunwant off
1005# endif 1064# endif
1006#endif 1065#endif
diff --git a/qmake/include/qintdict.h b/qmake/include/qintdict.h
index b4cb223..0299879 100644
--- a/qmake/include/qintdict.h
+++ b/qmake/include/qintdict.h
@@ -1,114 +1,118 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QIntDict template class 4** Definition of QIntDict template class
5** 5**
6** Created : 940624 6** Created : 940624
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QINTDICT_H 38#ifndef QINTDICT_H
39#define QINTDICT_H 39#define QINTDICT_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qgdict.h" 42#include "qgdict.h"
43#endif // QT_H 43#endif // QT_H
44 44
45template<class type> 45template<class type>
46class QIntDict 46class QIntDict
47#ifdef Q_QDOC 47#ifdef Q_QDOC
48 : public QPtrCollection 48 : public QPtrCollection
49#else 49#else
50 : public QGDict 50 : public QGDict
51#endif 51#endif
52{ 52{
53public: 53public:
54 QIntDict(int size=17) : QGDict(size,IntKey,0,0) {} 54 QIntDict(int size=17) : QGDict(size,IntKey,0,0) {}
55 QIntDict( const QIntDict<type> &d ) : QGDict(d) {} 55 QIntDict( const QIntDict<type> &d ) : QGDict(d) {}
56 ~QIntDict() { clear(); } 56 ~QIntDict() { clear(); }
57 QIntDict<type> &operator=(const QIntDict<type> &d) 57 QIntDict<type> &operator=(const QIntDict<type> &d)
58 { return (QIntDict<type>&)QGDict::operator=(d); } 58 { return (QIntDict<type>&)QGDict::operator=(d); }
59 uint count() const { return QGDict::count(); } 59 uint count() const { return QGDict::count(); }
60 uint size() const { return QGDict::size(); } 60 uint size() const { return QGDict::size(); }
61 bool isEmpty() const { return QGDict::count() == 0; } 61 bool isEmpty() const { return QGDict::count() == 0; }
62 void insert( long k, const type *d ) 62 void insert( long k, const type *d )
63 { QGDict::look_int(k,(Item)d,1); } 63 { QGDict::look_int(k,(Item)d,1); }
64 void replace( long k, const type *d ) 64 void replace( long k, const type *d )
65 { QGDict::look_int(k,(Item)d,2); } 65 { QGDict::look_int(k,(Item)d,2); }
66 bool remove( long k ) { return QGDict::remove_int(k); } 66 bool remove( long k ) { return QGDict::remove_int(k); }
67 type *take( long k ) { return (type*)QGDict::take_int(k); } 67 type *take( long k ) { return (type*)QGDict::take_int(k); }
68 type *find( long k ) const 68 type *find( long k ) const
69 { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); } 69 { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
70 type *operator[]( long k ) const 70 type *operator[]( long k ) const
71 { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); } 71 { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
72 void clear() { QGDict::clear(); } 72 void clear() { QGDict::clear(); }
73 void resize( uint n ) { QGDict::resize(n); } 73 void resize( uint n ) { QGDict::resize(n); }
74 void statistics() const { QGDict::statistics(); } 74 void statistics() const { QGDict::statistics(); }
75 75
76#ifdef Q_QDOC 76#ifdef Q_QDOC
77protected: 77protected:
78 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & ); 78 virtual QDataStream& read( QDataStream &, QPtrCollection::Item & );
79 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const; 79 virtual QDataStream& write( QDataStream &, QPtrCollection::Item ) const;
80#endif 80#endif
81 81
82private: 82private:
83 void deleteItem( Item d ); 83 void deleteItem( Item d );
84}; 84};
85 85
86#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) 86#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
87template<> inline void QIntDict<void>::deleteItem( QPtrCollection::Item ) 87template<> inline void QIntDict<void>::deleteItem( QPtrCollection::Item )
88{ 88{
89} 89}
90#endif 90#endif
91 91
92template<class type> inline void QIntDict<type>::deleteItem( QPtrCollection::Item d ) 92template<class type> inline void QIntDict<type>::deleteItem( QPtrCollection::Item d )
93{ 93{
94 if ( del_item ) delete (type*)d; 94 if ( del_item ) delete (type*)d;
95} 95}
96 96
97template<class type> 97template<class type>
98class QIntDictIterator : public QGDictIterator 98class QIntDictIterator : public QGDictIterator
99{ 99{
100public: 100public:
101 QIntDictIterator(const QIntDict<type> &d) :QGDictIterator((QGDict &)d) {} 101 QIntDictIterator(const QIntDict<type> &d) :QGDictIterator((QGDict &)d) {}
102 ~QIntDictIterator() {} 102 ~QIntDictIterator() {}
103 uint count() const { return dict->count(); } 103 uint count() const { return dict->count(); }
104 bool isEmpty() const { return dict->count() == 0; } 104 bool isEmpty() const { return dict->count() == 0; }
105 type *toFirst() { return (type *)QGDictIterator::toFirst(); } 105 type *toFirst() { return (type *)QGDictIterator::toFirst(); }
106 operator type *() const { return (type *)QGDictIterator::get(); } 106 operator type *() const { return (type *)QGDictIterator::get(); }
107 type *current() const { return (type *)QGDictIterator::get(); } 107 type *current() const { return (type *)QGDictIterator::get(); }
108 long currentKey() const { return QGDictIterator::getKeyInt(); } 108 long currentKey() const { return QGDictIterator::getKeyInt(); }
109 type *operator()() { return (type *)QGDictIterator::operator()(); } 109 type *operator()() { return (type *)QGDictIterator::operator()(); }
110 type *operator++() { return (type *)QGDictIterator::operator++(); } 110 type *operator++() { return (type *)QGDictIterator::operator++(); }
111 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);} 111 type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
112}; 112};
113 113
114#ifdef QT_QWINEXPORT
115#define Q_DEFINED_QINTDICT
116#include "qwinexport.h"
117#endif /* QT_QWINEXPORT */
114#endif // QINTDICT_H 118#endif // QINTDICT_H
diff --git a/qmake/include/qmap.h b/qmake/include/qmap.h
index 269bd6b..4bc0a2f 100644
--- a/qmake/include/qmap.h
+++ b/qmake/include/qmap.h
@@ -371,513 +371,517 @@ public:
371 371
372 NodePtr copy( NodePtr p ); 372 NodePtr copy( NodePtr p );
373 void clear(); 373 void clear();
374 void clear( NodePtr p ); 374 void clear( NodePtr p );
375 375
376 Iterator begin(){ return Iterator( (NodePtr)(header->left ) ); } 376 Iterator begin(){ return Iterator( (NodePtr)(header->left ) ); }
377 Iterator end(){ return Iterator( header ); } 377 Iterator end(){ return Iterator( header ); }
378 ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); } 378 ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); }
379 ConstIterator end() const { return ConstIterator( header ); } 379 ConstIterator end() const { return ConstIterator( header ); }
380 380
381 ConstIterator find(const Key& k) const; 381 ConstIterator find(const Key& k) const;
382 382
383 void remove( Iterator it ) { 383 void remove( Iterator it ) {
384 NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right ); 384 NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right );
385 delete del; 385 delete del;
386 --node_count; 386 --node_count;
387 } 387 }
388 388
389#ifdef QT_QMAP_DEBUG 389#ifdef QT_QMAP_DEBUG
390 void inorder( QMapNodeBase* x = 0, int level = 0 ){ 390 void inorder( QMapNodeBase* x = 0, int level = 0 ){
391 if ( !x ) 391 if ( !x )
392 x = header->parent; 392 x = header->parent;
393 if ( x->left ) 393 if ( x->left )
394 inorder( x->left, level + 1 ); 394 inorder( x->left, level + 1 );
395 //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl; 395 //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl;
396 if ( x->right ) 396 if ( x->right )
397 inorder( x->right, level + 1 ); 397 inorder( x->right, level + 1 );
398 } 398 }
399#endif 399#endif
400 400
401#if 0 401#if 0
402 Iterator insertMulti(const Key& v){ 402 Iterator insertMulti(const Key& v){
403 QMapNodeBase* y = header; 403 QMapNodeBase* y = header;
404 QMapNodeBase* x = header->parent; 404 QMapNodeBase* x = header->parent;
405 while (x != 0){ 405 while (x != 0){
406 y = x; 406 y = x;
407 x = ( v < key(x) ) ? x->left : x->right; 407 x = ( v < key(x) ) ? x->left : x->right;
408 } 408 }
409 return insert(x, y, v); 409 return insert(x, y, v);
410 } 410 }
411#endif 411#endif
412 412
413 Iterator insertSingle( const Key& k ); 413 Iterator insertSingle( const Key& k );
414 Iterator insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k ); 414 Iterator insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k );
415 415
416protected: 416protected:
417 /** 417 /**
418 * Helpers 418 * Helpers
419 */ 419 */
420 const Key& key( QMapNodeBase* b ) const { return ((NodePtr)b)->key; } 420 const Key& key( QMapNodeBase* b ) const { return ((NodePtr)b)->key; }
421 421
422 /** 422 /**
423 * Variables 423 * Variables
424 */ 424 */
425 NodePtr header; 425 NodePtr header;
426}; 426};
427 427
428 428
429template <class Key, class T> 429template <class Key, class T>
430Q_INLINE_TEMPLATES QMapPrivate<Key,T>::QMapPrivate() { 430Q_INLINE_TEMPLATES QMapPrivate<Key,T>::QMapPrivate() {
431 header = new Node; 431 header = new Node;
432 header->color = QMapNodeBase::Red; // Mark the header 432 header->color = QMapNodeBase::Red; // Mark the header
433 header->parent = 0; 433 header->parent = 0;
434 header->left = header->right = header; 434 header->left = header->right = header;
435} 435}
436template <class Key, class T> 436template <class Key, class T>
437Q_INLINE_TEMPLATES QMapPrivate<Key,T>::QMapPrivate( const QMapPrivate< Key, T >* _map ) : QMapPrivateBase( _map ) { 437Q_INLINE_TEMPLATES QMapPrivate<Key,T>::QMapPrivate( const QMapPrivate< Key, T >* _map ) : QMapPrivateBase( _map ) {
438 header = new Node; 438 header = new Node;
439 header->color = QMapNodeBase::Red; // Mark the header 439 header->color = QMapNodeBase::Red; // Mark the header
440 if ( _map->header->parent == 0 ) { 440 if ( _map->header->parent == 0 ) {
441 header->parent = 0; 441 header->parent = 0;
442 header->left = header->right = header; 442 header->left = header->right = header;
443 } else { 443 } else {
444 header->parent = copy( (NodePtr)(_map->header->parent) ); 444 header->parent = copy( (NodePtr)(_map->header->parent) );
445 header->parent->parent = header; 445 header->parent->parent = header;
446 header->left = header->parent->minimum(); 446 header->left = header->parent->minimum();
447 header->right = header->parent->maximum(); 447 header->right = header->parent->maximum();
448 } 448 }
449} 449}
450 450
451template <class Key, class T> 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 ) 452Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::NodePtr QMapPrivate<Key,T>::copy( Q_TYPENAME QMapPrivate<Key,T>::NodePtr p )
453{ 453{
454 if ( !p ) 454 if ( !p )
455 return 0; 455 return 0;
456 NodePtr n = new Node( *p ); 456 NodePtr n = new Node( *p );
457 n->color = p->color; 457 n->color = p->color;
458 if ( p->left ) { 458 if ( p->left ) {
459 n->left = copy( (NodePtr)(p->left) ); 459 n->left = copy( (NodePtr)(p->left) );
460 n->left->parent = n; 460 n->left->parent = n;
461 } else { 461 } else {
462 n->left = 0; 462 n->left = 0;
463 } 463 }
464 if ( p->right ) { 464 if ( p->right ) {
465 n->right = copy( (NodePtr)(p->right) ); 465 n->right = copy( (NodePtr)(p->right) );
466 n->right->parent = n; 466 n->right->parent = n;
467 } else { 467 } else {
468 n->right = 0; 468 n->right = 0;
469 } 469 }
470 return n; 470 return n;
471} 471}
472 472
473template <class Key, class T> 473template <class Key, class T>
474Q_INLINE_TEMPLATES void QMapPrivate<Key,T>::clear() 474Q_INLINE_TEMPLATES void QMapPrivate<Key,T>::clear()
475{ 475{
476 clear( (NodePtr)(header->parent) ); 476 clear( (NodePtr)(header->parent) );
477 header->color = QMapNodeBase::Red; 477 header->color = QMapNodeBase::Red;
478 header->parent = 0; 478 header->parent = 0;
479 header->left = header->right = header; 479 header->left = header->right = header;
480 node_count = 0; 480 node_count = 0;
481} 481}
482 482
483template <class Key, class T> 483template <class Key, class T>
484Q_INLINE_TEMPLATES void QMapPrivate<Key,T>::clear( Q_TYPENAME QMapPrivate<Key,T>::NodePtr p ) 484Q_INLINE_TEMPLATES void QMapPrivate<Key,T>::clear( Q_TYPENAME QMapPrivate<Key,T>::NodePtr p )
485{ 485{
486 while ( p != 0 ) { 486 while ( p != 0 ) {
487 clear( (NodePtr)p->right ); 487 clear( (NodePtr)p->right );
488 NodePtr y = (NodePtr)p->left; 488 NodePtr y = (NodePtr)p->left;
489 delete p; 489 delete p;
490 p = y; 490 p = y;
491 } 491 }
492} 492}
493 493
494template <class Key, class T> 494template <class Key, class T>
495Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::ConstIterator QMapPrivate<Key,T>::find(const Key& k) const 495Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::ConstIterator QMapPrivate<Key,T>::find(const Key& k) const
496{ 496{
497 QMapNodeBase* y = header; // Last node 497 QMapNodeBase* y = header; // Last node
498 QMapNodeBase* x = header->parent; // Root node. 498 QMapNodeBase* x = header->parent; // Root node.
499 499
500 while ( x != 0 ) { 500 while ( x != 0 ) {
501 // If as k <= key(x) go left 501 // If as k <= key(x) go left
502 if ( !( key(x) < k ) ) { 502 if ( !( key(x) < k ) ) {
503 y = x; 503 y = x;
504 x = x->left; 504 x = x->left;
505 } else { 505 } else {
506 x = x->right; 506 x = x->right;
507 } 507 }
508 } 508 }
509 509
510 // Was k bigger/smaller then the biggest/smallest 510 // Was k bigger/smaller then the biggest/smallest
511 // element of the tree ? Return end() 511 // element of the tree ? Return end()
512 if ( y == header || k < key(y) ) 512 if ( y == header || k < key(y) )
513 return ConstIterator( header ); 513 return ConstIterator( header );
514 return ConstIterator( (NodePtr)y ); 514 return ConstIterator( (NodePtr)y );
515} 515}
516 516
517template <class Key, class T> 517template <class Key, class T>
518Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insertSingle( const Key& k ) 518Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insertSingle( const Key& k )
519{ 519{
520 // Search correct position in the tree 520 // Search correct position in the tree
521 QMapNodeBase* y = header; 521 QMapNodeBase* y = header;
522 QMapNodeBase* x = header->parent; 522 QMapNodeBase* x = header->parent;
523 bool result = TRUE; 523 bool result = TRUE;
524 while ( x != 0 ) { 524 while ( x != 0 ) {
525 result = ( k < key(x) ); 525 result = ( k < key(x) );
526 y = x; 526 y = x;
527 x = result ? x->left : x->right; 527 x = result ? x->left : x->right;
528 } 528 }
529 // Get iterator on the last not empty one 529 // Get iterator on the last not empty one
530 Iterator j( (NodePtr)y ); 530 Iterator j( (NodePtr)y );
531 if ( result ) { 531 if ( result ) {
532 // Smaller then the leftmost one ? 532 // Smaller then the leftmost one ?
533 if ( j == begin() ) { 533 if ( j == begin() ) {
534 return insert(x, y, k ); 534 return insert(x, y, k );
535 } else { 535 } else {
536 // Perhaps daddy is the right one ? 536 // Perhaps daddy is the right one ?
537 --j; 537 --j;
538 } 538 }
539 } 539 }
540 // Really bigger ? 540 // Really bigger ?
541 if ( (j.node->key) < k ) 541 if ( (j.node->key) < k )
542 return insert(x, y, k ); 542 return insert(x, y, k );
543 // We are going to replace a node 543 // We are going to replace a node
544 return j; 544 return j;
545} 545}
546 546
547 547
548template <class Key, class T> 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 ) 549Q_INLINE_TEMPLATES Q_TYPENAME QMapPrivate<Key,T>::Iterator QMapPrivate<Key,T>::insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k )
550{ 550{
551 NodePtr z = new Node( k ); 551 NodePtr z = new Node( k );
552 if (y == header || x != 0 || k < key(y) ) { 552 if (y == header || x != 0 || k < key(y) ) {
553 y->left = z; // also makes leftmost = z when y == header 553 y->left = z; // also makes leftmost = z when y == header
554 if ( y == header ) { 554 if ( y == header ) {
555 header->parent = z; 555 header->parent = z;
556 header->right = z; 556 header->right = z;
557 } else if ( y == header->left ) 557 } else if ( y == header->left )
558 header->left = z; // maintain leftmost pointing to min node 558 header->left = z; // maintain leftmost pointing to min node
559 } else { 559 } else {
560 y->right = z; 560 y->right = z;
561 if ( y == header->right ) 561 if ( y == header->right )
562 header->right = z; // maintain rightmost pointing to max node 562 header->right = z; // maintain rightmost pointing to max node
563 } 563 }
564 z->parent = y; 564 z->parent = y;
565 z->left = 0; 565 z->left = 0;
566 z->right = 0; 566 z->right = 0;
567 rebalance( z, header->parent ); 567 rebalance( z, header->parent );
568 ++node_count; 568 ++node_count;
569 return Iterator(z); 569 return Iterator(z);
570} 570}
571 571
572 572
573#ifdef QT_CHECK_RANGE 573#ifdef QT_CHECK_RANGE
574# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_MAP_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" ) 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() ); 576# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL Q_ASSERT( !empty() );
577# else 577# else
578# define QT_CHECK_INVALID_MAP_ELEMENT 578# define QT_CHECK_INVALID_MAP_ELEMENT
579# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL 579# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL
580# endif 580# endif
581#else 581#else
582# define QT_CHECK_INVALID_MAP_ELEMENT 582# define QT_CHECK_INVALID_MAP_ELEMENT
583# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL 583# define QT_CHECK_INVALID_MAP_ELEMENT_FATAL
584#endif 584#endif
585 585
586template <class T> class QDeepCopy; 586template <class T> class QDeepCopy;
587 587
588template<class Key, class T> 588template<class Key, class T>
589class QMap 589class QMap
590{ 590{
591public: 591public:
592 /** 592 /**
593 * Typedefs 593 * Typedefs
594 */ 594 */
595 typedef Key key_type; 595 typedef Key key_type;
596 typedef T mapped_type; 596 typedef T mapped_type;
597 typedef QPair<const key_type, mapped_type> value_type; 597 typedef QPair<const key_type, mapped_type> value_type;
598 typedef value_type* pointer; 598 typedef value_type* pointer;
599 typedef const value_type* const_pointer; 599 typedef const value_type* const_pointer;
600 typedef value_type& reference; 600 typedef value_type& reference;
601 typedef const value_type& const_reference; 601 typedef const value_type& const_reference;
602#ifndef QT_NO_STL 602#ifndef QT_NO_STL
603 typedef ptrdiff_t difference_type; 603 typedef ptrdiff_t difference_type;
604#else 604#else
605 typedef int difference_type; 605 typedef int difference_type;
606#endif 606#endif
607 typedef size_t size_type; 607 typedef size_t size_type;
608 typedef QMapIterator<Key,T> iterator; 608 typedef QMapIterator<Key,T> iterator;
609 typedef QMapConstIterator<Key,T> const_iterator; 609 typedef QMapConstIterator<Key,T> const_iterator;
610 typedef QPair<iterator,bool> insert_pair; 610 typedef QPair<iterator,bool> insert_pair;
611 611
612 typedef QMapIterator< Key, T > Iterator; 612 typedef QMapIterator< Key, T > Iterator;
613 typedef QMapConstIterator< Key, T > ConstIterator; 613 typedef QMapConstIterator< Key, T > ConstIterator;
614 typedef T ValueType; 614 typedef T ValueType;
615 typedef QMapPrivate< Key, T > Priv; 615 typedef QMapPrivate< Key, T > Priv;
616 616
617 /** 617 /**
618 * API 618 * API
619 */ 619 */
620 QMap() 620 QMap()
621 { 621 {
622 sh = new QMapPrivate< Key, T >; 622 sh = new QMapPrivate< Key, T >;
623 } 623 }
624 QMap( const QMap<Key,T>& m ) 624 QMap( const QMap<Key,T>& m )
625 { 625 {
626 sh = m.sh; sh->ref(); 626 sh = m.sh; sh->ref();
627 } 627 }
628 628
629#ifndef QT_NO_STL 629#ifndef QT_NO_STL
630# ifdef Q_CC_HPACC // HP-UX aCC does require typename in some place 630# ifdef Q_CC_HPACC // HP-UX aCC does require typename in some place
631# undef Q_TYPENAME // but not accept them at others. 631# undef Q_TYPENAME // but not accept them at others.
632# define Q_TYPENAME // also doesn't like re-defines ... 632# define Q_TYPENAME // also doesn't like re-defines ...
633# endif 633# endif
634 QMap( const Q_TYPENAME std::map<Key,T>& m ) 634 QMap( const Q_TYPENAME std::map<Key,T>& m )
635 { 635 {
636 sh = new QMapPrivate<Key,T>; 636 sh = new QMapPrivate<Key,T>;
637#if defined(Q_OS_WIN32) 637#if defined(Q_OS_WIN32)
638 std::map<Key,T>::const_iterator it = m.begin(); 638 std::map<Key,T>::const_iterator it = m.begin();
639#else 639#else
640 QMapConstIterator<Key,T> it = m.begin(); 640 QMapConstIterator<Key,T> it = m.begin();
641#endif 641#endif
642 for ( ; it != m.end(); ++it ) { 642 for ( ; it != m.end(); ++it ) {
643 value_type p( (*it).first, (*it).second ); 643 value_type p( (*it).first, (*it).second );
644 insert( p ); 644 insert( p );
645 } 645 }
646 } 646 }
647#endif 647#endif
648 ~QMap() 648 ~QMap()
649 { 649 {
650 if ( sh->deref() ) 650 if ( sh->deref() )
651 delete sh; 651 delete sh;
652 } 652 }
653 QMap<Key,T>& operator= ( const QMap<Key,T>& m ); 653 QMap<Key,T>& operator= ( const QMap<Key,T>& m );
654#ifndef QT_NO_STL 654#ifndef QT_NO_STL
655 QMap<Key,T>& operator= ( const Q_TYPENAME std::map<Key,T>& m ) 655 QMap<Key,T>& operator= ( const Q_TYPENAME std::map<Key,T>& m )
656 { 656 {
657 clear(); 657 clear();
658#if defined(Q_OS_WIN32) 658#if defined(Q_OS_WIN32)
659 std::map<Key,T>::const_iterator it = m.begin(); 659 std::map<Key,T>::const_iterator it = m.begin();
660#else 660#else
661 QMapConstIterator<Key,T> it = m.begin(); 661 QMapConstIterator<Key,T> it = m.begin();
662#endif 662#endif
663 for ( ; it != m.end(); ++it ) { 663 for ( ; it != m.end(); ++it ) {
664 value_type p( (*it).first, (*it).second ); 664 value_type p( (*it).first, (*it).second );
665 insert( p ); 665 insert( p );
666 } 666 }
667 return *this; 667 return *this;
668 } 668 }
669# ifdef Q_CC_HPACC // undo the HP-UX aCC hackery done above 669# ifdef Q_CC_HPACC // undo the HP-UX aCC hackery done above
670# undef Q_TYPENAME 670# undef Q_TYPENAME
671# define Q_TYPENAME typename 671# define Q_TYPENAME typename
672# endif 672# endif
673#endif 673#endif
674 674
675 iterator begin() { detach(); return sh->begin(); } 675 iterator begin() { detach(); return sh->begin(); }
676 iterator end() { detach(); return sh->end(); } 676 iterator end() { detach(); return sh->end(); }
677 const_iterator begin() const { return ((const Priv*)sh)->begin(); } 677 const_iterator begin() const { return ((const Priv*)sh)->begin(); }
678 const_iterator end() const { return ((const Priv*)sh)->end(); } 678 const_iterator end() const { return ((const Priv*)sh)->end(); }
679 iterator replace( const Key& k, const T& v ) 679 iterator replace( const Key& k, const T& v )
680 { 680 {
681 remove( k ); 681 remove( k );
682 return insert( k, v ); 682 return insert( k, v );
683 } 683 }
684 684
685 size_type size() const 685 size_type size() const
686 { 686 {
687 return sh->node_count; 687 return sh->node_count;
688 } 688 }
689 bool empty() const 689 bool empty() const
690 { 690 {
691 return sh->node_count == 0; 691 return sh->node_count == 0;
692 } 692 }
693 QPair<iterator,bool> insert( const value_type& x ); 693 QPair<iterator,bool> insert( const value_type& x );
694 694
695 void erase( iterator it ) 695 void erase( iterator it )
696 { 696 {
697 detach(); 697 detach();
698 sh->remove( it ); 698 sh->remove( it );
699 } 699 }
700 void erase( const key_type& k ); 700 void erase( const key_type& k );
701 size_type count( const key_type& k ) const; 701 size_type count( const key_type& k ) const;
702 T& operator[] ( const Key& k ); 702 T& operator[] ( const Key& k );
703 void clear(); 703 void clear();
704 704
705 iterator find ( const Key& k ) 705 iterator find ( const Key& k )
706 { 706 {
707 detach(); 707 detach();
708 return iterator( sh->find( k ).node ); 708 return iterator( sh->find( k ).node );
709 } 709 }
710 const_iterator find ( const Key& k ) const {return sh->find( k ); } 710 const_iterator find ( const Key& k ) const {return sh->find( k ); }
711 711
712 const T& operator[] ( const Key& k ) const 712 const T& operator[] ( const Key& k ) const
713 { QT_CHECK_INVALID_MAP_ELEMENT; return sh->find( k ).data(); } 713 { QT_CHECK_INVALID_MAP_ELEMENT; return sh->find( k ).data(); }
714 bool contains ( const Key& k ) const 714 bool contains ( const Key& k ) const
715 { return find( k ) != end(); } 715 { return find( k ) != end(); }
716 //{ return sh->find( k ) != ((const Priv*)sh)->end(); } 716 //{ return sh->find( k ) != ((const Priv*)sh)->end(); }
717 717
718 size_type count() const { return sh->node_count; } 718 size_type count() const { return sh->node_count; }
719 719
720 QValueList<Key> keys() const { 720 QValueList<Key> keys() const {
721 QValueList<Key> r; 721 QValueList<Key> r;
722 for (const_iterator i=begin(); i!=end(); ++i) 722 for (const_iterator i=begin(); i!=end(); ++i)
723 r.append(i.key()); 723 r.append(i.key());
724 return r; 724 return r;
725 } 725 }
726 726
727 QValueList<T> values() const { 727 QValueList<T> values() const {
728 QValueList<T> r; 728 QValueList<T> r;
729 for (const_iterator i=begin(); i!=end(); ++i) 729 for (const_iterator i=begin(); i!=end(); ++i)
730 r.append(*i); 730 r.append(*i);
731 return r; 731 return r;
732 } 732 }
733 733
734 bool isEmpty() const { return sh->node_count == 0; } 734 bool isEmpty() const { return sh->node_count == 0; }
735 735
736 iterator insert( const Key& key, const T& value, bool overwrite = TRUE ); 736 iterator insert( const Key& key, const T& value, bool overwrite = TRUE );
737 void remove( iterator it ) { detach(); sh->remove( it ); } 737 void remove( iterator it ) { detach(); sh->remove( it ); }
738 void remove( const Key& k ); 738 void remove( const Key& k );
739 739
740#if defined(Q_FULL_TEMPLATE_INSTANTIATION) 740#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
741 bool operator==( const QMap<Key,T>& ) const { return FALSE; } 741 bool operator==( const QMap<Key,T>& ) const { return FALSE; }
742#ifndef QT_NO_STL 742#ifndef QT_NO_STL
743 bool operator==( const Q_TYPENAME std::map<Key,T>& ) const { return FALSE; } 743 bool operator==( const Q_TYPENAME std::map<Key,T>& ) const { return FALSE; }
744#endif 744#endif
745#endif 745#endif
746 746
747protected: 747protected:
748 /** 748 /**
749 * Helpers 749 * Helpers
750 */ 750 */
751 void detach() { if ( sh->count > 1 ) detachInternal(); } 751 void detach() { if ( sh->count > 1 ) detachInternal(); }
752 752
753 Priv* sh; 753 Priv* sh;
754private: 754private:
755 void detachInternal(); 755 void detachInternal();
756 756
757 friend class QDeepCopy< QMap<Key,T> >; 757 friend class QDeepCopy< QMap<Key,T> >;
758}; 758};
759 759
760template<class Key, class T> 760template<class Key, class T>
761Q_INLINE_TEMPLATES QMap<Key,T>& QMap<Key,T>::operator= ( const QMap<Key,T>& m ) 761Q_INLINE_TEMPLATES QMap<Key,T>& QMap<Key,T>::operator= ( const QMap<Key,T>& m )
762{ 762{
763 m.sh->ref(); 763 m.sh->ref();
764 if ( sh->deref() ) 764 if ( sh->deref() )
765 delete sh; 765 delete sh;
766 sh = m.sh; 766 sh = m.sh;
767 return *this; 767 return *this;
768} 768}
769 769
770template<class Key, class T> 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 ) 771Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::insert_pair QMap<Key,T>::insert( const Q_TYPENAME QMap<Key,T>::value_type& x )
772{ 772{
773 detach(); 773 detach();
774 size_type n = size(); 774 size_type n = size();
775 iterator it = sh->insertSingle( x.first ); 775 iterator it = sh->insertSingle( x.first );
776 bool inserted = FALSE; 776 bool inserted = FALSE;
777 if ( n < size() ) { 777 if ( n < size() ) {
778 inserted = TRUE; 778 inserted = TRUE;
779 it.data() = x.second; 779 it.data() = x.second;
780 } 780 }
781 return QPair<iterator,bool>( it, inserted ); 781 return QPair<iterator,bool>( it, inserted );
782} 782}
783 783
784template<class Key, class T> 784template<class Key, class T>
785Q_INLINE_TEMPLATES void QMap<Key,T>::erase( const Key& k ) 785Q_INLINE_TEMPLATES void QMap<Key,T>::erase( const Key& k )
786{ 786{
787 detach(); 787 detach();
788 iterator it( sh->find( k ).node ); 788 iterator it( sh->find( k ).node );
789 if ( it != end() ) 789 if ( it != end() )
790 sh->remove( it ); 790 sh->remove( it );
791} 791}
792 792
793template<class Key, class T> 793template<class Key, class T>
794Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::size_type QMap<Key,T>::count( const Key& k ) const 794Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::size_type QMap<Key,T>::count( const Key& k ) const
795{ 795{
796 const_iterator it( sh->find( k ).node ); 796 const_iterator it( sh->find( k ).node );
797 if ( it != end() ) { 797 if ( it != end() ) {
798 size_type c = 0; 798 size_type c = 0;
799 while ( it != end() ) { 799 while ( it != end() ) {
800 ++it; 800 ++it;
801 ++c; 801 ++c;
802 } 802 }
803 return c; 803 return c;
804 } 804 }
805 return 0; 805 return 0;
806} 806}
807 807
808template<class Key, class T> 808template<class Key, class T>
809Q_INLINE_TEMPLATES T& QMap<Key,T>::operator[] ( const Key& k ) 809Q_INLINE_TEMPLATES T& QMap<Key,T>::operator[] ( const Key& k )
810{ 810{
811 detach(); 811 detach();
812 QMapNode<Key,T>* p = sh->find( k ).node; 812 QMapNode<Key,T>* p = sh->find( k ).node;
813 if ( p != sh->end().node ) 813 if ( p != sh->end().node )
814 return p->data; 814 return p->data;
815 return insert( k, T() ).data(); 815 return insert( k, T() ).data();
816} 816}
817 817
818template<class Key, class T> 818template<class Key, class T>
819Q_INLINE_TEMPLATES void QMap<Key,T>::clear() 819Q_INLINE_TEMPLATES void QMap<Key,T>::clear()
820{ 820{
821 if ( sh->count == 1 ) 821 if ( sh->count == 1 )
822 sh->clear(); 822 sh->clear();
823 else { 823 else {
824 sh->deref(); 824 sh->deref();
825 sh = new QMapPrivate<Key,T>; 825 sh = new QMapPrivate<Key,T>;
826 } 826 }
827} 827}
828 828
829template<class Key, class T> 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 ) 830Q_INLINE_TEMPLATES Q_TYPENAME QMap<Key,T>::iterator QMap<Key,T>::insert( const Key& key, const T& value, bool overwrite )
831{ 831{
832 detach(); 832 detach();
833 size_type n = size(); 833 size_type n = size();
834 iterator it = sh->insertSingle( key ); 834 iterator it = sh->insertSingle( key );
835 if ( overwrite || n < size() ) 835 if ( overwrite || n < size() )
836 it.data() = value; 836 it.data() = value;
837 return it; 837 return it;
838} 838}
839 839
840template<class Key, class T> 840template<class Key, class T>
841Q_INLINE_TEMPLATES void QMap<Key,T>::remove( const Key& k ) 841Q_INLINE_TEMPLATES void QMap<Key,T>::remove( const Key& k )
842{ 842{
843 detach(); 843 detach();
844 iterator it( sh->find( k ).node ); 844 iterator it( sh->find( k ).node );
845 if ( it != end() ) 845 if ( it != end() )
846 sh->remove( it ); 846 sh->remove( it );
847} 847}
848 848
849template<class Key, class T> 849template<class Key, class T>
850Q_INLINE_TEMPLATES void QMap<Key,T>::detachInternal() 850Q_INLINE_TEMPLATES void QMap<Key,T>::detachInternal()
851{ 851{
852 sh->deref(); sh = new QMapPrivate<Key,T>( sh ); 852 sh->deref(); sh = new QMapPrivate<Key,T>( sh );
853} 853}
854 854
855 855
856#ifndef QT_NO_DATASTREAM 856#ifndef QT_NO_DATASTREAM
857template<class Key, class T> 857template<class Key, class T>
858Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) { 858Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) {
859 m.clear(); 859 m.clear();
860 Q_UINT32 c; 860 Q_UINT32 c;
861 s >> c; 861 s >> c;
862 for( Q_UINT32 i = 0; i < c; ++i ) { 862 for( Q_UINT32 i = 0; i < c; ++i ) {
863 Key k; T t; 863 Key k; T t;
864 s >> k >> t; 864 s >> k >> t;
865 m.insert( k, t ); 865 m.insert( k, t );
866 if ( s.atEnd() ) 866 if ( s.atEnd() )
867 break; 867 break;
868 } 868 }
869 return s; 869 return s;
870} 870}
871 871
872 872
873template<class Key, class T> 873template<class Key, class T>
874Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) { 874Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) {
875 s << (Q_UINT32)m.size(); 875 s << (Q_UINT32)m.size();
876 QMapConstIterator<Key,T> it = m.begin(); 876 QMapConstIterator<Key,T> it = m.begin();
877 for( ; it != m.end(); ++it ) 877 for( ; it != m.end(); ++it )
878 s << it.key() << it.data(); 878 s << it.key() << it.data();
879 return s; 879 return s;
880} 880}
881#endif 881#endif
882 882
883#ifdef QT_QWINEXPORT
884#define Q_DEFINED_QMAP
885#include "qwinexport.h"
886#endif /* QT_QWINEXPORT */
883#endif // QMAP_H 887#endif // QMAP_H
diff --git a/qmake/include/qmemarray.h b/qmake/include/qmemarray.h
index a5baf99..267670d 100644
--- a/qmake/include/qmemarray.h
+++ b/qmake/include/qmemarray.h
@@ -1,122 +1,129 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QMemArray template/macro class 4** Definition of QMemArray template/macro class
5** 5**
6** Created : 930906 6** Created : 930906
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QMEMARRAY_H 38#ifndef QMEMARRAY_H
39#define QMEMARRAY_H 39#define QMEMARRAY_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qgarray.h" 42#include "qgarray.h"
43#endif // QT_H 43#endif // QT_H
44 44
45 45
46template<class type> 46template<class type>
47class QMemArray : public QGArray 47class QMemArray : public QGArray
48{ 48{
49public: 49public:
50 typedef type* Iterator; 50 typedef type* Iterator;
51 typedef const type* ConstIterator; 51 typedef const type* ConstIterator;
52 typedef type ValueType; 52 typedef type ValueType;
53 53
54protected: 54protected:
55 QMemArray( int, int ) : QGArray( 0, 0 ) {} 55 QMemArray( int, int ) : QGArray( 0, 0 ) {}
56 56
57public: 57public:
58 QMemArray() {} 58 QMemArray() {}
59 QMemArray( int size ) : QGArray(size*sizeof(type)) {} 59 QMemArray( int size ) : QGArray(size*sizeof(type)) {}
60 QMemArray( const QMemArray<type> &a ) : QGArray(a) {} 60 QMemArray( const QMemArray<type> &a ) : QGArray(a) {}
61 ~QMemArray() {} 61 ~QMemArray() {}
62 QMemArray<type> &operator=(const QMemArray<type> &a) 62 QMemArray<type> &operator=(const QMemArray<type> &a)
63 { return (QMemArray<type>&)QGArray::assign(a); } 63 { return (QMemArray<type>&)QGArray::assign(a); }
64 type *data() const{ return (type *)QGArray::data(); } 64 type *data() const{ return (type *)QGArray::data(); }
65 uint nrefs() const{ return QGArray::nrefs(); } 65 uint nrefs() const{ return QGArray::nrefs(); }
66 uint size() const{ return QGArray::size()/sizeof(type); } 66 uint size() const{ return QGArray::size()/sizeof(type); }
67 uint count() const{ return size(); } 67 uint count() const{ return size(); }
68 bool isEmpty() const{ return QGArray::size() == 0; } 68 bool isEmpty() const{ return QGArray::size() == 0; }
69 bool isNull() const{ return QGArray::data() == 0; } 69 bool isNull() const{ return QGArray::data() == 0; }
70 bool resize( uint size ){ return QGArray::resize(size*sizeof(type)); } 70 bool resize( uint size ){ return QGArray::resize(size*sizeof(type)); }
71 bool resize( uint size, Optimization optim ) { return QGArray::resize(size*sizeof(type), optim); }
71 bool truncate( uint pos ){ return QGArray::resize(pos*sizeof(type)); } 72 bool truncate( uint pos ){ return QGArray::resize(pos*sizeof(type)); }
72 bool fill( const type &d, int size = -1 ) 73 bool fill( const type &d, int size = -1 )
73 { return QGArray::fill((char*)&d,size,sizeof(type) ); } 74 { return QGArray::fill((char*)&d,size,sizeof(type) ); }
74 void detach() { QGArray::detach(); } 75 void detach() { QGArray::detach(); }
75 QMemArray<type> copy() const 76 QMemArray<type> copy() const
76 { QMemArray<type> tmp; return tmp.duplicate(*this); } 77 { QMemArray<type> tmp; return tmp.duplicate(*this); }
77 QMemArray<type>& assign( const QMemArray<type>& a ) 78 QMemArray<type>& assign( const QMemArray<type>& a )
78 { return (QMemArray<type>&)QGArray::assign(a); } 79 { return (QMemArray<type>&)QGArray::assign(a); }
79 QMemArray<type>& assign( const type *a, uint n ) 80 QMemArray<type>& assign( const type *a, uint n )
80 { return (QMemArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); } 81 { return (QMemArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); }
81 QMemArray<type>& duplicate( const QMemArray<type>& a ) 82 QMemArray<type>& duplicate( const QMemArray<type>& a )
82 { return (QMemArray<type>&)QGArray::duplicate(a); } 83 { return (QMemArray<type>&)QGArray::duplicate(a); }
83 QMemArray<type>& duplicate( const type *a, uint n ) 84 QMemArray<type>& duplicate( const type *a, uint n )
84 { return (QMemArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); } 85 { return (QMemArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); }
85 QMemArray<type>& setRawData( const type *a, uint n ) 86 QMemArray<type>& setRawData( const type *a, uint n )
86 { return (QMemArray<type>&)QGArray::setRawData((char*)a, 87 { return (QMemArray<type>&)QGArray::setRawData((char*)a,
87 n*sizeof(type)); } 88 n*sizeof(type)); }
88 void resetRawData( const type *a, uint n ) 89 void resetRawData( const type *a, uint n )
89 { QGArray::resetRawData((char*)a,n*sizeof(type)); } 90 { QGArray::resetRawData((char*)a,n*sizeof(type)); }
90 int find( const type &d, uint i=0 ) const 91 int find( const type &d, uint i=0 ) const
91 { return QGArray::find((char*)&d,i,sizeof(type)); } 92 { return QGArray::find((char*)&d,i,sizeof(type)); }
92 int contains( const type &d ) const 93 int contains( const type &d ) const
93 { return QGArray::contains((char*)&d,sizeof(type)); } 94 { return QGArray::contains((char*)&d,sizeof(type)); }
94 void sort() { QGArray::sort(sizeof(type)); } 95 void sort() { QGArray::sort(sizeof(type)); }
95 int bsearch( const type &d ) const 96 int bsearch( const type &d ) const
96 { return QGArray::bsearch((const char*)&d,sizeof(type)); } 97 { return QGArray::bsearch((const char*)&d,sizeof(type)); }
97 // ### Qt 4.0: maybe provide uint overload as work-around for MSVC bug 98 // ### Qt 4.0: maybe provide uint overload as work-around for MSVC bug
98 type& operator[]( int i ) const 99 type& operator[]( int i ) const
99 { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } 100 { return (type &)(*(type *)QGArray::at(i*sizeof(type))); }
100 type& at( uint i ) const 101 type& at( uint i ) const
101 { return (type &)(*(type *)QGArray::at(i*sizeof(type))); } 102 { return (type &)(*(type *)QGArray::at(i*sizeof(type))); }
102 operator const type*() const { return (const type *)QGArray::data(); } 103 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); }
104 bool operator!=( const QMemArray<type> &a ) const { return !isEqual(a); } 105 bool operator!=( const QMemArray<type> &a ) const { return !isEqual(a); }
105 Iterator begin() { return data(); } 106 Iterator begin() { return data(); }
106 Iterator end() { return data() + size(); } 107 Iterator end() { return data() + size(); }
107 ConstIterator begin() const { return data(); } 108 ConstIterator begin() const { return data(); }
108 ConstIterator end() const { return data() + size(); } 109 ConstIterator end() const { return data() + size(); }
109}; 110};
110 111
112#ifndef QT_QWINEXPORT
111#if defined(Q_TEMPLATEDLL) 113#if defined(Q_TEMPLATEDLL)
112// MOC_SKIP_BEGIN 114// MOC_SKIP_BEGIN
113Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<int>; 115Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<int>;
114Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<bool>; 116Q_TEMPLATE_EXTERN template class Q_EXPORT QMemArray<bool>;
115// MOC_SKIP_END 117// MOC_SKIP_END
116#endif 118#endif
119#endif /* QT_QWINEXPORT */
117 120
118#ifndef QT_NO_COMPAT 121#ifndef QT_NO_COMPAT
119#define QArray QMemArray 122#define QArray QMemArray
120#endif 123#endif
121 124
125#ifdef QT_QWINEXPORT
126#define Q_DEFINED_QMEMARRAY
127#include <qwinexport.h>
128#endif /* QT_QWINEXPORT */
122#endif // QARRAY_H 129#endif // QARRAY_H
diff --git a/qmake/include/qptrlist.h b/qmake/include/qptrlist.h
index 53fb605..17b5ee9 100644
--- a/qmake/include/qptrlist.h
+++ b/qmake/include/qptrlist.h
@@ -1,160 +1,162 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QPtrList template/macro class 4** Definition of QPtrList template/macro class
5** 5**
6** Created :
7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 6** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 7**
10** This file is part of the tools module of the Qt GUI Toolkit. 8** This file is part of the tools module of the Qt GUI Toolkit.
11** 9**
12** This file may be distributed under the terms of the Q Public License 10** 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 11** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 12** LICENSE.QPL included in the packaging of this file.
15** 13**
16** This file may be distributed and/or modified under the terms of the 14** 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 15** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the 16** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 17** packaging of this file.
20** 18**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 19** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 20** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 21** Agreement provided with the Software.
24** 22**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 23** 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. 24** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 25**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 26** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 27** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 28** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 29** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 30**
33** Contact info@trolltech.com if any conditions of this licensing are 31** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 32** not clear to you.
35** 33**
36**********************************************************************/ 34**********************************************************************/
37 35
38#ifndef QPTRLIST_H 36#ifndef QPTRLIST_H
39#define QPTRLIST_H 37#define QPTRLIST_H
40 38
41#ifndef QT_H 39#ifndef QT_H
42#include "qglist.h" 40#include "qglist.h"
43#endif // QT_H 41#endif // QT_H
44 42
45 43
46template<class type> 44template<class type>
47class QPtrList 45class QPtrList
48#ifdef Q_QDOC 46#ifdef Q_QDOC
49 : public QPtrCollection 47 : public QPtrCollection
50#else 48#else
51 : public QGList 49 : public QGList
52#endif 50#endif
53{ 51{
54public: 52public:
55 QPtrList() {} 53 QPtrList() {}
56 QPtrList( const QPtrList<type> &l ) : QGList(l) {} 54 QPtrList( const QPtrList<type> &l ) : QGList(l) {}
57 ~QPtrList() { clear(); } 55 ~QPtrList() { clear(); }
58 QPtrList<type> &operator=(const QPtrList<type> &l) 56 QPtrList<type> &operator=(const QPtrList<type> &l)
59 { return (QPtrList<type>&)QGList::operator=(l); } 57 { return (QPtrList<type>&)QGList::operator=(l); }
60 bool operator==( const QPtrList<type> &list ) const 58 bool operator==( const QPtrList<type> &list ) const
61 { return QGList::operator==( list ); } 59 { return QGList::operator==( list ); }
62 bool operator!=( const QPtrList<type> &list ) const 60 bool operator!=( const QPtrList<type> &list ) const
63 { return !QGList::operator==( list ); } 61 { return !QGList::operator==( list ); }
64 uint count() const { return QGList::count(); } 62 uint count() const { return QGList::count(); }
65 bool isEmpty() const { return QGList::count() == 0; } 63 bool isEmpty() const { return QGList::count() == 0; }
66 bool insert( uint i, const type *d){ return QGList::insertAt(i,(QPtrCollection::Item)d); } 64 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); } 65 void inSort( const type *d ){ QGList::inSort((QPtrCollection::Item)d); }
68 void prepend( const type *d ){ QGList::insertAt(0,(QPtrCollection::Item)d); } 66 void prepend( const type *d ){ QGList::insertAt(0,(QPtrCollection::Item)d); }
69 void append( const type *d ){ QGList::append((QPtrCollection::Item)d); } 67 void append( const type *d ){ QGList::append((QPtrCollection::Item)d); }
70 bool remove( uint i ) { return QGList::removeAt(i); } 68 bool remove( uint i ) { return QGList::removeAt(i); }
71 bool remove() { return QGList::remove((QPtrCollection::Item)0); } 69 bool remove() { return QGList::remove((QPtrCollection::Item)0); }
72 bool remove( const type *d ){ return QGList::remove((QPtrCollection::Item)d); } 70 bool remove( const type *d ){ return QGList::remove((QPtrCollection::Item)d); }
73 bool removeRef( const type *d ){ return QGList::removeRef((QPtrCollection::Item)d); } 71 bool removeRef( const type *d ){ return QGList::removeRef((QPtrCollection::Item)d); }
74 void removeNode( QLNode *n ){ QGList::removeNode(n); } 72 void removeNode( QLNode *n ){ QGList::removeNode(n); }
75 bool removeFirst() { return QGList::removeFirst(); } 73 bool removeFirst() { return QGList::removeFirst(); }
76 bool removeLast() { return QGList::removeLast(); } 74 bool removeLast() { return QGList::removeLast(); }
77 type *take( uint i ) { return (type *)QGList::takeAt(i); } 75 type *take( uint i ) { return (type *)QGList::takeAt(i); }
78 type *take() { return (type *)QGList::take(); } 76 type *take() { return (type *)QGList::take(); }
79 type *takeNode( QLNode *n ) { return (type *)QGList::takeNode(n); } 77 type *takeNode( QLNode *n ) { return (type *)QGList::takeNode(n); }
80 void clear() { QGList::clear(); } 78 void clear() { QGList::clear(); }
81 void sort() { QGList::sort(); } 79 void sort() { QGList::sort(); }
82 int find( const type *d ) { return QGList::find((QPtrCollection::Item)d); } 80 int find( const type *d ) { return QGList::find((QPtrCollection::Item)d); }
83 int findNext( const type *d ){ return QGList::find((QPtrCollection::Item)d,FALSE); } 81 int findNext( const type *d ){ return QGList::find((QPtrCollection::Item)d,FALSE); }
84 int findRef( const type *d ){ return QGList::findRef((QPtrCollection::Item)d); } 82 int findRef( const type *d ){ return QGList::findRef((QPtrCollection::Item)d); }
85 int findNextRef( const type *d ){ return QGList::findRef((QPtrCollection::Item)d,FALSE);} 83 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); } 84 uint contains( const type *d ) const { return QGList::contains((QPtrCollection::Item)d); }
87 uint containsRef( const type *d ) const 85 uint containsRef( const type *d ) const
88 { return QGList::containsRef((QPtrCollection::Item)d); } 86 { return QGList::containsRef((QPtrCollection::Item)d); }
89 bool replace( uint i, const type *d ) { return QGList::replaceAt( i, (QPtrCollection::Item)d ); } 87 bool replace( uint i, const type *d ) { return QGList::replaceAt( i, (QPtrCollection::Item)d ); }
90 type *at( uint i ) { return (type *)QGList::at(i); } 88 type *at( uint i ) { return (type *)QGList::at(i); }
91 int at() const { return QGList::at(); } 89 int at() const { return QGList::at(); }
92 type *current() const { return (type *)QGList::get(); } 90 type *current() const { return (type *)QGList::get(); }
93 QLNode *currentNode() const{ return QGList::currentNode(); } 91 QLNode *currentNode() const{ return QGList::currentNode(); }
94 type *getFirst() const { return (type *)QGList::cfirst(); } 92 type *getFirst() const { return (type *)QGList::cfirst(); }
95 type *getLast() const { return (type *)QGList::clast(); } 93 type *getLast() const { return (type *)QGList::clast(); }
96 type *first() { return (type *)QGList::first(); } 94 type *first() { return (type *)QGList::first(); }
97 type *last() { return (type *)QGList::last(); } 95 type *last() { return (type *)QGList::last(); }
98 type *next() { return (type *)QGList::next(); } 96 type *next() { return (type *)QGList::next(); }
99 type *prev() { return (type *)QGList::prev(); } 97 type *prev() { return (type *)QGList::prev(); }
100 void toVector( QGVector *vec )const{ QGList::toVector(vec); } 98 void toVector( QGVector *vec )const{ QGList::toVector(vec); }
101 99
102#ifdef Q_QDOC 100#ifdef Q_QDOC
103protected: 101protected:
104 virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item ); 102 virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item );
105 virtual QDataStream& read( QDataStream&, QPtrCollection::Item& ); 103 virtual QDataStream& read( QDataStream&, QPtrCollection::Item& );
106 virtual QDataStream& write( QDataStream&, QPtrCollection::Item ) const; 104 virtual QDataStream& write( QDataStream&, QPtrCollection::Item ) const;
107#endif 105#endif
108 106
109private: 107private:
110 void deleteItem( Item d ); 108 void deleteItem( Item d );
111}; 109};
112 110
113#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) 111#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
114template<> inline void QPtrList<void>::deleteItem( QPtrCollection::Item ) 112template<> inline void QPtrList<void>::deleteItem( QPtrCollection::Item )
115{ 113{
116} 114}
117#endif 115#endif
118 116
119template<class type> inline void QPtrList<type>::deleteItem( QPtrCollection::Item d ) 117template<class type> inline void QPtrList<type>::deleteItem( QPtrCollection::Item d )
120{ 118{
121 if ( del_item ) delete (type *)d; 119 if ( del_item ) delete (type *)d;
122} 120}
123 121
124template<class type> 122template<class type>
125class QPtrListIterator : public QGListIterator 123class QPtrListIterator : public QGListIterator
126{ 124{
127public: 125public:
128 QPtrListIterator(const QPtrList<type> &l) :QGListIterator((QGList &)l) {} 126 QPtrListIterator(const QPtrList<type> &l) :QGListIterator((QGList &)l) {}
129 ~QPtrListIterator() {} 127 ~QPtrListIterator() {}
130 uint count() const { return list->count(); } 128 uint count() const { return list->count(); }
131 bool isEmpty() const { return list->count() == 0; } 129 bool isEmpty() const { return list->count() == 0; }
132 bool atFirst() const { return QGListIterator::atFirst(); } 130 bool atFirst() const { return QGListIterator::atFirst(); }
133 bool atLast() const { return QGListIterator::atLast(); } 131 bool atLast() const { return QGListIterator::atLast(); }
134 type *toFirst() { return (type *)QGListIterator::toFirst(); } 132 type *toFirst() { return (type *)QGListIterator::toFirst(); }
135 type *toLast() { return (type *)QGListIterator::toLast(); } 133 type *toLast() { return (type *)QGListIterator::toLast(); }
136 operator type *() const { return (type *)QGListIterator::get(); } 134 operator type *() const { return (type *)QGListIterator::get(); }
137 type *operator*() { return (type *)QGListIterator::get(); } 135 type *operator*() { return (type *)QGListIterator::get(); }
138 136
139 // No good, since QPtrList<char> (ie. QStrList fails... 137 // No good, since QPtrList<char> (ie. QStrList fails...
140 // 138 //
141 // MSVC++ gives warning 139 // MSVC++ gives warning
142 // Sunpro C++ 4.1 gives error 140 // Sunpro C++ 4.1 gives error
143 // type *operator->() { return (type *)QGListIterator::get(); } 141 // type *operator->() { return (type *)QGListIterator::get(); }
144 142
145 type *current() const { return (type *)QGListIterator::get(); } 143 type *current() const { return (type *)QGListIterator::get(); }
146 type *operator()() { return (type *)QGListIterator::operator()();} 144 type *operator()() { return (type *)QGListIterator::operator()();}
147 type *operator++() { return (type *)QGListIterator::operator++(); } 145 type *operator++() { return (type *)QGListIterator::operator++(); }
148 type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);} 146 type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);}
149 type *operator--() { return (type *)QGListIterator::operator--(); } 147 type *operator--() { return (type *)QGListIterator::operator--(); }
150 type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);} 148 type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);}
151 QPtrListIterator<type>& operator=(const QPtrListIterator<type>&it) 149 QPtrListIterator<type>& operator=(const QPtrListIterator<type>&it)
152 { QGListIterator::operator=(it); return *this; } 150 { QGListIterator::operator=(it); return *this; }
153}; 151};
154 152
155#ifndef QT_NO_COMPAT 153#ifndef QT_NO_COMPAT
156#define QList QPtrList 154#define QList QPtrList
157#define QListIterator QPtrListIterator 155#define QListIterator QPtrListIterator
158#endif 156#endif
159 157
158#ifdef QT_QWINEXPORT
159#define Q_DEFINED_QPTRLIST
160#include "qwinexport.h"
161#endif /* QT_QWINEXPORT */
160#endif // QPTRLIST_H 162#endif // QPTRLIST_H
diff --git a/qmake/include/qptrvector.h b/qmake/include/qptrvector.h
index f6d9623..49b40b7 100644
--- a/qmake/include/qptrvector.h
+++ b/qmake/include/qptrvector.h
@@ -1,113 +1,117 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QPtrVector pointer based template class 4** Definition of QPtrVector pointer based template class
5** 5**
6** Created : 930907 6** Created : 930907
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QPTRVECTOR_H 38#ifndef QPTRVECTOR_H
39#define QPTRVECTOR_H 39#define QPTRVECTOR_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qgvector.h" 42#include "qgvector.h"
43#endif // QT_H 43#endif // QT_H
44 44
45template<class type> 45template<class type>
46class QPtrVector 46class QPtrVector
47#ifdef Q_QDOC 47#ifdef Q_QDOC
48 : public QPtrCollection 48 : public QPtrCollection
49#else 49#else
50 : public QGVector 50 : public QGVector
51#endif 51#endif
52{ 52{
53public: 53public:
54 QPtrVector() { } 54 QPtrVector() { }
55 QPtrVector( uint size ) : QGVector(size) { } 55 QPtrVector( uint size ) : QGVector(size) { }
56 QPtrVector( const QPtrVector<type> &v ) : QGVector( v ) { } 56 QPtrVector( const QPtrVector<type> &v ) : QGVector( v ) { }
57 ~QPtrVector() { clear(); } 57 ~QPtrVector() { clear(); }
58 QPtrVector<type> &operator=(const QPtrVector<type> &v) 58 QPtrVector<type> &operator=(const QPtrVector<type> &v)
59 { return (QPtrVector<type>&)QGVector::operator=(v); } 59 { return (QPtrVector<type>&)QGVector::operator=(v); }
60 bool operator==( const QPtrVector<type> &v ) const { return QGVector::operator==(v); } 60 bool operator==( const QPtrVector<type> &v ) const { return QGVector::operator==(v); }
61 type **data() const { return (type **)QGVector::data(); } 61 type **data() const { return (type **)QGVector::data(); }
62 uint size() const { return QGVector::size(); } 62 uint size() const { return QGVector::size(); }
63 uint count() const { return QGVector::count(); } 63 uint count() const { return QGVector::count(); }
64 bool isEmpty() const { return QGVector::count() == 0; } 64 bool isEmpty() const { return QGVector::count() == 0; }
65 bool isNull() const { return QGVector::size() == 0; } 65 bool isNull() const { return QGVector::size() == 0; }
66 bool resize( uint size ) { return QGVector::resize(size); } 66 bool resize( uint size ) { return QGVector::resize(size); }
67 bool insert( uint i, const type *d){ return QGVector::insert(i,(Item)d); } 67 bool insert( uint i, const type *d){ return QGVector::insert(i,(Item)d); }
68 bool remove( uint i ) { return QGVector::remove(i); } 68 bool remove( uint i ) { return QGVector::remove(i); }
69 type *take( uint i ) { return (type *)QGVector::take(i); } 69 type *take( uint i ) { return (type *)QGVector::take(i); }
70 void clear() { QGVector::clear(); } 70 void clear() { QGVector::clear(); }
71 bool fill( const type *d, int size=-1 ) 71 bool fill( const type *d, int size=-1 )
72 { return QGVector::fill((Item)d,size);} 72 { return QGVector::fill((Item)d,size);}
73 void sort() { QGVector::sort(); } 73 void sort() { QGVector::sort(); }
74 int bsearch( const type *d ) const{ return QGVector::bsearch((Item)d); } 74 int bsearch( const type *d ) const{ return QGVector::bsearch((Item)d); }
75 int findRef( const type *d, uint i=0 ) const 75 int findRef( const type *d, uint i=0 ) const
76 { return QGVector::findRef((Item)d,i);} 76 { return QGVector::findRef((Item)d,i);}
77 int find( const type *d, uint i= 0 ) const 77 int find( const type *d, uint i= 0 ) const
78 { return QGVector::find((Item)d,i); } 78 { return QGVector::find((Item)d,i); }
79 uint containsRef( const type *d ) const 79 uint containsRef( const type *d ) const
80 { return QGVector::containsRef((Item)d); } 80 { return QGVector::containsRef((Item)d); }
81 uint contains( const type *d ) const 81 uint contains( const type *d ) const
82 { return QGVector::contains((Item)d); } 82 { return QGVector::contains((Item)d); }
83 type *operator[]( int i ) const{ return (type *)QGVector::at(i); } 83 type *operator[]( int i ) const{ return (type *)QGVector::at(i); }
84 type *at( uint 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); } 85 void toList( QGList *list ) const{ QGVector::toList(list); }
86 86
87#ifdef Q_QDOC 87#ifdef Q_QDOC
88protected: 88protected:
89 virtual int compareItems( QPtrCollection::Item d1, QPtrCollection::Item d2 ); 89 virtual int compareItems( QPtrCollection::Item d1, QPtrCollection::Item d2 );
90 virtual QDataStream& read( QDataStream &s, QPtrCollection::Item &d ); 90 virtual QDataStream& read( QDataStream &s, QPtrCollection::Item &d );
91 virtual QDataStream& write( QDataStream &s, QPtrCollection::Item d ) const; 91 virtual QDataStream& write( QDataStream &s, QPtrCollection::Item d ) const;
92#endif 92#endif
93 93
94private: 94private:
95 void deleteItem( Item d ); 95 void deleteItem( Item d );
96}; 96};
97 97
98#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION) 98#if !defined(Q_BROKEN_TEMPLATE_SPECIALIZATION)
99template<> inline void QPtrVector<void>::deleteItem( QPtrCollection::Item ) 99template<> inline void QPtrVector<void>::deleteItem( QPtrCollection::Item )
100{ 100{
101} 101}
102#endif 102#endif
103 103
104template<class type> inline void QPtrVector<type>::deleteItem( QPtrCollection::Item d ) 104template<class type> inline void QPtrVector<type>::deleteItem( QPtrCollection::Item d )
105{ 105{
106 if ( del_item ) delete (type *)d; 106 if ( del_item ) delete (type *)d;
107} 107}
108 108
109#ifndef QT_NO_COMPAT 109#ifndef QT_NO_COMPAT
110#define QVector QPtrVector 110#define QVector QPtrVector
111#endif 111#endif
112 112
113#ifdef QT_QWINEXPORT
114#define Q_DEFINED_QPTRVECTOR
115#include "qwinexport.h"
116#endif /* QT_QWINEXPORT */
113#endif // QVECTOR_H 117#endif // QVECTOR_H
diff --git a/qmake/include/qregexp.h b/qmake/include/qregexp.h
index 7bb777a..90f54bd 100644
--- a/qmake/include/qregexp.h
+++ b/qmake/include/qregexp.h
@@ -1,115 +1,115 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QRegExp class 4** Definition of QRegExp class
5** 5**
6** Created : 950126 6** Created : 950126
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QREGEXP_H 38#ifndef QREGEXP_H
39#define QREGEXP_H 39#define QREGEXP_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qstringlist.h" 42#include "qstringlist.h"
43#endif // QT_H 43#endif // QT_H
44 44
45#ifndef QT_NO_REGEXP 45#ifndef QT_NO_REGEXP
46class QRegExpEngine; 46class QRegExpEngine;
47struct QRegExpPrivate; 47struct QRegExpPrivate;
48 48
49class Q_EXPORT QRegExp 49class Q_EXPORT QRegExp
50{ 50{
51public: 51public:
52 enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch }; 52 enum CaretMode { CaretAtZero, CaretAtOffset, CaretWontMatch };
53 53
54 QRegExp(); 54 QRegExp();
55 QRegExp( const QString& pattern, bool caseSensitive = TRUE, 55 QRegExp( const QString& pattern, bool caseSensitive = TRUE,
56 bool wildcard = FALSE ); 56 bool wildcard = FALSE );
57 QRegExp( const QRegExp& rx ); 57 QRegExp( const QRegExp& rx );
58 ~QRegExp(); 58 ~QRegExp();
59 QRegExp& operator=( const QRegExp& rx ); 59 QRegExp& operator=( const QRegExp& rx );
60 60
61 bool operator==( const QRegExp& rx ) const; 61 bool operator==( const QRegExp& rx ) const;
62 bool operator!=( const QRegExp& rx ) const { return !operator==( rx ); } 62 bool operator!=( const QRegExp& rx ) const { return !operator==( rx ); }
63 63
64 bool isEmpty() const; 64 bool isEmpty() const;
65 bool isValid() const; 65 bool isValid() const;
66 QString pattern() const; 66 QString pattern() const;
67 void setPattern( const QString& pattern ); 67 void setPattern( const QString& pattern );
68 bool caseSensitive() const; 68 bool caseSensitive() const;
69 void setCaseSensitive( bool sensitive ); 69 void setCaseSensitive( bool sensitive );
70#ifndef QT_NO_REGEXP_WILDCARD 70#ifndef QT_NO_REGEXP_WILDCARD
71 bool wildcard() const; 71 bool wildcard() const;
72 void setWildcard( bool wildcard ); 72 void setWildcard( bool wildcard );
73#endif 73#endif
74 bool minimal() const; 74 bool minimal() const;
75 void setMinimal( bool minimal ); 75 void setMinimal( bool minimal );
76 76
77 bool exactMatch( const QString& str ) const; 77 bool exactMatch( const QString& str ) const;
78#ifndef QT_NO_COMPAT 78#ifndef QT_NO_COMPAT
79 int match( const QString& str, int index = 0, int *len = 0, 79 int match( const QString& str, int index = 0, int *len = 0,
80 bool indexIsStart = TRUE ) const; 80 bool indexIsStart = TRUE ) const;
81#endif 81#endif
82 82
83#if defined(qdoc) 83#if defined(Q_QDOC)
84 int search( const QString& str, int offset = 0, 84 int search( const QString& str, int offset = 0,
85 CaretMode caretMode = CaretAtZero ) const; 85 CaretMode caretMode = CaretAtZero ) const;
86 int searchRev( const QString& str, int offset = -1, 86 int searchRev( const QString& str, int offset = -1,
87 CaretMode caretMode = CaretAtZero ) const; 87 CaretMode caretMode = CaretAtZero ) const;
88#else 88#else
89 // ### Qt 4.0: reduce these four to two functions 89 // ### Qt 4.0: reduce these four to two functions
90 int search( const QString& str, int offset = 0 ) const; 90 int search( const QString& str, int offset = 0 ) const;
91 int search( const QString& str, int offset, CaretMode caretMode ) const; 91 int search( const QString& str, int offset, CaretMode caretMode ) const;
92 int searchRev( const QString& str, int offset = -1 ) const; 92 int searchRev( const QString& str, int offset = -1 ) const;
93 int searchRev( const QString& str, int offset, CaretMode caretMode ) const; 93 int searchRev( const QString& str, int offset, CaretMode caretMode ) const;
94#endif 94#endif
95 int matchedLength() const; 95 int matchedLength() const;
96#ifndef QT_NO_REGEXP_CAPTURE 96#ifndef QT_NO_REGEXP_CAPTURE
97 int numCaptures() const; 97 int numCaptures() const;
98 QStringList capturedTexts(); 98 QStringList capturedTexts();
99 QString cap( int nth = 0 ); 99 QString cap( int nth = 0 );
100 int pos( int nth = 0 ); 100 int pos( int nth = 0 );
101 QString errorString(); 101 QString errorString();
102#endif 102#endif
103 103
104 static QString escape( const QString& str ); 104 static QString escape( const QString& str );
105 105
106private: 106private:
107 void compile( bool caseSensitive ); 107 void compile( bool caseSensitive );
108 108
109 static int caretIndex( int offset, CaretMode caretMode ); 109 static int caretIndex( int offset, CaretMode caretMode );
110 110
111 QRegExpEngine *eng; 111 QRegExpEngine *eng;
112 QRegExpPrivate *priv; 112 QRegExpPrivate *priv;
113}; 113};
114#endif // QT_NO_REGEXP 114#endif // QT_NO_REGEXP
115#endif // QREGEXP_H 115#endif // QREGEXP_H
diff --git a/qmake/include/qstring.h b/qmake/include/qstring.h
index 2a87a5a..c1d6740 100644
--- a/qmake/include/qstring.h
+++ b/qmake/include/qstring.h
@@ -1,950 +1,991 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of the QString class, and related Unicode 4** Definition of the QString class, and related Unicode functions.
5** functions.
6** 5**
7** Created : 920609 6** Created : 920609
8** 7**
9** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
10** 9**
11** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
12** 11**
13** This file may be distributed under the terms of the Q Public License 12** 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 13** as defined by Trolltech AS of Norway and appearing in the file
15** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
16** 15**
17** This file may be distributed and/or modified under the terms of the 16** 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 17** GNU General Public License version 2 as published by the Free Software
19** Foundation and appearing in the file LICENSE.GPL included in the 18** Foundation and appearing in the file LICENSE.GPL included in the
20** packaging of this file. 19** packaging of this file.
21** 20**
22** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
23** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
24** Agreement provided with the Software. 23** Agreement provided with the Software.
25** 24**
26** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 25** 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28** 27**
29** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
30** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
31** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
32** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
33** 32**
34** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
35** not clear to you. 34** not clear to you.
36** 35**
37**********************************************************************/ 36**********************************************************************/
38 37
39#ifndef QSTRING_H 38#ifndef QSTRING_H
40#define QSTRING_H 39#define QSTRING_H
41 40
42#ifndef QT_H 41#ifndef QT_H
43#include "qcstring.h" 42#include "qcstring.h"
44#endif // QT_H 43#endif // QT_H
45 44
45#ifndef QT_NO_STL
46#include <string>
47#if defined(Q_WRONG_SB_CTYPE_MACROS) && defined(_SB_CTYPE_MACROS)
48#undef _SB_CTYPE_MACROS
49#endif
50#endif
51
46 52
47/***************************************************************************** 53/*****************************************************************************
48 QString class 54 QString class
49 *****************************************************************************/ 55 *****************************************************************************/
50 56
51class QRegExp; 57class QRegExp;
52class QString; 58class QString;
53class QCharRef; 59class QCharRef;
54template <class T> class QDeepCopy; 60template <class T> class QDeepCopy;
55 61
56class Q_EXPORT QChar { 62class Q_EXPORT QChar {
57public: 63public:
58 QChar(); 64 QChar();
59 QChar( char c ); 65 QChar( char c );
60 QChar( uchar c ); 66 QChar( uchar c );
61 QChar( uchar c, uchar r ); 67 QChar( uchar c, uchar r );
62 QChar( const QChar& c ); 68 QChar( const QChar& c );
63 QChar( ushort rc ); 69 QChar( ushort rc );
64 QChar( short rc ); 70 QChar( short rc );
65 QChar( uint rc ); 71 QChar( uint rc );
66 QChar( int rc ); 72 QChar( int rc );
67 73
68 QT_STATIC_CONST QChar null; // 0000 74 QT_STATIC_CONST QChar null; // 0000
69 QT_STATIC_CONST QChar replacement; // FFFD 75 QT_STATIC_CONST QChar replacement; // FFFD
70 QT_STATIC_CONST QChar byteOrderMark; // FEFF 76 QT_STATIC_CONST QChar byteOrderMark; // FEFF
71 QT_STATIC_CONST QChar byteOrderSwapped; // FFFE 77 QT_STATIC_CONST QChar byteOrderSwapped; // FFFE
72 QT_STATIC_CONST QChar nbsp; // 00A0 78 QT_STATIC_CONST QChar nbsp; // 00A0
73 79
74 // Unicode information 80 // Unicode information
75 81
76 enum Category 82 enum Category
77 { 83 {
78 NoCategory, 84 NoCategory,
79 85
80 Mark_NonSpacing, // Mn 86 Mark_NonSpacing, // Mn
81 Mark_SpacingCombining, // Mc 87 Mark_SpacingCombining, // Mc
82 Mark_Enclosing, // Me 88 Mark_Enclosing, // Me
83 89
84 Number_DecimalDigit, // Nd 90 Number_DecimalDigit, // Nd
85 Number_Letter, // Nl 91 Number_Letter, // Nl
86 Number_Other, // No 92 Number_Other, // No
87 93
88 Separator_Space, // Zs 94 Separator_Space, // Zs
89 Separator_Line, // Zl 95 Separator_Line, // Zl
90 Separator_Paragraph, // Zp 96 Separator_Paragraph, // Zp
91 97
92 Other_Control, // Cc 98 Other_Control, // Cc
93 Other_Format, // Cf 99 Other_Format, // Cf
94 Other_Surrogate, // Cs 100 Other_Surrogate, // Cs
95 Other_PrivateUse, // Co 101 Other_PrivateUse, // Co
96 Other_NotAssigned, // Cn 102 Other_NotAssigned, // Cn
97 103
98 Letter_Uppercase, // Lu 104 Letter_Uppercase, // Lu
99 Letter_Lowercase, // Ll 105 Letter_Lowercase, // Ll
100 Letter_Titlecase, // Lt 106 Letter_Titlecase, // Lt
101 Letter_Modifier, // Lm 107 Letter_Modifier, // Lm
102 Letter_Other, // Lo 108 Letter_Other, // Lo
103 109
104 Punctuation_Connector, // Pc 110 Punctuation_Connector, // Pc
105 Punctuation_Dash, // Pd 111 Punctuation_Dash, // Pd
106 Punctuation_Dask = Punctuation_Dash, // oops 112 Punctuation_Dask = Punctuation_Dash, // oops
107 Punctuation_Open, // Ps 113 Punctuation_Open, // Ps
108 Punctuation_Close, // Pe 114 Punctuation_Close, // Pe
109 Punctuation_InitialQuote, // Pi 115 Punctuation_InitialQuote, // Pi
110 Punctuation_FinalQuote, // Pf 116 Punctuation_FinalQuote, // Pf
111 Punctuation_Other, // Po 117 Punctuation_Other, // Po
112 118
113 Symbol_Math, // Sm 119 Symbol_Math, // Sm
114 Symbol_Currency, // Sc 120 Symbol_Currency, // Sc
115 Symbol_Modifier, // Sk 121 Symbol_Modifier, // Sk
116 Symbol_Other // So 122 Symbol_Other // So
117 }; 123 };
118 124
119 enum Direction 125 enum Direction
120 { 126 {
121 DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON, 127 DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
122 DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN 128 DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
123 }; 129 };
124 130
125 enum Decomposition 131 enum Decomposition
126 { 132 {
127 Single, Canonical, Font, NoBreak, Initial, Medial, 133 Single, Canonical, Font, NoBreak, Initial, Medial,
128 Final, Isolated, Circle, Super, Sub, Vertical, 134 Final, Isolated, Circle, Super, Sub, Vertical,
129 Wide, Narrow, Small, Square, Compat, Fraction 135 Wide, Narrow, Small, Square, Compat, Fraction
130 }; 136 };
131 137
132 enum Joining 138 enum Joining
133 { 139 {
134 OtherJoining, Dual, Right, Center 140 OtherJoining, Dual, Right, Center
135 }; 141 };
136 142
137 enum CombiningClass 143 enum CombiningClass
138 { 144 {
139 Combining_BelowLeftAttached = 200, 145 Combining_BelowLeftAttached = 200,
140 Combining_BelowAttached = 202, 146 Combining_BelowAttached = 202,
141 Combining_BelowRightAttached = 204, 147 Combining_BelowRightAttached = 204,
142 Combining_LeftAttached = 208, 148 Combining_LeftAttached = 208,
143 Combining_RightAttached = 210, 149 Combining_RightAttached = 210,
144 Combining_AboveLeftAttached = 212, 150 Combining_AboveLeftAttached = 212,
145 Combining_AboveAttached = 214, 151 Combining_AboveAttached = 214,
146 Combining_AboveRightAttached = 216, 152 Combining_AboveRightAttached = 216,
147 153
148 Combining_BelowLeft = 218, 154 Combining_BelowLeft = 218,
149 Combining_Below = 220, 155 Combining_Below = 220,
150 Combining_BelowRight = 222, 156 Combining_BelowRight = 222,
151 Combining_Left = 224, 157 Combining_Left = 224,
152 Combining_Right = 226, 158 Combining_Right = 226,
153 Combining_AboveLeft = 228, 159 Combining_AboveLeft = 228,
154 Combining_Above = 230, 160 Combining_Above = 230,
155 Combining_AboveRight = 232, 161 Combining_AboveRight = 232,
156 162
157 Combining_DoubleBelow = 233, 163 Combining_DoubleBelow = 233,
158 Combining_DoubleAbove = 234, 164 Combining_DoubleAbove = 234,
159 Combining_IotaSubscript = 240 165 Combining_IotaSubscript = 240
160 }; 166 };
161 167
162 // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO 168 // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
163 169
164 int digitValue() const; 170 int digitValue() const;
165 QChar lower() const; 171 QChar lower() const;
166 QChar upper() const; 172 QChar upper() const;
167 173
168 Category category() const; 174 Category category() const;
169 Direction direction() const; 175 Direction direction() const;
170 Joining joining() const; 176 Joining joining() const;
171 bool mirrored() const; 177 bool mirrored() const;
172 QChar mirroredChar() const; 178 QChar mirroredChar() const;
173 const QString &decomposition() const; // ### return just QString in 4.0 179 const QString &decomposition() const; // ### return just QString in 4.0
174 Decomposition decompositionTag() const; 180 Decomposition decompositionTag() const;
175 unsigned char combiningClass() const; 181 unsigned char combiningClass() const;
176 182
177 char latin1() const { return ucs > 0xff ? 0 : (char) ucs; } 183 char latin1() const { return ucs > 0xff ? 0 : (char) ucs; }
178 ushort unicode() const { return ucs; } 184 ushort unicode() const { return ucs; }
179 ushort &unicode() { return ucs; } 185 ushort &unicode() { return ucs; }
180#ifndef QT_NO_CAST_ASCII 186#ifndef QT_NO_CAST_ASCII
181 // like all ifdef'd code this is undocumented 187 // like all ifdef'd code this is undocumented
182 operator char() const { return latin1(); } 188 operator char() const { return latin1(); }
183#endif 189#endif
184 190
185 bool isNull() const { return unicode()==0; } 191 bool isNull() const { return unicode()==0; }
186 bool isPrint() const; 192 bool isPrint() const;
187 bool isPunct() const; 193 bool isPunct() const;
188 bool isSpace() const; 194 bool isSpace() const;
189 bool isMark() const; 195 bool isMark() const;
190 bool isLetter() const; 196 bool isLetter() const;
191 bool isNumber() const; 197 bool isNumber() const;
192 bool isLetterOrNumber() const; 198 bool isLetterOrNumber() const;
193 bool isDigit() const; 199 bool isDigit() const;
194 bool isSymbol() const; 200 bool isSymbol() const;
195 201
196 uchar cell() const { return ((uchar) ucs & 0xff); } 202 uchar cell() const { return ((uchar) ucs & 0xff); }
197 uchar row() const { return ((uchar) (ucs>>8)&0xff); } 203 uchar row() const { return ((uchar) (ucs>>8)&0xff); }
198 void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; } 204 void setCell( uchar cell ) { ucs = (ucs & 0xff00) + cell; }
199 void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); } 205 void setRow( uchar row ) { ucs = (((ushort) row)<<8) + (ucs&0xff); }
200 206
201 static bool networkOrdered() { 207 static bool networkOrdered() {
202 int wordSize; 208 int wordSize;
203 bool bigEndian = FALSE; 209 bool bigEndian = FALSE;
204 qSysInfo( &wordSize, &bigEndian ); 210 qSysInfo( &wordSize, &bigEndian );
205 return bigEndian; 211 return bigEndian;
206 } 212 }
207 213
208 friend inline bool operator==( char ch, QChar c ); 214 friend inline bool operator==( char ch, QChar c );
209 friend inline bool operator==( QChar c, char ch ); 215 friend inline bool operator==( QChar c, char ch );
210 friend inline bool operator==( QChar c1, QChar c2 ); 216 friend inline bool operator==( QChar c1, QChar c2 );
211 friend inline bool operator!=( QChar c1, QChar c2 ); 217 friend inline bool operator!=( QChar c1, QChar c2 );
212 friend inline bool operator!=( char ch, QChar c ); 218 friend inline bool operator!=( char ch, QChar c );
213 friend inline bool operator!=( QChar c, char ch ); 219 friend inline bool operator!=( QChar c, char ch );
214 friend inline bool operator<=( QChar c, char ch ); 220 friend inline bool operator<=( QChar c, char ch );
215 friend inline bool operator<=( char ch, QChar c ); 221 friend inline bool operator<=( char ch, QChar c );
216 friend inline bool operator<=( QChar c1, QChar c2 ); 222 friend inline bool operator<=( QChar c1, QChar c2 );
217 223
218private: 224private:
219 ushort ucs; 225 ushort ucs;
220#if defined(QT_QSTRING_UCS_4) 226#if defined(QT_QSTRING_UCS_4)
221 ushort grp; 227 ushort grp;
222#endif 228#endif
223} Q_PACKED; 229} Q_PACKED;
224 230
225inline QChar::QChar() : ucs( 0 ) 231inline QChar::QChar() : ucs( 0 )
226#ifdef QT_QSTRING_UCS_4 232#ifdef QT_QSTRING_UCS_4
227 , grp( 0 ) 233 , grp( 0 )
228#endif 234#endif
229{ 235{
230} 236}
231inline QChar::QChar( char c ) : ucs( (uchar)c ) 237inline QChar::QChar( char c ) : ucs( (uchar)c )
232#ifdef QT_QSTRING_UCS_4 238#ifdef QT_QSTRING_UCS_4
233 , grp( 0 ) 239 , grp( 0 )
234#endif 240#endif
235{ 241{
236} 242}
237inline QChar::QChar( uchar c ) : ucs( c ) 243inline QChar::QChar( uchar c ) : ucs( c )
238#ifdef QT_QSTRING_UCS_4 244#ifdef QT_QSTRING_UCS_4
239 , grp( 0 ) 245 , grp( 0 )
240#endif 246#endif
241{ 247{
242} 248}
243inline QChar::QChar( uchar c, uchar r ) : ucs( (r << 8) | c ) 249inline QChar::QChar( uchar c, uchar r ) : ucs( (r << 8) | c )
244#ifdef QT_QSTRING_UCS_4 250#ifdef QT_QSTRING_UCS_4
245 , grp( 0 ) 251 , grp( 0 )
246#endif 252#endif
247{ 253{
248} 254}
249inline QChar::QChar( const QChar& c ) : ucs( c.ucs ) 255inline QChar::QChar( const QChar& c ) : ucs( c.ucs )
250#ifdef QT_QSTRING_UCS_4 256#ifdef QT_QSTRING_UCS_4
251 , grp( c.grp ) 257 , grp( c.grp )
252#endif 258#endif
253{ 259{
254} 260}
255 261
256inline QChar::QChar( ushort rc ) : ucs( rc ) 262inline QChar::QChar( ushort rc ) : ucs( rc )
257#ifdef QT_QSTRING_UCS_4 263#ifdef QT_QSTRING_UCS_4
258 , grp( 0 ) 264 , grp( 0 )
259#endif 265#endif
260{ 266{
261} 267}
262inline QChar::QChar( short rc ) : ucs( (ushort) rc ) 268inline QChar::QChar( short rc ) : ucs( (ushort) rc )
263#ifdef QT_QSTRING_UCS_4 269#ifdef QT_QSTRING_UCS_4
264 , grp( 0 ) 270 , grp( 0 )
265#endif 271#endif
266{ 272{
267} 273}
268inline QChar::QChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) ) 274inline QChar::QChar( uint rc ) : ucs( (ushort ) (rc & 0xffff) )
269#ifdef QT_QSTRING_UCS_4 275#ifdef QT_QSTRING_UCS_4
270 , grp( (ushort) ((rc >> 16) & 0xffff) ) 276 , grp( (ushort) ((rc >> 16) & 0xffff) )
271#endif 277#endif
272{ 278{
273} 279}
274inline QChar::QChar( int rc ) : ucs( (ushort) (rc & 0xffff) ) 280inline QChar::QChar( int rc ) : ucs( (ushort) (rc & 0xffff) )
275#ifdef QT_QSTRING_UCS_4 281#ifdef QT_QSTRING_UCS_4
276 , grp( (ushort) ((rc >> 16) & 0xffff) ) 282 , grp( (ushort) ((rc >> 16) & 0xffff) )
277#endif 283#endif
278{ 284{
279} 285}
280 286
281inline bool operator==( char ch, QChar c ) 287inline bool operator==( char ch, QChar c )
282{ 288{
283 return ((uchar) ch) == c.ucs; 289 return ((uchar) ch) == c.ucs;
284} 290}
285 291
286inline bool operator==( QChar c, char ch ) 292inline bool operator==( QChar c, char ch )
287{ 293{
288 return ((uchar) ch) == c.ucs; 294 return ((uchar) ch) == c.ucs;
289} 295}
290 296
291inline bool operator==( QChar c1, QChar c2 ) 297inline bool operator==( QChar c1, QChar c2 )
292{ 298{
293 return c1.ucs == c2.ucs; 299 return c1.ucs == c2.ucs;
294} 300}
295 301
296inline bool operator!=( QChar c1, QChar c2 ) 302inline bool operator!=( QChar c1, QChar c2 )
297{ 303{
298 return c1.ucs != c2.ucs; 304 return c1.ucs != c2.ucs;
299} 305}
300 306
301inline bool operator!=( char ch, QChar c ) 307inline bool operator!=( char ch, QChar c )
302{ 308{
303 return ((uchar)ch) != c.ucs; 309 return ((uchar)ch) != c.ucs;
304} 310}
305 311
306inline bool operator!=( QChar c, char ch ) 312inline bool operator!=( QChar c, char ch )
307{ 313{
308 return ((uchar) ch) != c.ucs; 314 return ((uchar) ch) != c.ucs;
309} 315}
310 316
311inline bool operator<=( QChar c, char ch ) 317inline bool operator<=( QChar c, char ch )
312{ 318{
313 return c.ucs <= ((uchar) ch); 319 return c.ucs <= ((uchar) ch);
314} 320}
315 321
316inline bool operator<=( char ch, QChar c ) 322inline bool operator<=( char ch, QChar c )
317{ 323{
318 return ((uchar) ch) <= c.ucs; 324 return ((uchar) ch) <= c.ucs;
319} 325}
320 326
321inline bool operator<=( QChar c1, QChar c2 ) 327inline bool operator<=( QChar c1, QChar c2 )
322{ 328{
323 return c1.ucs <= c2.ucs; 329 return c1.ucs <= c2.ucs;
324} 330}
325 331
326inline bool operator>=( QChar c, char ch ) { return ch <= c; } 332inline bool operator>=( QChar c, char ch ) { return ch <= c; }
327inline bool operator>=( char ch, QChar c ) { return c <= ch; } 333inline bool operator>=( char ch, QChar c ) { return c <= ch; }
328inline bool operator>=( QChar c1, QChar c2 ) { return c2 <= c1; } 334inline bool operator>=( QChar c1, QChar c2 ) { return c2 <= c1; }
329inline bool operator<( QChar c, char ch ) { return !(ch<=c); } 335inline bool operator<( QChar c, char ch ) { return !(ch<=c); }
330inline bool operator<( char ch, QChar c ) { return !(c<=ch); } 336inline bool operator<( char ch, QChar c ) { return !(c<=ch); }
331inline bool operator<( QChar c1, QChar c2 ) { return !(c2<=c1); } 337inline bool operator<( QChar c1, QChar c2 ) { return !(c2<=c1); }
332inline bool operator>( QChar c, char ch ) { return !(ch>=c); } 338inline bool operator>( QChar c, char ch ) { return !(ch>=c); }
333inline bool operator>( char ch, QChar c ) { return !(c>=ch); } 339inline bool operator>( char ch, QChar c ) { return !(c>=ch); }
334inline bool operator>( QChar c1, QChar c2 ) { return !(c2>=c1); } 340inline bool operator>( QChar c1, QChar c2 ) { return !(c2>=c1); }
335 341
336// internal 342// internal
337struct Q_EXPORT QStringData : public QShared { 343struct Q_EXPORT QStringData : public QShared {
338 QStringData() : 344 QStringData() :
339 QShared(), unicode(0), ascii(0), len(0), simpletext(1), maxl(0), dirty(0) { ref(); } 345 QShared(), unicode(0), ascii(0), len(0), issimpletext(TRUE), maxl(0), islatin1(FALSE) { ref(); }
340 QStringData(QChar *u, uint l, uint m) : 346 QStringData(QChar *u, uint l, uint m) :
341 QShared(), unicode(u), ascii(0), len(l), simpletext(1), maxl(m), dirty(1) { } 347 QShared(), unicode(u), ascii(0), len(l), issimpletext(FALSE), maxl(m), islatin1(FALSE) { }
342 ~QStringData() { if ( unicode ) delete[] ((char*)unicode); 348 ~QStringData() { if ( unicode ) delete[] ((char*)unicode);
343 if ( ascii ) delete[] ascii; } 349 if ( ascii ) delete[] ascii; }
344 350
345 void deleteSelf(); 351 void deleteSelf();
346 QChar *unicode; 352 QChar *unicode;
347 char *ascii; 353 char *ascii;
348 void setDirty() { 354 void setDirty() {
349 if ( ascii ) { 355 if ( ascii ) {
350 delete [] ascii; 356 delete [] ascii;
351 ascii = 0; 357 ascii = 0;
352 } 358 }
353 dirty = 1; 359 issimpletext = FALSE;
354 } 360 }
355#ifdef Q_OS_MAC9 361#ifdef Q_OS_MAC9
356 uint len; 362 uint len;
357#else 363#else
358 uint len : 30; 364 uint len : 30;
359#endif 365#endif
360 uint simpletext : 1; 366 uint issimpletext : 1;
361#ifdef Q_OS_MAC9 367#ifdef Q_OS_MAC9
362 uint maxl; 368 uint maxl;
363#else 369#else
364 uint maxl : 30; 370 uint maxl : 30;
365#endif 371#endif
366 uint dirty : 1; 372 uint islatin1 : 1;
367 373
368private: 374private:
369#if defined(Q_DISABLE_COPY) 375#if defined(Q_DISABLE_COPY)
370 QStringData( const QStringData& ); 376 QStringData( const QStringData& );
371 QStringData& operator=( const QStringData& ); 377 QStringData& operator=( const QStringData& );
372#endif 378#endif
373}; 379};
374 380
375 381
376class Q_EXPORT QString 382class Q_EXPORT QString
377{ 383{
378public: 384public:
379 QString(); // make null string 385 QString(); // make null string
380 QString( QChar ); // one-char string 386 QString( QChar ); // one-char string
381 QString( const QString & ); // impl-shared copy 387 QString( const QString & ); // impl-shared copy
382 QString( const QByteArray& ); // deep copy 388 QString( const QByteArray& ); // deep copy
383 QString( const QChar* unicode, uint length ); // deep copy 389 QString( const QChar* unicode, uint length ); // deep copy
384#ifndef QT_NO_CAST_ASCII 390#ifndef QT_NO_CAST_ASCII
385 QString( const char *str ); // deep copy 391 QString( const char *str ); // deep copy
386#endif 392#endif
393#ifndef QT_NO_STL
394 QString( const std::string& ); // deep copy
395#endif
387 ~QString(); 396 ~QString();
388 397
389 QString &operator=( const QString & ); // impl-shared copy 398 QString &operator=( const QString & ); // impl-shared copy
390#ifndef QT_NO_CAST_ASCII
391 QString &operator=( const char * ); // deep copy 399 QString &operator=( const char * ); // deep copy
400#ifndef QT_NO_STL
401 QString &operator=( const std::string& ); // deep copy
392#endif 402#endif
393 QString &operator=( const QCString& ); // deep copy 403 QString &operator=( const QCString& ); // deep copy
394 QString &operator=( QChar c ); 404 QString &operator=( QChar c );
395 QString &operator=( char c ); 405 QString &operator=( char c );
396 406
397 QT_STATIC_CONST QString null; 407 QT_STATIC_CONST QString null;
398 408
399 bool isNull() const; 409 bool isNull() const;
400 bool isEmpty() const; 410 bool isEmpty() const;
401 uint length() const; 411 uint length() const;
402 void truncate( uint pos ); 412 void truncate( uint pos );
403 413
404 QString & fill( QChar c, int len = -1 ); 414 QString & fill( QChar c, int len = -1 );
405 415
406 QString copy() const; 416 QString copy() const;
407 417
408 QString arg( long a, int fieldwidth=0, int base=10 ) const; 418 QString arg( long a, int fieldwidth=0, int base=10 ) const;
409 QString arg( ulong a, int fieldwidth=0, int base=10 ) const; 419 QString arg( ulong a, int fieldwidth=0, int base=10 ) const;
410 QString arg( int a, int fieldwidth=0, int base=10 ) const; 420 QString arg( int a, int fieldwidth=0, int base=10 ) const;
411 QString arg( uint a, int fieldwidth=0, int base=10 ) const; 421 QString arg( uint a, int fieldwidth=0, int base=10 ) const;
412 QString arg( short a, int fieldwidth=0, int base=10 ) const; 422 QString arg( short a, int fieldwidth=0, int base=10 ) const;
413 QString arg( ushort a, int fieldwidth=0, int base=10 ) const; 423 QString arg( ushort a, int fieldwidth=0, int base=10 ) const;
414 QString arg( char a, int fieldwidth=0 ) const; 424 QString arg( char a, int fieldwidth=0 ) const;
415 QString arg( QChar a, int fieldwidth=0 ) const; 425 QString arg( QChar a, int fieldwidth=0 ) const;
416 QString arg( const QString& a, int fieldwidth=0 ) const; 426 QString arg( const QString& a, int fieldwidth=0 ) const;
417 QString arg( double a, int fieldwidth=0, char fmt='g', int prec=-1 ) const; 427 QString arg( double a, int fieldwidth=0, char fmt='g', int prec=-1 ) const;
418 428
419#ifndef QT_NO_SPRINTF 429#ifndef QT_NO_SPRINTF
420 QString &sprintf( const char* format, ... ) 430 QString &sprintf( const char* format, ... )
421#if defined(Q_CC_GNU) && !defined(__INSURE__) 431#if defined(Q_CC_GNU) && !defined(__INSURE__)
422 __attribute__ ((format (printf, 2, 3))) 432 __attribute__ ((format (printf, 2, 3)))
423#endif 433#endif
424 ; 434 ;
425#endif 435#endif
426 436
427 int find( QChar c, int index=0, bool cs=TRUE ) const; 437 int find( QChar c, int index=0, bool cs=TRUE ) const;
428 int find( char c, int index=0, bool cs=TRUE ) const; 438 int find( char c, int index=0, bool cs=TRUE ) const;
429 int find( const QString &str, int index=0, bool cs=TRUE ) const; 439 int find( const QString &str, int index=0, bool cs=TRUE ) const;
430#ifndef QT_NO_REGEXP 440#ifndef QT_NO_REGEXP
431 int find( const QRegExp &, int index=0 ) const; 441 int find( const QRegExp &, int index=0 ) const;
432#endif 442#endif
433#ifndef QT_NO_CAST_ASCII 443#ifndef QT_NO_CAST_ASCII
434 int find( const char* str, int index=0 ) const; 444 int find( const char* str, int index=0 ) const;
435#endif 445#endif
436 int findRev( QChar c, int index=-1, bool cs=TRUE) const; 446 int findRev( QChar c, int index=-1, bool cs=TRUE) const;
437 int findRev( char c, int index=-1, bool cs=TRUE) const; 447 int findRev( char c, int index=-1, bool cs=TRUE) const;
438 int findRev( const QString &str, int index=-1, bool cs=TRUE) const; 448 int findRev( const QString &str, int index=-1, bool cs=TRUE) const;
439#ifndef QT_NO_REGEXP 449#ifndef QT_NO_REGEXP
440 int findRev( const QRegExp &, int index=-1 ) const; 450 int findRev( const QRegExp &, int index=-1 ) const;
441#endif 451#endif
442#ifndef QT_NO_CAST_ASCII 452#ifndef QT_NO_CAST_ASCII
443 int findRev( const char* str, int index=-1 ) const; 453 int findRev( const char* str, int index=-1 ) const;
444#endif 454#endif
445 int contains( QChar c, bool cs=TRUE ) const; 455 int contains( QChar c, bool cs=TRUE ) const;
446 int contains( char c, bool cs=TRUE ) const 456 int contains( char c, bool cs=TRUE ) const
447 { return contains(QChar(c), cs); } 457 { return contains(QChar(c), cs); }
448#ifndef QT_NO_CAST_ASCII 458#ifndef QT_NO_CAST_ASCII
449 int contains( const char* str, bool cs=TRUE ) const; 459 int contains( const char* str, bool cs=TRUE ) const;
450#endif 460#endif
451 int contains( const QString &str, bool cs=TRUE ) const; 461 int contains( const QString &str, bool cs=TRUE ) const;
452#ifndef QT_NO_REGEXP 462#ifndef QT_NO_REGEXP
453 int contains( const QRegExp & ) const; 463 int contains( const QRegExp & ) const;
454#endif 464#endif
455 465
456 enum SectionFlags { 466 enum SectionFlags {
457 SectionDefault = 0x00, 467 SectionDefault = 0x00,
458 SectionSkipEmpty = 0x01, 468 SectionSkipEmpty = 0x01,
459 SectionIncludeLeadingSep = 0x02, 469 SectionIncludeLeadingSep = 0x02,
460 SectionIncludeTrailingSep = 0x04, 470 SectionIncludeTrailingSep = 0x04,
461 SectionCaseInsensitiveSeps = 0x08 471 SectionCaseInsensitiveSeps = 0x08
462 }; 472 };
463 QString section( QChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; 473 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; 474 QString section( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
465#ifndef QT_NO_CAST_ASCII 475#ifndef QT_NO_CAST_ASCII
466 QString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; 476 QString section( const char *in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
467#endif 477#endif
468 QString section( const QString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const; 478 QString section( const QString &in_sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
469#ifndef QT_NO_REGEXP 479#ifndef QT_NO_REGEXP
470 QString section( const QRegExp &reg, int start, int end = 0xffffffff, int flags = SectionDefault ) const; 480 QString section( const QRegExp &reg, int start, int end = 0xffffffff, int flags = SectionDefault ) const;
471#endif 481#endif
472 482
473 QString left( uint len ) const; 483 QString left( uint len ) const;
474 QString right( uint len ) const; 484 QString right( uint len ) const;
475 QString mid( uint index, uint len=0xffffffff) const; 485 QString mid( uint index, uint len=0xffffffff) const;
476 486
477 QString leftJustify( uint width, QChar fill=' ', bool trunc=FALSE)const; 487 QString leftJustify( uint width, QChar fill=' ', bool trunc=FALSE)const;
478 QString rightJustify( uint width, QChar fill=' ',bool trunc=FALSE)const; 488 QString rightJustify( uint width, QChar fill=' ',bool trunc=FALSE)const;
479 489
480 QString lower() const; 490 QString lower() const;
481 QString upper() const; 491 QString upper() const;
482 492
483 QString stripWhiteSpace() const; 493 QString stripWhiteSpace() const;
484 QString simplifyWhiteSpace() const; 494 QString simplifyWhiteSpace() const;
485 495
486 QString &insert( uint index, const QString & ); 496 QString &insert( uint index, const QString & );
487 QString &insert( uint index, const QChar*, uint len ); 497 QString &insert( uint index, const QChar*, uint len );
488 QString &insert( uint index, QChar ); 498 QString &insert( uint index, QChar );
489 QString &insert( uint index, char c ) { return insert(index,QChar(c)); } 499 QString &insert( uint index, char c ) { return insert(index,QChar(c)); }
490 QString &append( char ); 500 QString &append( char );
491 QString &append( QChar ); 501 QString &append( QChar );
492 QString &append( const QString & ); 502 QString &append( const QString & );
493#ifndef QT_NO_CAST_ASCII 503#ifndef QT_NO_CAST_ASCII
494 QString &append( const QByteArray & ); 504 QString &append( const QByteArray & );
495 QString &append( const char * ); 505 QString &append( const char * );
496#endif 506#endif
507#ifndef QT_NO_STL
508 QString &append( const std::string& );
509#endif
497 QString &prepend( char ); 510 QString &prepend( char );
498 QString &prepend( QChar ); 511 QString &prepend( QChar );
499 QString &prepend( const QString & ); 512 QString &prepend( const QString & );
500#ifndef QT_NO_CAST_ASCII 513#ifndef QT_NO_CAST_ASCII
501 QString &prepend( const QByteArray & ); 514 QString &prepend( const QByteArray & );
502 QString &prepend( const char * ); 515 QString &prepend( const char * );
503#endif 516#endif
517#ifndef QT_NO_STL
518 QString &prepend( const std::string& );
519#endif
504 QString &remove( uint index, uint len ); 520 QString &remove( uint index, uint len );
505 QString &remove( QChar c ); 521 QString &remove( QChar c );
506 QString &remove( char c ) { return remove( QChar(c) ); } 522 QString &remove( char c ) { return remove( QChar(c) ); }
507 QString &remove( const QString & ); 523 QString &remove( const QString & );
508#ifndef QT_NO_REGEXP 524#ifndef QT_NO_REGEXP
509 QString &remove( const QRegExp & ); 525 QString &remove( const QRegExp & );
510#endif 526#endif
511#ifndef QT_NO_CAST_ASCII 527#ifndef QT_NO_CAST_ASCII
512 QString &remove( const char * ); 528 QString &remove( const char * );
513#endif 529#endif
514 QString &replace( uint index, uint len, const QString & ); 530 QString &replace( uint index, uint len, const QString & );
515 QString &replace( uint index, uint len, const QChar*, uint clen ); 531 QString &replace( uint index, uint len, const QChar*, uint clen );
516 QString &replace( uint index, uint len, QChar ); 532 QString &replace( uint index, uint len, QChar );
517 QString &replace( uint index, uint len, char c ) 533 QString &replace( uint index, uint len, char c )
518 { return replace( index, len, QChar(c) ); } 534 { return replace( index, len, QChar(c) ); }
519 QString &replace( QChar c, const QString & ); 535 QString &replace( QChar c, const QString & );
520 QString &replace( char c, const QString & after ) 536 QString &replace( char c, const QString & after )
521 { return replace( QChar(c), after ); } 537 { return replace( QChar(c), after ); }
522 QString &replace( const QString &, const QString & ); 538 QString &replace( const QString &, const QString & );
523#ifndef QT_NO_REGEXP_CAPTURE 539#ifndef QT_NO_REGEXP_CAPTURE
524 QString &replace( const QRegExp &, const QString & ); 540 QString &replace( const QRegExp &, const QString & );
525#endif 541#endif
526 QString &replace( QChar, QChar ); 542 QString &replace( QChar, QChar );
527 543
528 short toShort( bool *ok=0, int base=10 ) const; 544 short toShort( bool *ok=0, int base=10 ) const;
529 ushort toUShort( bool *ok=0, int base=10 ) const; 545 ushort toUShort( bool *ok=0, int base=10 ) const;
530 int toInt( bool *ok=0, int base=10 ) const; 546 int toInt( bool *ok=0, int base=10 ) const;
531 uint toUInt( bool *ok=0, int base=10 ) const; 547 uint toUInt( bool *ok=0, int base=10 ) const;
532 long toLong( bool *ok=0, int base=10 ) const; 548 long toLong( bool *ok=0, int base=10 ) const;
533 ulong toULong( bool *ok=0, int base=10 ) const; 549 ulong toULong( bool *ok=0, int base=10 ) const;
534 float toFloat( bool *ok=0 ) const; 550 float toFloat( bool *ok=0 ) const;
535 double toDouble( bool *ok=0 ) const; 551 double toDouble( bool *ok=0 ) const;
536 552
537 QString &setNum( short, int base=10 ); 553 QString &setNum( short, int base=10 );
538 QString &setNum( ushort, int base=10 ); 554 QString &setNum( ushort, int base=10 );
539 QString &setNum( int, int base=10 ); 555 QString &setNum( int, int base=10 );
540 QString &setNum( uint, int base=10 ); 556 QString &setNum( uint, int base=10 );
541 QString &setNum( long, int base=10 ); 557 QString &setNum( long, int base=10 );
542 QString &setNum( ulong, int base=10 ); 558 QString &setNum( ulong, int base=10 );
543 QString &setNum( float, char f='g', int prec=6 ); 559 QString &setNum( float, char f='g', int prec=6 );
544 QString &setNum( double, char f='g', int prec=6 ); 560 QString &setNum( double, char f='g', int prec=6 );
545 561
546 static QString number( long, int base=10 ); 562 static QString number( long, int base=10 );
547 static QString number( ulong, int base=10); 563 static QString number( ulong, int base=10);
548 static QString number( int, int base=10 ); 564 static QString number( int, int base=10 );
549 static QString number( uint, int base=10); 565 static QString number( uint, int base=10);
550 static QString number( double, char f='g', int prec=6 ); 566 static QString number( double, char f='g', int prec=6 );
551 567
552 void setExpand( uint index, QChar c ); 568 void setExpand( uint index, QChar c );
553 569
554 QString &operator+=( const QString &str ); 570 QString &operator+=( const QString &str );
555#ifndef QT_NO_CAST_ASCII 571#ifndef QT_NO_CAST_ASCII
556 QString &operator+=( const QByteArray &str ); 572 QString &operator+=( const QByteArray &str );
557 QString &operator+=( const char *str ); 573 QString &operator+=( const char *str );
558#endif 574#endif
575#ifndef QT_NO_STL
576 QString &operator+=( const std::string& );
577#endif
559 QString &operator+=( QChar c ); 578 QString &operator+=( QChar c );
560 QString &operator+=( char c ); 579 QString &operator+=( char c );
561 580
562 QChar at( uint i ) const 581 QChar at( uint i ) const
563 { return i < d->len ? d->unicode[i] : QChar::null; } 582 { return i < d->len ? d->unicode[i] : QChar::null; }
564 QChar operator[]( int i ) const { return at((uint)i); } 583 QChar operator[]( int i ) const { return at((uint)i); }
565 QCharRef at( uint i ); 584 QCharRef at( uint i );
566 QCharRef operator[]( int i ); 585 QCharRef operator[]( int i );
567 586
568 QChar constref(uint i) const 587 QChar constref(uint i) const
569 { return at(i); } 588 { return at(i); }
570 QChar& ref(uint i) 589 QChar& ref(uint i)
571 { // Optimized for easy-inlining by simple compilers. 590 { // Optimized for easy-inlining by simple compilers.
572 if ( d->count != 1 || i >= d->len ) 591 if ( d->count != 1 || i >= d->len )
573 subat( i ); 592 subat( i );
574 d->setDirty(); 593 d->setDirty();
575 return d->unicode[i]; 594 return d->unicode[i];
576 } 595 }
577 596
578 const QChar* unicode() const { return d->unicode; } 597 const QChar* unicode() const { return d->unicode; }
579 const char* ascii() const { return latin1(); } 598 const char* ascii() const;
599 static QString fromAscii(const char*, int len=-1);
580 const char* latin1() const; 600 const char* latin1() const;
581 static QString fromLatin1(const char*, int len=-1); 601 static QString fromLatin1(const char*, int len=-1);
582 QCString utf8() const; 602 QCString utf8() const;
583 static QString fromUtf8(const char*, int len=-1); 603 static QString fromUtf8(const char*, int len=-1);
584 QCString local8Bit() const; 604 QCString local8Bit() const;
585 static QString fromLocal8Bit(const char*, int len=-1); 605 static QString fromLocal8Bit(const char*, int len=-1);
586 bool operator!() const; 606 bool operator!() const;
587#ifndef QT_NO_ASCII_CAST 607#ifndef QT_NO_ASCII_CAST
588 operator const char *() const { return latin1(); } 608 operator const char *() const { return ascii(); }
589#endif 609#endif
610#ifndef QT_NO_STL
611 operator std::string() const { return ascii() ? ascii() : ""; }
612#endif
613
590 static QString fromUcs2( const unsigned short *ucs2 ); 614 static QString fromUcs2( const unsigned short *ucs2 );
591 const unsigned short *ucs2() const; 615 const unsigned short *ucs2() const;
592 616
593 QString &setUnicode( const QChar* unicode, uint len ); 617 QString &setUnicode( const QChar* unicode, uint len );
594 QString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len ); 618 QString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len );
619 QString &setAscii( const char*, int len=-1 );
595 QString &setLatin1( const char*, int len=-1 ); 620 QString &setLatin1( const char*, int len=-1 );
596 621
597 int compare( const QString& s ) const; 622 int compare( const QString& s ) const;
598 static int compare( const QString& s1, const QString& s2 ) 623 static int compare( const QString& s1, const QString& s2 )
599 { return s1.compare( s2 ); } 624 { return s1.compare( s2 ); }
600 625
601 int localeAwareCompare( const QString& s ) const; 626 int localeAwareCompare( const QString& s ) const;
602 static int localeAwareCompare( const QString& s1, const QString& s2 ) 627 static int localeAwareCompare( const QString& s1, const QString& s2 )
603 { return s1.localeAwareCompare( s2 ); } 628 { return s1.localeAwareCompare( s2 ); }
604 629
605#ifndef QT_NO_DATASTREAM 630#ifndef QT_NO_DATASTREAM
606 friend Q_EXPORT QDataStream &operator>>( QDataStream &, QString & ); 631 friend Q_EXPORT QDataStream &operator>>( QDataStream &, QString & );
607#endif 632#endif
608 633
609 void compose(); 634 void compose();
610 635
611#ifndef QT_NO_COMPAT 636#ifndef QT_NO_COMPAT
612 const char* data() const { return latin1(); } 637 const char* data() const { return ascii(); }
613#endif 638#endif
614 639
615 bool startsWith( const QString& ) const; 640 bool startsWith( const QString& ) const;
616 bool endsWith( const QString& ) const; 641 bool endsWith( const QString& ) const;
617 642
618 void setLength( uint newLength ); 643 void setLength( uint newLength );
619 644
620 bool simpleText() const { if ( d->dirty ) checkSimpleText(); return (bool)d->simpletext; } 645 bool simpleText() const { if ( !d->issimpletext ) checkSimpleText(); return (bool)d->issimpletext; }
621 bool isRightToLeft() const; 646 bool isRightToLeft() const;
622 647
623 648
624private: 649private:
625 QString( int size, bool /* dummy */ );// allocate size incl. \0 650 QString( int size, bool /* dummy */ );// allocate size incl. \0
626 651
627 void deref(); 652 void deref();
628 void real_detach(); 653 void real_detach();
629 void subat( uint ); 654 void subat( uint );
630 bool findArg(int& pos, int& len) const; 655 bool findArg(int& pos, int& len) const;
631 656
632 void checkSimpleText() const; 657 void checkSimpleText() const;
633 658
634 static QChar* asciiToUnicode( const char*, uint * len, uint maxlen=(uint)-1 ); 659 static QChar* latin1ToUnicode( const char*, uint * len, uint maxlen=(uint)-1 );
635 static QChar* asciiToUnicode( const QByteArray&, uint * len ); 660 static QChar* latin1ToUnicode( const QByteArray&, uint * len );
636 static char* unicodeToAscii( const QChar*, uint len ); 661 static char* unicodeToLatin1( const QChar*, uint len );
637 662
638 QStringData *d; 663 QStringData *d;
639 static QStringData* shared_null; 664 static QStringData* shared_null;
640 static QStringData* makeSharedNull(); 665 static QStringData* makeSharedNull();
641 666
642 friend class QConstString; 667 friend class QConstString;
643 friend class QTextStream; 668 friend class QTextStream;
644 QString( QStringData* dd, bool /* dummy */ ) : d(dd) { } 669 QString( QStringData* dd, bool /* dummy */ ) : d(dd) { }
645 670
646 // needed for QDeepCopy 671 // needed for QDeepCopy
647 void detach(); 672 void detach();
648 friend class QDeepCopy<QString>; 673 friend class QDeepCopy<QString>;
649}; 674};
650 675
651class Q_EXPORT QCharRef { 676class Q_EXPORT QCharRef {
652 friend class QString; 677 friend class QString;
653 QString& s; 678 QString& s;
654 uint p; 679 uint p;
655 QCharRef(QString* str, uint pos) : s(*str), p(pos) { } 680 QCharRef(QString* str, uint pos) : s(*str), p(pos) { }
656 681
657public: 682public:
658 // most QChar operations repeated here... 683 // most QChar operations repeated here...
659 684
660 // all this is not documented: We just say "like QChar" and let it be. 685 // all this is not documented: We just say "like QChar" and let it be.
661#ifndef Q_QDOC 686#ifndef Q_QDOC
662 ushort unicode() const { return s.constref(p).unicode(); } 687 ushort unicode() const { return s.constref(p).unicode(); }
663 char latin1() const { return s.constref(p).latin1(); } 688 char latin1() const { return s.constref(p).latin1(); }
664 689
665 // An operator= for each QChar cast constructor... 690 // An operator= for each QChar cast constructor...
666 QCharRef operator=(char c ) { s.ref(p)=c; return *this; } 691 QCharRef operator=(char c ) { s.ref(p)=c; return *this; }
667 QCharRef operator=(uchar c ) { s.ref(p)=c; return *this; } 692 QCharRef operator=(uchar c ) { s.ref(p)=c; return *this; }
668 QCharRef operator=(QChar c ) { s.ref(p)=c; return *this; } 693 QCharRef operator=(QChar c ) { s.ref(p)=c; return *this; }
669 QCharRef operator=(const QCharRef& c ) { s.ref(p)=c.unicode(); return *this; } 694 QCharRef operator=(const QCharRef& c ) { s.ref(p)=c.unicode(); return *this; }
670 QCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; } 695 QCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; }
671 QCharRef operator=(short rc ) { s.ref(p)=rc; return *this; } 696 QCharRef operator=(short rc ) { s.ref(p)=rc; return *this; }
672 QCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; } 697 QCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; }
673 QCharRef operator=(int rc ) { s.ref(p)=rc; return *this; } 698 QCharRef operator=(int rc ) { s.ref(p)=rc; return *this; }
674 699
675 operator QChar () const { return s.constref(p); } 700 operator QChar () const { return s.constref(p); }
676 701
677 // each function... 702 // each function...
678 bool isNull() const { return unicode()==0; } 703 bool isNull() const { return unicode()==0; }
679 bool isPrint() const { return s.constref(p).isPrint(); } 704 bool isPrint() const { return s.constref(p).isPrint(); }
680 bool isPunct() const { return s.constref(p).isPunct(); } 705 bool isPunct() const { return s.constref(p).isPunct(); }
681 bool isSpace() const { return s.constref(p).isSpace(); } 706 bool isSpace() const { return s.constref(p).isSpace(); }
682 bool isMark() const { return s.constref(p).isMark(); } 707 bool isMark() const { return s.constref(p).isMark(); }
683 bool isLetter() const { return s.constref(p).isLetter(); } 708 bool isLetter() const { return s.constref(p).isLetter(); }
684 bool isNumber() const { return s.constref(p).isNumber(); } 709 bool isNumber() const { return s.constref(p).isNumber(); }
685 bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); } 710 bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); }
686 bool isDigit() const { return s.constref(p).isDigit(); } 711 bool isDigit() const { return s.constref(p).isDigit(); }
687 712
688 int digitValue() const { return s.constref(p).digitValue(); } 713 int digitValue() const { return s.constref(p).digitValue(); }
689 QChar lower() const { return s.constref(p).lower(); } 714 QChar lower() const { return s.constref(p).lower(); }
690 QChar upper() const { return s.constref(p).upper(); } 715 QChar upper() const { return s.constref(p).upper(); }
691 716
692 QChar::Category category() const { return s.constref(p).category(); } 717 QChar::Category category() const { return s.constref(p).category(); }
693 QChar::Direction direction() const { return s.constref(p).direction(); } 718 QChar::Direction direction() const { return s.constref(p).direction(); }
694 QChar::Joining joining() const { return s.constref(p).joining(); } 719 QChar::Joining joining() const { return s.constref(p).joining(); }
695 bool mirrored() const { return s.constref(p).mirrored(); } 720 bool mirrored() const { return s.constref(p).mirrored(); }
696 QChar mirroredChar() const { return s.constref(p).mirroredChar(); } 721 QChar mirroredChar() const { return s.constref(p).mirroredChar(); }
697 const QString &decomposition() const { return s.constref(p).decomposition(); } 722 const QString &decomposition() const { return s.constref(p).decomposition(); }
698 QChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); } 723 QChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); }
699 unsigned char combiningClass() const { return s.constref(p).combiningClass(); } 724 unsigned char combiningClass() const { return s.constref(p).combiningClass(); }
700 725
701 // Not the non-const ones of these. 726 // Not the non-const ones of these.
702 uchar cell() const { return s.constref(p).cell(); } 727 uchar cell() const { return s.constref(p).cell(); }
703 uchar row() const { return s.constref(p).row(); } 728 uchar row() const { return s.constref(p).row(); }
704#endif 729#endif
705}; 730};
706 731
707inline QCharRef QString::at( uint i ) { return QCharRef(this,i); } 732inline QCharRef QString::at( uint i ) { return QCharRef(this,i); }
708inline QCharRef QString::operator[]( int i ) { return at((uint)i); } 733inline QCharRef QString::operator[]( int i ) { return at((uint)i); }
709 734
710 735
711class Q_EXPORT QConstString : private QString { 736class Q_EXPORT QConstString : private QString {
712public: 737public:
713 QConstString( const QChar* unicode, uint length ); 738 QConstString( const QChar* unicode, uint length );
714 ~QConstString(); 739 ~QConstString();
715 const QString& string() const { return *this; } 740 const QString& string() const { return *this; }
716}; 741};
717 742
718 743
719/***************************************************************************** 744/*****************************************************************************
720 QString stream functions 745 QString stream functions
721 *****************************************************************************/ 746 *****************************************************************************/
722#ifndef QT_NO_DATASTREAM 747#ifndef QT_NO_DATASTREAM
723Q_EXPORT QDataStream &operator<<( QDataStream &, const QString & ); 748Q_EXPORT QDataStream &operator<<( QDataStream &, const QString & );
724Q_EXPORT QDataStream &operator>>( QDataStream &, QString & ); 749Q_EXPORT QDataStream &operator>>( QDataStream &, QString & );
725#endif 750#endif
726 751
727/***************************************************************************** 752/*****************************************************************************
728 QString inline functions 753 QString inline functions
729 *****************************************************************************/ 754 *****************************************************************************/
730 755
731// These two move code into makeSharedNull() and deletesData() 756// These two move code into makeSharedNull() and deletesData()
732// to improve cache-coherence (and reduce code bloat), while 757// to improve cache-coherence (and reduce code bloat), while
733// keeping the common cases fast. 758// keeping the common cases fast.
734// 759//
735// No safe way to pre-init shared_null on ALL compilers/linkers. 760// No safe way to pre-init shared_null on ALL compilers/linkers.
736inline QString::QString() : 761inline QString::QString() :
737 d(shared_null ? shared_null : makeSharedNull()) 762 d(shared_null ? shared_null : makeSharedNull())
738{ 763{
739 d->ref(); 764 d->ref();
740} 765}
741// 766//
742inline QString::~QString() 767inline QString::~QString()
743{ 768{
744 if ( d->deref() ) { 769 if ( d->deref() ) {
745 if ( d != shared_null ) 770 if ( d != shared_null )
746 d->deleteSelf(); 771 d->deleteSelf();
747 } 772 }
748} 773}
749 774
750// needed for QDeepCopy 775// needed for QDeepCopy
751inline void QString::detach() 776inline void QString::detach()
752{ real_detach(); } 777{ real_detach(); }
753 778
754inline QString QString::section( QChar sep, int start, int end, int flags ) const 779inline QString QString::section( QChar sep, int start, int end, int flags ) const
755{ return section(QString(sep), start, end, flags); } 780{ return section(QString(sep), start, end, flags); }
756 781
757inline QString QString::section( char sep, int start, int end, int flags ) const 782inline QString QString::section( char sep, int start, int end, int flags ) const
758{ return section(QChar(sep), start, end, flags); } 783{ return section(QChar(sep), start, end, flags); }
759 784
760#ifndef QT_NO_CAST_ASCII 785#ifndef QT_NO_CAST_ASCII
761inline QString QString::section( const char *in_sep, int start, int end, int flags ) const 786inline QString QString::section( const char *in_sep, int start, int end, int flags ) const
762{ return section(QString(in_sep), start, end, flags); } 787{ return section(QString(in_sep), start, end, flags); }
763#endif 788#endif
764 789
765inline QString &QString::operator=( QChar c ) 790inline QString &QString::operator=( QChar c )
766{ *this = QString(c); return *this; } 791{ *this = QString(c); return *this; }
767 792
768inline QString &QString::operator=( char c ) 793inline QString &QString::operator=( char c )
769{ *this = QString(QChar(c)); return *this; } 794{ *this = QString(QChar(c)); return *this; }
770 795
771inline bool QString::isNull() const 796inline bool QString::isNull() const
772{ return unicode() == 0; } 797{ return unicode() == 0; }
773 798
774inline bool QString::operator!() const 799inline bool QString::operator!() const
775{ return isNull(); } 800{ return isNull(); }
776 801
777inline uint QString::length() const 802inline uint QString::length() const
778{ return d->len; } 803{ return d->len; }
779 804
780inline bool QString::isEmpty() const 805inline bool QString::isEmpty() const
781{ return length() == 0; } 806{ return length() == 0; }
782 807
783inline QString QString::copy() const 808inline QString QString::copy() const
784{ return QString( *this ); } 809{ return QString( *this ); }
785 810
786inline QString &QString::prepend( const QString & s ) 811inline QString &QString::prepend( const QString & s )
787{ return insert(0,s); } 812{ return insert(0,s); }
788 813
789inline QString &QString::prepend( QChar c ) 814inline QString &QString::prepend( QChar c )
790{ return insert(0,c); } 815{ return insert(0,c); }
791 816
792inline QString &QString::prepend( char c ) 817inline QString &QString::prepend( char c )
793{ return insert(0,c); } 818{ return insert(0,c); }
794 819
795#ifndef QT_NO_CAST_ASCII 820#ifndef QT_NO_CAST_ASCII
796inline QString &QString::prepend( const QByteArray & s ) 821inline QString &QString::prepend( const QByteArray & s )
797{ return insert(0,s.data()); } 822{ return insert(0,QString(s)); }
823#endif
824
825#ifndef QT_NO_STL
826inline QString &QString::prepend( const std::string& s )
827{ return insert(0, s); }
828#endif
829
830#ifndef QT_NO_CAST_ASCII
831inline QString &QString::operator+=( const QByteArray &s )
832{ return operator+=(QString(s)); }
798#endif 833#endif
799 834
800inline QString &QString::append( const QString & s ) 835inline QString &QString::append( const QString & s )
801{ return operator+=(s); } 836{ return operator+=(s); }
802 837
803#ifndef QT_NO_CAST_ASCII 838#ifndef QT_NO_CAST_ASCII
804inline QString &QString::append( const QByteArray &s ) 839inline QString &QString::append( const QByteArray &s )
805{ return operator+=(s.data()); } 840{ return operator+=(s); }
806 841
807inline QString &QString::append( const char * s ) 842inline QString &QString::append( const char * s )
808{ return operator+=(s); } 843{ return operator+=(s); }
809#endif 844#endif
810 845
811inline QString &QString::append( QChar c ) 846inline QString &QString::append( QChar c )
812{ return operator+=(c); } 847{ return operator+=(c); }
813 848
814inline QString &QString::append( char c ) 849inline QString &QString::append( char c )
815{ return operator+=(c); } 850{ return operator+=(c); }
816 851
817#ifndef QT_NO_CAST_ASCII 852#ifndef QT_NO_STL
818inline QString &QString::operator+=( const QByteArray &s ) 853inline QString &QString::operator+=( const std::string& s )
819{ return operator+=(s.data()); } 854{ return operator+=(s.c_str()); }
855inline QString &QString::append( const std::string& s )
856{ return operator+=(s); }
820#endif 857#endif
821 858
822inline QString &QString::setNum( short n, int base ) 859inline QString &QString::setNum( short n, int base )
823{ return setNum((long)n, base); } 860{ return setNum((long)n, base); }
824 861
825inline QString &QString::setNum( ushort n, int base ) 862inline QString &QString::setNum( ushort n, int base )
826{ return setNum((ulong)n, base); } 863{ return setNum((ulong)n, base); }
827 864
828inline QString &QString::setNum( int n, int base ) 865inline QString &QString::setNum( int n, int base )
829{ return setNum((long)n, base); } 866{ return setNum((long)n, base); }
830 867
831inline QString &QString::setNum( uint n, int base ) 868inline QString &QString::setNum( uint n, int base )
832{ return setNum((ulong)n, base); } 869{ return setNum((ulong)n, base); }
833 870
834inline QString &QString::setNum( float n, char f, int prec ) 871inline QString &QString::setNum( float n, char f, int prec )
835{ return setNum((double)n,f,prec); } 872{ return setNum((double)n,f,prec); }
836 873
837inline QString QString::arg(int a, int fieldwidth, int base) const 874inline QString QString::arg(int a, int fieldwidth, int base) const
838{ return arg((long)a, fieldwidth, base); } 875{ return arg((long)a, fieldwidth, base); }
839 876
840inline QString QString::arg(uint a, int fieldwidth, int base) const 877inline QString QString::arg(uint a, int fieldwidth, int base) const
841{ return arg((ulong)a, fieldwidth, base); } 878{ return arg((ulong)a, fieldwidth, base); }
842 879
843inline QString QString::arg(short a, int fieldwidth, int base) const 880inline QString QString::arg(short a, int fieldwidth, int base) const
844{ return arg((long)a, fieldwidth, base); } 881{ return arg((long)a, fieldwidth, base); }
845 882
846inline QString QString::arg(ushort a, int fieldwidth, int base) const 883inline QString QString::arg(ushort a, int fieldwidth, int base) const
847{ return arg((ulong)a, fieldwidth, base); } 884{ return arg((ulong)a, fieldwidth, base); }
848 885
849inline int QString::find( char c, int index, bool cs ) const 886inline int QString::find( char c, int index, bool cs ) const
850{ return find(QChar(c), index, cs); } 887{ return find(QChar(c), index, cs); }
851 888
852inline int QString::findRev( char c, int index, bool cs) const 889inline int QString::findRev( char c, int index, bool cs) const
853{ return findRev( QChar(c), index, cs ); } 890{ return findRev( QChar(c), index, cs ); }
854 891
855#ifndef QT_NO_CAST_ASCII 892#ifndef QT_NO_CAST_ASCII
856inline int QString::find( const char* str, int index ) const 893inline int QString::find( const char* str, int index ) const
857{ return find(QString::fromLatin1(str), index); } 894{ return find(QString::fromAscii(str), index); }
858 895
859inline int QString::findRev( const char* str, int index ) const 896inline int QString::findRev( const char* str, int index ) const
860{ return findRev(QString::fromLatin1(str), index); } 897{ return findRev(QString::fromAscii(str), index); }
861#endif 898#endif
862 899
863 900
864/***************************************************************************** 901/*****************************************************************************
865 QString non-member operators 902 QString non-member operators
866 *****************************************************************************/ 903 *****************************************************************************/
867 904
868Q_EXPORT bool operator!=( const QString &s1, const QString &s2 ); 905Q_EXPORT bool operator!=( const QString &s1, const QString &s2 );
869Q_EXPORT bool operator<( const QString &s1, const QString &s2 ); 906Q_EXPORT bool operator<( const QString &s1, const QString &s2 );
870Q_EXPORT bool operator<=( const QString &s1, const QString &s2 ); 907Q_EXPORT bool operator<=( const QString &s1, const QString &s2 );
871Q_EXPORT bool operator==( const QString &s1, const QString &s2 ); 908Q_EXPORT bool operator==( const QString &s1, const QString &s2 );
872Q_EXPORT bool operator>( const QString &s1, const QString &s2 ); 909Q_EXPORT bool operator>( const QString &s1, const QString &s2 );
873Q_EXPORT bool operator>=( const QString &s1, const QString &s2 ); 910Q_EXPORT bool operator>=( const QString &s1, const QString &s2 );
874#ifndef QT_NO_CAST_ASCII 911#ifndef QT_NO_CAST_ASCII
875Q_EXPORT bool operator!=( const QString &s1, const char *s2 ); 912Q_EXPORT bool operator!=( const QString &s1, const char *s2 );
876Q_EXPORT bool operator<( const QString &s1, const char *s2 ); 913Q_EXPORT bool operator<( const QString &s1, const char *s2 );
877Q_EXPORT bool operator<=( const QString &s1, const char *s2 ); 914Q_EXPORT bool operator<=( const QString &s1, const char *s2 );
878Q_EXPORT bool operator==( const QString &s1, const char *s2 ); 915Q_EXPORT bool operator==( const QString &s1, const char *s2 );
879Q_EXPORT bool operator>( const QString &s1, const char *s2 ); 916Q_EXPORT bool operator>( const QString &s1, const char *s2 );
880Q_EXPORT bool operator>=( const QString &s1, const char *s2 ); 917Q_EXPORT bool operator>=( const QString &s1, const char *s2 );
881Q_EXPORT bool operator!=( const char *s1, const QString &s2 ); 918Q_EXPORT bool operator!=( const char *s1, const QString &s2 );
882Q_EXPORT bool operator<( const char *s1, const QString &s2 ); 919Q_EXPORT bool operator<( const char *s1, const QString &s2 );
883Q_EXPORT bool operator<=( const char *s1, const QString &s2 ); 920Q_EXPORT bool operator<=( const char *s1, const QString &s2 );
884Q_EXPORT bool operator==( const char *s1, const QString &s2 ); 921Q_EXPORT bool operator==( const char *s1, const QString &s2 );
885//Q_EXPORT bool operator>( const char *s1, const QString &s2 ); // MSVC++ 922//Q_EXPORT bool operator>( const char *s1, const QString &s2 ); // MSVC++
886Q_EXPORT bool operator>=( const char *s1, const QString &s2 ); 923Q_EXPORT bool operator>=( const char *s1, const QString &s2 );
887#endif 924#endif
888 925
889Q_EXPORT inline const QString operator+( const QString &s1, const QString &s2 ) 926Q_EXPORT inline const QString operator+( const QString &s1, const QString &s2 )
890{ 927{
891 QString tmp( s1 ); 928 QString tmp( s1 );
892 tmp += s2; 929 tmp += s2;
893 return tmp; 930 return tmp;
894} 931}
895 932
896#ifndef QT_NO_CAST_ASCII 933#ifndef QT_NO_CAST_ASCII
897Q_EXPORT inline const QString operator+( const QString &s1, const char *s2 ) 934Q_EXPORT inline const QString operator+( const QString &s1, const char *s2 )
898{ 935{
899 QString tmp( s1 ); 936 QString tmp( s1 );
900 tmp += QString::fromLatin1(s2); 937 tmp += QString::fromAscii(s2);
901 return tmp; 938 return tmp;
902} 939}
903 940
904Q_EXPORT inline const QString operator+( const char *s1, const QString &s2 ) 941Q_EXPORT inline const QString operator+( const char *s1, const QString &s2 )
905{ 942{
906 QString tmp = QString::fromLatin1( s1 ); 943 QString tmp = QString::fromAscii( s1 );
907 tmp += s2; 944 tmp += s2;
908 return tmp; 945 return tmp;
909} 946}
910#endif 947#endif
911 948
912Q_EXPORT inline const QString operator+( const QString &s1, QChar c2 ) 949Q_EXPORT inline const QString operator+( const QString &s1, QChar c2 )
913{ 950{
914 QString tmp( s1 ); 951 QString tmp( s1 );
915 tmp += c2; 952 tmp += c2;
916 return tmp; 953 return tmp;
917} 954}
918 955
919Q_EXPORT inline const QString operator+( const QString &s1, char c2 ) 956Q_EXPORT inline const QString operator+( const QString &s1, char c2 )
920{ 957{
921 QString tmp( s1 ); 958 QString tmp( s1 );
922 tmp += c2; 959 tmp += c2;
923 return tmp; 960 return tmp;
924} 961}
925 962
926Q_EXPORT inline const QString operator+( QChar c1, const QString &s2 ) 963Q_EXPORT inline const QString operator+( QChar c1, const QString &s2 )
927{ 964{
928 QString tmp; 965 QString tmp;
929 tmp += c1; 966 tmp += c1;
930 tmp += s2; 967 tmp += s2;
931 return tmp; 968 return tmp;
932} 969}
933 970
934Q_EXPORT inline const QString operator+( char c1, const QString &s2 ) 971Q_EXPORT inline const QString operator+( char c1, const QString &s2 )
935{ 972{
936 QString tmp; 973 QString tmp;
937 tmp += c1; 974 tmp += c1;
938 tmp += s2; 975 tmp += s2;
939 return tmp; 976 return tmp;
940} 977}
941 978
942#if defined(Q_OS_WIN32) 979#if defined(Q_OS_WIN32)
943extern Q_EXPORT QString qt_winQString(void*); 980extern Q_EXPORT QString qt_winQString(void*);
944extern Q_EXPORT const void* qt_winTchar(const QString& str, bool addnul); 981extern Q_EXPORT const void* qt_winTchar(const QString& str, bool addnul);
945extern Q_EXPORT void* qt_winTchar_new(const QString& str); 982extern Q_EXPORT void* qt_winTchar_new(const QString& str);
946extern Q_EXPORT QCString qt_winQString2MB( const QString& s, int len=-1 ); 983extern Q_EXPORT QCString qt_winQString2MB( const QString& s, int len=-1 );
947extern Q_EXPORT QString qt_winMB2QString( const char* mb, int len=-1 ); 984extern Q_EXPORT QString qt_winMB2QString( const char* mb, int len=-1 );
948#endif 985#endif
949 986
987#ifdef QT_QWINEXPORT
988#define Q_DEFINED_QSTRING
989#include "qwinexport.h"
990#endif /* QT_QWINEXPORT */
950#endif // QSTRING_H 991#endif // QSTRING_H
diff --git a/qmake/include/qstrlist.h b/qmake/include/qstrlist.h
index 86de328..b9dd753 100644
--- a/qmake/include/qstrlist.h
+++ b/qmake/include/qstrlist.h
@@ -1,112 +1,114 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QStrList, QStrIList and QStrListIterator classes 4** Definition of QStrList, QStrIList and QStrListIterator classes
5** 5**
6** Created : 920730 6** Created : 920730
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QSTRLIST_H 38#ifndef QSTRLIST_H
39#define QSTRLIST_H 39#define QSTRLIST_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qstring.h" 42#include "qstring.h"
43#include "qptrlist.h" 43#include "qptrlist.h"
44#include "qdatastream.h" 44#include "qdatastream.h"
45#endif // QT_H 45#endif // QT_H
46 46
47 47
48#ifndef QT_QWINEXPORT
48#if defined(Q_TEMPLATEDLL) 49#if defined(Q_TEMPLATEDLL)
49Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<char>; 50Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrList<char>;
50Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrListIterator<char>; 51Q_TEMPLATE_EXTERN template class Q_EXPORT QPtrListIterator<char>;
51#endif 52#endif
53#endif /* QT_QWINEXPORT */
52 54
53#if defined(Q_QDOC) 55#if defined(Q_QDOC)
54class QStrListIterator : public QPtrListIterator<char> 56class QStrListIterator : public QPtrListIterator<char>
55{ 57{
56}; 58};
57#else 59#else
58typedef QPtrListIterator<char> QStrListIterator; 60typedef QPtrListIterator<char> QStrListIterator;
59#endif 61#endif
60 62
61class Q_EXPORT QStrList : public QPtrList<char> 63class Q_EXPORT QStrList : public QPtrList<char>
62{ 64{
63public: 65public:
64 QStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; } 66 QStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; }
65 QStrList( const QStrList & ); 67 QStrList( const QStrList & );
66 ~QStrList() { clear(); } 68 ~QStrList() { clear(); }
67 QStrList& operator=( const QStrList & ); 69 QStrList& operator=( const QStrList & );
68 70
69private: 71private:
70 QPtrCollection::Item newItem( QPtrCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; } 72 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; } 73 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, 74 int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ) { return qstrcmp((const char*)s1,
73 (const char*)s2); } 75 (const char*)s2); }
74#ifndef QT_NO_DATASTREAM 76#ifndef QT_NO_DATASTREAM
75 QDataStream &read( QDataStream &s, QPtrCollection::Item &d ) 77 QDataStream &read( QDataStream &s, QPtrCollection::Item &d )
76 { s >> (char *&)d; return s; } 78 { s >> (char *&)d; return s; }
77 QDataStream &write( QDataStream &s, QPtrCollection::Item d ) const 79 QDataStream &write( QDataStream &s, QPtrCollection::Item d ) const
78 { return s << (const char *)d; } 80 { return s << (const char *)d; }
79#endif 81#endif
80 bool dc; 82 bool dc;
81}; 83};
82 84
83 85
84 class Q_EXPORT QStrIList : public QStrList// case insensitive string list 86 class Q_EXPORT QStrIList : public QStrList// case insensitive string list
85{ 87{
86public: 88public:
87 QStrIList( bool deepCopies=TRUE ) : QStrList( deepCopies ) {} 89 QStrIList( bool deepCopies=TRUE ) : QStrList( deepCopies ) {}
88 ~QStrIList() { clear(); } 90 ~QStrIList() { clear(); }
89private: 91private:
90 int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ) 92 int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 )
91 { return qstricmp((const char*)s1, 93 { return qstricmp((const char*)s1,
92 (const char*)s2); } 94 (const char*)s2); }
93}; 95};
94 96
95 97
96inline QStrList & QStrList::operator=( const QStrList &strList ) 98inline QStrList & QStrList::operator=( const QStrList &strList )
97{ 99{
98 clear(); 100 clear();
99 dc = strList.dc; 101 dc = strList.dc;
100 del_item = dc; 102 del_item = dc;
101 QPtrList<char>::operator=( strList ); 103 QPtrList<char>::operator=( strList );
102 return *this; 104 return *this;
103} 105}
104 106
105inline QStrList::QStrList( const QStrList &strList ) 107inline QStrList::QStrList( const QStrList &strList )
106 : QPtrList<char>( strList ) 108 : QPtrList<char>( strList )
107{ 109{
108 dc = FALSE; 110 dc = FALSE;
109 operator=( strList ); 111 operator=( strList );
110} 112}
111 113
112#endif // QSTRLIST_H 114#endif // QSTRLIST_H
diff --git a/qmake/include/qtextcodec.h b/qmake/include/qtextcodec.h
index 149b5cb..995e434 100644
--- a/qmake/include/qtextcodec.h
+++ b/qmake/include/qtextcodec.h
@@ -1,114 +1,128 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QTextCodec class 4** Definition of QTextCodec class
5** 5**
6** Created : 981015 6** Created : 981015
7** 7**
8** Copyright (C) 1998-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1998-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QTEXTCODEC_H 38#ifndef QTEXTCODEC_H
39#define QTEXTCODEC_H 39#define QTEXTCODEC_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qstring.h" 42#include "qstring.h"
43#endif // QT_H 43#endif // QT_H
44 44
45#ifndef QT_NO_TEXTCODEC 45#ifndef QT_NO_TEXTCODEC
46 46
47class QTextCodec; 47class QTextCodec;
48class QIODevice; 48class QIODevice;
49class QFont; 49class QFont;
50 50
51class Q_EXPORT QTextEncoder { 51class Q_EXPORT QTextEncoder {
52public: 52public:
53 virtual ~QTextEncoder(); 53 virtual ~QTextEncoder();
54 virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0; 54 virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0;
55}; 55};
56 56
57class Q_EXPORT QTextDecoder { 57class Q_EXPORT QTextDecoder {
58public: 58public:
59 virtual ~QTextDecoder(); 59 virtual ~QTextDecoder();
60 virtual QString toUnicode(const char* chars, int len) = 0; 60 virtual QString toUnicode(const char* chars, int len) = 0;
61}; 61};
62 62
63class Q_EXPORT QTextCodec { 63class Q_EXPORT QTextCodec {
64public: 64public:
65 virtual ~QTextCodec(); 65 virtual ~QTextCodec();
66 66
67#ifndef QT_NO_CODECS 67#ifndef QT_NO_CODECS
68 static QTextCodec* loadCharmap(QIODevice*); 68 static QTextCodec* loadCharmap(QIODevice*);
69 static QTextCodec* loadCharmapFile(QString filename); 69 static QTextCodec* loadCharmapFile(QString filename);
70#endif //QT_NO_CODECS 70#endif //QT_NO_CODECS
71 static QTextCodec* codecForMib(int mib); 71 static QTextCodec* codecForMib(int mib);
72 static QTextCodec* codecForName(const char* hint, int accuracy=0); 72 static QTextCodec* codecForName(const char* hint, int accuracy=0);
73 static QTextCodec* codecForContent(const char* chars, int len); 73 static QTextCodec* codecForContent(const char* chars, int len);
74 static QTextCodec* codecForIndex(int i); 74 static QTextCodec* codecForIndex(int i);
75 static QTextCodec* codecForLocale(); 75 static QTextCodec* codecForLocale();
76 static void setCodecForLocale(QTextCodec *c); 76 static void setCodecForLocale(QTextCodec *c);
77 77
78 static QTextCodec* codecForTr();
79 static void setCodecForTr(QTextCodec *c);
80 static QTextCodec* codecForCStrings();
81 static void setCodecForCStrings(QTextCodec *c);
82
78 static void deleteAllCodecs(); 83 static void deleteAllCodecs();
79 84
80 static const char* locale(); 85 static const char* locale();
81 86
82 virtual const char* name() const = 0; 87 virtual const char* name() const = 0;
83 virtual const char* mimeName() const; 88 virtual const char* mimeName() const;
84 virtual int mibEnum() const = 0; 89 virtual int mibEnum() const = 0;
85 90
86 virtual QTextDecoder* makeDecoder() const; 91 virtual QTextDecoder* makeDecoder() const;
87 virtual QTextEncoder* makeEncoder() const; 92 virtual QTextEncoder* makeEncoder() const;
88 93
89 virtual QString toUnicode(const char* chars, int len) const; 94 virtual QString toUnicode(const char* chars, int len) const;
90 virtual QCString fromUnicode(const QString& uc, int& lenInOut) const; 95 virtual QCString fromUnicode(const QString& uc, int& lenInOut) const;
91 96
92 QCString fromUnicode(const QString& uc) const; 97 QCString fromUnicode(const QString& uc) const;
93 QString toUnicode(const QByteArray&, int len) const; 98 QString toUnicode(const QByteArray&, int len) const;
94 QString toUnicode(const QByteArray&) const; 99 QString toUnicode(const QByteArray&) const;
95 QString toUnicode(const QCString&, int len) const; 100 QString toUnicode(const QCString&, int len) const;
96 QString toUnicode(const QCString&) const; 101 QString toUnicode(const QCString&) const;
97 QString toUnicode(const char* chars) const; 102 QString toUnicode(const char* chars) const;
98 virtual bool canEncode( QChar ) const; 103 virtual bool canEncode( QChar ) const;
99 virtual bool canEncode( const QString& ) const; 104 virtual bool canEncode( const QString& ) const;
100 105
101 virtual int heuristicContentMatch(const char* chars, int len) const = 0; 106 virtual int heuristicContentMatch(const char* chars, int len) const = 0;
102 virtual int heuristicNameMatch(const char* hint) const; 107 virtual int heuristicNameMatch(const char* hint) const;
103 108
104 virtual QByteArray fromUnicode(const QString& uc, int from, int len) const; 109 virtual QByteArray fromUnicode(const QString& uc, int from, int len) const;
105 virtual unsigned short characterFromUnicode(const QString &str, int pos) const; 110 virtual unsigned short characterFromUnicode(const QString &str, int pos) const;
106 111
107protected: 112protected:
108 QTextCodec(); 113 QTextCodec();
109 static int simpleHeuristicNameMatch(const char* name, const char* hint); 114 static int simpleHeuristicNameMatch(const char* name, const char* hint);
110 115
116private:
117 static QTextCodec *cftr;
118 static QTextCodec *cfcs;
111 friend class QFont; 119 friend class QFont;
112}; 120};
121
122inline QTextCodec* QTextCodec::codecForTr() { return cftr; }
123inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
124inline QTextCodec* QTextCodec::codecForCStrings() { return cfcs; }
125inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { cfcs = c; }
126
113#endif // QT_NO_TEXTCODEC 127#endif // QT_NO_TEXTCODEC
114#endif // QTEXTCODEC_H 128#endif // QTEXTCODEC_H
diff --git a/qmake/include/qtl.h b/qmake/include/qtl.h
index 346cecc..25631fd 100644
--- a/qmake/include/qtl.h
+++ b/qmake/include/qtl.h
@@ -1,321 +1,322 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of Qt template library classes 4** Definition of Qt template library classes
5** 5**
6** Created : 990128 6** Created : 990128
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QTL_H 38#ifndef QTL_H
39#define QTL_H 39#define QTL_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qglobal.h" 42#include "qglobal.h"
43#include "qtextstream.h" 43#include "qtextstream.h"
44#include "qstring.h" 44#include "qstring.h"
45#endif // QT_H 45#endif // QT_H
46 46
47#ifndef QT_NO_TEXTSTREAM 47#ifndef QT_NO_TEXTSTREAM
48template <class T> 48template <class T>
49class QTextOStreamIterator 49class QTextOStreamIterator
50{ 50{
51protected: 51protected:
52 QTextOStream& stream; 52 QTextOStream& stream;
53 QString separator; 53 QString separator;
54 54
55public: 55public:
56 QTextOStreamIterator( QTextOStream& s) : stream( s ) {} 56 QTextOStreamIterator( QTextOStream& s) : stream( s ) {}
57 QTextOStreamIterator( QTextOStream& s, const QString& sep ) 57 QTextOStreamIterator( QTextOStream& s, const QString& sep )
58 : stream( s ), separator( sep ) {} 58 : stream( s ), separator( sep ) {}
59 QTextOStreamIterator<T>& operator= ( const T& x ) { 59 QTextOStreamIterator<T>& operator= ( const T& x ) {
60 stream << x; 60 stream << x;
61 if ( !separator.isEmpty() ) 61 if ( !separator.isEmpty() )
62 stream << separator; 62 stream << separator;
63 return *this; 63 return *this;
64 } 64 }
65 QTextOStreamIterator<T>& operator*() { return *this; } 65 QTextOStreamIterator<T>& operator*() { return *this; }
66 QTextOStreamIterator<T>& operator++() { return *this; } 66 QTextOStreamIterator<T>& operator++() { return *this; }
67 QTextOStreamIterator<T>& operator++(int) { return *this; } 67 QTextOStreamIterator<T>& operator++(int) { return *this; }
68}; 68};
69#endif //QT_NO_TEXTSTREAM 69#endif //QT_NO_TEXTSTREAM
70 70
71template <class InputIterator, class OutputIterator> 71template <class InputIterator, class OutputIterator>
72inline OutputIterator qCopy( InputIterator _begin, InputIterator _end, 72inline OutputIterator qCopy( InputIterator _begin, InputIterator _end,
73 OutputIterator _dest ) 73 OutputIterator _dest )
74{ 74{
75 while( _begin != _end ) 75 while( _begin != _end )
76 *_dest++ = *_begin++; 76 *_dest++ = *_begin++;
77 return _dest; 77 return _dest;
78} 78}
79 79
80template <class BiIterator, class BiOutputIterator> 80template <class BiIterator, class BiOutputIterator>
81inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end, 81inline BiOutputIterator qCopyBackward( BiIterator _begin, BiIterator _end,
82 BiOutputIterator _dest ) 82 BiOutputIterator _dest )
83{ 83{
84 while ( _begin != _end ) 84 while ( _begin != _end )
85 *--_dest = *--_end; 85 *--_dest = *--_end;
86 return _dest; 86 return _dest;
87} 87}
88 88
89template <class InputIterator1, class InputIterator2> 89template <class InputIterator1, class InputIterator2>
90inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 ) 90inline bool qEqual( InputIterator1 first1, InputIterator1 last1, InputIterator2 first2 )
91{ 91{
92 // ### compare using !(*first1 == *first2) in Qt 4.0
92 for ( ; first1 != last1; ++first1, ++first2 ) 93 for ( ; first1 != last1; ++first1, ++first2 )
93 if ( *first1 != *first2 ) 94 if ( *first1 != *first2 )
94 return FALSE; 95 return FALSE;
95 return TRUE; 96 return TRUE;
96} 97}
97 98
98template <class ForwardIterator, class T> 99template <class ForwardIterator, class T>
99inline void qFill( ForwardIterator first, ForwardIterator last, const T& val ) 100inline void qFill( ForwardIterator first, ForwardIterator last, const T& val )
100{ 101{
101 for ( ; first != last; ++first ) 102 for ( ; first != last; ++first )
102 *first = val; 103 *first = val;
103} 104}
104 105
105#if 0 106#if 0
106template <class BiIterator, class OutputIterator> 107template <class BiIterator, class OutputIterator>
107inline OutputIterator qReverseCopy( BiIterator _begin, BiIterator _end, 108inline OutputIterator qReverseCopy( BiIterator _begin, BiIterator _end,
108 OutputIterator _dest ) 109 OutputIterator _dest )
109{ 110{
110 while ( _begin != _end ) { 111 while ( _begin != _end ) {
111 --_end; 112 --_end;
112 *_dest = *_end; 113 *_dest = *_end;
113 ++_dest; 114 ++_dest;
114 } 115 }
115 return _dest; 116 return _dest;
116} 117}
117#endif 118#endif
118 119
119 120
120template <class InputIterator, class T> 121template <class InputIterator, class T>
121inline InputIterator qFind( InputIterator first, InputIterator last, 122inline InputIterator qFind( InputIterator first, InputIterator last,
122 const T& val ) 123 const T& val )
123{ 124{
124 while ( first != last && *first != val ) 125 while ( first != last && *first != val )
125 ++first; 126 ++first;
126 return first; 127 return first;
127} 128}
128 129
129template <class InputIterator, class T, class Size> 130template <class InputIterator, class T, class Size>
130inline void qCount( InputIterator first, InputIterator last, const T& value, 131inline void qCount( InputIterator first, InputIterator last, const T& value,
131 Size& n ) 132 Size& n )
132{ 133{
133 for ( ; first != last; ++first ) 134 for ( ; first != last; ++first )
134 if ( *first == value ) 135 if ( *first == value )
135 ++n; 136 ++n;
136} 137}
137 138
138template <class T> 139template <class T>
139inline void qSwap( T& _value1, T& _value2 ) 140inline void qSwap( T& _value1, T& _value2 )
140{ 141{
141 T tmp = _value1; 142 T tmp = _value1;
142 _value1 = _value2; 143 _value1 = _value2;
143 _value2 = tmp; 144 _value2 = tmp;
144} 145}
145 146
146 147
147template <class InputIterator> 148template <class InputIterator>
148Q_INLINE_TEMPLATES void qBubbleSort( InputIterator b, InputIterator e ) 149Q_INLINE_TEMPLATES void qBubbleSort( InputIterator b, InputIterator e )
149{ 150{
150 // Goto last element; 151 // Goto last element;
151 InputIterator last = e; 152 InputIterator last = e;
152 --last; 153 --last;
153 // only one element or no elements ? 154 // only one element or no elements ?
154 if ( last == b ) 155 if ( last == b )
155 return; 156 return;
156 157
157 // So we have at least two elements in here 158 // So we have at least two elements in here
158 while( b != last ) { 159 while( b != last ) {
159 bool swapped = FALSE; 160 bool swapped = FALSE;
160 InputIterator swap_pos = b; 161 InputIterator swap_pos = b;
161 InputIterator x = e; 162 InputIterator x = e;
162 InputIterator y = x; 163 InputIterator y = x;
163 y--; 164 y--;
164 do { 165 do {
165 --x; 166 --x;
166 --y; 167 --y;
167 if ( *x < *y ) { 168 if ( *x < *y ) {
168 swapped = TRUE; 169 swapped = TRUE;
169 qSwap( *x, *y ); 170 qSwap( *x, *y );
170 swap_pos = y; 171 swap_pos = y;
171 } 172 }
172 } while( y != b ); 173 } while( y != b );
173 if ( !swapped ) 174 if ( !swapped )
174 return; 175 return;
175 b = swap_pos; 176 b = swap_pos;
176 b++; 177 b++;
177 } 178 }
178} 179}
179 180
180 181
181template <class Container> 182template <class Container>
182inline void qBubbleSort( Container &c ) 183inline void qBubbleSort( Container &c )
183{ 184{
184 qBubbleSort( c.begin(), c.end() ); 185 qBubbleSort( c.begin(), c.end() );
185} 186}
186 187
187 188
188template <class Value> 189template <class Value>
189Q_INLINE_TEMPLATES void qHeapSortPushDown( Value* heap, int first, int last ) 190Q_INLINE_TEMPLATES void qHeapSortPushDown( Value* heap, int first, int last )
190{ 191{
191 int r = first; 192 int r = first;
192 while ( r <= last / 2 ) { 193 while ( r <= last / 2 ) {
193 if ( last == 2 * r ) { 194 if ( last == 2 * r ) {
194 // node r has only one child 195 // node r has only one child
195 if ( heap[2 * r] < heap[r] ) 196 if ( heap[2 * r] < heap[r] )
196 qSwap( heap[r], heap[2 * r] ); 197 qSwap( heap[r], heap[2 * r] );
197 r = last; 198 r = last;
198 } else { 199 } else {
199 // node r has two children 200 // node r has two children
200 if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) { 201 if ( heap[2 * r] < heap[r] && !(heap[2 * r + 1] < heap[2 * r]) ) {
201 // swap with left child 202 // swap with left child
202 qSwap( heap[r], heap[2 * r] ); 203 qSwap( heap[r], heap[2 * r] );
203 r *= 2; 204 r *= 2;
204 } else if ( heap[2 * r + 1] < heap[r] 205 } else if ( heap[2 * r + 1] < heap[r]
205 && heap[2 * r + 1] < heap[2 * r] ) { 206 && heap[2 * r + 1] < heap[2 * r] ) {
206 // swap with right child 207 // swap with right child
207 qSwap( heap[r], heap[2 * r + 1] ); 208 qSwap( heap[r], heap[2 * r + 1] );
208 r = 2 * r + 1; 209 r = 2 * r + 1;
209 } else { 210 } else {
210 r = last; 211 r = last;
211 } 212 }
212 } 213 }
213 } 214 }
214} 215}
215 216
216 217
217template <class InputIterator, class Value> 218template <class InputIterator, class Value>
218Q_INLINE_TEMPLATES void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n ) 219Q_INLINE_TEMPLATES void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n )
219{ 220{
220 // Create the heap 221 // Create the heap
221 InputIterator insert = b; 222 InputIterator insert = b;
222 Value* realheap = new Value[n]; 223 Value* realheap = new Value[n];
223 // Wow, what a fake. But I want the heap to be indexed as 1...n 224 // Wow, what a fake. But I want the heap to be indexed as 1...n
224 Value* heap = realheap - 1; 225 Value* heap = realheap - 1;
225 int size = 0; 226 int size = 0;
226 for( ; insert != e; ++insert ) { 227 for( ; insert != e; ++insert ) {
227 heap[++size] = *insert; 228 heap[++size] = *insert;
228 int i = size; 229 int i = size;
229 while( i > 1 && heap[i] < heap[i / 2] ) { 230 while( i > 1 && heap[i] < heap[i / 2] ) {
230 qSwap( heap[i], heap[i / 2] ); 231 qSwap( heap[i], heap[i / 2] );
231 i /= 2; 232 i /= 2;
232 } 233 }
233 } 234 }
234 235
235 // Now do the sorting 236 // Now do the sorting
236 for( uint i = n; i > 0; i-- ) { 237 for( uint i = n; i > 0; i-- ) {
237 *b++ = heap[1]; 238 *b++ = heap[1];
238 if ( i > 1 ) { 239 if ( i > 1 ) {
239 heap[1] = heap[i]; 240 heap[1] = heap[i];
240 qHeapSortPushDown( heap, 1, (int)i - 1 ); 241 qHeapSortPushDown( heap, 1, (int)i - 1 );
241 } 242 }
242 } 243 }
243 244
244 delete[] realheap; 245 delete[] realheap;
245} 246}
246 247
247 248
248template <class InputIterator> 249template <class InputIterator>
249Q_INLINE_TEMPLATES void qHeapSort( InputIterator b, InputIterator e ) 250Q_INLINE_TEMPLATES void qHeapSort( InputIterator b, InputIterator e )
250{ 251{
251 // Empty ? 252 // Empty ?
252 if ( b == e ) 253 if ( b == e )
253 return; 254 return;
254 255
255 // How many entries have to be sorted ? 256 // How many entries have to be sorted ?
256 InputIterator it = b; 257 InputIterator it = b;
257 uint n = 0; 258 uint n = 0;
258 while ( it != e ) { 259 while ( it != e ) {
259 ++n; 260 ++n;
260 ++it; 261 ++it;
261 } 262 }
262 263
263 // The second last parameter is a hack to retrieve the value type 264 // The second last parameter is a hack to retrieve the value type
264 // Do the real sorting here 265 // Do the real sorting here
265 qHeapSortHelper( b, e, *b, n ); 266 qHeapSortHelper( b, e, *b, n );
266} 267}
267 268
268 269
269template <class Container> 270template <class Container>
270Q_INLINE_TEMPLATES void qHeapSort( Container &c ) 271Q_INLINE_TEMPLATES void qHeapSort( Container &c )
271{ 272{
272 if ( c.begin() == c.end() ) 273 if ( c.begin() == c.end() )
273 return; 274 return;
274 275
275 // The second last parameter is a hack to retrieve the value type 276 // The second last parameter is a hack to retrieve the value type
276 // Do the real sorting here 277 // Do the real sorting here
277 qHeapSortHelper( c.begin(), c.end(), *(c.begin()), (uint)c.count() ); 278 qHeapSortHelper( c.begin(), c.end(), *(c.begin()), (uint)c.count() );
278} 279}
279 280
280template <class Container> 281template <class Container>
281class QBackInsertIterator 282class QBackInsertIterator
282{ 283{
283public: 284public:
284 Q_EXPLICIT QBackInsertIterator( Container &c ) 285 Q_EXPLICIT QBackInsertIterator( Container &c )
285 : container( &c ) 286 : container( &c )
286 { 287 {
287 } 288 }
288 289
289 QBackInsertIterator<Container>& 290 QBackInsertIterator<Container>&
290 operator=( const Q_TYPENAME Container::value_type &value ) 291 operator=( const Q_TYPENAME Container::value_type &value )
291 { 292 {
292 container->push_back( value ); 293 container->push_back( value );
293 return *this; 294 return *this;
294 } 295 }
295 296
296 QBackInsertIterator<Container>& operator*() 297 QBackInsertIterator<Container>& operator*()
297 { 298 {
298 return *this; 299 return *this;
299 } 300 }
300 301
301 QBackInsertIterator<Container>& operator++() 302 QBackInsertIterator<Container>& operator++()
302 { 303 {
303 return *this; 304 return *this;
304 } 305 }
305 306
306 QBackInsertIterator<Container>& operator++(int) 307 QBackInsertIterator<Container>& operator++(int)
307 { 308 {
308 return *this; 309 return *this;
309 } 310 }
310 311
311protected: 312protected:
312 Container *container; 313 Container *container;
313}; 314};
314 315
315template <class Container> 316template <class Container>
316inline QBackInsertIterator<Container> qBackInserter( Container &c ) 317inline QBackInsertIterator<Container> qBackInserter( Container &c )
317{ 318{
318 return QBackInsertIterator<Container>( c ); 319 return QBackInsertIterator<Container>( c );
319} 320}
320 321
321#endif 322#endif
diff --git a/qmake/include/quuid.h b/qmake/include/quuid.h
index 591d2f1..664c149 100644
--- a/qmake/include/quuid.h
+++ b/qmake/include/quuid.h
@@ -1,168 +1,168 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QUuid class 4** Definition of QUuid class
5** 5**
6** Created: 010523 6** Created : 010523
7** 7**
8** Copyright (C) 1992-2001 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QUUID_H 38#ifndef QUUID_H
39#define QUUID_H 39#define QUUID_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include <qstring.h> 42#include <qstring.h>
43#endif // QT_H 43#endif // QT_H
44 44
45#include <string.h> 45#include <string.h>
46 46
47#if defined(Q_OS_WIN32) 47#if defined(Q_OS_WIN32)
48#ifndef GUID_DEFINED 48#ifndef GUID_DEFINED
49#define GUID_DEFINED 49#define GUID_DEFINED
50typedef struct _GUID 50typedef struct _GUID
51{ 51{
52 ulong Data1; 52 ulong Data1;
53 ushort Data2; 53 ushort Data2;
54 ushort Data3; 54 ushort Data3;
55 uchar Data4[ 8 ]; 55 uchar Data4[ 8 ];
56} GUID; 56} GUID, *REFGUID, *LPGUID;
57#endif 57#endif
58#endif 58#endif
59 59
60struct Q_EXPORT QUuid 60struct Q_EXPORT QUuid
61{ 61{
62 QUuid() 62 QUuid()
63 { 63 {
64 memset( this, 0, sizeof(QUuid) ); 64 memset( this, 0, sizeof(QUuid) );
65 } 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 ) 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 { 67 {
68 data1 = l; 68 data1 = l;
69 data2 = w1; 69 data2 = w1;
70 data3 = w2; 70 data3 = w2;
71 data4[0] = b1; 71 data4[0] = b1;
72 data4[1] = b2; 72 data4[1] = b2;
73 data4[2] = b3; 73 data4[2] = b3;
74 data4[3] = b4; 74 data4[3] = b4;
75 data4[4] = b5; 75 data4[4] = b5;
76 data4[5] = b6; 76 data4[5] = b6;
77 data4[6] = b7; 77 data4[6] = b7;
78 data4[7] = b8; 78 data4[7] = b8;
79 } 79 }
80 QUuid( const QUuid &uuid ) 80 QUuid( const QUuid &uuid )
81 { 81 {
82 memcpy( this, &uuid, sizeof(QUuid) ); 82 memcpy( this, &uuid, sizeof(QUuid) );
83 } 83 }
84#ifndef QT_NO_QUUID_STRING 84#ifndef QT_NO_QUUID_STRING
85 QUuid( const QString & ); 85 QUuid( const QString & );
86 QUuid( const char * ); 86 QUuid( const char * );
87 QString toString() const; 87 QString toString() const;
88 operator QString() const { return toString(); } 88 operator QString() const { return toString(); }
89#endif 89#endif
90 bool isNull() const; 90 bool isNull() const;
91 91
92 QUuid &operator=(const QUuid &orig ) 92 QUuid &operator=(const QUuid &orig )
93 { 93 {
94 memcpy( this, &orig, sizeof(QUuid) ); 94 memcpy( this, &orig, sizeof(QUuid) );
95 return *this; 95 return *this;
96 } 96 }
97 97
98 bool operator==(const QUuid &orig ) const 98 bool operator==(const QUuid &orig ) const
99 { 99 {
100 uint i; 100 uint i;
101 if ( data1 != orig.data1 || data2 != orig.data2 || 101 if ( data1 != orig.data1 || data2 != orig.data2 ||
102 data3 != orig.data3 ) 102 data3 != orig.data3 )
103 return FALSE; 103 return FALSE;
104 104
105 for( i = 0; i < 8; i++ ) 105 for( i = 0; i < 8; i++ )
106 if ( data4[i] != orig.data4[i] ) 106 if ( data4[i] != orig.data4[i] )
107 return FALSE; 107 return FALSE;
108 108
109 return TRUE; 109 return TRUE;
110 } 110 }
111 111
112 bool operator!=(const QUuid &orig ) const 112 bool operator!=(const QUuid &orig ) const
113 { 113 {
114 return !( *this == orig ); 114 return !( *this == orig );
115 } 115 }
116 116
117#if defined(Q_OS_WIN32) 117#if defined(Q_OS_WIN32)
118 // On Windows we have a type GUID that is used by the platform API, so we 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. 119 // provide convenience operators to cast from and to this type.
120 QUuid( const GUID &guid ) 120 QUuid( const GUID &guid )
121 { 121 {
122 memcpy( this, &guid, sizeof(GUID) ); 122 memcpy( this, &guid, sizeof(GUID) );
123 } 123 }
124 124
125 QUuid &operator=(const GUID &orig ) 125 QUuid &operator=(const GUID &orig )
126 { 126 {
127 memcpy( this, &orig, sizeof(QUuid) ); 127 memcpy( this, &orig, sizeof(QUuid) );
128 return *this; 128 return *this;
129 } 129 }
130 130
131 operator GUID() const 131 operator GUID() const
132 { 132 {
133 GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } }; 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; 134 return guid;
135 } 135 }
136 136
137 bool operator==( const GUID &guid ) const 137 bool operator==( const GUID &guid ) const
138 { 138 {
139 uint i; 139 uint i;
140 if ( data1 != guid.Data1 || data2 != guid.Data2 || 140 if ( data1 != guid.Data1 || data2 != guid.Data2 ||
141 data3 != guid.Data3 ) 141 data3 != guid.Data3 )
142 return FALSE; 142 return FALSE;
143 143
144 for( i = 0; i < 8; i++ ) 144 for( i = 0; i < 8; i++ )
145 if ( data4[i] != guid.Data4[i] ) 145 if ( data4[i] != guid.Data4[i] )
146 return FALSE; 146 return FALSE;
147 147
148 return TRUE; 148 return TRUE;
149 } 149 }
150 150
151 bool operator!=( const GUID &guid ) const 151 bool operator!=( const GUID &guid ) const
152 { 152 {
153 return !( *this == guid ); 153 return !( *this == guid );
154 } 154 }
155#endif 155#endif
156 156
157 uint data1; 157 uint data1;
158 ushort data2; 158 ushort data2;
159 ushort data3; 159 ushort data3;
160 uchar data4[ 8 ]; 160 uchar data4[ 8 ];
161}; 161};
162 162
163#ifndef QT_NO_DATASTREAM 163#ifndef QT_NO_DATASTREAM
164Q_EXPORT QDataStream &operator<<( QDataStream &, const QUuid & ); 164Q_EXPORT QDataStream &operator<<( QDataStream &, const QUuid & );
165Q_EXPORT QDataStream &operator>>( QDataStream &, QUuid & ); 165Q_EXPORT QDataStream &operator>>( QDataStream &, QUuid & );
166#endif 166#endif
167 167
168#endif //QUUID_H 168#endif //QUUID_H
diff --git a/qmake/include/qvaluelist.h b/qmake/include/qvaluelist.h
index 54f7aec..f5cd7bb 100644
--- a/qmake/include/qvaluelist.h
+++ b/qmake/include/qvaluelist.h
@@ -153,513 +153,517 @@ class QValueListConstIterator
153 public: 153 public:
154 /** 154 /**
155 * Typedefs 155 * Typedefs
156 */ 156 */
157 typedef QValueListNode<T>* NodePtr; 157 typedef QValueListNode<T>* NodePtr;
158#ifndef QT_NO_STL 158#ifndef QT_NO_STL
159 typedef std::bidirectional_iterator_tag iterator_category; 159 typedef std::bidirectional_iterator_tag iterator_category;
160#endif 160#endif
161 typedef T value_type; 161 typedef T value_type;
162 typedef size_t size_type; 162 typedef size_t size_type;
163#ifndef QT_NO_STL 163#ifndef QT_NO_STL
164 typedef ptrdiff_t difference_type; 164 typedef ptrdiff_t difference_type;
165#else 165#else
166 typedef int difference_type; 166 typedef int difference_type;
167#endif 167#endif
168 typedef const T* pointer; 168 typedef const T* pointer;
169 typedef const T& reference; 169 typedef const T& reference;
170 170
171 /** 171 /**
172 * Variables 172 * Variables
173 */ 173 */
174 NodePtr node; 174 NodePtr node;
175 175
176 /** 176 /**
177 * Functions 177 * Functions
178 */ 178 */
179 QValueListConstIterator() : node( 0 ) {} 179 QValueListConstIterator() : node( 0 ) {}
180 QValueListConstIterator( NodePtr p ) : node( p ) {} 180 QValueListConstIterator( NodePtr p ) : node( p ) {}
181 QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {} 181 QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {}
182 QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {} 182 QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
183 183
184 bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; } 184 bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; }
185 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; } 186 const T& operator*() const { return node->data; }
187 // UDT for T = x* 187 // UDT for T = x*
188 // const T* operator->() const { return &node->data; } 188 // const T* operator->() const { return &node->data; }
189 189
190 QValueListConstIterator<T>& operator++() { 190 QValueListConstIterator<T>& operator++() {
191 node = node->next; 191 node = node->next;
192 return *this; 192 return *this;
193 } 193 }
194 194
195 QValueListConstIterator<T> operator++(int) { 195 QValueListConstIterator<T> operator++(int) {
196 QValueListConstIterator<T> tmp = *this; 196 QValueListConstIterator<T> tmp = *this;
197 node = node->next; 197 node = node->next;
198 return tmp; 198 return tmp;
199 } 199 }
200 200
201 QValueListConstIterator<T>& operator--() { 201 QValueListConstIterator<T>& operator--() {
202 node = node->prev; 202 node = node->prev;
203 return *this; 203 return *this;
204 } 204 }
205 205
206 QValueListConstIterator<T> operator--(int) { 206 QValueListConstIterator<T> operator--(int) {
207 QValueListConstIterator<T> tmp = *this; 207 QValueListConstIterator<T> tmp = *this;
208 node = node->prev; 208 node = node->prev;
209 return tmp; 209 return tmp;
210 } 210 }
211}; 211};
212 212
213template <class T> 213template <class T>
214class QValueListPrivate : public QShared 214class QValueListPrivate : public QShared
215{ 215{
216public: 216public:
217 /** 217 /**
218 * Typedefs 218 * Typedefs
219 */ 219 */
220 typedef QValueListIterator<T> Iterator; 220 typedef QValueListIterator<T> Iterator;
221 typedef QValueListConstIterator<T> ConstIterator; 221 typedef QValueListConstIterator<T> ConstIterator;
222 typedef QValueListNode<T> Node; 222 typedef QValueListNode<T> Node;
223 typedef QValueListNode<T>* NodePtr; 223 typedef QValueListNode<T>* NodePtr;
224 typedef size_t size_type; 224 typedef size_t size_type;
225 225
226 /** 226 /**
227 * Functions 227 * Functions
228 */ 228 */
229 QValueListPrivate(); 229 QValueListPrivate();
230 QValueListPrivate( const QValueListPrivate<T>& _p ); 230 QValueListPrivate( const QValueListPrivate<T>& _p );
231 231
232 void derefAndDelete() // ### hack to get around hp-cc brain damage 232 void derefAndDelete() // ### hack to get around hp-cc brain damage
233 { 233 {
234 if ( deref() ) 234 if ( deref() )
235 delete this; 235 delete this;
236 } 236 }
237 237
238#if defined(Q_TEMPLATEDLL) 238#if defined(Q_TEMPLATEDLL)
239 // Workaround MS bug in memory de/allocation in DLL vs. EXE 239 // Workaround MS bug in memory de/allocation in DLL vs. EXE
240 virtual 240 virtual
241#endif 241#endif
242 ~QValueListPrivate(); 242 ~QValueListPrivate();
243 243
244 Iterator insert( Iterator it, const T& x ); 244 Iterator insert( Iterator it, const T& x );
245 Iterator remove( Iterator it ); 245 Iterator remove( Iterator it );
246 NodePtr find( NodePtr start, const T& x ) const; 246 NodePtr find( NodePtr start, const T& x ) const;
247 int findIndex( NodePtr start, const T& x ) const; 247 int findIndex( NodePtr start, const T& x ) const;
248 uint contains( const T& x ) const; 248 uint contains( const T& x ) const;
249 uint remove( const T& x ); 249 uint remove( const T& x );
250 NodePtr at( size_type i ) const; 250 NodePtr at( size_type i ) const;
251 void clear(); 251 void clear();
252 252
253 NodePtr node; 253 NodePtr node;
254 size_type nodes; 254 size_type nodes;
255}; 255};
256 256
257template <class T> 257template <class T>
258Q_INLINE_TEMPLATES QValueListPrivate<T>::QValueListPrivate() 258Q_INLINE_TEMPLATES QValueListPrivate<T>::QValueListPrivate()
259{ 259{
260 node = new Node; node->next = node->prev = node; nodes = 0; 260 node = new Node; node->next = node->prev = node; nodes = 0;
261} 261}
262 262
263template <class T> 263template <class T>
264Q_INLINE_TEMPLATES QValueListPrivate<T>::QValueListPrivate( const QValueListPrivate<T>& _p ) 264Q_INLINE_TEMPLATES QValueListPrivate<T>::QValueListPrivate( const QValueListPrivate<T>& _p )
265 : QShared() 265 : QShared()
266{ 266{
267 node = new Node; node->next = node->prev = node; nodes = 0; 267 node = new Node; node->next = node->prev = node; nodes = 0;
268 Iterator b( _p.node->next ); 268 Iterator b( _p.node->next );
269 Iterator e( _p.node ); 269 Iterator e( _p.node );
270 Iterator i( node ); 270 Iterator i( node );
271 while( b != e ) 271 while( b != e )
272 insert( i, *b++ ); 272 insert( i, *b++ );
273} 273}
274 274
275template <class T> 275template <class T>
276Q_INLINE_TEMPLATES QValueListPrivate<T>::~QValueListPrivate() { 276Q_INLINE_TEMPLATES QValueListPrivate<T>::~QValueListPrivate() {
277 NodePtr p = node->next; 277 NodePtr p = node->next;
278 while( p != node ) { 278 while( p != node ) {
279 NodePtr x = p->next; 279 NodePtr x = p->next;
280 delete p; 280 delete p;
281 p = x; 281 p = x;
282 } 282 }
283 delete node; 283 delete node;
284} 284}
285 285
286template <class T> 286template <class T>
287Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::Iterator QValueListPrivate<T>::insert( Q_TYPENAME QValueListPrivate<T>::Iterator it, const T& x ) 287Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::Iterator QValueListPrivate<T>::insert( Q_TYPENAME QValueListPrivate<T>::Iterator it, const T& x )
288{ 288{
289 NodePtr p = new Node( x ); 289 NodePtr p = new Node( x );
290 p->next = it.node; 290 p->next = it.node;
291 p->prev = it.node->prev; 291 p->prev = it.node->prev;
292 it.node->prev->next = p; 292 it.node->prev->next = p;
293 it.node->prev = p; 293 it.node->prev = p;
294 nodes++; 294 nodes++;
295 return p; 295 return p;
296} 296}
297 297
298template <class T> 298template <class T>
299Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::Iterator QValueListPrivate<T>::remove( Q_TYPENAME QValueListPrivate<T>::Iterator it ) 299Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::Iterator QValueListPrivate<T>::remove( Q_TYPENAME QValueListPrivate<T>::Iterator it )
300{ 300{
301 Q_ASSERT ( it.node != node ); 301 Q_ASSERT ( it.node != node );
302 NodePtr next = it.node->next; 302 NodePtr next = it.node->next;
303 NodePtr prev = it.node->prev; 303 NodePtr prev = it.node->prev;
304 prev->next = next; 304 prev->next = next;
305 next->prev = prev; 305 next->prev = prev;
306 delete it.node; 306 delete it.node;
307 nodes--; 307 nodes--;
308 return Iterator( next ); 308 return Iterator( next );
309} 309}
310 310
311template <class T> 311template <class T>
312Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::find( Q_TYPENAME QValueListPrivate<T>::NodePtr start, const T& x ) const 312Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::find( Q_TYPENAME QValueListPrivate<T>::NodePtr start, const T& x ) const
313{ 313{
314 ConstIterator first( start ); 314 ConstIterator first( start );
315 ConstIterator last( node ); 315 ConstIterator last( node );
316 while( first != last) { 316 while( first != last) {
317 if ( *first == x ) 317 if ( *first == x )
318 return first.node; 318 return first.node;
319 ++first; 319 ++first;
320 } 320 }
321 return last.node; 321 return last.node;
322} 322}
323 323
324template <class T> 324template <class T>
325Q_INLINE_TEMPLATES int QValueListPrivate<T>::findIndex( Q_TYPENAME QValueListPrivate<T>::NodePtr start, const T& x ) const 325Q_INLINE_TEMPLATES int QValueListPrivate<T>::findIndex( Q_TYPENAME QValueListPrivate<T>::NodePtr start, const T& x ) const
326{ 326{
327 ConstIterator first( start ); 327 ConstIterator first( start );
328 ConstIterator last( node ); 328 ConstIterator last( node );
329 int pos = 0; 329 int pos = 0;
330 while( first != last) { 330 while( first != last) {
331 if ( *first == x ) 331 if ( *first == x )
332 return pos; 332 return pos;
333 ++first; 333 ++first;
334 ++pos; 334 ++pos;
335 } 335 }
336 return -1; 336 return -1;
337} 337}
338 338
339template <class T> 339template <class T>
340Q_INLINE_TEMPLATES uint QValueListPrivate<T>::contains( const T& x ) const 340Q_INLINE_TEMPLATES uint QValueListPrivate<T>::contains( const T& x ) const
341{ 341{
342 uint result = 0; 342 uint result = 0;
343 Iterator first = Iterator( node->next ); 343 Iterator first = Iterator( node->next );
344 Iterator last = Iterator( node ); 344 Iterator last = Iterator( node );
345 while( first != last) { 345 while( first != last) {
346 if ( *first == x ) 346 if ( *first == x )
347 ++result; 347 ++result;
348 ++first; 348 ++first;
349 } 349 }
350 return result; 350 return result;
351} 351}
352 352
353template <class T> 353template <class T>
354Q_INLINE_TEMPLATES uint QValueListPrivate<T>::remove( const T& x ) 354Q_INLINE_TEMPLATES uint QValueListPrivate<T>::remove( const T& x )
355{ 355{
356 uint result = 0; 356 uint result = 0;
357 Iterator first = Iterator( node->next ); 357 Iterator first = Iterator( node->next );
358 Iterator last = Iterator( node ); 358 Iterator last = Iterator( node );
359 while( first != last) { 359 while( first != last) {
360 if ( *first == x ) { 360 if ( *first == x ) {
361 first = remove( first ); 361 first = remove( first );
362 ++result; 362 ++result;
363 } else 363 } else
364 ++first; 364 ++first;
365 } 365 }
366 return result; 366 return result;
367} 367}
368 368
369template <class T> 369template <class T>
370Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::at( size_type i ) const 370Q_INLINE_TEMPLATES Q_TYPENAME QValueListPrivate<T>::NodePtr QValueListPrivate<T>::at( size_type i ) const
371{ 371{
372 Q_ASSERT( i <= nodes ); 372 Q_ASSERT( i <= nodes );
373 NodePtr p = node->next; 373 NodePtr p = node->next;
374 for( size_type x = 0; x < i; ++x ) 374 for( size_type x = 0; x < i; ++x )
375 p = p->next; 375 p = p->next;
376 return p; 376 return p;
377} 377}
378 378
379template <class T> 379template <class T>
380Q_INLINE_TEMPLATES void QValueListPrivate<T>::clear() 380Q_INLINE_TEMPLATES void QValueListPrivate<T>::clear()
381{ 381{
382 nodes = 0; 382 nodes = 0;
383 NodePtr p = node->next; 383 NodePtr p = node->next;
384 while( p != node ) { 384 while( p != node ) {
385 NodePtr next = p->next; 385 NodePtr next = p->next;
386 delete p; 386 delete p;
387 p = next; 387 p = next;
388 } 388 }
389 node->next = node->prev = node; 389 node->next = node->prev = node;
390} 390}
391 391
392#ifdef QT_CHECK_RANGE 392#ifdef QT_CHECK_RANGE
393# if !defined( QT_NO_DEBUG ) && defined( QT_CHECK_VALUELIST_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" ) 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() ); 395# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL Q_ASSERT( !empty() );
396# else 396# else
397# define QT_CHECK_INVALID_LIST_ELEMENT 397# define QT_CHECK_INVALID_LIST_ELEMENT
398# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL 398# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL
399# endif 399# endif
400#else 400#else
401# define QT_CHECK_INVALID_LIST_ELEMENT 401# define QT_CHECK_INVALID_LIST_ELEMENT
402# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL 402# define QT_CHECK_INVALID_LIST_ELEMENT_FATAL
403#endif 403#endif
404 404
405template <class T> class QDeepCopy; 405template <class T> class QDeepCopy;
406 406
407template <class T> 407template <class T>
408class QValueList 408class QValueList
409{ 409{
410public: 410public:
411 /** 411 /**
412 * Typedefs 412 * Typedefs
413 */ 413 */
414 typedef QValueListIterator<T> iterator; 414 typedef QValueListIterator<T> iterator;
415 typedef QValueListConstIterator<T> const_iterator; 415 typedef QValueListConstIterator<T> const_iterator;
416 typedef T value_type; 416 typedef T value_type;
417 typedef value_type* pointer; 417 typedef value_type* pointer;
418 typedef const value_type* const_pointer; 418 typedef const value_type* const_pointer;
419 typedef value_type& reference; 419 typedef value_type& reference;
420 typedef const value_type& const_reference; 420 typedef const value_type& const_reference;
421 typedef size_t size_type; 421 typedef size_t size_type;
422#ifndef QT_NO_STL 422#ifndef QT_NO_STL
423 typedef ptrdiff_t difference_type; 423 typedef ptrdiff_t difference_type;
424#else 424#else
425 typedef int difference_type; 425 typedef int difference_type;
426#endif 426#endif
427 427
428 /** 428 /**
429 * API 429 * API
430 */ 430 */
431 QValueList() { sh = new QValueListPrivate<T>; } 431 QValueList() { sh = new QValueListPrivate<T>; }
432 QValueList( const QValueList<T>& l ) { sh = l.sh; sh->ref(); } 432 QValueList( const QValueList<T>& l ) { sh = l.sh; sh->ref(); }
433#ifndef QT_NO_STL 433#ifndef QT_NO_STL
434# ifdef Q_CC_HPACC // HP-UX aCC does require typename in some place 434# ifdef Q_CC_HPACC // HP-UX aCC does require typename in some place
435# undef Q_TYPENAME // but not accept them at others. 435# undef Q_TYPENAME // but not accept them at others.
436# define Q_TYPENAME // also doesn't like re-defines ... 436# define Q_TYPENAME // also doesn't like re-defines ...
437# endif 437# endif
438 QValueList( const Q_TYPENAME std::list<T>& l ) 438 QValueList( const Q_TYPENAME std::list<T>& l )
439 { 439 {
440 sh = new QValueListPrivate<T>; 440 sh = new QValueListPrivate<T>;
441 qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); 441 qCopy( l.begin(), l.end(), std::back_inserter( *this ) );
442 } 442 }
443#endif 443#endif
444 ~QValueList() { sh->derefAndDelete(); } 444 ~QValueList() { sh->derefAndDelete(); }
445 445
446 QValueList<T>& operator= ( const QValueList<T>& l ) 446 QValueList<T>& operator= ( const QValueList<T>& l )
447 { 447 {
448 l.sh->ref(); 448 l.sh->ref();
449 sh->derefAndDelete(); 449 sh->derefAndDelete();
450 sh = l.sh; 450 sh = l.sh;
451 return *this; 451 return *this;
452 } 452 }
453#ifndef QT_NO_STL 453#ifndef QT_NO_STL
454 QValueList<T>& operator= ( const Q_TYPENAME std::list<T>& l ) 454 QValueList<T>& operator= ( const Q_TYPENAME std::list<T>& l )
455 { 455 {
456 detach(); 456 detach();
457 qCopy( l.begin(), l.end(), std::back_inserter( *this ) ); 457 qCopy( l.begin(), l.end(), std::back_inserter( *this ) );
458 return *this; 458 return *this;
459 } 459 }
460 bool operator== ( const Q_TYPENAME std::list<T>& l ) const 460 bool operator== ( const Q_TYPENAME std::list<T>& l ) const
461 { 461 {
462 if ( size() != l.size() ) 462 if ( size() != l.size() )
463 return FALSE; 463 return FALSE;
464 const_iterator it2 = begin(); 464 const_iterator it2 = begin();
465#if !defined(Q_CC_MIPS) 465#if !defined(Q_CC_MIPS)
466 typename 466 typename
467#endif 467#endif
468 std::list<T>::const_iterator it = l.begin(); 468 std::list<T>::const_iterator it = l.begin();
469 for ( ; it2 != end(); ++it2, ++it ) 469 for ( ; it2 != end(); ++it2, ++it )
470 if ( !((*it2) == (*it)) ) 470 if ( !((*it2) == (*it)) )
471 return FALSE; 471 return FALSE;
472 return TRUE; 472 return TRUE;
473 } 473 }
474# ifdef Q_CC_HPACC // undo the HP-UX aCC hackery done above 474# ifdef Q_CC_HPACC // undo the HP-UX aCC hackery done above
475# undef Q_TYPENAME 475# undef Q_TYPENAME
476# define Q_TYPENAME typename 476# define Q_TYPENAME typename
477# endif 477# endif
478#endif 478#endif
479 bool operator== ( const QValueList<T>& l ) const; 479 bool operator== ( const QValueList<T>& l ) const;
480 bool operator!= ( const QValueList<T>& l ) const { return !( *this == l ); } 480 bool operator!= ( const QValueList<T>& l ) const { return !( *this == l ); }
481 iterator begin() { detach(); return iterator( sh->node->next ); } 481 iterator begin() { detach(); return iterator( sh->node->next ); }
482 const_iterator begin() const { return const_iterator( sh->node->next ); } 482 const_iterator begin() const { return const_iterator( sh->node->next ); }
483 iterator end() { detach(); return iterator( sh->node ); } 483 iterator end() { detach(); return iterator( sh->node ); }
484 const_iterator end() const { return const_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 ); } 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 ); } 486 uint remove( const T& x ) { detach(); return sh->remove( x ); }
487 void clear(); 487 void clear();
488 488
489 QValueList<T>& operator<< ( const T& x ) 489 QValueList<T>& operator<< ( const T& x )
490 { 490 {
491 append( x ); 491 append( x );
492 return *this; 492 return *this;
493 } 493 }
494 494
495 size_type size() const { return sh->nodes; } 495 size_type size() const { return sh->nodes; }
496 bool empty() const { return sh->nodes == 0; } 496 bool empty() const { return sh->nodes == 0; }
497 void push_front( const T& x ) { detach(); sh->insert( begin(), x ); } 497 void push_front( const T& x ) { detach(); sh->insert( begin(), x ); }
498 void push_back( const T& x ) { detach(); sh->insert( end(), x ); } 498 void push_back( const T& x ) { detach(); sh->insert( end(), x ); }
499 iterator erase( iterator pos ) { detach(); return sh->remove( pos ); } 499 iterator erase( iterator pos ) { detach(); return sh->remove( pos ); }
500 iterator erase( iterator first, iterator last ); 500 iterator erase( iterator first, iterator last );
501 reference front() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); } 501 reference front() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *begin(); }
502 const_reference front() const { 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()); } 503 reference back() { QT_CHECK_INVALID_LIST_ELEMENT_FATAL; return *(--end()); }
504 const_reference back() const { 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() ); } 505 void pop_front() { QT_CHECK_INVALID_LIST_ELEMENT; erase( begin() ); }
506 void pop_back() { 506 void pop_back() {
507 QT_CHECK_INVALID_LIST_ELEMENT; 507 QT_CHECK_INVALID_LIST_ELEMENT;
508 iterator tmp = end(); 508 iterator tmp = end();
509 erase( --tmp ); 509 erase( --tmp );
510 } 510 }
511 void insert( iterator pos, size_type n, const T& x ); 511 void insert( iterator pos, size_type n, const T& x );
512 // Some compilers (incl. vc++) would instantiate this function even if 512 // Some compilers (incl. vc++) would instantiate this function even if
513 // it is not used; this would constrain QValueList to classes that provide 513 // it is not used; this would constrain QValueList to classes that provide
514 // an operator< 514 // an operator<
515 /* 515 /*
516 void sort() 516 void sort()
517 { 517 {
518 qHeapSort( *this ); 518 qHeapSort( *this );
519 } 519 }
520 */ 520 */
521 521
522 QValueList<T> operator+ ( const QValueList<T>& l ) const; 522 QValueList<T> operator+ ( const QValueList<T>& l ) const;
523 QValueList<T>& operator+= ( const QValueList<T>& l ); 523 QValueList<T>& operator+= ( const QValueList<T>& l );
524 524
525 iterator fromLast() { detach(); return iterator( sh->node->prev ); } 525 iterator fromLast() { detach(); return iterator( sh->node->prev ); }
526 const_iterator fromLast() const { return const_iterator( sh->node->prev ); } 526 const_iterator fromLast() const { return const_iterator( sh->node->prev ); }
527 527
528 bool isEmpty() const { return ( sh->nodes == 0 ); } 528 bool isEmpty() const { return ( sh->nodes == 0 ); }
529 529
530 iterator append( const T& x ) { detach(); return sh->insert( end(), x ); } 530 iterator append( const T& x ) { detach(); return sh->insert( end(), x ); }
531 iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); } 531 iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); }
532 532
533 iterator remove( iterator it ) { detach(); return sh->remove( it ); } 533 iterator remove( iterator it ) { detach(); return sh->remove( it ); }
534 534
535 T& first() { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->node->next->data; } 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; } 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; } 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; } 538 const T& last() const { QT_CHECK_INVALID_LIST_ELEMENT; return sh->node->prev->data; }
539 539
540 T& operator[] ( size_type i ) { QT_CHECK_INVALID_LIST_ELEMENT; detach(); return sh->at(i)->data; } 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; } 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) ); } 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) ); } 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) ); } 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) ); } 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 ) ); } 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 ) ); } 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) ; } 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 ); } 549 size_type contains( const T& x ) const { return sh->contains( x ); }
550 550
551 size_type count() const { return sh->nodes; } 551 size_type count() const { return sh->nodes; }
552 552
553 QValueList<T>& operator+= ( const T& x ) 553 QValueList<T>& operator+= ( const T& x )
554 { 554 {
555 append( x ); 555 append( x );
556 return *this; 556 return *this;
557 } 557 }
558 typedef QValueListIterator<T> Iterator; 558 typedef QValueListIterator<T> Iterator;
559 typedef QValueListConstIterator<T> ConstIterator; 559 typedef QValueListConstIterator<T> ConstIterator;
560 typedef T ValueType; 560 typedef T ValueType;
561 561
562protected: 562protected:
563 /** 563 /**
564 * Helpers 564 * Helpers
565 */ 565 */
566 void detach() { if ( sh->count > 1 ) detachInternal(); } 566 void detach() { if ( sh->count > 1 ) detachInternal(); }
567 567
568 /** 568 /**
569 * Variables 569 * Variables
570 */ 570 */
571 QValueListPrivate<T>* sh; 571 QValueListPrivate<T>* sh;
572 572
573private: 573private:
574 void detachInternal(); 574 void detachInternal();
575 575
576 friend class QDeepCopy< QValueList<T> >; 576 friend class QDeepCopy< QValueList<T> >;
577}; 577};
578 578
579template <class T> 579template <class T>
580Q_INLINE_TEMPLATES bool QValueList<T>::operator== ( const QValueList<T>& l ) const 580Q_INLINE_TEMPLATES bool QValueList<T>::operator== ( const QValueList<T>& l ) const
581{ 581{
582 if ( size() != l.size() ) 582 if ( size() != l.size() )
583 return FALSE; 583 return FALSE;
584 const_iterator it2 = begin(); 584 const_iterator it2 = begin();
585 const_iterator it = l.begin(); 585 const_iterator it = l.begin();
586 for( ; it != l.end(); ++it, ++it2 ) 586 for( ; it != l.end(); ++it, ++it2 )
587 if ( !( *it == *it2 ) ) 587 if ( !( *it == *it2 ) )
588 return FALSE; 588 return FALSE;
589 return TRUE; 589 return TRUE;
590} 590}
591 591
592template <class T> 592template <class T>
593Q_INLINE_TEMPLATES void QValueList<T>::clear() 593Q_INLINE_TEMPLATES void QValueList<T>::clear()
594{ 594{
595 if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QValueListPrivate<T>; } 595 if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QValueListPrivate<T>; }
596} 596}
597 597
598template <class T> 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 ) 599Q_INLINE_TEMPLATES Q_TYPENAME QValueList<T>::iterator QValueList<T>::erase( Q_TYPENAME QValueList<T>::iterator first, Q_TYPENAME QValueList<T>::iterator last )
600{ 600{
601 while ( first != last ) 601 while ( first != last )
602 erase( first++ ); 602 erase( first++ );
603 return last; 603 return last;
604} 604}
605 605
606 606
607template <class T> 607template <class T>
608Q_INLINE_TEMPLATES void QValueList<T>::insert( Q_TYPENAME QValueList<T>::iterator pos, size_type n, const T& x ) 608Q_INLINE_TEMPLATES void QValueList<T>::insert( Q_TYPENAME QValueList<T>::iterator pos, size_type n, const T& x )
609{ 609{
610 for ( ; n > 0; --n ) 610 for ( ; n > 0; --n )
611 insert( pos, x ); 611 insert( pos, x );
612} 612}
613 613
614template <class T> 614template <class T>
615Q_INLINE_TEMPLATES QValueList<T> QValueList<T>::operator+ ( const QValueList<T>& l ) const 615Q_INLINE_TEMPLATES QValueList<T> QValueList<T>::operator+ ( const QValueList<T>& l ) const
616{ 616{
617 QValueList<T> l2( *this ); 617 QValueList<T> l2( *this );
618 for( const_iterator it = l.begin(); it != l.end(); ++it ) 618 for( const_iterator it = l.begin(); it != l.end(); ++it )
619 l2.append( *it ); 619 l2.append( *it );
620 return l2; 620 return l2;
621} 621}
622 622
623template <class T> 623template <class T>
624Q_INLINE_TEMPLATES QValueList<T>& QValueList<T>::operator+= ( const QValueList<T>& l ) 624Q_INLINE_TEMPLATES QValueList<T>& QValueList<T>::operator+= ( const QValueList<T>& l )
625{ 625{
626 for( const_iterator it = l.begin(); it != l.end(); ++it ) 626 for( const_iterator it = l.begin(); it != l.end(); ++it )
627 append( *it ); 627 append( *it );
628 return *this; 628 return *this;
629} 629}
630 630
631template <class T> 631template <class T>
632Q_INLINE_TEMPLATES void QValueList<T>::detachInternal() 632Q_INLINE_TEMPLATES void QValueList<T>::detachInternal()
633{ 633{
634 sh->deref(); sh = new QValueListPrivate<T>( *sh ); 634 sh->deref(); sh = new QValueListPrivate<T>( *sh );
635} 635}
636 636
637#ifndef QT_NO_DATASTREAM 637#ifndef QT_NO_DATASTREAM
638template <class T> 638template <class T>
639Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QValueList<T>& l ) 639Q_INLINE_TEMPLATES QDataStream& operator>>( QDataStream& s, QValueList<T>& l )
640{ 640{
641 l.clear(); 641 l.clear();
642 Q_UINT32 c; 642 Q_UINT32 c;
643 s >> c; 643 s >> c;
644 for( Q_UINT32 i = 0; i < c; ++i ) 644 for( Q_UINT32 i = 0; i < c; ++i )
645 { 645 {
646 T t; 646 T t;
647 s >> t; 647 s >> t;
648 l.append( t ); 648 l.append( t );
649 if ( s.atEnd() ) 649 if ( s.atEnd() )
650 break; 650 break;
651 } 651 }
652 return s; 652 return s;
653} 653}
654 654
655template <class T> 655template <class T>
656Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QValueList<T>& l ) 656Q_INLINE_TEMPLATES QDataStream& operator<<( QDataStream& s, const QValueList<T>& l )
657{ 657{
658 s << (Q_UINT32)l.size(); 658 s << (Q_UINT32)l.size();
659 QValueListConstIterator<T> it = l.begin(); 659 QValueListConstIterator<T> it = l.begin();
660 for( ; it != l.end(); ++it ) 660 for( ; it != l.end(); ++it )
661 s << *it; 661 s << *it;
662 return s; 662 return s;
663} 663}
664#endif // QT_NO_DATASTREAM 664#endif // QT_NO_DATASTREAM
665#ifdef QT_QWINEXPORT
666#define Q_DEFINED_QVALUELIST
667#include "qwinexport.h"
668#endif /* QT_QWINEXPORT */
665#endif // QVALUELIST_H 669#endif // QVALUELIST_H
diff --git a/qmake/include/qvaluestack.h b/qmake/include/qvaluestack.h
index 7e9bc48..c3f966e 100644
--- a/qmake/include/qvaluestack.h
+++ b/qmake/include/qvaluestack.h
@@ -1,64 +1,64 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of QValueStack class 4** Definition of QValueStack class
5** 5**
6** Created : 990925 6** Created : 990925
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2003 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the tools module of the Qt GUI Toolkit. 10** This file is part of the tools module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 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 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 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 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 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License 22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software. 23** Agreement provided with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#ifndef QVALUESTACK_H 38#ifndef QVALUESTACK_H
39#define QVALUESTACK_H 39#define QVALUESTACK_H
40 40
41#ifndef QT_H 41#ifndef QT_H
42#include "qvaluelist.h" 42#include "qvaluelist.h"
43#endif // QT_H 43#endif // QT_H
44 44
45 45
46template<class T> 46template<class T>
47class QValueStack : public QValueList<T> 47class QValueStack : public QValueList<T>
48{ 48{
49public: 49public:
50 QValueStack() {} 50 QValueStack() {}
51 ~QValueStack() {} 51 ~QValueStack() {}
52 void push( const T& d ) { append(d); } 52 void push( const T& d ) { append(d); }
53 T pop() 53 T pop()
54 { 54 {
55 T elem( this->last() ); 55 T elem( this->last() );
56 if ( !this->isEmpty() ) 56 if ( !this->isEmpty() )
57 remove( this->fromLast() ); 57 this->remove( this->fromLast() );
58 return elem; 58 return elem;
59 } 59 }
60 T& top() { return this->last(); } 60 T& top() { return this->last(); }
61 const T& top() const { return this->last(); } 61 const T& top() const { return this->last(); }
62}; 62};
63 63
64#endif 64#endif