home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / qglobal.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  22KB  |  813 lines

  1. /****************************************************************************
  2. ** $Id$
  3. **
  4. ** Global type declarations and definitions
  5. **
  6. ** Created : 920529
  7. **
  8. ** Copyright (C) 1992-2001 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the tools module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QGLOBAL_H
  39. #define QGLOBAL_H
  40.  
  41. #define QT_VERSION       300
  42. #define QT_VERSION_STR   "3.0.0"
  43.  
  44.  
  45. /*
  46.    The operating system, must be one of: (Q_OS_x)
  47.  
  48.      MACX      - Mac OS X
  49.      MAC9      - Mac OS 9
  50.      MSDOS  - MS-DOS and Windows
  51.      OS2      - OS/2
  52.      OS2EMX - XFree86 on OS/2 (not PM)
  53.      WIN32  - Win32 (Windows 95/98/ME and Windows NT/2000)
  54.      SUN      - SunOS
  55.      SOLARIS     - Sun Solaris
  56.      HPUX      - HP-UX
  57.      ULTRIX - DEC Ultrix
  58.      LINUX  - Linux
  59.      FREEBSD     - FreeBSD
  60.      NETBSD - NetBSD
  61.      OPENBSD    - OpenBSD
  62.      BSDI      - BSD/OS
  63.      IRIX      - SGI Irix
  64.      OSF      - Compaq Tru64
  65.      UNIXWARE     - SCO UnixWare
  66.      SCO      - SCO OpenServer
  67.      AIX      - AIX
  68.      HURD      - GNU Hurd
  69.      DGUX      - DG/UX
  70.      DYNIX  - DYNIX/ptx
  71.      RELIANT     - Reliant UNIX
  72.      QNX      - QNX
  73.     QNX6   - QNX RTP 6.1
  74.      LYNX      - LynxOS
  75.      BSD4      - Any BSD 4.4 system
  76.      UNIX      - Any UNIX BSD/SYSV system
  77. */
  78.  
  79. #if defined(__APPLE__) && defined(__GNUC__)
  80. #  define Q_OS_MACX
  81. #elif defined(__MACOSX__)
  82. #  define Q_OS_MACX
  83. #elif defined(macintosh)
  84. #  define Q_OS_MAC9
  85. #elif defined(MSDOS) || defined(_MSDOS) || defined(__MSDOS__)
  86. #  define Q_OS_MSDOS
  87. #elif defined(OS2) || defined(_OS2) || defined(__OS2__)
  88. #  if defined(__EMX__)
  89. #    define Q_OS_OS2EMX
  90. #  else
  91. #    define Q_OS_OS2
  92. #  endif
  93. #elif defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
  94. #  define Q_OS_WIN32
  95. #  define Q_OS_WIN64
  96. #elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
  97. #  define Q_OS_WIN32
  98. #elif defined(__MWERKS__) && defined(__INTEL__)
  99. #  define Q_OS_WIN32
  100. #elif defined(sun) || defined(__sun) || defined(__sun__)
  101. #  if defined(__SVR4)
  102. #    define Q_OS_SOLARIS
  103. #  else
  104. #    define Q_OS_SUN
  105. #    define Q_OS_BSD4
  106. #  endif
  107. #elif defined(hpux) || defined(__hpux) || defined(__hpux__)
  108. #  define Q_OS_HPUX
  109. #elif defined(ultrix) || defined(__ultrix) || defined(__ultrix__)
  110. #  define Q_OS_ULTRIX
  111. #elif defined(sinix)
  112. #  define Q_OS_RELIANT
  113. #elif defined(linux) || defined(__linux) || defined(__linux__)
  114. #  define Q_OS_LINUX
  115. #elif defined(__FreeBSD__)
  116. #  define Q_OS_FREEBSD
  117. #  define Q_OS_BSD4
  118. #elif defined(__NetBSD__)
  119. #  define Q_OS_NETBSD
  120. #  define Q_OS_BSD4
  121. #elif defined(__OpenBSD__)
  122. #  define Q_OS_OPENBSD
  123. #  define Q_OS_BSD4
  124. #elif defined(bsdi) || defined(__bsdi__)
  125. #  define Q_OS_BSDI
  126. #  define Q_OS_BSD4
  127. #elif defined(sgi) || defined(__sgi)
  128. #  define Q_OS_IRIX
  129. #elif defined(__osf__)
  130. #  define Q_OS_OSF
  131. #elif defined(_AIX)
  132. #  define Q_OS_AIX
  133. #elif defined(__Lynx__)
  134. #  define Q_OS_LYNX
  135. #elif defined(_UNIXWARE)
  136. #  define Q_OS_UNIXWARE
  137. #elif defined(__GNU__)
  138. #  define Q_OS_HURD
  139. #elif defined(DGUX)
  140. #  define Q_OS_DGUX
  141. #elif defined(__QNXNTO__)
  142. #  define Q_OS_QNX6
  143. #elif defined(__QNX__)
  144. #  define Q_OS_QNX
  145. #elif defined(_SCO_DS) || defined(M_UNIX) || defined(M_XENIX)
  146. #  define Q_OS_SCO
  147. #elif defined(sco) || defined(_UNIXWARE7)
  148. #  define Q_OS_UNIXWARE7
  149. #elif !defined(_SCO_DS) && defined(__USLC__) && defined(__SCO_VERSION__)
  150. #  define Q_OS_UNIXWARE7
  151. #elif defined(_SEQUENT_)
  152. #  define Q_OS_DYNIX
  153. #elif defined(__svr4__)
  154. /*   generic fallback for the rest of svr4 systems, e.g. g++ on UnixWare7.*/
  155. #  define Q_OS_SVR4
  156. #else
  157. #  error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
  158. #endif
  159.  
  160. #if defined(Q_OS_MAC9) || defined(Q_OS_MACX)
  161. #  define Q_OS_MAC
  162. #endif
  163.  
  164. #if defined(Q_OS_MAC9) || defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
  165. #  undef Q_OS_UNIX
  166. #elif !defined(Q_OS_UNIX)
  167. #  define Q_OS_UNIX
  168. #endif
  169.  
  170.  
  171. /*
  172.    The compiler, must be one of: (Q_CC_x)
  173.  
  174.      SYM      - Symantec C++ for both PC and Macintosh
  175.      MPW      - MPW C++
  176.      MWERKS - Metrowerks CodeWarrior
  177.      MSVC      - Microsoft Visual C/C++
  178.      BOR      - Borland/Turbo C++
  179.      WAT      - Watcom C++
  180.      GNU      - GNU C++
  181.      COMEAU - Comeau C++
  182.      EDG      - Edison Design Group C++
  183.      OC      - CenterLine C++
  184.      SUN      - Sun C++
  185.      MIPS      - MIPSpro C++
  186.      DEC      - DEC C++
  187.      HP      - HPUX C++
  188.      HPACC  - HPUX ANSI C++
  189.      USLC      - SCO UnixWare C++
  190.      CDS      - Reliant C++
  191.      KAI      - KAI C++
  192.      HIGHC  - MetaWare High C/C++
  193.      INTEL  - Intel C++
  194.  
  195.    Should be sorted most-authoritative to least-authoritative
  196. */
  197.  
  198. /* Symantec C++ is now Digital Mars? */
  199. #if defined(__SC__)
  200. #  define Q_CC_SYM
  201.  
  202. #elif defined(applec)
  203. #  define Q_CC_MPW
  204. #  define Q_NO_BOOL_TYPE
  205.  
  206. #elif defined(__MWERKS__)
  207. #  define Q_CC_MWERKS
  208. #  define QMAC_PASCAL pascal
  209.  
  210. #elif defined(_MSC_VER)
  211. #  define Q_CC_MSVC
  212. /* proper support of bool for _MSC_VER >= 1100 */
  213. #  define Q_CANNOT_DELETE_CONSTANT
  214.  
  215. #elif defined(__BORLANDC__) || defined(__TURBOC__)
  216. #  define Q_CC_BOR
  217. #  if __BORLANDC__ < 0x500
  218. #    define Q_NO_BOOL_TYPE
  219. #  endif
  220.  
  221. #elif defined(__WATCOMC__)
  222. #  define Q_CC_WAT
  223.  
  224. /* Never tested! */
  225. #elif defined(__HIGHC__)
  226. #  define Q_CC_HIGHC
  227.  
  228. #elif defined(__GNUC__)
  229. #  define Q_CC_GNU
  230. #  define Q_C_CALLBACKS
  231. #  if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
  232. #    define Q_FULL_TEMPLATE_INSTANTIATION
  233. #  endif
  234. #  if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
  235. #    define Q_PACKED __attribute__ ((packed))
  236. #  endif
  237.  
  238. /* IBM compiler versions are a bit messy. There are actually two products:
  239.    the C product, and the C++ product. The C++ compiler is always packaged
  240.    with the latest version of the C compiler. Version numbers do not always
  241.    match. This little table (I'm not sure it's accurate) should be helpful:
  242.  
  243.        C++ product               C product
  244.  
  245.         C Set 3.1              C Compiler 3.0
  246.          ...                       ...
  247.     C++ Compiler 3.6.6         C Compiler 4.3
  248.          ...                       ...
  249.     Visual Age C++ 4.0              ...
  250.          ...                       ...
  251.     Visual Age C++ 5.0         C Compiler 5.0
  252.  
  253.    Now:
  254.    __xlC__    is the version of the C compiler in hexadecimal notation
  255.               - it's only an approximation of the C++ compiler version
  256.    __IBMCPP__ is the version of the C++ compiler in decimal notation
  257.               - but it's not defined on older compilers like C Set 3.1 */
  258. #elif defined(__xlC__)
  259. #  define Q_CC_XLC
  260. #  define Q_FULL_TEMPLATE_INSTANTIATION
  261. #  if __xlC__ < 0x400
  262. #    define Q_NO_BOOL_TYPE
  263. #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
  264. #    define Q_CANNOT_DELETE_CONSTANT
  265. #  endif
  266.  
  267. /* Compilers with EDG front end are similar. To detect them we test:
  268.    __EDG documented by SGI, observed on MIPSpro 7.3.1.1 and KAI C++ 4.0b
  269.    __EDG__ documented in EDG online docs, observed on Compaq C++ V6.3-002 */
  270. #elif defined(__EDG) || defined(__EDG__) || defined(Q_CC_EDG)
  271. #  if !defined(Q_CC_EDG)
  272. #    define Q_CC_EDG
  273. #  endif
  274. /* Compaq have disabled EDG's _BOOL macro - observed on Compaq C++ V6.3-002. */
  275. #  if defined(__DECCXX)
  276. #    define Q_CC_DEC
  277. /* Compaq use _BOOL_EXISTS instead of _BOOL. */
  278. #    if defined(_BOOL_EXISTS)
  279. /* Well, at least macro _BOOL_EXISTS is documented for Compaq C++ V6.3.
  280.    In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
  281. #    elif __DECCXX_VER < 60060005
  282. #      define Q_NO_BOOL_TYPE
  283. #    endif
  284. /* Apart from Compaq, from the EDG documentation:
  285.    _BOOL
  286.     Defined in C++ mode when bool is a keyword. The name of this predefined
  287.     macro is specified by a configuration flag. _BOOL is the default.
  288.    __BOOL_DEFINED
  289.     Defined in Microsoft C++ mode when bool is a keyword. */
  290. #  else
  291. #    if !defined(_BOOL) && !defined(__BOOL_DEFINED)
  292. #      define Q_NO_BOOL_TYPE
  293. #    endif
  294. #    if defined(__COMO__)
  295. #      define Q_CC_COMEAU
  296. #      define Q_C_CALLBACKS
  297. #    elif defined(__KCC)
  298. #      define Q_CC_KAI
  299. #    elif defined(__INTEL_COMPILER)
  300. #      define Q_CC_INTEL
  301. /* The new UnixWare 7 compiler is based on EDG and does define __EDG__ */
  302. #    elif defined(__USLC__)
  303. #      define Q_CC_USLC
  304. /* Never tested! */
  305. #    elif defined(CENTERLINE_CLPP) || defined(OBJECTCENTER)
  306. #      define Q_CC_OC
  307. /* The MIPSpro compiler in o32 mode is based on EDG but disables features
  308.    such as template specialization nevertheless */
  309. #    elif defined(sgi) || defined(__sgi)
  310. #      define Q_CC_MIPS
  311. #      if defined(_MIPS_SIM) && ( _MIPS_SIM == _ABIO32) /* o32 ABI */
  312. #        define Q_BROKEN_TEMPLATE_SPECIALIZATION
  313. #      endif
  314. #    endif
  315. #  endif
  316.  
  317. /* the older UnixWare compiler is not based on EDG */
  318. #elif defined(__USLC__)
  319. #  define Q_CC_USLC
  320. #  define Q_NO_BOOL_TYPE
  321.  
  322. #elif defined(__SUNPRO_CC)
  323. #  define Q_CC_SUN
  324. /* 5.0 compiler or better
  325.     'bool' is enabled by default but can be disabled using -features=nobool
  326.     in which case _BOOL is not defined
  327.         this is the default in 4.2 compatibility mode triggered by -compat=4 */
  328. #  if __SUNPRO_CC >= 0x500
  329. #    if !defined(_BOOL)
  330. #      define Q_NO_BOOL_TYPE
  331. #    endif
  332. #    define Q_C_CALLBACKS
  333. /* 4.2 compiler or older */
  334. #  else
  335. #    define Q_NO_BOOL_TYPE
  336. #  endif
  337.  
  338. /* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
  339.    documentation but nevertheless uses EDG conventions like _BOOL */
  340. #elif defined(sinix)
  341. #  define Q_CC_EDG
  342. #  define Q_CC_CDS
  343. #  if !defined(_BOOL)
  344. #    define Q_NO_BOOL_TYPE
  345. #  endif
  346.  
  347. #elif defined(Q_OS_HPUX)
  348. /* __HP_aCC was not defined in first aCC releases */
  349. #  if defined(__HP_aCC) || __cplusplus >= 199707L
  350. #    define Q_CC_HPACC
  351. #  else
  352. #    define Q_CC_HP
  353. /* bool is a reserved keyword in later versions */
  354. #    define bool int
  355. #    define Q_FULL_TEMPLATE_INSTANTIATION
  356. #    define Q_BROKEN_TEMPLATE_SPECIALIZATION
  357. #  endif
  358.  
  359. #else
  360. #  error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
  361. #endif
  362.  
  363. #ifndef Q_PACKED
  364. #  define Q_PACKED
  365. #endif
  366.  
  367.  
  368. /*
  369.    The window system, must be one of: (Q_WS_x)
  370.  
  371.      MACX      - Mac OS X
  372.      MAC9      - Mac OS 9
  373.      QWS      - Qt/Embedded
  374.      WIN32  - Windows
  375.      X11      - X Window System
  376.      PM      - unsupported
  377.      WIN16  - unsupported
  378. */
  379.  
  380. #if defined( Q_OS_MACX )
  381. #  define Q_WS_MACX
  382. #elif defined( Q_OS_MAC9 )
  383. #  define Q_WS_MAC9
  384. #elif defined(Q_OS_MSDOS)
  385. #  define Q_WS_WIN16
  386. #  error "Qt requires Win32 and does not work with Windows 3.x"
  387. #elif defined(_WIN32_X11_)
  388. #  define Q_WS_X11
  389. #elif defined(Q_OS_WIN32)
  390. #  define Q_WS_WIN32
  391. #  if defined(Q_OS_WIN64)
  392. #    define Q_WS_WIN64
  393. #  endif
  394. #elif defined(Q_OS_OS2)
  395. #  define Q_WS_PM
  396. #  error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
  397. #elif defined(Q_OS_UNIX)
  398. #  ifdef QWS
  399. #    define Q_WS_QWS
  400. #  else
  401. #    define Q_WS_X11
  402. #  endif
  403. #endif
  404. #if defined(Q_OS_MAC) && !defined(QMAC_PASCAL)
  405. #  define QMAC_PASCAL
  406. #endif
  407.  
  408. #if defined(Q_WS_WIN16) || defined(Q_WS_WIN32)
  409. #  define Q_WS_WIN
  410. #endif
  411.  
  412. #if defined(Q_WS_MAC9) || defined(Q_WS_MACX)
  413. #  define Q_WS_MAC
  414. #endif
  415.  
  416.  
  417. /*
  418.    Some classes do not permit copies to be made of an object.
  419.    These classes contains a private copy constructor and operator=
  420.    to disable copying (the compiler gives an error message).
  421.    Undefine Q_DISABLE_COPY to turn off this checking.
  422. */
  423.  
  424. #define Q_DISABLE_COPY
  425.  
  426. #if defined(__cplusplus)
  427.  
  428. //
  429. // Useful type definitions for Qt
  430. //
  431.  
  432. #if defined(Q_NO_BOOL_TYPE)
  433. typedef int bool;
  434. #endif
  435.  
  436. typedef unsigned char   uchar;
  437. typedef unsigned short  ushort;
  438. typedef unsigned    uint;
  439. typedef unsigned long   ulong;
  440. typedef char           *pchar;
  441. typedef uchar           *puchar;
  442. typedef const char     *pcchar;
  443.  
  444.  
  445. //
  446. // Constant bool values
  447. //
  448.  
  449. #ifndef TRUE
  450. const bool FALSE = 0;
  451. const bool TRUE = !0;
  452. #endif
  453.  
  454.  
  455. //
  456. // Workaround for static const members on MSVC++.
  457. //
  458.  
  459. #if defined(Q_CC_MSVC)
  460. #  define QT_STATIC_CONST static
  461. #  define QT_STATIC_CONST_IMPL
  462. #else
  463. #  define QT_STATIC_CONST static const
  464. #  define QT_STATIC_CONST_IMPL const
  465. #endif
  466.  
  467.  
  468. //
  469. // Utility macros and inline functions
  470. //
  471.  
  472. #define QMAX(a, b)    ((b) < (a) ? (a) : (b))
  473. #define QMIN(a, b)    ((a) < (b) ? (a) : (b))
  474. #define QABS(a)    ((a) >= 0  ? (a) : -(a))
  475.  
  476. inline int qRound( double d )
  477. {
  478.     return int( d >= 0.0 ? d + 0.5 : d - 0.5 );
  479. }
  480.  
  481.  
  482. //
  483. // Size-dependent types (architechture-dependent byte order)
  484. //
  485.  
  486. #if !defined(QT_CLEAN_NAMESPACE)
  487. // source compatibility with Qt 1.x
  488. typedef signed char        INT8;         // 8 bit signed
  489. typedef unsigned char       UINT8;        // 8 bit unsigned
  490. typedef short            INT16;     // 16 bit signed
  491. typedef unsigned short       UINT16;    // 16 bit unsigned
  492. typedef int        INT32;      // 32 bit signed
  493. typedef unsigned int       UINT32;    // 32 bit unsigned
  494. #endif
  495.  
  496. typedef signed char        Q_INT8;     // 8 bit signed
  497. typedef unsigned char       Q_UINT8;    // 8 bit unsigned
  498. typedef short            Q_INT16;     // 16 bit signed
  499. typedef unsigned short       Q_UINT16;    // 16 bit unsigned
  500. typedef int        Q_INT32;      // 32 bit signed
  501. typedef unsigned int       Q_UINT32;    // 32 bit unsigned
  502. #if defined(Q_OS_WIN64)
  503. // LLP64 64-bit model on Windows
  504. typedef __int64        Q_LONG;     // word up to 64 bit signed
  505. typedef unsigned __int64       Q_ULONG;    // word up to 64 bit unsigned
  506. #else
  507. // LP64 64-bit model on Linux
  508. typedef long            Q_LONG;
  509. typedef unsigned long       Q_ULONG;
  510. #endif
  511.  
  512. #if !defined(QT_CLEAN_NAMESPACE)
  513. #define Q_INT64        Q_LONG
  514. #define Q_UINT64        Q_ULONG
  515. #endif
  516.  
  517.  
  518. //
  519. // Data stream functions is provided by many classes (defined in qdatastream.h)
  520. //
  521.  
  522. class QDataStream;
  523.  
  524.  
  525. //
  526. // Some platform specific stuff
  527. //
  528.  
  529. #ifdef Q_WS_WIN
  530. extern bool qt_winunicode;
  531. #endif
  532.  
  533. //
  534. // feature seubsetting
  535. //
  536. // Note that disabling some features will produce a libqt that is not
  537. // compatible with other libqt builds. Such modifications are only
  538. // supported on Qt/Embedded where reducing the library size is important
  539. // and where the application-suite is often a fixed set.
  540. //
  541. #if !defined(QT_MOC)
  542. #if defined(QCONFIG_LOCAL)
  543. #include <qconfig-local.h>
  544. #elif defined(QCONFIG_MINIMAL)
  545. #include <qconfig-minimal.h>
  546. #elif defined(QCONFIG_SMALL)
  547. #include <qconfig-small.h>
  548. #elif defined(QCONFIG_MEDIUM)
  549. #include <qconfig-medium.h>
  550. #elif defined(QCONFIG_LARGE)
  551. #include <qconfig-large.h>
  552. #else // everything...
  553. #include <qconfig.h>
  554. #endif
  555. #endif
  556.  
  557. // prune to local config
  558. #include "qmodules.h"
  559. #ifndef QT_MODULE_ICONVIEW
  560. # define QT_NO_ICONVIEW
  561. #endif
  562. #ifndef QT_MODULE_WORKSPACE
  563. # define QT_NO_WORKSPACE
  564. #endif
  565. #ifndef QT_MODULE_NETWORK
  566. #define QT_NO_NETWORK
  567. #endif
  568. #ifndef QT_MODULE_CANVAS
  569. # define QT_NO_CANVAS
  570. #endif
  571. #ifndef QT_MODULE_TABLE
  572. #define QT_NO_TABLE
  573. #endif
  574. #ifndef QT_MODULE_XML
  575. # define QT_NO_XML
  576. #endif
  577. #ifndef QT_MODULE_OPENGL
  578. # define QT_NO_OPENGL
  579. #endif
  580. #if !defined(QT_MODULE_SQL)
  581. # define QT_NO_SQL
  582. #endif
  583.  
  584. #ifdef Q_WS_MAC9
  585. //No need for menu merging
  586. #  ifndef QMAC_QMENUBAR_NO_MERGE
  587. #    define QMAC_QMENUBAR_NO_MERGE
  588. #  endif
  589. //Mac9 does not use quartz
  590. #  ifndef QMAC_NO_QUARTZ
  591. #    define QMAC_NO_QUARTZ
  592. #  endif
  593. #endif
  594. #ifdef Q_WS_MACX //for no nobody uses quartz, just putting in first level hooks
  595. #  ifndef QMAC_NO_QUARTZ
  596. #    define QMAC_NO_QUARTZ
  597. #  endif
  598. #endif
  599.  
  600. #ifndef QT_H
  601. #include <qfeatures.h>
  602. #endif // QT_H
  603.  
  604.  
  605. //
  606. // Create Qt DLL if QT_DLL is defined (Windows only)
  607. //
  608.  
  609. #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
  610. #  if defined(QT_NODLL)
  611. #    undef QT_MAKEDLL
  612. #    undef QT_DLL
  613. #  elif defined(QT_MAKEDLL) /* create a Qt DLL library */
  614. #    if defined(QT_DLL)
  615. #      undef QT_DLL
  616. #    endif
  617. #    define Q_EXPORT  __declspec(dllexport)
  618. #    define Q_TEMPLATEDLL
  619. #    undef  Q_DISABLE_COPY  /* avoid unresolved externals */
  620. #  elif defined(QT_DLL)       /* use a Qt DLL library */
  621. #    define Q_EXPORT  __declspec(dllimport)
  622. #    define Q_TEMPLATEDLL
  623. #    undef  Q_DISABLE_COPY  /* avoid unresolved externals */
  624. #  endif
  625. #else
  626. #  undef QT_MAKEDLL        /* ignore these for other platforms */
  627. #  undef QT_DLL
  628. #endif
  629.  
  630. #ifndef Q_EXPORT
  631. #  define Q_EXPORT
  632. #endif
  633.  
  634.  
  635. //
  636. // System information
  637. //
  638.  
  639. Q_EXPORT const char *qVersion();
  640. Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
  641. #if defined(Q_WS_WIN)
  642. Q_EXPORT int qWinVersion();
  643. #endif
  644.  
  645.  
  646. //
  647. // Avoid some particularly useless warnings from some stupid compilers.
  648. // To get ALL C++ compiler warnings, define QT_CC_WARNINGS or comment out
  649. // the line "#define QT_NO_WARNINGS"
  650. //
  651.  
  652. #if !defined(QT_CC_WARNINGS)
  653. #  define QT_NO_WARNINGS
  654. #endif
  655. #if defined(QT_NO_WARNINGS)
  656. #  if defined(Q_CC_MSVC)
  657. #    pragma warning(disable: 4244) // 'conversion' conversion from 'type1' to 'type2', possible loss of data
  658. #    pragma warning(disable: 4275) // non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
  659. #    pragma warning(disable: 4514) // unreferenced inline/local function has been removed
  660. #    pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning)
  661. #    pragma warning(disable: 4097) // typedef-name 'identifier1' used as synonym for class-name 'identifier2'
  662. #    pragma warning(disable: 4706) // assignment within conditional expression
  663. #    pragma warning(disable: 4786) // truncating debug info after 255 characters
  664. #    pragma warning(disable: 4660) // template-class specialization 'identifier' is already instantiated
  665. #    pragma warning(disable: 4355) // 'this' : used in base member initializer list
  666. #  elif defined(Q_CC_BOR)
  667. #    pragma option -w-inl
  668. #    pragma option -w-aus
  669. #    pragma warn -inl
  670. #    pragma warn -pia
  671. #    pragma warn -ccc
  672. #    pragma warn -rch
  673. #    pragma warn -sig
  674. #  elif defined(Q_CC_MWERKS)
  675. #    pragma warn_possunwant off
  676. #  endif
  677. #endif
  678.  
  679.  
  680. //
  681. // Use to avoid "unused parameter" warnings
  682. //
  683.  
  684. #define Q_UNUSED(x) (void)x;
  685.  
  686.  
  687. //
  688. // Debugging and error handling
  689. //
  690.  
  691. #if !defined(QT_NO_CHECK)
  692. #  define QT_CHECK_STATE             // check state of objects etc.
  693. #  define QT_CHECK_RANGE             // check range of indexes etc.
  694. #  define QT_CHECK_NULL             // check null pointers
  695. #  define QT_CHECK_MATH             // check math functions
  696. #endif
  697.  
  698. #if !defined(QT_NO_DEBUG) && !defined(QT_DEBUG)
  699. #  define QT_DEBUG              // display debug messages
  700. #  if !defined(QT_NO_COMPAT)
  701. // source compatibility with Qt 2.x
  702. #    if !defined(NO_DEBUG) && !defined(DEBUG)
  703. #      if !defined(Q_OS_MACX)            // clash with MacOS X headers
  704. #        define DEBUG
  705. #      endif
  706. #    endif
  707. #  endif
  708. #endif
  709.  
  710.  
  711. Q_EXPORT void qDebug( const char *, ... )   // print debug message
  712. #if defined(Q_CC_GNU) && !defined(__INSURE__)
  713.     __attribute__ ((format (printf, 1, 2)))
  714. #endif
  715. ;
  716.  
  717. Q_EXPORT void qWarning( const char *, ... ) // print warning message
  718. #if defined(Q_CC_GNU) && !defined(__INSURE__)
  719.     __attribute__ ((format (printf, 1, 2)))
  720. #endif
  721. ;
  722.  
  723. Q_EXPORT void qFatal( const char *, ... )   // print fatal message and exit
  724. #if defined(Q_CC_GNU)
  725.     __attribute__ ((format (printf, 1, 2)))
  726. #endif
  727. ;
  728.  
  729. Q_EXPORT void qSystemWarning( const char *, int code = -1 );
  730.  
  731. #if !defined(QT_CLEAN_NAMESPACE)
  732. // source compatibility with Qt 1.x
  733.  
  734. Q_EXPORT void debug( const char *, ... )    // print debug message
  735. #if defined(Q_CC_GNU) && !defined(__INSURE__)
  736.     __attribute__ ((format (printf, 1, 2)))
  737. #endif
  738. ;
  739.  
  740. Q_EXPORT void warning( const char *, ... )  // print warning message
  741. #if defined(Q_CC_GNU) && !defined(__INSURE__)
  742.     __attribute__ ((format (printf, 1, 2)))
  743. #endif
  744. ;
  745.  
  746. Q_EXPORT void fatal( const char *, ... )    // print fatal message and exit
  747. #if defined(Q_CC_GNU) && !defined(__INSURE__)
  748.     __attribute__ ((format (printf, 1, 2)))
  749. #endif
  750. ;
  751.  
  752. #endif // QT_CLEAN_NAMESPACE
  753.  
  754.  
  755. #if !defined(Q_ASSERT)
  756. #if defined(QT_CHECK_STATE)
  757. #if defined(QT_FATAL_ASSERT)
  758. #define Q_ASSERT(x)  ((x) ? (void)0 : qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
  759. #else
  760. #define Q_ASSERT(x)  ((x) ? (void)0 : qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__))
  761. #endif
  762. #else
  763. #define Q_ASSERT(x)
  764. #endif
  765. #endif
  766.  
  767. #if !defined(QT_NO_COMPAT)
  768. // source compatibility with Qt 2.x
  769. #ifndef Q_OS_TEMP
  770. #  if !defined(ASSERT)
  771. #    define ASSERT(x) Q_ASSERT(x)
  772. #  endif
  773. #endif // Q_OS_TEMP
  774. #endif // QT_NO_COMPAT
  775.  
  776.  
  777. Q_EXPORT bool qt_check_pointer( bool c, const char *, int );
  778.  
  779. #if defined(QT_CHECK_NULL)
  780. #  define Q_CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))
  781. #else
  782. #  define Q_CHECK_PTR(p)
  783. #endif
  784.  
  785. #if !defined(QT_NO_COMPAT)
  786. // source compatibility with Qt 2.x
  787. #  if !defined(CHECK_PTR)
  788. #    define CHECK_PTR(x) Q_CHECK_PTR(x)
  789. #  endif
  790. #endif // QT_NO_COMPAT
  791.  
  792.  
  793. enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
  794.  
  795. typedef void (*QtMsgHandler)(QtMsgType, const char *);
  796. Q_EXPORT QtMsgHandler qInstallMsgHandler( QtMsgHandler );
  797.  
  798. #if !defined(QT_NO_COMPAT)
  799. // source compatibility with Qt 2.x
  800. typedef QtMsgHandler msg_handler;
  801. #endif
  802.  
  803. Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );
  804.  
  805. Q_EXPORT void qObsolete( const char *obj, const char *oldfunc,
  806.            const char *newfunc );
  807. Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );
  808. Q_EXPORT void qObsolete( const char *message );
  809.  
  810. #endif // __cplusplus
  811.  
  812. #endif // QGLOBAL_H
  813.