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