Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qglobal.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** 
00003 **
00004 ** Global type declarations and definitions
00005 **
00006 ** Created : 920529
00007 **
00008 ** Copyright (C) 1992-2003 Trolltech AS.  All rights reserved.
00009 **
00010 ** This file is part of the tools module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech AS of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QGLOBAL_H
00039 #define QGLOBAL_H
00040 
00041 #define QT_VERSION_STR   "3.3.2"
00042 /*
00043    QT_VERSION is (major << 16) + (minor << 8) + patch.
00044  */
00045 #define QT_VERSION 0x030302
00046 
00047 /*
00048    The operating system, must be one of: (Q_OS_x)
00049 
00050      MACX       - Mac OS X
00051      MAC9       - Mac OS 9
00052      DARWIN     - Darwin OS (Without Mac OS X)
00053      MSDOS      - MS-DOS and Windows
00054      OS2        - OS/2
00055      OS2EMX     - XFree86 on OS/2 (not PM)
00056      WIN32      - Win32 (Windows 95/98/ME and Windows NT/2000/XP)
00057      CYGWIN     - Cygwin
00058      SOLARIS    - Sun Solaris
00059      HPUX       - HP-UX
00060      ULTRIX     - DEC Ultrix
00061      LINUX      - Linux
00062      FREEBSD    - FreeBSD
00063      NETBSD     - NetBSD
00064      OPENBSD    - OpenBSD
00065      BSDI       - BSD/OS
00066      IRIX       - SGI Irix
00067      OSF        - HP Tru64 UNIX
00068      SCO        - SCO OpenServer 5
00069      UNIXWARE   - UnixWare 7, Open UNIX 8
00070      AIX        - AIX
00071      HURD       - GNU Hurd
00072      DGUX       - DG/UX
00073      RELIANT    - Reliant UNIX
00074      DYNIX      - DYNIX/ptx
00075      QNX        - QNX
00076      QNX6       - QNX RTP 6.1
00077      LYNX       - LynxOS
00078      BSD4       - Any BSD 4.4 system
00079      UNIX       - Any UNIX BSD/SYSV system
00080 */
00081 
00082 #if defined(__DARWIN_X11__)
00083 #  define Q_OS_DARWIN
00084 #elif defined(__APPLE__) && defined(__GNUC__)
00085 #  define Q_OS_MACX
00086 #elif defined(__MACOSX__)
00087 #  define Q_OS_MACX
00088 #elif defined(macintosh)
00089 #  define Q_OS_MAC9
00090 #elif defined(__CYGWIN__)
00091 #  define Q_OS_CYGWIN
00092 #elif defined(MSDOS) || defined(_MSDOS)
00093 #  define Q_OS_MSDOS
00094 #elif defined(__OS2__)
00095 #  if defined(__EMX__)
00096 #    define Q_OS_OS2EMX
00097 #  else
00098 #    define Q_OS_OS2
00099 #  endif
00100 #elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
00101 #  define Q_OS_WIN32
00102 #  define Q_OS_WIN64
00103 #elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
00104 #  define Q_OS_WIN32
00105 #elif defined(__MWERKS__) && defined(__INTEL__)
00106 #  define Q_OS_WIN32
00107 #elif defined(__sun) || defined(sun)
00108 #  define Q_OS_SOLARIS
00109 #elif defined(hpux) || defined(__hpux)
00110 #  define Q_OS_HPUX
00111 #elif defined(__ultrix) || defined(ultrix)
00112 #  define Q_OS_ULTRIX
00113 #elif defined(sinix)
00114 #  define Q_OS_RELIANT
00115 #elif defined(__linux__) || defined(__linux)
00116 #  define Q_OS_LINUX
00117 #elif defined(__FreeBSD__) || defined(__DragonFly__)
00118 #  define Q_OS_FREEBSD
00119 #  define Q_OS_BSD4
00120 #elif defined(__NetBSD__)
00121 #  define Q_OS_NETBSD
00122 #  define Q_OS_BSD4
00123 #elif defined(__OpenBSD__)
00124 #  define Q_OS_OPENBSD
00125 #  define Q_OS_BSD4
00126 #elif defined(__bsdi__)
00127 #  define Q_OS_BSDI
00128 #  define Q_OS_BSD4
00129 #elif defined(__sgi)
00130 #  define Q_OS_IRIX
00131 #elif defined(__osf__)
00132 #  define Q_OS_OSF
00133 #elif defined(_AIX)
00134 #  define Q_OS_AIX
00135 #elif defined(__Lynx__)
00136 #  define Q_OS_LYNX
00137 #elif defined(__GNU_HURD__)
00138 #  define Q_OS_HURD
00139 #elif defined(__DGUX__)
00140 #  define Q_OS_DGUX
00141 #elif defined(__QNXNTO__)
00142 #  define Q_OS_QNX6
00143 #elif defined(__QNX__)
00144 #  define Q_OS_QNX
00145 #elif defined(_SEQUENT_)
00146 #  define Q_OS_DYNIX
00147 #elif defined(_SCO_DS)                   /* SCO OpenServer 5 + GCC */
00148 #  define Q_OS_SCO
00149 #elif defined(__USLC__)                  /* all SCO platforms + UDK or OUDK */
00150 #  define Q_OS_UNIXWARE
00151 #  define Q_OS_UNIXWARE7
00152 #elif defined(__svr4__) && defined(i386) /* Open UNIX 8 + GCC */
00153 #  define Q_OS_UNIXWARE
00154 #  define Q_OS_UNIXWARE7
00155 #elif defined(__MAKEDEPEND__)
00156 #else
00157 #  error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
00158 #endif
00159 
00160 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
00161 #  define Q_OS_WIN
00162 #endif
00163 
00164 #if defined(Q_OS_MAC9) || defined(Q_OS_MACX)
00165 #  define Q_OS_MAC
00166 /* We have to prevent qmake to generate makefiles or projectfiles for the Apple build system. 
00167  * This would work if we would use QT3. But we compile with QT2 which don't use qmake and does nothing
00168  * about the MAC platform !! (se)
00169  */
00170 #warning "evil hack here !! (se)"
00171 #define Q_OS_LINUX
00172 #undef Q_OS_MACX
00173 #undef Q_OS_MAC
00174 #endif
00175 
00176 #if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN)
00177 #  undef Q_OS_UNIX
00178 #elif !defined(Q_OS_UNIX)
00179 #  define Q_OS_UNIX
00180 #endif
00181 
00182 
00183 /*
00184    The compiler, must be one of: (Q_CC_x)
00185 
00186      SYM        - Symantec C++ for both PC and Macintosh
00187      MPW        - MPW C++
00188      MWERKS     - Metrowerks CodeWarrior
00189      MSVC       - Microsoft Visual C/C++, Intel C++ for Windows
00190      BOR        - Borland/Turbo C++
00191      WAT        - Watcom C++
00192      GNU        - GNU C++
00193      COMEAU     - Comeau C++
00194      EDG        - Edison Design Group C++
00195      OC         - CenterLine C++
00196      SUN        - Sun WorkShop, Forte Developer, or Sun ONE Studio C++
00197      MIPS       - MIPSpro C++
00198      DEC        - DEC C++
00199      HP         - HPUX C++
00200      HPACC      - HPUX ANSI C++
00201      USLC       - SCO OUDK, UDK, and UnixWare 2.X C++
00202      CDS        - Reliant C++
00203      KAI        - KAI C++
00204      INTEL      - Intel C++ for Linux, Intel C++ for Windows
00205      HIGHC      - MetaWare High C/C++
00206      PGI        - Portland Group C++
00207      GHS        - Green Hills Optimizing C++ Compilers
00208 
00209    Should be sorted most to least authoritative.
00210 */
00211 
00212 /* Symantec C++ is now Digital Mars */
00213 #if defined(__DMC__) || defined(__SC__)
00214 #  define Q_CC_SYM
00215 /* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
00216 #  if defined(__SC__) && __SC__ < 0x750
00217 #    define Q_NO_EXPLICIT_KEYWORD
00218 #  endif
00219 #  define Q_NO_USING_KEYWORD
00220 #  if !defined(_CPPUNWIND)
00221 #    define Q_NO_EXCEPTIONS
00222 #  endif
00223 
00224 #elif defined(applec)
00225 #  define Q_CC_MPW
00226 #  define Q_NO_BOOL_TYPE
00227 #  define Q_NO_EXPLICIT_KEYWORD
00228 #  define Q_NO_USING_KEYWORD
00229 
00230 #elif defined(__MWERKS__)
00231 #  define Q_CC_MWERKS
00232 /* "explicit" recognized since 4.0d1 */
00233 #  define QMAC_PASCAL pascal
00234 
00235 #elif defined(_MSC_VER)
00236 #  define Q_CC_MSVC
00237 /* proper support of bool for _MSC_VER >= 1100 */
00238 #  define Q_CANNOT_DELETE_CONSTANT
00239 #  define Q_INLINE_TEMPLATES inline
00240 /* Visual C++.Net issues for _MSC_VER >= 1300 */
00241 #  if _MSC_VER >= 1300
00242 #    define Q_CC_MSVC_NET
00243 #    if _MSC_VER < 1310 || defined(Q_OS_WIN64)
00244 #      define Q_TYPENAME
00245 #    endif
00246 #  endif
00247 /* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
00248 #  if defined(__INTEL_COMPILER)
00249 #    define Q_CC_INTEL
00250 #    if !defined(__EXCEPTIONS)
00251 #      define Q_NO_EXCEPTIONS
00252 #    endif
00253 #  else
00254 #    define Q_NO_USING_KEYWORD /* ### check "using" status */
00255 #  endif
00256 
00257 #elif defined(__BORLANDC__) || defined(__TURBOC__)
00258 #  define Q_CC_BOR
00259 #  if __BORLANDC__ < 0x502
00260 #    define Q_NO_BOOL_TYPE
00261 #    define Q_NO_EXPLICIT_KEYWORD
00262 #  endif
00263 #  define Q_NO_USING_KEYWORD /* ### check "using" status */
00264 
00265 #elif defined(__WATCOMC__)
00266 #  define Q_CC_WAT
00267 #  if defined(Q_OS_QNX4)
00268 /* compiler flags */
00269 #    define Q_TYPENAME
00270 #    define Q_NO_BOOL_TYPE
00271 #    define Q_CANNOT_DELETE_CONSTANT
00272 #    define mutable
00273 /* ??? */
00274 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
00275 /* no template classes in QVariant */
00276 #    define QT_NO_TEMPLATE_VARIANT
00277 /* Wcc does not fill in functions needed by valuelists, maps, and
00278    valuestacks implicitly */
00279 #    define Q_FULL_TEMPLATE_INSTANTIATION
00280 /* can we just compare the structures? */
00281 #    define Q_FULL_TEMPLATE_INSTANTIATION_MEMCMP
00282 /* these are not useful to our customers */
00283 #    define QT_QWS_NO_SHM
00284 #    define QT_NO_QWS_MULTIPROCESS
00285 #    define QT_NO_SQL
00286 #    define QT_NO_QWS_CURSOR
00287 #  endif
00288 
00289 #elif defined(__GNUC__)
00290 #  define Q_CC_GNU
00291 #  define Q_C_CALLBACKS
00292 #  if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
00293 #    define Q_FULL_TEMPLATE_INSTANTIATION
00294 #  endif
00295 /* GCC 2.95 knows "using" but does not support it correctly */
00296 #  if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
00297 #    define Q_NO_USING_KEYWORD
00298 #  endif
00299 /* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
00300 #  if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
00301 #    define Q_WRONG_SB_CTYPE_MACROS
00302 #  endif
00303 
00304 /* ARM gcc pads structs to 32 bits, even when they contain a single
00305    char, or short.  We tell gcc to pack QChars to 16 bits, to avoid
00306    QString bloat. However, gcc 3.4 doesn't allow us to create references to
00307    members of a packed struct. (Pointers are OK, because then you
00308    supposedly know what you are doing.) */
00309 #  if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
00310 #    define Q_PACKED __attribute__ ((packed))
00311 #    if __GNUC__ == 3 && __GNUC_MINOR__ >= 4
00312 #      define Q_NO_PACKED_REFERENCE
00313 #    endif
00314 #  endif
00315 #  if !defined(__EXCEPTIONS)
00316 #    define Q_NO_EXCEPTIONS
00317 #  endif
00318 
00319 /* IBM compiler versions are a bit messy. There are actually two products:
00320    the C product, and the C++ product. The C++ compiler is always packaged
00321    with the latest version of the C compiler. Version numbers do not always
00322    match. This little table (I'm not sure it's accurate) should be helpful:
00323 
00324    C++ product                C product
00325 
00326             C Set 3.1         C Compiler 3.0
00327                   ...         ...
00328    C++ Compiler 3.6.6         C Compiler 4.3
00329                   ...         ...
00330    Visual Age C++ 4.0         ...
00331                   ...         ...
00332    Visual Age C++ 5.0         C Compiler 5.0
00333                   ...         ...
00334    Visual Age C++ 6.0         C Compiler 6.0
00335 
00336    Now:
00337    __xlC__    is the version of the C compiler in hexadecimal notation
00338               is only an approximation of the C++ compiler version
00339    __IBMCPP__ is the version of the C++ compiler in decimal notation
00340               but it is not defined on older compilers like C Set 3.1 */
00341 #elif defined(__xlC__)
00342 #  define Q_CC_XLC
00343 #  define Q_FULL_TEMPLATE_INSTANTIATION
00344 #  if __xlC__ < 0x400
00345 #    define Q_NO_BOOL_TYPE
00346 #    define Q_NO_EXPLICIT_KEYWORD
00347 #    define Q_NO_USING_KEYWORD
00348 #    define Q_TYPENAME
00349 #    define Q_INLINE_TEMPLATES inline
00350 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
00351 #    define Q_CANNOT_DELETE_CONSTANT
00352 #  endif
00353 
00354 /* Older versions of DEC C++ do not define __EDG__ or __EDG - observed
00355    on DEC C++ V5.5-004. New versions do define  __EDG__ - observed on
00356    Compaq C++ V6.3-002.
00357    This compiler is different enough from other EDG compilers to handle
00358    it separately anyway. */
00359 #elif defined(__DECCXX) || defined(__DECC)
00360 #  define Q_CC_DEC
00361 /* Compaq C++ V6 compilers are EDG-based but I'm not sure about older
00362    DEC C++ V5 compilers. */
00363 #  if defined(__EDG__)
00364 #    define Q_CC_EDG
00365 #  endif
00366 /* Compaq have disabled EDG's _BOOL macro and use _BOOL_EXISTS instead
00367    - observed on Compaq C++ V6.3-002.
00368    In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
00369 #  if !defined(_BOOL_EXISTS)
00370 #    define Q_NO_BOOL_TYPE
00371 #  endif
00372 /* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
00373 #  define Q_NO_USING_KEYWORD
00374 /* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
00375    DEC C++ V5.5-004. */
00376 #  if __DECCXX_VER < 60060000
00377 #    define Q_TYPENAME
00378 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
00379 #    define Q_CANNOT_DELETE_CONSTANT
00380 #  endif
00381 /* avoid undefined symbol problems with out-of-line template members */
00382 #  define Q_INLINE_TEMPLATES inline
00383 
00384 /* Compilers with EDG front end are similar. To detect them we test:
00385    __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
00386    __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 */
00387 #elif defined(__EDG) || defined(__EDG__)
00388 #  define Q_CC_EDG
00389 /* From the EDG documentation (does not seem to apply to Compaq C++):
00390    _BOOL
00391         Defined in C++ mode when bool is a keyword. The name of this
00392         predefined macro is specified by a configuration flag. _BOOL
00393         is the default.
00394    __BOOL_DEFINED
00395         Defined in Microsoft C++ mode when bool is a keyword. */
00396 #  if !defined(_BOOL) && !defined(__BOOL_DEFINED)
00397 #    define Q_NO_BOOL_TYPE
00398 #  endif
00399 
00400 /* The Comeau compiler is based on EDG and does define __EDG__ */
00401 #  if defined(__COMO__)
00402 #    define Q_CC_COMEAU
00403 #    define Q_C_CALLBACKS
00404 
00405 /* The `using' keyword was introduced to avoid KAI C++ warnings
00406    but it's now causing KAI C++ errors instead. The standard is
00407    unclear about the use of this keyword, and in practice every
00408    compiler is using its own set of rules. Forget it. */
00409 #  elif defined(__KCC)
00410 #    define Q_CC_KAI
00411 #    if !defined(_EXCEPTIONS)
00412 #      define Q_NO_EXCEPTIONS
00413 #    endif
00414 #    define Q_NO_USING_KEYWORD
00415 
00416 /* Using the `using' keyword avoids Intel C++ for Linux warnings */
00417 #  elif defined(__INTEL_COMPILER)
00418 #    define Q_CC_INTEL
00419 #    if !defined(__EXCEPTIONS)
00420 #      define Q_NO_EXCEPTIONS
00421 #    endif
00422 
00423 /* The Portland Group compiler is based on EDG and does define __EDG__ */
00424 #  elif defined(__PGI)
00425 #    define Q_CC_PGI
00426 #    if !defined(__EXCEPTIONS)
00427 #      define Q_NO_EXCEPTIONS
00428 #    endif
00429 
00430 /* Never tested! */
00431 #  elif defined(__ghs)
00432 #    define Q_CC_GHS
00433 
00434 /* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
00435 #  elif defined(__USLC__) && defined(__SCO_VERSION__)
00436 #    define Q_CC_USLC
00437 /* The latest UDK 7.1.1b does not need this, but previous versions do */
00438 #    if !defined(__SCO_VERSION__) || (__SCO_VERSION__ < 302200010)
00439 #      define Q_INLINE_TEMPLATES inline
00440 #    endif
00441 #    define Q_NO_USING_KEYWORD /* ### check "using" status */
00442 
00443 /* Never tested! */
00444 #  elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
00445 #    define Q_CC_OC
00446 #    define Q_NO_USING_KEYWORD
00447 
00448 /* CDS++ defines __EDG__ although this is not documented in the Reliant
00449    documentation. It also follows conventions like _BOOL and this documented */
00450 #  elif defined(sinix)
00451 #    define Q_CC_CDS
00452 #    define Q_NO_USING_KEYWORD
00453 #    if defined(__cplusplus) && (__cplusplus < 2) /* Cfront C++ mode */
00454 #      define Q_NO_EXCEPTIONS
00455 #    endif
00456 
00457 /* The MIPSpro compiler in o32 mode is based on EDG but disables features
00458    such as template specialization nevertheless */
00459 #  elif defined(__sgi)
00460 #    define Q_CC_MIPS
00461 #    if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32) /* o32 ABI */
00462 #      define Q_TYPENAME
00463 #      define Q_BROKEN_TEMPLATE_SPECIALIZATION
00464 #      define Q_NO_EXPLICIT_KEYWORD
00465 #      define Q_INLINE_TEMPLATES inline
00466 #    elif defined(_COMPILER_VERSION) && (_COMPILER_VERSION < 730) /* 7.2 */
00467 #      define Q_TYPENAME
00468 #      define Q_BROKEN_TEMPLATE_SPECIALIZATION
00469 #    endif
00470 #    define Q_NO_USING_KEYWORD /* ### check "using" status */
00471 #    if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740)
00472 #      pragma set woff 3624,3625, 3649 /* turn off some harmless warnings */
00473 #    endif
00474 #  endif
00475 
00476 /* The older UnixWare 2.X compiler? */
00477 #elif defined(__USLC__)
00478 #  define Q_CC_USLC
00479 #  define Q_TYPENAME
00480 #  define Q_NO_BOOL_TYPE
00481 #  define Q_NO_EXPLICIT_KEYWORD
00482 #  define Q_NO_USING_KEYWORD
00483 #  define Q_INLINE_TEMPLATES inline
00484 
00485 /* Never tested! */
00486 #elif defined(__HIGHC__)
00487 #  define Q_CC_HIGHC
00488 
00489 #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C)
00490 #  define Q_CC_SUN
00491 /* 5.0 compiler or better
00492     'bool' is enabled by default but can be disabled using -features=nobool
00493     in which case _BOOL is not defined
00494         this is the default in 4.2 compatibility mode triggered by -compat=4 */
00495 #  if __SUNPRO_CC >= 0x500
00496 #    if !defined(_BOOL)
00497 #      define Q_NO_BOOL_TYPE
00498 #    endif
00499 #    if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
00500 #      define Q_NO_USING_KEYWORD
00501 #    endif
00502 #    define Q_C_CALLBACKS
00503 /* 4.2 compiler or older */
00504 #  else
00505 #    define Q_NO_BOOL_TYPE
00506 #    define Q_NO_EXPLICIT_KEYWORD
00507 #    define Q_NO_USING_KEYWORD
00508 #  endif
00509 
00510 /* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
00511    documentation but nevertheless uses EDG conventions like _BOOL */
00512 #elif defined(sinix)
00513 #  define Q_CC_EDG
00514 #  define Q_CC_CDS
00515 #  if !defined(_BOOL)
00516 #    define Q_NO_BOOL_TYPE
00517 #  endif
00518 #  define Q_BROKEN_TEMPLATE_SPECIALIZATION
00519 
00520 #elif defined(Q_OS_HPUX)
00521 /* __HP_aCC was not defined in first aCC releases */
00522 #  if defined(__HP_aCC) || __cplusplus >= 199707L
00523 #    define Q_CC_HPACC
00524 #  else
00525 #    define Q_CC_HP
00526 #    define Q_NO_BOOL_TYPE
00527 #    define Q_FULL_TEMPLATE_INSTANTIATION
00528 #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
00529 #    define Q_NO_EXPLICIT_KEYWORD
00530 #  endif
00531 #  define Q_NO_USING_KEYWORD /* ### check "using" status */
00532 
00533 #else
00534 #  error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
00535 #endif
00536 
00537 #ifndef Q_PACKED
00538 #  define Q_PACKED
00539 #endif
00540 
00541 
00542 /*
00543    The window system, must be one of: (Q_WS_x)
00544 
00545      MACX       - Mac OS X
00546      MAC9       - Mac OS 9
00547      QWS        - Qt/Embedded
00548      WIN32      - Windows
00549      X11        - X Window System
00550      PM         - unsupported
00551      WIN16      - unsupported
00552 */
00553 
00554 #if defined(Q_OS_MAC9)
00555 #  define Q_WS_MAC9
00556 #elif defined(Q_OS_MSDOS)
00557 #  define Q_WS_WIN16
00558 #  error "Qt requires Win32 and does not work with Windows 3.x"
00559 #elif defined(_WIN32_X11_)
00560 #  define Q_WS_X11
00561 #elif defined(Q_OS_WIN32)
00562 #  define Q_WS_WIN32
00563 #  if defined(Q_OS_WIN64)
00564 #    define Q_WS_WIN64
00565 #  endif
00566 #elif defined(Q_OS_OS2)
00567 #  define Q_WS_PM
00568 #  error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
00569 #elif defined(Q_OS_UNIX)
00570 #  if defined(QWS)
00571 #    define Q_WS_QWS
00572 #    define QT_NO_QWS_IM
00573 #  elif defined(Q_OS_MACX)
00574 #    define Q_WS_MACX
00575 #  else
00576 #    define Q_WS_X11
00577 #  endif
00578 #endif
00579 #if defined(Q_OS_MAC) && !defined(QMAC_PASCAL)
00580 #  define QMAC_PASCAL
00581 #endif
00582 
00583 #if defined(Q_WS_WIN16) || defined(Q_WS_WIN32)
00584 #  define Q_WS_WIN
00585 #endif
00586 
00587 #if (defined(Q_WS_MAC9) || defined(Q_WS_MACX)) && !defined(Q_WS_QWS) && !defined(Q_WS_X11)
00588 #  define Q_WS_MAC
00589 #endif
00590 
00591 
00592 /*
00593    Some classes do not permit copies to be made of an object.
00594    These classes contains a private copy constructor and operator=
00595    to disable copying (the compiler gives an error message).
00596    Undefine Q_DISABLE_COPY to turn off this checking.
00597 */
00598 
00599 #define Q_DISABLE_COPY
00600 
00601 #if defined(__cplusplus)
00602 
00603 
00604 //
00605 // Useful type definitions for Qt
00606 //
00607 
00608 #if defined(Q_NO_BOOL_TYPE)
00609 #if defined(Q_CC_HP)
00610 // bool is an unsupported reserved keyword in later versions
00611 #define bool int
00612 #else
00613 typedef int bool;
00614 #endif
00615 #endif
00616 
00617 typedef unsigned char   uchar;
00618 typedef unsigned short  ushort;
00619 typedef unsigned        uint;
00620 typedef unsigned long   ulong;
00621 typedef char           *pchar;
00622 typedef uchar          *puchar;
00623 typedef const char     *pcchar;
00624 
00625 
00626 //
00627 // Constant bool values
00628 //
00629 
00630 #ifndef TRUE
00631 const bool FALSE = 0;
00632 const bool TRUE = !0;
00633 #endif
00634 #if defined(__WATCOMC__)
00635 #  if defined(Q_OS_QNX4)
00636 const bool false = FALSE;
00637 const bool true = TRUE;
00638 #  endif
00639 #endif
00640 
00641 //
00642 // Proper for-scoping
00643 // ### turn on in 4.0
00644 
00645 #if 0 && defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET)
00646 #  define for if(0){}else for
00647 #endif
00648 
00649 //
00650 // Use the "explicit" keyword on platforms that support it.
00651 //
00652 
00653 #if !defined(Q_NO_EXPLICIT_KEYWORD)
00654 #  define Q_EXPLICIT explicit
00655 #else
00656 #  define Q_EXPLICIT
00657 #endif
00658 
00659 
00660 //
00661 // Workaround for static const members on MSVC++.
00662 //
00663 
00664 #if defined(Q_CC_MSVC)
00665 #  define QT_STATIC_CONST static
00666 #  define QT_STATIC_CONST_IMPL
00667 #else
00668 #  define QT_STATIC_CONST static const
00669 #  define QT_STATIC_CONST_IMPL const
00670 #endif
00671 
00672 
00673 //
00674 // Utility macros and inline functions
00675 //
00676 
00677 #define QMAX(a, b)      ((b) < (a) ? (a) : (b))
00678 #define QMIN(a, b)      ((a) < (b) ? (a) : (b))
00679 #define QABS(a) ((a) >= 0  ? (a) : -(a))
00680 
00681 inline int qRound( double d )
00682 {
00683     return d >= 0.0 ? int(d + 0.5) : int( d - ((int)d-1) + 0.5 ) + ((int)d-1);
00684 }
00685 
00686 
00687 //
00688 // Size-dependent types (architechture-dependent byte order)
00689 //
00690 
00691 #if !defined(QT_CLEAN_NAMESPACE)
00692 // source compatibility with Qt 1.x
00693 typedef signed char             INT8;           // 8 bit signed
00694 typedef unsigned char           UINT8;          // 8 bit unsigned
00695 typedef short                   INT16;          // 16 bit signed
00696 typedef unsigned short          UINT16;         // 16 bit unsigned
00697 typedef int                     INT32;          // 32 bit signed
00698 typedef unsigned int            UINT32;         // 32 bit unsigned
00699 #endif
00700 
00701 typedef signed char             Q_INT8;         // 8 bit signed
00702 typedef unsigned char           Q_UINT8;        // 8 bit unsigned
00703 typedef short                   Q_INT16;        // 16 bit signed
00704 typedef unsigned short          Q_UINT16;       // 16 bit unsigned
00705 typedef int                     Q_INT32;        // 32 bit signed
00706 typedef unsigned int            Q_UINT32;       // 32 bit unsigned
00707 #if defined(Q_OS_WIN64)
00708 typedef __int64                 Q_LONG;         // word up to 64 bit signed
00709 typedef unsigned __int64        Q_ULONG;        // word up to 64 bit unsigned
00710 #else
00711 typedef long                    Q_LONG;         // word up to 64 bit signed
00712 typedef unsigned long           Q_ULONG;        // word up to 64 bit unsigned
00713 #endif
00714 #if defined(Q_OS_WIN) && !defined(Q_CC_GNU)
00715 #  define Q_INT64_C(c)          c ## i64        // signed 64 bit constant
00716 #  define Q_UINT64_C(c)         c ## ui64       // unsigned 64 bit constant
00717 typedef __int64                 Q_INT64;        // 64 bit signed
00718 typedef unsigned __int64        Q_UINT64;       // 64 bit unsigned
00719 #else
00720 #  define Q_INT64_C(c)          c ## LL         // signed 64 bit constant
00721 #  define Q_UINT64_C(c)         c ## ULL        // unsigned 64 bit constant
00722 typedef long long               Q_INT64;        // 64 bit signed
00723 typedef unsigned long long      Q_UINT64;       // 64 bit unsigned
00724 #endif
00725 typedef Q_INT64                 Q_LLONG;        // signed long long
00726 typedef Q_UINT64                Q_ULLONG;       // unsigned long long
00727 
00728 #if defined(Q_OS_MACX) && !defined(QT_LARGEFILE_SUPPORT)
00729 #  define QT_LARGEFILE_SUPPORT 64
00730 #endif
00731 #if defined(QT_LARGEFILE_SUPPORT)
00732     typedef Q_ULLONG QtOffset;
00733 #else
00734     typedef Q_ULONG QtOffset;
00735 #endif
00736 
00737 
00738 //
00739 // Data stream functions is provided by many classes (defined in qdatastream.h)
00740 //
00741 
00742 class QDataStream;
00743 
00744 
00745 //
00746 // Feature subsetting
00747 //
00748 // Note that disabling some features will produce a libqt that is not
00749 // compatible with other libqt builds. Such modifications are only
00750 // supported on Qt/Embedded where reducing the library size is important
00751 // and where the application-suite is often a fixed set.
00752 //
00753 
00754 #if !defined(QT_MOC)
00755 #if defined(QCONFIG_LOCAL)
00756 #include "qconfig-local.h"
00757 #elif defined(QCONFIG_MINIMAL)
00758 #include "qconfig-minimal.h"
00759 #elif defined(QCONFIG_SMALL)
00760 #include "qconfig-small.h"
00761 #elif defined(QCONFIG_MEDIUM)
00762 #include "qconfig-medium.h"
00763 #elif defined(QCONFIG_LARGE)
00764 #include "qconfig-large.h"
00765 #else // everything...
00766 #include "qconfig.h"
00767 #endif
00768 #endif
00769 
00770 
00771 #ifndef QT_BUILD_KEY
00772 #define QT_BUILD_KEY "unspecified"
00773 #endif
00774 
00775 // prune to local config
00776 #include "qmodules.h"
00777 #ifndef QT_MODULE_DIALOGS
00778 # define QT_NO_DIALOG
00779 #endif
00780 #ifndef QT_MODULE_ICONVIEW
00781 # define QT_NO_ICONVIEW
00782 #endif
00783 #ifndef QT_MODULE_WORKSPACE
00784 # define QT_NO_WORKSPACE
00785 #endif
00786 #ifndef QT_MODULE_NETWORK
00787 #define QT_NO_NETWORK
00788 #endif
00789 #ifndef QT_MODULE_CANVAS
00790 # define QT_NO_CANVAS
00791 #endif
00792 #ifndef QT_MODULE_TABLE
00793 #define QT_NO_TABLE
00794 #endif
00795 #ifndef QT_MODULE_XML
00796 # define QT_NO_XML
00797 #endif
00798 #ifndef QT_MODULE_OPENGL
00799 # define QT_NO_OPENGL
00800 #endif
00801 #if !defined(QT_MODULE_SQL)
00802 # define QT_NO_SQL
00803 #endif
00804 
00805 #if defined(Q_WS_MAC9)
00806 //No need for menu merging
00807 #  ifndef QMAC_QMENUBAR_NO_MERGE
00808 #    define QMAC_QMENUBAR_NO_MERGE
00809 #  endif
00810 //Mac9 does not use quartz
00811 #  ifndef QMAC_NO_QUARTZ
00812 #    define QMAC_NO_QUARTZ
00813 #  endif
00814 #  ifndef QMAC_QMENUBAR_NO_EVENT
00815 #    define QMAC_QMENUBAR_NO_EVENT
00816 #  endif
00817 #endif
00818 #if defined(Q_WS_MACX) //for no nobody uses quartz, just putting in first level hooks
00819 #  ifndef QMAC_NO_QUARTZ
00820 #    define QMAC_NO_QUARTZ
00821 #  endif
00822 #  ifndef QMAC_QMENUBAR_NO_EVENT
00823 #    define QMAC_QMENUBAR_NO_EVENT
00824 #  endif
00825 #endif
00826 
00827 #if !defined(Q_WS_QWS) && !defined(QT_NO_COP)
00828 #  define QT_NO_COP
00829 #endif
00830 
00831 #ifndef QT_H
00832 #include "qfeatures.h"
00833 #endif /* QT_H */
00834 
00835 
00836 //
00837 // Create Qt DLL if QT_DLL is defined (Windows only)
00838 // or QT_SHARED is defined (Kylix only)
00839 //
00840 
00841 #if defined(Q_OS_WIN)
00842 #  if defined(QT_NODLL)
00843 #    undef QT_MAKEDLL
00844 #    undef QT_DLL
00845 #  elif defined(QT_MAKEDLL)     /* create a Qt DLL library */
00846 #    if defined(QT_DLL)
00847 #      undef QT_DLL
00848 #    endif
00849 #    define Q_EXPORT  __declspec(dllexport)
00850 #    define Q_TEMPLATEDLL
00851 #    define Q_TEMPLATE_EXTERN
00852 #    undef  Q_DISABLE_COPY      /* avoid unresolved externals */
00853 #  elif defined(QT_DLL)         /* use a Qt DLL library */
00854 #    define Q_EXPORT  __declspec(dllimport)
00855 #    define Q_TEMPLATEDLL
00856 #    ifndef Q_TEMPLATE_EXTERN
00857 #      if defined(Q_CC_MSVC_NET)
00858 #        define Q_TEMPLATE_EXTERN extern
00859 #      else
00860 #        define Q_TEMPLATE_EXTERN
00861 #      endif
00862 #    endif
00863 #    undef  Q_DISABLE_COPY      /* avoid unresolved externals */
00864 #  endif
00865 #elif defined(Q_OS_LINUX) && defined(Q_CC_BOR)
00866 #  if defined(QT_SHARED)        /* create a Qt shared library */
00867 #    define Q_EXPORT  __declspec(dllexport)
00868 #    define Q_TEMPLATEDLL
00869 #    define Q_TEMPLATE_EXTERN
00870 #    undef  Q_DISABLE_COPY      /* avoid unresolved externals */
00871 #  else
00872 #    define Q_TEMPLATEDLL
00873 #    define Q_TEMPLATE_EXTERN
00874 #    undef  Q_DISABLE_COPY      /* avoid unresolved externals */
00875 #  endif
00876 #else
00877 #  undef QT_MAKEDLL             /* ignore these for other platforms */
00878 #  undef QT_DLL
00879 #endif
00880 
00881 #ifndef Q_EXPORT
00882 #  define Q_EXPORT
00883 #endif
00884 
00885 
00886 //
00887 // Some platform specific stuff
00888 //
00889 
00890 #if defined(Q_WS_WIN)
00891 extern Q_EXPORT bool qt_winunicode;
00892 #endif
00893 
00894 
00895 //
00896 // System information
00897 //
00898 
00899 Q_EXPORT const char *qVersion();
00900 Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
00901 Q_EXPORT bool qSharedBuild();
00902 #if defined(Q_OS_MAC)
00903 int qMacVersion();
00904 #elif defined(Q_WS_WIN)
00905 Q_EXPORT int qWinVersion();
00906 #if defined(UNICODE)
00907 #define QT_WA( uni, ansi ) if ( qt_winunicode ) { uni } else { ansi }
00908 #define QT_WA_INLINE( uni, ansi ) ( qt_winunicode ? uni : ansi )
00909 #else
00910 #define QT_WA( uni, ansi ) ansi
00911 #define QT_WA_INLINE( uni, ansi ) ansi
00912 #endif
00913 #endif
00914 
00915 #ifdef Q_OS_TEMP
00916 #ifdef QT_WA
00917 #undef QT_WA
00918 #undef QT_WA_INLINE
00919 #endif
00920 #define QT_WA( uni, ansi ) uni
00921 #define QT_WA_INLINE( uni, ansi ) ( uni )
00922 #endif
00923 
00924 #ifndef Q_INLINE_TEMPLATES
00925 #  define Q_INLINE_TEMPLATES
00926 #endif
00927 
00928 #ifndef Q_TYPENAME
00929 #  define Q_TYPENAME typename
00930 #endif
00931 
00932 //
00933 // Use to avoid "unused parameter" warnings
00934 //
00935 #define Q_UNUSED(x) (void)x;
00936 
00937 //
00938 // Debugging and error handling
00939 //
00940 
00941 #if !defined(QT_NO_CHECK)
00942 #  define QT_CHECK_STATE                        // check state of objects etc.
00943 #  define QT_CHECK_RANGE                        // check range of indexes etc.
00944 #  define QT_CHECK_NULL                         // check null pointers
00945 #  define QT_CHECK_MATH                         // check math functions
00946 #endif
00947 
00948 #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
00949 #  define QT_DEBUG                              // display debug messages
00950 #  if !defined(QT_NO_COMPAT)                    // compatibility with Qt 2
00951 #    if !defined(NO_DEBUG) && !defined(DEBUG)
00952 #      if !defined(Q_OS_MACX)                   // clash with MacOS X headers
00953 #        define DEBUG
00954 #      endif
00955 #    endif
00956 #  endif
00957 #endif
00958 
00959 
00960 Q_EXPORT void qDebug( const char *, ... )       // print debug message
00961 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00962     __attribute__ ((format (printf, 1, 2)))
00963 #endif
00964 ;
00965 
00966 Q_EXPORT void qWarning( const char *, ... )     // print warning message
00967 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00968     __attribute__ ((format (printf, 1, 2)))
00969 #endif
00970 ;
00971 
00972 Q_EXPORT void qFatal( const char *, ... )       // print fatal message and exit
00973 #if defined(Q_CC_GNU)
00974     __attribute__ ((format (printf, 1, 2)))
00975 #endif
00976 ;
00977 
00978 Q_EXPORT void qSystemWarning( const char *, int code = -1 );
00979 
00980 #if !defined(QT_CLEAN_NAMESPACE)                // compatibility with Qt 1
00981 
00982 Q_EXPORT void debug( const char *, ... )        // print debug message
00983 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00984     __attribute__ ((format (printf, 1, 2)))
00985 #endif
00986 ;
00987 
00988 Q_EXPORT void warning( const char *, ... )      // print warning message
00989 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00990     __attribute__ ((format (printf, 1, 2)))
00991 #endif
00992 ;
00993 
00994 Q_EXPORT void fatal( const char *, ... )        // print fatal message and exit
00995 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00996     __attribute__ ((format (printf, 1, 2)))
00997 #endif
00998 ;
00999 
01000 #endif // QT_CLEAN_NAMESPACE
01001 
01002 
01003 #if !defined(Q_ASSERT)
01004 #  if defined(QT_CHECK_STATE)
01005 #    if defined(QT_FATAL_ASSERT)
01006 #      define Q_ASSERT(x)  ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
01007 #    else
01008 #      define Q_ASSERT(x)  ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
01009 #    endif
01010 #  else
01011 #    define Q_ASSERT(x)
01012 #  endif
01013 #endif
01014 
01015 #if !defined(QT_NO_COMPAT)                      // compatibility with Qt 2
01016 #  if !defined(ASSERT)
01017 #    if !defined(Q_OS_TEMP)
01018 #      define ASSERT(x) Q_ASSERT(x)
01019 #    endif
01020 #  endif
01021 #endif // QT_NO_COMPAT
01022 
01023 
01024 Q_EXPORT bool qt_check_pointer( bool c, const char *, int );
01025 
01026 #if defined(QT_CHECK_NULL)
01027 #  define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))
01028 #else
01029 #  define Q_CHECK_PTR(p)
01030 #endif
01031 
01032 #if !defined(QT_NO_COMPAT)                      // compatibility with Qt 2
01033 #  if !defined(CHECK_PTR)
01034 #    define CHECK_PTR(x) Q_CHECK_PTR(x)
01035 #  endif
01036 #endif // QT_NO_COMPAT
01037 
01038 enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
01039 
01040 typedef void (*QtMsgHandler)(QtMsgType, const char *);
01041 Q_EXPORT QtMsgHandler qInstallMsgHandler( QtMsgHandler );
01042 
01043 #if !defined(QT_NO_COMPAT)                      // compatibility with Qt 2
01044 typedef QtMsgHandler msg_handler;
01045 #endif // QT_NO_COMPAT
01046 
01047 Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );
01048 
01049 Q_EXPORT void qObsolete( const char *obj, const char *oldfunc,
01050                    const char *newfunc );
01051 Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );
01052 Q_EXPORT void qObsolete( const char *message );
01053 
01054 
01055 //
01056 // Install paths from configure
01057 //
01058 
01059 Q_EXPORT const char *qInstallPath();
01060 Q_EXPORT const char *qInstallPathDocs();
01061 Q_EXPORT const char *qInstallPathHeaders();
01062 Q_EXPORT const char *qInstallPathLibs();
01063 Q_EXPORT const char *qInstallPathBins();
01064 Q_EXPORT const char *qInstallPathPlugins();
01065 Q_EXPORT const char *qInstallPathData();
01066 Q_EXPORT const char *qInstallPathTranslations();
01067 Q_EXPORT const char *qInstallPathSysconf();
01068 
01069 #endif /* __cplusplus */
01070 
01071 /*
01072  compilers which follow outdated template instantiation rules
01073  require a class to have a comparison operator to exist when
01074  a QValueList of this type is instantiated. It's not actually
01075  used in the list, though. Hence the dummy implementation.
01076  Just in case other code relies on it we better trigger a warning
01077  mandating a real implementation.
01078 */
01079 #ifdef Q_FULL_TEMPLATE_INSTANTIATION
01080 #  define Q_DUMMY_COMPARISON_OPERATOR(C) \
01081     bool operator==( const C& ) const { \
01082         qWarning( #C"::operator==( const "#C"& ) got called." ); \
01083         return FALSE; \
01084     }
01085 #else
01086 #  define Q_DUMMY_COMPARISON_OPERATOR(C)
01087 #endif
01088 
01089 #endif /* QGLOBAL_H */
01090 
01091 /*
01092  Avoid some particularly useless warnings from some stupid compilers.
01093  To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
01094  the line "#define QT_NO_WARNINGS"
01095 */
01096 
01097 #if !defined(QT_CC_WARNINGS)
01098 #  define QT_NO_WARNINGS
01099 #endif
01100 #if defined(QT_NO_WARNINGS)
01101 #  if defined(Q_CC_MSVC)
01102 #    pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data
01103 #    pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
01104 #    pragma warning(disable: 4514) // unreferenced inline/local function has been removed
01105 #    pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning)
01106 #    pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2'
01107 #    pragma warning(disable: 4706) // assignment within conditional expression
01108 #    pragma warning(disable: 4786) // truncating debug info after 255 characters
01109 #    pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated
01110 #    pragma warning(disable: 4355) // 'this' : used in base member initializer list
01111 #    pragma warning(disable: 4231) // nonstandard extension used : 'extern' before template explicit instantiation
01112 #    pragma warning(disable: 4710) // function not inlined
01113 #  elif defined(Q_CC_BOR)
01114 #    pragma option -w-inl
01115 #    pragma option -w-aus
01116 #    pragma warn -inl
01117 #    pragma warn -pia
01118 #    pragma warn -ccc
01119 #    pragma warn -rch
01120 #    pragma warn -sig
01121 #  endif
01122 #endif
01123 

Generated on Sat Nov 5 16:18:24 2005 for OPIE by  doxygen 1.4.2