-rw-r--r-- | qmake/include/private/qdir_p.h | 2 | ||||
-rw-r--r-- | qmake/include/private/qlocale_p.h | 128 | ||||
-rw-r--r-- | qmake/include/private/qsettings_p.h | 30 | ||||
-rw-r--r-- | qmake/include/qfiledefs_p.h | 64 | ||||
-rw-r--r-- | qmake/include/qglobal.h | 165 | ||||
-rw-r--r-- | qmake/include/qlocale.h | 491 | ||||
-rw-r--r-- | qmake/include/qsettings.h | 156 | ||||
-rw-r--r-- | qmake/include/qunicodetables_p.h | 263 | ||||
-rw-r--r-- | qmake/include/quuid.h | 27 |
9 files changed, 1253 insertions, 73 deletions
diff --git a/qmake/include/private/qdir_p.h b/qmake/include/private/qdir_p.h index a6c7c91..4d9dfc6 100644 --- a/qmake/include/private/qdir_p.h +++ b/qmake/include/private/qdir_p.h @@ -1,10 +1,10 @@ /**************************************************************************** -** $Id$ +** ** ** Definition of some private QDir functions. ** ** Created : 001106 ** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of the tools module of the Qt GUI Toolkit. diff --git a/qmake/include/private/qlocale_p.h b/qmake/include/private/qlocale_p.h new file mode 100644 index 0000000..26c05c9 --- a/dev/null +++ b/qmake/include/private/qlocale_p.h @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** +** Declaration of the QLocalePrivate class +** +** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. +** +** This file is part of the widgets module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QLOCALE_P_H +#define QLOCALE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of internal files. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// +// + +#include <qstring.h> + +struct QLocalePrivate +{ +public: + const QChar &decimal() const { return (QChar&)m_decimal; } + const QChar &group() const { return (QChar&)m_group; } + const QChar &list() const { return (QChar&)m_list; } + const QChar &percent() const { return (QChar&)m_percent; } + const QChar &zero() const { return (QChar&)m_zero; } + QChar plus() const { return QChar('+'); } + const QChar &minus() const { return (QChar&)m_minus; } + const QChar &exponential() const { return (QChar&)m_exponential; } + QString infinity() const; + QString nan() const; + + Q_UINT32 languageId() const { return m_language_id; } + Q_UINT32 countryId() const { return m_country_id; } + + bool isDigit(QChar d) const; + + enum GroupSeparatorMode { + FailOnGroupSeparators, + ParseGroupSeparators + }; + + enum DoubleForm { + DFExponent = 0, // %e or %E + DFDecimal, // %f or %F + DFSignificantDigits, // %g or %G + _DFMax = DFSignificantDigits + }; + + enum Flags { + NoFlags = 0, + + // These correspond to the options in a printf format string + Alternate = 0x01, + ZeroPadded = 0x02, + LeftAdjusted = 0x04, + BlankBeforePositive = 0x08, + AlwaysShowSign = 0x10, + ThousandsGroup = 0x20, + CapitalEorX = 0x40 // %x, %e, %f, %g vs. %X, %E, %F, %G + }; + + QString doubleToString(double d, + int precision = -1, + DoubleForm form = DFSignificantDigits, + int width = -1, + unsigned flags = NoFlags) const; + QString longLongToString(Q_LLONG l, int precision = -1, + int base = 10, + int width = -1, + unsigned flags = NoFlags) const; + QString unsLongLongToString(Q_ULLONG l, int precision = -1, + int base = 10, + int width = -1, + unsigned flags = NoFlags) const; + double stringToDouble(QString num, bool *ok, GroupSeparatorMode group_sep_mode) const; + Q_LLONG stringToLongLong(QString num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const; + Q_ULLONG stringToUnsLongLong(QString num, int base, bool *ok, GroupSeparatorMode group_sep_mode) const; + bool removeGroupSeparators(QString &num_str) const; + bool numberToCLocale(QString &locale_num, GroupSeparatorMode group_sep_mode) const; + + Q_UINT32 m_language_id, m_country_id; + + Q_UINT16 m_decimal, m_group, m_list, m_percent, + m_zero, m_minus, m_exponential; + + static const QString m_infinity; + static const QString m_nan; + static const QChar m_plus; + + static const char *systemLocaleName(); +}; + +#endif diff --git a/qmake/include/private/qsettings_p.h b/qmake/include/private/qsettings_p.h index 095291c..4b76f44 100644 --- a/qmake/include/private/qsettings_p.h +++ b/qmake/include/private/qsettings_p.h @@ -1,29 +1,39 @@ /**************************************************************************** -** $Id$ +** ** ** Definition of QSettings related classes ** -** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. +** Created : 990124 ** -** This file is part of the tools module of the Qt GUI Toolkit. +** Copyright (C) 1999-2002 Trolltech AS. All rights reserved. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses for Windows may use this file in accordance with the Qt Commercial -** License Agreement provided with the Software. +** This file is part of the kernel module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. ** -** This file is not available for use under any other license without -** express written permission from the copyright holder. +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for ** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef QSETTINGS_P_H #define QSETTINGS_P_H @@ -41,16 +51,17 @@ // #ifndef QT_H #include "qstringlist.h" #include "qmap.h" #include "qvaluestack.h" #endif // QT_H +#ifndef QT_NO_SETTINGS class QSettingsSysPrivate; // QSettingsGroup is a map of key/value pairs class QSettingsGroup : public QMap<QString,QString> { public: QSettingsGroup(); @@ -123,11 +134,12 @@ public: bool sysRemoveEntry( const QString & ); bool sysSync(); void sysInsertSearchPath( QSettings::System, const QString & ); void sysRemoveSearchPath( QSettings::System, const QString & ); #endif -}; +}; +#endif //QT_NO_SETTINGS #endif // QSETTINGS_P_H diff --git a/qmake/include/qfiledefs_p.h b/qmake/include/qfiledefs_p.h new file mode 100644 index 0000000..659aaec --- a/dev/null +++ b/qmake/include/qfiledefs_p.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** +** Common macros and system include files for QFile, QFileInfo and QDir. +** +** Created : 930812 +** +** Copyright (C) 1992-2001 Trolltech AS. All rights reserved. +** +** This file is part of the tools module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QFILEDEFS_P_H +#define QFILEDEFS_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of qfileinfo*.cpp. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// +// + +// Be sure to include qplatformdefs.h first! +struct QFileInfoCache +{ +#if defined(Q_WS_WIN) + QT_STATBUF st; +#else + struct stat st; +#endif +}; + + +#endif diff --git a/qmake/include/qglobal.h b/qmake/include/qglobal.h index 94e5607..b7e919d 100644 --- a/qmake/include/qglobal.h +++ b/qmake/include/qglobal.h @@ -1,16 +1,16 @@ /**************************************************************************** -** $Id$ +** ** ** Global type declarations and definitions ** ** Created : 920529 ** -** Copyright (C) 1992-2002 Trolltech AS. All rights reserved. +** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. ** ** This file is part of the tools module of the Qt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file ** LICENSE.QPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the @@ -33,27 +33,28 @@ ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef QGLOBAL_H #define QGLOBAL_H -#define QT_VERSION_STR "3.1.2" +#define QT_VERSION_STR "3.3.2" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x030102 +#define QT_VERSION 0x030302 /* The operating system, must be one of: (Q_OS_x) MACX - Mac OS X MAC9 - Mac OS 9 + DARWIN - Darwin OS (Without Mac OS X) MSDOS - MS-DOS and Windows OS2 - OS/2 OS2EMX - XFree86 on OS/2 (not PM) WIN32 - Win32 (Windows 95/98/ME and Windows NT/2000/XP) CYGWIN - Cygwin SOLARIS - Sun Solaris HPUX - HP-UX ULTRIX - DEC Ultrix @@ -73,17 +74,19 @@ DYNIX - DYNIX/ptx QNX - QNX QNX6 - QNX RTP 6.1 LYNX - LynxOS BSD4 - Any BSD 4.4 system UNIX - Any UNIX BSD/SYSV system */ -#if defined(__APPLE__) && defined(__GNUC__) +#if defined(__DARWIN_X11__) +# define Q_OS_DARWIN +#elif defined(__APPLE__) && defined(__GNUC__) # define Q_OS_MACX #elif defined(__MACOSX__) # define Q_OS_MACX #elif defined(macintosh) # define Q_OS_MAC9 #elif defined(__CYGWIN__) # define Q_OS_CYGWIN #elif defined(MSDOS) || defined(_MSDOS) @@ -106,17 +109,17 @@ #elif defined(hpux) || defined(__hpux) # define Q_OS_HPUX #elif defined(__ultrix) || defined(ultrix) # define Q_OS_ULTRIX #elif defined(sinix) # define Q_OS_RELIANT #elif defined(__linux__) || defined(__linux) # define Q_OS_LINUX -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) # define Q_OS_FREEBSD # define Q_OS_BSD4 #elif defined(__NetBSD__) # define Q_OS_NETBSD # define Q_OS_BSD4 #elif defined(__OpenBSD__) # define Q_OS_OPENBSD # define Q_OS_BSD4 @@ -144,60 +147,58 @@ #elif defined(_SCO_DS) /* SCO OpenServer 5 + GCC */ # define Q_OS_SCO #elif defined(__USLC__) /* all SCO platforms + UDK or OUDK */ # define Q_OS_UNIXWARE # define Q_OS_UNIXWARE7 #elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */ # define Q_OS_UNIXWARE # define Q_OS_UNIXWARE7 +#elif defined(__MAKEDEPEND__) #else # error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com" #endif +#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) +# define Q_OS_WIN +#endif + #if defined(Q_OS_MAC9) || defined(Q_OS_MACX) -/* This hack forces the generater to compile qmake not for maxosx native. It is - * compiled for Linux and generates usual makefiles.. - * Does anyone has a better solution for this ? (eilers) - */ -// # define Q_OS_MAC -#define Q_OS_LINUX -#warning "boeser Hack !! (se)" -#undef Q_OS_MACX +# define Q_OS_MAC #endif -#if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN32) || defined(Q_OS_WIN64) +#if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) # undef Q_OS_UNIX #elif !defined(Q_OS_UNIX) # define Q_OS_UNIX #endif /* The compiler, must be one of: (Q_CC_x) SYM - Symantec C++ for both PC and Macintosh MPW - MPW C++ MWERKS - Metrowerks CodeWarrior - MSVC - Microsoft Visual C/C++ + MSVC - Microsoft Visual C/C++, Intel C++ for Windows BOR - Borland/Turbo C++ WAT - Watcom C++ GNU - GNU C++ COMEAU - Comeau C++ EDG - Edison Design Group C++ OC - CenterLine C++ SUN - Sun WorkShop, Forte Developer, or Sun ONE Studio C++ MIPS - MIPSpro C++ DEC - DEC C++ HP - HPUX C++ HPACC - HPUX ANSI C++ USLC - SCO OUDK, UDK, and UnixWare 2.X C++ CDS - Reliant C++ KAI - KAI C++ - INTEL - Intel C++ + INTEL - Intel C++ for Linux, Intel C++ for Windows HIGHC - MetaWare High C/C++ PGI - Portland Group C++ GHS - Green Hills Optimizing C++ Compilers Should be sorted most to least authoritative. */ /* Symantec C++ is now Digital Mars */ @@ -217,31 +218,38 @@ # define Q_NO_BOOL_TYPE # define Q_NO_EXPLICIT_KEYWORD # define Q_NO_USING_KEYWORD #elif defined(__MWERKS__) # define Q_CC_MWERKS /* "explicit" recognized since 4.0d1 */ # define QMAC_PASCAL pascal -# define Q_NO_USING_KEYWORD /* ### check "using" status */ #elif defined(_MSC_VER) # define Q_CC_MSVC /* proper support of bool for _MSC_VER >= 1100 */ # define Q_CANNOT_DELETE_CONSTANT # define Q_INLINE_TEMPLATES inline /* Visual C++.Net issues for _MSC_VER >= 1300 */ # if _MSC_VER >= 1300 # define Q_CC_MSVC_NET -# if _MSC_VER < 1310 +# if _MSC_VER < 1310 || defined(Q_OS_WIN64) # define Q_TYPENAME # endif # endif -# define Q_NO_USING_KEYWORD /* ### check "using" status */ +/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */ +# if defined(__INTEL_COMPILER) +# define Q_CC_INTEL +# if !defined(__EXCEPTIONS) +# define Q_NO_EXCEPTIONS +# endif +# else +# define Q_NO_USING_KEYWORD /* ### check "using" status */ +# endif #elif defined(__BORLANDC__) || defined(__TURBOC__) # define Q_CC_BOR # if __BORLANDC__ < 0x502 # define Q_NO_BOOL_TYPE # define Q_NO_EXPLICIT_KEYWORD # endif # define Q_NO_USING_KEYWORD /* ### check "using" status */ @@ -279,18 +287,27 @@ /* GCC 2.95 knows "using" but does not support it correctly */ # if __GNUC__ == 2 && __GNUC_MINOR__ <= 95 # define Q_NO_USING_KEYWORD # endif /* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */ # if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1 # define Q_WRONG_SB_CTYPE_MACROS # endif + +/* ARM gcc pads structs to 32 bits, even when they contain a single + char, or short. We tell gcc to pack QChars to 16 bits, to avoid + QString bloat. However, gcc 3.4 doesn't allow us to create references to + members of a packed struct. (Pointers are OK, because then you + supposedly know what you are doing.) */ # if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP) # define Q_PACKED __attribute__ ((packed)) +# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 +# define Q_NO_PACKED_REFERENCE +# endif # endif # if !defined(__EXCEPTIONS) # define Q_NO_EXCEPTIONS # endif /* IBM compiler versions are a bit messy. There are actually two products: the C product, and the C++ product. The C++ compiler is always packaged with the latest version of the C compiler. Version numbers do not always @@ -300,16 +317,18 @@ C Set 3.1 C Compiler 3.0 ... ... C++ Compiler 3.6.6 C Compiler 4.3 ... ... Visual Age C++ 4.0 ... ... ... Visual Age C++ 5.0 C Compiler 5.0 + ... ... + Visual Age C++ 6.0 C Compiler 6.0 Now: __xlC__ is the version of the C compiler in hexadecimal notation is only an approximation of the C++ compiler version __IBMCPP__ is the version of the C++ compiler in decimal notation but it is not defined on older compilers like C Set 3.1 */ #elif defined(__xlC__) # define Q_CC_XLC @@ -324,17 +343,17 @@ # define Q_CANNOT_DELETE_CONSTANT # endif /* Older versions of DEC C++ do not define __EDG__ or __EDG - observed on DEC C++ V5.5-004. New versions do define __EDG__ - observed on Compaq C++ V6.3-002. This compiler is different enough from other EDG compilers to handle it separately anyway. */ -#elif defined(__DECCXX) +#elif defined(__DECCXX) || defined(__DECC) # define Q_CC_DEC /* Compaq C++ V6 compilers are EDG-based but I'm not sure about older DEC C++ V5 compilers. */ # if defined(__EDG__) # define Q_CC_EDG # endif /* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead - observed on Compaq C++ V6.3-002. @@ -365,29 +384,33 @@ predefined macro is specified by a configuration flag. _BOOL is the default. __BOOL_DEFINED Defined in Microsoft C++ mode when bool is a keyword. */ # if !defined(_BOOL) && !defined(__BOOL_DEFINED) # define Q_NO_BOOL_TYPE # endif -/* The Portland Group compiler is based on EDG and does define __EDG__ */ +/* The Comeau compiler is based on EDG and does define __EDG__ */ # if defined(__COMO__) # define Q_CC_COMEAU # define Q_C_CALLBACKS -/* Using the `using' keyword avoids KAI C++ warnings */ +/* The `using' keyword was introduced to avoid KAI C++ warnings + but it's now causing KAI C++ errors instead. The standard is + unclear about the use of this keyword, and in practice every + compiler is using its own set of rules. Forget it. */ # elif defined(__KCC) # define Q_CC_KAI # if !defined(_EXCEPTIONS) # define Q_NO_EXCEPTIONS # endif +# define Q_NO_USING_KEYWORD -/* Using the `using' keyword avoids Intel C++ warnings */ +/* Using the `using' keyword avoids Intel C++ for Linux warnings */ # elif defined(__INTEL_COMPILER) # define Q_CC_INTEL # if !defined(__EXCEPTIONS) # define Q_NO_EXCEPTIONS # endif /* The Portland Group compiler is based on EDG and does define __EDG__ */ # elif defined(__PGI) @@ -425,40 +448,42 @@ /* The MIPSpro compiler in o32 mode is based on EDG but disables features such as template specialization nevertheless */ # elif defined(__sgi) # define Q_CC_MIPS # if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */ # define Q_TYPENAME # define Q_BROKEN_TEMPLATE_SPECIALIZATION -# define Q_STRICT_INLINING_RULES # define Q_NO_EXPLICIT_KEYWORD # define Q_INLINE_TEMPLATES inline # elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */ # define Q_TYPENAME # define Q_BROKEN_TEMPLATE_SPECIALIZATION # endif # define Q_NO_USING_KEYWORD /* ### check "using" status */ +# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740) +# pragma set woff 3624,3625, 3649 /* turn off some harmless warnings */ +# endif # endif /* The older UnixWare 2.X compiler? */ #elif defined(__USLC__) # define Q_CC_USLC # define Q_TYPENAME # define Q_NO_BOOL_TYPE # define Q_NO_EXPLICIT_KEYWORD # define Q_NO_USING_KEYWORD # define Q_INLINE_TEMPLATES inline /* Never tested! */ #elif defined(__HIGHC__) # define Q_CC_HIGHC -#elif defined(__SUNPRO_CC) +#elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) # define Q_CC_SUN /* 5.0 compiler or better 'bool' is enabled by default but can be disabled using -features=nobool in which case _BOOL is not defined this is the default in 4.2 compatibility mode triggered by -compat=4 */ # if __SUNPRO_CC >= 0x500 # if !defined(_BOOL) # define Q_NO_BOOL_TYPE @@ -600,16 +625,23 @@ const bool TRUE = !0; #endif #if defined(__WATCOMC__) # if defined(Q_OS_QNX4) const bool false = FALSE; const bool true = TRUE; # endif #endif +// +// Proper for-scoping +// ### turn on in 4.0 + +#if 0 && defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) +# define for if(0){}else for +#endif // // Use the "explicit" keyword on platforms that support it. // #if !defined(Q_NO_EXPLICIT_KEYWORD) # define Q_EXPLICIT explicit #else @@ -660,36 +692,41 @@ typedef unsigned int UINT32; // 32 bit unsigned typedef signed char Q_INT8; // 8 bit signed typedef unsigned char Q_UINT8; // 8 bit unsigned typedef short Q_INT16; // 16 bit signed typedef unsigned short Q_UINT16; // 16 bit unsigned typedef int Q_INT32; // 32 bit signed typedef unsigned int Q_UINT32; // 32 bit unsigned #if defined(Q_OS_WIN64) -// LLP64 64-bit model on Windows typedef __int64 Q_LONG; // word up to 64 bit signed typedef unsigned __int64 Q_ULONG; // word up to 64 bit unsigned #else -// LP64 64-bit model on Linux -typedef long Q_LONG; -typedef unsigned long Q_ULONG; +typedef long Q_LONG; // word up to 64 bit signed +typedef unsigned long Q_ULONG; // word up to 64 bit unsigned #endif - -#if !defined(QT_CLEAN_NAMESPACE) -// mininum size of 64 bits is not guaranteed -#define Q_INT64 Q_LONG -#define Q_UINT64 Q_ULONG +#if defined(Q_OS_WIN) && !defined(Q_CC_GNU) +# define Q_INT64_C(c) c ## i64 // signed 64 bit constant +# define Q_UINT64_C(c) c ## ui64 // unsigned 64 bit constant +typedef __int64 Q_INT64; // 64 bit signed +typedef unsigned __int64 Q_UINT64; // 64 bit unsigned +#else +# define Q_INT64_C(c) c ## LL // signed 64 bit constant +# define Q_UINT64_C(c) c ## ULL // unsigned 64 bit constant +typedef long long Q_INT64; // 64 bit signed +typedef unsigned long long Q_UINT64; // 64 bit unsigned #endif +typedef Q_INT64 Q_LLONG; // signed long long +typedef Q_UINT64 Q_ULLONG; // unsigned long long #if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT) # define QT_LARGEFILE_SUPPORT 64 #endif #if defined(QT_LARGEFILE_SUPPORT) - typedef unsigned long long QtOffset; + typedef Q_ULLONG QtOffset; #else typedef Q_ULONG QtOffset; #endif // // Data stream functions is provided by many classes (defined in qdatastream.h) // @@ -703,37 +740,40 @@ class QDataStream; // Note that disabling some features will produce a libqt that is not // compatible with other libqt builds. Such modifications are only // supported on Qt/Embedded where reducing the library size is important // and where the application-suite is often a fixed set. // #if !defined(QT_MOC) #if defined(QCONFIG_LOCAL) -#include <qconfig-local.h> +#include "qconfig-local.h" #elif defined(QCONFIG_MINIMAL) -#include <qconfig-minimal.h> +#include "qconfig-minimal.h" #elif defined(QCONFIG_SMALL) -#include <qconfig-small.h> +#include "qconfig-small.h" #elif defined(QCONFIG_MEDIUM) -#include <qconfig-medium.h> +#include "qconfig-medium.h" #elif defined(QCONFIG_LARGE) -#include <qconfig-large.h> +#include "qconfig-large.h" #else // everything... -#include <qconfig.h> +#include "qconfig.h" #endif #endif #ifndef QT_BUILD_KEY #define QT_BUILD_KEY "unspecified" #endif // prune to local config #include "qmodules.h" +#ifndef QT_MODULE_DIALOGS +# define QT_NO_DIALOG +#endif #ifndef QT_MODULE_ICONVIEW # define QT_NO_ICONVIEW #endif #ifndef QT_MODULE_WORKSPACE # define QT_NO_WORKSPACE #endif #ifndef QT_MODULE_NETWORK #define QT_NO_NETWORK @@ -776,26 +816,26 @@ class QDataStream; # endif #endif #if !defined(Q_WS_QWS) && !defined(QT_NO_COP) # define QT_NO_COP #endif #ifndef QT_H -#include <qfeatures.h> -#endif // QT_H +#include "qfeatures.h" +#endif /* QT_H */ // // Create Qt DLL if QT_DLL is defined (Windows only) // or QT_SHARED is defined (Kylix only) // -#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) +#if defined(Q_OS_WIN) # if defined(QT_NODLL) # undef QT_MAKEDLL # undef QT_DLL # elif defined(QT_MAKEDLL) /* create a Qt DLL library */ # if defined(QT_DLL) # undef QT_DLL # endif # define Q_EXPORT __declspec(dllexport) @@ -845,16 +885,17 @@ extern Q_EXPORT bool qt_winunicode; // // System information // Q_EXPORT const char *qVersion(); Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian ); +Q_EXPORT bool qSharedBuild(); #if defined(Q_OS_MAC) int qMacVersion(); #elif defined(Q_WS_WIN) Q_EXPORT int qWinVersion(); #if defined(UNICODE) #define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi } #define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi ) #else @@ -878,17 +919,16 @@ Q_EXPORT int qWinVersion(); #ifndef Q_TYPENAME # define Q_TYPENAME typename #endif // // Use to avoid "unused parameter" warnings // - #define Q_UNUSED(x) (void)x; // // Debugging and error handling // #if !defined(QT_NO_CHECK) # define QT_CHECK_STATE // check state of objects etc. @@ -1010,42 +1050,46 @@ Q_EXPORT void qObsolete( const char *message ); Q_EXPORT const char *qInstallPath(); Q_EXPORT const char *qInstallPathDocs(); Q_EXPORT const char *qInstallPathHeaders(); Q_EXPORT const char *qInstallPathLibs(); Q_EXPORT const char *qInstallPathBins(); Q_EXPORT const char *qInstallPathPlugins(); Q_EXPORT const char *qInstallPathData(); +Q_EXPORT const char *qInstallPathTranslations(); +Q_EXPORT const char *qInstallPathSysconf(); -#endif // __cplusplus +#endif /* __cplusplus */ -// compilers which follow outdated template instantiation rules -// require a class to have a comparison operator to exist when -// a QValueList of this type is instantiated. It's not actually -// used in the list, though. Hence the dummy implementation. -// Just in case other code relies on it we better trigger a warning -// mandating a real implementation. +/* + compilers which follow outdated template instantiation rules + require a class to have a comparison operator to exist when + a QValueList of this type is instantiated. It's not actually + used in the list, though. Hence the dummy implementation. + Just in case other code relies on it we better trigger a warning + mandating a real implementation. +*/ #ifdef Q_FULL_TEMPLATE_INSTANTIATION # define Q_DUMMY_COMPARISON_OPERATOR(C) \ bool operator==( const C& ) const { \ qWarning( #C"::operator==( const "#C"& ) got called." ); \ return FALSE; \ } #else # define Q_DUMMY_COMPARISON_OPERATOR(C) #endif -#endif // QGLOBAL_H +#endif /* QGLOBAL_H */ -// -// Avoid some particularly useless warnings from some stupid compilers. -// To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out -// the line "#define QT_NO_WARNINGS" -// +/* + Avoid some particularly useless warnings from some stupid compilers. + To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out + the line "#define QT_NO_WARNINGS" +*/ #if !defined(QT_CC_WARNINGS) # define QT_NO_WARNINGS #endif #if defined(QT_NO_WARNINGS) # if defined(Q_CC_MSVC) # pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data # pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' @@ -1061,12 +1105,11 @@ Q_EXPORT const char *qInstallPathData(); # elif defined(Q_CC_BOR) # pragma option -w-inl # pragma option -w-aus # pragma warn -inl # pragma warn -pia # pragma warn -ccc # pragma warn -rch # pragma warn -sig -# elif defined(Q_CC_MWERKS) -# pragma warn_possunwant off # endif #endif + diff --git a/qmake/include/qlocale.h b/qmake/include/qlocale.h new file mode 100644 index 0000000..20ad03b --- a/dev/null +++ b/qmake/include/qlocale.h @@ -0,0 +1,491 @@ +/**************************************************************************** +** +** +** Declaration of the QLocale class +** +** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. +** +** This file is part of the tools module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QLOCALE_H +#define QLOCALE_H + +#include "qstring.h" + +struct QLocalePrivate; + +class Q_EXPORT QLocale +{ + friend class QString; + +public: + enum Language { + C = 1, + Abkhazian = 2, + Afan = 3, + Afar = 4, + Afrikaans = 5, + Albanian = 6, + Amharic = 7, + Arabic = 8, + Armenian = 9, + Assamese = 10, + Aymara = 11, + Azerbaijani = 12, + Bashkir = 13, + Basque = 14, + Bengali = 15, + Bhutani = 16, + Bihari = 17, + Bislama = 18, + Breton = 19, + Bulgarian = 20, + Burmese = 21, + Byelorussian = 22, + Cambodian = 23, + Catalan = 24, + Chinese = 25, + Corsican = 26, + Croatian = 27, + Czech = 28, + Danish = 29, + Dutch = 30, + English = 31, + Esperanto = 32, + Estonian = 33, + Faroese = 34, + FijiLanguage = 35, + Finnish = 36, + French = 37, + Frisian = 38, + Gaelic = 39, + Galician = 40, + Georgian = 41, + German = 42, + Greek = 43, + Greenlandic = 44, + Guarani = 45, + Gujarati = 46, + Hausa = 47, + Hebrew = 48, + Hindi = 49, + Hungarian = 50, + Icelandic = 51, + Indonesian = 52, + Interlingua = 53, + Interlingue = 54, + Inuktitut = 55, + Inupiak = 56, + Irish = 57, + Italian = 58, + Japanese = 59, + Javanese = 60, + Kannada = 61, + Kashmiri = 62, + Kazakh = 63, + Kinyarwanda = 64, + Kirghiz = 65, + Korean = 66, + Kurdish = 67, + Kurundi = 68, + Laothian = 69, + Latin = 70, + Latvian = 71, + Lingala = 72, + Lithuanian = 73, + Macedonian = 74, + Malagasy = 75, + Malay = 76, + Malayalam = 77, + Maltese = 78, + Maori = 79, + Marathi = 80, + Moldavian = 81, + Mongolian = 82, + NauruLanguage = 83, + Nepali = 84, + Norwegian = 85, + Occitan = 86, + Oriya = 87, + Pashto = 88, + Persian = 89, + Polish = 90, + Portuguese = 91, + Punjabi = 92, + Quechua = 93, + RhaetoRomance = 94, + Romanian = 95, + Russian = 96, + Samoan = 97, + Sangho = 98, + Sanskrit = 99, + Serbian = 100, + SerboCroatian = 101, + Sesotho = 102, + Setswana = 103, + Shona = 104, + Sindhi = 105, + Singhalese = 106, + Siswati = 107, + Slovak = 108, + Slovenian = 109, + Somali = 110, + Spanish = 111, + Sundanese = 112, + Swahili = 113, + Swedish = 114, + Tagalog = 115, + Tajik = 116, + Tamil = 117, + Tatar = 118, + Telugu = 119, + Thai = 120, + Tibetan = 121, + Tigrinya = 122, + TongaLanguage = 123, + Tsonga = 124, + Turkish = 125, + Turkmen = 126, + Twi = 127, + Uigur = 128, + Ukrainian = 129, + Urdu = 130, + Uzbek = 131, + Vietnamese = 132, + Volapuk = 133, + Welsh = 134, + Wolof = 135, + Xhosa = 136, + Yiddish = 137, + Yoruba = 138, + Zhuang = 139, + Zulu = 140, + LastLanguage = Zulu + }; + + enum Country { + AnyCountry = 0, + Afghanistan = 1, + Albania = 2, + Algeria = 3, + AmericanSamoa = 4, + Andorra = 5, + Angola = 6, + Anguilla = 7, + Antarctica = 8, + AntiguaAndBarbuda = 9, + Argentina = 10, + Armenia = 11, + Aruba = 12, + Australia = 13, + Austria = 14, + Azerbaijan = 15, + Bahamas = 16, + Bahrain = 17, + Bangladesh = 18, + Barbados = 19, + Belarus = 20, + Belgium = 21, + Belize = 22, + Benin = 23, + Bermuda = 24, + Bhutan = 25, + Bolivia = 26, + BosniaAndHerzegowina = 27, + Botswana = 28, + BouvetIsland = 29, + Brazil = 30, + BritishIndianOceanTerritory = 31, + BruneiDarussalam = 32, + Bulgaria = 33, + BurkinaFaso = 34, + Burundi = 35, + Cambodia = 36, + Cameroon = 37, + Canada = 38, + CapeVerde = 39, + CaymanIslands = 40, + CentralAfricanRepublic = 41, + Chad = 42, + Chile = 43, + China = 44, + ChristmasIsland = 45, + CocosIslands = 46, + Colombia = 47, + Comoros = 48, + DemocraticRepublicOfCongo = 49, + PeoplesRepublicOfCongo = 50, + CookIslands = 51, + CostaRica = 52, + IvoryCoast = 53, + Croatia = 54, + Cuba = 55, + Cyprus = 56, + CzechRepublic = 57, + Denmark = 58, + Djibouti = 59, + Dominica = 60, + DominicanRepublic = 61, + EastTimor = 62, + Ecuador = 63, + Egypt = 64, + ElSalvador = 65, + EquatorialGuinea = 66, + Eritrea = 67, + Estonia = 68, + Ethiopia = 69, + FalklandIslands = 70, + FaroeIslands = 71, + FijiCountry = 72, + Finland = 73, + France = 74, + MetropolitanFrance = 75, + FrenchGuiana = 76, + FrenchPolynesia = 77, + FrenchSouthernTerritories = 78, + Gabon = 79, + Gambia = 80, + Georgia = 81, + Germany = 82, + Ghana = 83, + Gibraltar = 84, + Greece = 85, + Greenland = 86, + Grenada = 87, + Guadeloupe = 88, + Guam = 89, + Guatemala = 90, + Guinea = 91, + GuineaBissau = 92, + Guyana = 93, + Haiti = 94, + HeardAndMcDonaldIslands = 95, + Honduras = 96, + HongKong = 97, + Hungary = 98, + Iceland = 99, + India = 100, + Indonesia = 101, + Iran = 102, + Iraq = 103, + Ireland = 104, + Israel = 105, + Italy = 106, + Jamaica = 107, + Japan = 108, + Jordan = 109, + Kazakhstan = 110, + Kenya = 111, + Kiribati = 112, + DemocraticRepublicOfKorea = 113, + RepublicOfKorea = 114, + Kuwait = 115, + Kyrgyzstan = 116, + Lao = 117, + Latvia = 118, + Lebanon = 119, + Lesotho = 120, + Liberia = 121, + LibyanArabJamahiriya = 122, + Liechtenstein = 123, + Lithuania = 124, + Luxembourg = 125, + Macau = 126, + Macedonia = 127, + Madagascar = 128, + Malawi = 129, + Malaysia = 130, + Maldives = 131, + Mali = 132, + Malta = 133, + MarshallIslands = 134, + Martinique = 135, + Mauritania = 136, + Mauritius = 137, + Mayotte = 138, + Mexico = 139, + Micronesia = 140, + Moldova = 141, + Monaco = 142, + Mongolia = 143, + Montserrat = 144, + Morocco = 145, + Mozambique = 146, + Myanmar = 147, + Namibia = 148, + NauruCountry = 149, + Nepal = 150, + Netherlands = 151, + NetherlandsAntilles = 152, + NewCaledonia = 153, + NewZealand = 154, + Nicaragua = 155, + Niger = 156, + Nigeria = 157, + Niue = 158, + NorfolkIsland = 159, + NorthernMarianaIslands = 160, + Norway = 161, + Oman = 162, + Pakistan = 163, + Palau = 164, + PalestinianTerritory = 165, + Panama = 166, + PapuaNewGuinea = 167, + Paraguay = 168, + Peru = 169, + Philippines = 170, + Pitcairn = 171, + Poland = 172, + Portugal = 173, + PuertoRico = 174, + Qatar = 175, + Reunion = 176, + Romania = 177, + RussianFederation = 178, + Rwanda = 179, + SaintKittsAndNevis = 180, + StLucia = 181, + StVincentAndTheGrenadines = 182, + Samoa = 183, + SanMarino = 184, + SaoTomeAndPrincipe = 185, + SaudiArabia = 186, + Senegal = 187, + Seychelles = 188, + SierraLeone = 189, + Singapore = 190, + Slovakia = 191, + Slovenia = 192, + SolomonIslands = 193, + Somalia = 194, + SouthAfrica = 195, + SouthGeorgiaAndTheSouthSandwichIslands = 196, + Spain = 197, + SriLanka = 198, + StHelena = 199, + StPierreAndMiquelon = 200, + Sudan = 201, + Suriname = 202, + SvalbardAndJanMayenIslands = 203, + Swaziland = 204, + Sweden = 205, + Switzerland = 206, + SyrianArabRepublic = 207, + Taiwan = 208, + Tajikistan = 209, + Tanzania = 210, + Thailand = 211, + Togo = 212, + Tokelau = 213, + TongaCountry = 214, + TrinidadAndTobago = 215, + Tunisia = 216, + Turkey = 217, + Turkmenistan = 218, + TurksAndCaicosIslands = 219, + Tuvalu = 220, + Uganda = 221, + Ukraine = 222, + UnitedArabEmirates = 223, + UnitedKingdom = 224, + UnitedStates = 225, + UnitedStatesMinorOutlyingIslands = 226, + Uruguay = 227, + Uzbekistan = 228, + Vanuatu = 229, + VaticanCityState = 230, + Venezuela = 231, + VietNam = 232, + BritishVirginIslands = 233, + USVirginIslands = 234, + WallisAndFutunaIslands = 235, + WesternSahara = 236, + Yemen = 237, + Yugoslavia = 238, + Zambia = 239, + Zimbabwe = 240, + LastCountry = Zimbabwe + }; + + QLocale(); + QLocale(const QString &name); + QLocale(Language language, Country country = AnyCountry); + QLocale(const QLocale &other); + + QLocale &operator=(const QLocale &other); + + Language language() const; + Country country() const; + QString name() const; + + short toShort(const QString &s, bool *ok = 0) const; + ushort toUShort(const QString &s, bool *ok = 0) const; + int toInt(const QString &s, bool *ok = 0) const; + uint toUInt(const QString &s, bool *ok = 0) const; + Q_LONG toLong(const QString &s, bool *ok = 0) const; + Q_ULONG toULong(const QString &s, bool *ok = 0) const; + Q_LLONG toLongLong(const QString &s, bool *ok = 0) const; + Q_ULLONG toULongLong(const QString &s, bool *ok = 0) const; + float toFloat(const QString &s, bool *ok = 0) const; + double toDouble(const QString &s, bool *ok = 0) const; + + QString toString(short i) const + { return toString((Q_LLONG)i); } + QString toString(ushort i) const + { return toString((Q_ULLONG)i); } + QString toString(int i) const + { return toString((Q_LLONG)i); } + QString toString(uint i) const + { return toString((Q_ULLONG)i); } +#if !defined(Q_OS_WIN64) + QString toString(Q_LONG i) const + { return toString((Q_LLONG)i); } + QString toString(Q_ULONG i) const + { return toString((Q_ULLONG)i); } +#endif + QString toString(Q_LLONG i) const; + QString toString(Q_ULLONG i) const; + QString toString(float i, char f = 'g', int prec = 6) const + { return toString((double) i, f, prec); } + QString toString(double i, char f = 'g', int prec = 6) const; + + static QString languageToString(Language language); + static QString countryToString(Country country); + static void setDefault(const QLocale &locale); + + static QLocale c() { return QLocale(C); } + static QLocale system(); + +private: + const QLocalePrivate *d; + static const QLocalePrivate *default_d; +}; + +#endif diff --git a/qmake/include/qsettings.h b/qmake/include/qsettings.h new file mode 100644 index 0000000..72f04eb --- a/dev/null +++ b/qmake/include/qsettings.h @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** +** Definition of QSettings class +** +** Created : 000626 +** +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. +** +** This file is part of the tools module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QSETTINGS_H +#define QSETTINGS_H + +#ifndef QT_H +#include "qdatetime.h" +#include "qstringlist.h" +#endif // QT_H + +#ifndef QT_NO_SETTINGS + +class QSettingsPrivate; + + +class Q_EXPORT QSettings +{ +public: + enum Format { + Native = 0, + Ini + }; + enum System { + Unix = 0, + Windows, + Mac + }; + enum Scope { + User, + Global + }; + + QSettings(); + QSettings( Format format ); + + ~QSettings(); + +#if !defined(Q_NO_BOOL_TYPE) + bool writeEntry( const QString &, bool ); +#endif + bool writeEntry( const QString &, double ); + bool writeEntry( const QString &, int ); + bool writeEntry( const QString &, const char * ); + bool writeEntry( const QString &, const QString & ); + bool writeEntry( const QString &, const QStringList & ); + bool writeEntry( const QString &, const QStringList &, const QChar& sep ); + + QStringList entryList(const QString &) const; + QStringList subkeyList(const QString &) const; + + //### remove non const versions in 4.0 + QStringList readListEntry( const QString &, bool * = 0 ); + QStringList readListEntry( const QString &, const QChar& sep, bool * = 0 ); + QString readEntry( const QString &, const QString &def = QString::null, bool * = 0 ); + int readNumEntry( const QString &, int def = 0, bool * = 0 ); + double readDoubleEntry( const QString &, double def = 0, bool * = 0 ); + bool readBoolEntry( const QString &, bool def = FALSE, bool * = 0 ); + + //### make those non-inlined in 4.0 + QStringList readListEntry( const QString &key, bool *ok = 0 ) const + { + QSettings *that = (QSettings*)this; + return that->readListEntry( key, ok ); + } + QStringList readListEntry( const QString &key, const QChar& sep, bool *ok = 0 ) const + { + QSettings *that = (QSettings*)this; + return that->readListEntry( key, sep, ok ); + } + QString readEntry( const QString &key, const QString &def = QString::null, + bool *ok = 0 ) const + { + QSettings *that = (QSettings*)this; + return that->readEntry( key, def, ok ); + } + int readNumEntry( const QString &key, int def = 0, bool *ok = 0 ) const + { + QSettings *that = (QSettings*)this; + return that->readNumEntry( key, def, ok ); + } + + double readDoubleEntry( const QString &key, double def = 0, bool *ok = 0 ) const + { + QSettings *that = (QSettings*)this; + return that->readDoubleEntry( key, def, ok ); + } + bool readBoolEntry( const QString &key, bool def = FALSE, bool *ok = 0 ) const + { + QSettings *that = (QSettings*)this; + return that->readBoolEntry( key, def, ok ); + } + + bool removeEntry( const QString & ); + + void insertSearchPath( System, const QString & ); + void removeSearchPath( System, const QString & ); + + void setPath( const QString &domain, const QString &product, Scope = Global ); + + void beginGroup( const QString &group ); + void endGroup(); + void resetGroup(); + QString group() const; + + bool sync(); + +private: + QSettingsPrivate *d; + +#if defined(Q_DISABLE_COPY) + QSettings(const QSettings &); + QSettings &operator=(const QSettings &); +#endif + + QDateTime lastModificationTime( const QString & ); + + friend class QApplication; +}; + +#endif // QT_NO_SETTINGS +#endif // QSETTINGS_H diff --git a/qmake/include/qunicodetables_p.h b/qmake/include/qunicodetables_p.h new file mode 100644 index 0000000..0e799e4 --- a/dev/null +++ b/qmake/include/qunicodetables_p.h @@ -0,0 +1,263 @@ +/**************************************************************************** +** +** +** ??? +** +** Copyright (C) 2003 Trolltech AS. All rights reserved. +** +** This file is part of the widgets module of the Qt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.QPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for QPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QUNICODETABLES_P_H +#define QUNICODETABLES_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of internal files. This header file may change from version to version +// without notice, or even be removed. +// +// We mean it. +// +// + +#ifndef QT_H +#include "qstring.h" +#endif // QT_H + +#ifdef QT_NO_UNICODETABLES +# include <ctype.h> +#endif + +class QUnicodeTables { +public: + static const Q_UINT8 unicode_info[]; +#ifndef QT_NO_UNICODETABLES + static const Q_UINT16 decomposition_map[]; + static const Q_UINT16 decomposition_info[]; + static const Q_UINT16 ligature_map[]; + static const Q_UINT16 ligature_info[]; + static const Q_UINT8 direction_info[]; + static const Q_UINT8 combining_info[]; + static const Q_UINT16 case_info[]; + static const Q_INT8 decimal_info[]; + static const Q_UINT16 symmetricPairs[]; + static const int symmetricPairsSize; + static const Q_UINT8 line_break_info[]; +#else + static const Q_UINT8 latin1_line_break_info[]; +#endif + static const unsigned char otherScripts[]; + static const unsigned char indicScripts[]; + static const unsigned char scriptTable[]; + enum { SCRIPTS_INDIC = 0x7e }; + + // see http://www.unicode.org/reports/tr14/tr14-13.html + // we don't use the XX and AI properties and map them to AL instead. + enum LineBreakClass { + LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS, + LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO, + LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY, + LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM, + LineBreak_SA, LineBreak_BK, LineBreak_CR, LineBreak_LF, LineBreak_SG, + LineBreak_CB, LineBreak_SP + }; +}; + + +inline QChar::Category category( const QChar &c ) +{ +#ifdef QT_NO_UNICODETABLES + if ( c.unicode() > 0xff ) return QChar::Letter_Uppercase; //######## + return (QChar::Category)QUnicodeTables::unicode_info[c.unicode()]; +#else + register int uc = ((int)QUnicodeTables::unicode_info[c.row()]) << 8; + uc += c.cell(); + return (QChar::Category)QUnicodeTables::unicode_info[uc]; +#endif // QT_NO_UNICODETABLES +} + +inline QChar lower( const QChar &c ) +{ +#ifndef QT_NO_UNICODETABLES + int row = c.row(); + int cell = c.cell(); + register int ci = QUnicodeTables::case_info[row]; + register int uc = ((int)QUnicodeTables::unicode_info[c.row()]) << 8; + uc += c.cell(); + if (QUnicodeTables::unicode_info[uc] != QChar::Letter_Uppercase || !ci) + return c; + Q_UINT16 lower = QUnicodeTables::case_info[(ci<<8)+cell]; + return lower ? QChar(lower) : c; +#else + if ( c.row() ) + return c; + return QChar( tolower((uchar) c.latin1()) ); +#endif +} + +inline QChar upper( const QChar &c ) +{ +#ifndef QT_NO_UNICODETABLES + int row = c.row(); + int cell = c.cell(); + register int ci = QUnicodeTables::case_info[row]; + register int uc = ((int)QUnicodeTables::unicode_info[c.row()]) << 8; + uc += c.cell(); + if (QUnicodeTables::unicode_info[uc] != QChar::Letter_Lowercase || !ci) + return c; + Q_UINT16 upper = QUnicodeTables::case_info[(ci<<8)+cell]; + return upper ? QChar(upper) : c; +#else + if ( c.row() ) + return c; + return QChar( toupper((uchar) c.latin1()) ); +#endif +} + +inline QChar::Direction direction( const QChar &c ) +{ +#ifndef QT_NO_UNICODETABLES + register int pos = QUnicodeTables::direction_info[c.row()]; + return (QChar::Direction) (QUnicodeTables::direction_info[(pos<<8)+c.cell()] & 0x1f); +#else + Q_UNUSED(c); + return QChar::DirL; +#endif +} + +inline bool mirrored( const QChar &c ) +{ +#ifndef QT_NO_UNICODETABLES + register int pos = QUnicodeTables::direction_info[c.row()]; + return QUnicodeTables::direction_info[(pos<<8)+c.cell()] > 128; +#else + Q_UNUSED(c); + return FALSE; +#endif +} + + +inline QChar mirroredChar( const QChar &ch ) +{ +#ifndef QT_NO_UNICODETABLES + if(!::mirrored( ch )) + return ch; + + int i; + int c = ch.unicode(); + for (i = 0; i < QUnicodeTables::symmetricPairsSize; i ++) { + if (QUnicodeTables::symmetricPairs[i] == c) + return QUnicodeTables::symmetricPairs[(i%2) ? (i-1) : (i+1)]; + } +#endif + return ch; +} + +inline QChar::Joining joining( const QChar &ch ) +{ +#ifndef QT_NO_UNICODETABLES + register int pos = QUnicodeTables::direction_info[ch.row()]; + return (QChar::Joining) ((QUnicodeTables::direction_info[(pos<<8)+ch.cell()] >> 5) &0x3); +#else + Q_UNUSED(ch); + return QChar::OtherJoining; +#endif +} + +inline bool isMark( const QChar &ch ) +{ + QChar::Category c = ::category( ch ); + return c >= QChar::Mark_NonSpacing && c <= QChar::Mark_Enclosing; +} + +inline unsigned char combiningClass( const QChar &ch ) +{ +#ifndef QT_NO_UNICODETABLES + const int pos = QUnicodeTables::combining_info[ch.row()]; + return QUnicodeTables::combining_info[(pos<<8) + ch.cell()]; +#else + Q_UNUSED(ch); + return 0; +#endif +} + +inline bool isSpace( const QChar &ch ) +{ + if( ch.unicode() >= 9 && ch.unicode() <=13 ) return TRUE; + QChar::Category c = ::category( ch ); + return c >= QChar::Separator_Space && c <= QChar::Separator_Paragraph; +} + +inline int lineBreakClass( const QChar &ch ) +{ +#ifdef QT_NO_UNICODETABLES + return ch.row() ? QUnicodeTables::LineBreak_AL + : QUnicodeTables::latin1_line_break_info[ch.cell()]; +#else + register int pos = ((int)QUnicodeTables::line_break_info[ch.row()] << 8) + ch.cell(); + return QUnicodeTables::line_break_info[pos]; +#endif +} + +inline int scriptForChar( ushort uc ) +{ + unsigned char script = QUnicodeTables::scriptTable[(uc>>8)]; + if ( script >= QUnicodeTables::SCRIPTS_INDIC ) { + if ( script == QUnicodeTables::SCRIPTS_INDIC ) { + script = QUnicodeTables::indicScripts[ (uc-0x0900)>>7 ]; + } else { + // 0x80 + SCRIPTS_xx + unsigned char index = script-0x80; + unsigned char cell = uc &0xff; + while( QUnicodeTables::otherScripts[index++] < cell ) + index++; + script = QUnicodeTables::otherScripts[index]; + } + } + return script; +} + +#ifdef Q_WS_X11 +#define SCRIPT_FOR_CHAR( script, c ) \ +do { \ + unsigned short _uc = (c).unicode(); \ + if ( _uc < 0x100 ) { \ + script = QFont::Latin; \ + } else { \ + script = (QFont::Script)scriptForChar( _uc ); \ + } \ +} while( FALSE ) +#else +#define SCRIPT_FOR_CHAR( script, c ) \ + script = (QFont::Script)scriptForChar( (c).unicode() ) +#endif + +#endif diff --git a/qmake/include/quuid.h b/qmake/include/quuid.h index 664c149..f5d8a86 100644 --- a/qmake/include/quuid.h +++ b/qmake/include/quuid.h @@ -1,10 +1,10 @@ /**************************************************************************** -** $Id$ +** ** ** Definition of QUuid class ** ** Created : 010523 ** ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. ** ** This file is part of the tools module of the Qt GUI Toolkit. @@ -34,17 +34,17 @@ ** not clear to you. ** **********************************************************************/ #ifndef QUUID_H #define QUUID_H #ifndef QT_H -#include <qstring.h> +#include "qstring.h" #endif // QT_H #include <string.h> #if defined(Q_OS_WIN32) #ifndef GUID_DEFINED #define GUID_DEFINED typedef struct _GUID @@ -52,18 +52,35 @@ typedef struct _GUID ulong Data1; ushort Data2; ushort Data3; uchar Data4[ 8 ]; } GUID, *REFGUID, *LPGUID; #endif #endif + struct Q_EXPORT QUuid { + enum Variant { + VarUnknown =-1, + NCS = 0, // 0 - - + DCE = 2, // 1 0 - + Microsoft = 6, // 1 1 0 + Reserved = 7 // 1 1 1 + }; + + enum Version { + VerUnknown =-1, + Time = 1, // 0 0 0 1 + EmbeddedPOSIX = 2, // 0 0 1 0 + Name = 3, // 0 0 1 1 + Random = 4 // 0 1 0 0 + }; + QUuid() { memset( this, 0, sizeof(QUuid) ); } QUuid( uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8 ) { data1 = l; data2 = w1; @@ -109,16 +126,19 @@ struct Q_EXPORT QUuid return TRUE; } bool operator!=(const QUuid &orig ) const { return !( *this == orig ); } + bool operator<(const QUuid &other ) const; + bool operator>(const QUuid &other ) const; + #if defined(Q_OS_WIN32) // On Windows we have a type GUID that is used by the platform API, so we // provide convenience operators to cast from and to this type. QUuid( const GUID &guid ) { memcpy( this, &guid, sizeof(GUID) ); } @@ -148,16 +168,19 @@ struct Q_EXPORT QUuid return TRUE; } bool operator!=( const GUID &guid ) const { return !( *this == guid ); } #endif + static QUuid createUuid(); + QUuid::Variant variant() const; + QUuid::Version version() const; uint data1; ushort data2; ushort data3; uchar data4[ 8 ]; }; #ifndef QT_NO_DATASTREAM |