Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/qtools/qglobal.h

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/****************************************************************************
2**
3**
4** Global type declarations and definitions
5**
6** Created : 920529
7**
8** Copyright (C) 1992-2000 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
42#define QT_VERSION223
43#define QT_VERSION_STR"2.2.3"
44
45
46//
47// The operating system, must be one of: (_OS_x_)
48//
49// MAC- Macintosh
50// MSDOS- MS-DOS and Windows
51// OS2- OS/2
52// OS2EMX- XFree86 on OS/2 (not PM)
53// WIN32- Win32 (Windows 95/98 and Windows NT)
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// IRIX- SGI Irix
63// OSF- OSF Unix
64// BSDI- BSDI Unix
65// SCO- SCO of some sort
66// AIX- AIX Unix
67// UNIXWARE- SCO UnixWare
68// GNU- GNU Hurd
69// DGUX- DG Unix
70// UNIX- Any UNIX bsd/sysv system
71//
72
73#if defined(__APPLE__) || defined(macintosh)
74#define _OS_MAC_
75# ifdef MAC_OS_X_VERSION_MIN_REQUIRED
76# undef MAC_OS_X_VERSION_MIN_REQUIRED
77# endif
78# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3
79# include <AvailabilityMacros.h>
80# if !defined(MAC_OS_X_VERSION_10_3)
81# define MAC_OS_X_VERSION_10_3 MAC_OS_X_VERSION_10_2 + 1
82# endif
83# if !defined(MAC_OS_X_VERSION_10_4)
84# define MAC_OS_X_VERSION_10_4 MAC_OS_X_VERSION_10_3 + 1
85# endif
86# if !defined(MAC_OS_X_VERSION_10_5)
87# define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1
88# endif
89# if !defined(MAC_OS_X_VERSION_10_6)
90# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1
91# endif
92# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6)
93# error "This version of Mac OS X is unsupported"
94# endif
95#elif defined(MSDOS) || defined(_MSDOS) || defined(__MSDOS__)
96#define _OS_MSDOS_
97#elif defined(OS2) || defined(_OS2) || defined(__OS2__)
98#if defined(__EMX__)
99#define _OS_OS2EMX_
100#else
101#define _OS_OS2_
102#endif
103#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
104#define _OS_WIN32_
105#elif defined(__MWERKS__) && defined(__INTEL__)
106#define _OS_WIN32_
107#elif defined(sun) || defined(__sun) || defined(__sun__)
108#if defined(__SVR4)
109#define _OS_SOLARIS_
110#else
111#define _OS_SUN_
112#endif
113#elif defined(hpux) || defined(__hpux) || defined(__hpux__)
114#define _OS_HPUX_
115#elif defined(ultrix) || defined(__ultrix) || defined(__ultrix__)
116#define _OS_ULTRIX_
117#elif defined(reliantunix)
118#define _OS_RELIANTUNIX_
119#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
120#define _OS_LINUX_
121#elif defined(__FreeBSD__)
122#define _OS_FREEBSD_
123#elif defined(__NetBSD__)
124#define _OS_NETBSD_
125#elif defined(__OpenBSD__)
126#define _OS_OPENBSD_
127#elif defined(sgi) || defined(__sgi)
128#define _OS_IRIX_
129#elif defined(__osf__)
130#define _OS_OSF_
131#elif defined(bsdi) || defined(__bsdi__)
132#define _OS_BSDI_
133#elif defined(_AIX)
134#define _OS_AIX_
135#elif defined(__Lynx__)
136#define _OS_LYNXOS_
137#elif defined(_UNIXWARE)
138#define _OS_UNIXWARE_
139#elif defined(DGUX)
140#define _OS_DGUX_
141#elif defined(__QNX__)
142#define _OS_QNX_
143#elif defined(_SCO_DS) || defined(M_UNIX) || defined(M_XENIX)
144#define _OS_SCO_
145#elif defined(sco) || defined(_UNIXWARE7)
146#define _OS_UNIXWARE7_
147#elif !defined(_SCO_DS) && defined(__USLC__) && defined(__SCO_VERSION__)
148#define _OS_UNIXWARE7_
149#elif defined(__CYGWIN__)
150#define _OS_CYGWIN_
151#elif defined(__BEOS__)
152#define _OS_BEOS_
153#elif defined(__MINT__)
154#define _OS_MINT_
155#else
156#error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
157#endif
158
159#if defined(_OS_MAC_) || defined(_OS_MSDOS_) || defined(_OS_OS2_) || defined(_OS_WIN32_)
160#undef_OS_UNIX_
161#elif !defined(_OS_UNIX_)
162#define _OS_UNIX_
163// QT_CLEAN_NAMESPACE is not defined by default; it would break too
164// much code.
165#if !defined(QT_CLEAN_NAMESPACE) && !defined(UNIX)
166// ### remove 3.0
167#define UNIX
168#endif
169#endif
170
171
172//
173// The compiler, must be one of: (_CC_x_)
174//
175// SYM- Symantec C++ for both PC and Macintosh
176// MPW- MPW C++
177// MWERKS- Metrowerks CodeWarrior
178// MSVC- Microsoft Visual C/C++
179// BOR- Borland/Turbo C++
180// WAT- Watcom C++
181// GNU- GNU C++
182// COMEAU- Comeau C++
183// EDG- Edison Design Group C++
184// OC- CenterLine C++
185// SUN- Sun C++
186// DEC- DEC C++
187// HP- HPUX C++
188// USLC- SCO UnixWare7 C++
189// CDS- Reliant C++
190// KAI- KAI C++
191//
192
193
194// Should be sorted most-authorative to least-authorative
195
196#if defined(__SC__)
197#define _CC_SYM_
198#elif defined( __KCC )
199#define _CC_KAI_
200#define _CC_EDG_
201#define Q_HAS_BOOL_TYPE
202#elif defined(applec)
203#define _CC_MPW_
204#elif defined(__MWERKS__)
205#define _CC_MWERKS_
206#define Q_HAS_BOOL_TYPE
207#elif defined(_MSC_VER)
208#define _CC_MSVC_
209#elif defined(__BORLANDC__) || defined(__TURBOC__)
210#define _CC_BOR_
211#elif defined(__WATCOMC__)
212#define _CC_WAT_
213#define Q_HAS_BOOL_TYPE
214#elif defined(__GNUC__)
215#define _CC_GNU_
216#if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
217#define Q_FULL_TEMPLATE_INSTANTIATION
218#define Q_TEMPLATE_NEEDS_CLASS_DECLARATION
219#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
220#define Q_SPURIOUS_NON_VOID_WARNING
221#endif
222#if __GNUC__ == 2 && __GNUC_MINOR__ >= 95
223#define Q_DELETING_VOID_UNDEFINED
224#endif
225#if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
226#define Q_PACKED __attribute__ ((packed))
227#endif
228#elif defined(__xlC__)
229#define _CC_XLC_
230#define Q_FULL_TEMPLATE_INSTANTIATION
231#if __xlC__ >= 0x400
232#define Q_HAS_BOOL_TYPE
233#endif
234#if __xlC__ <= 0x0306
235#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
236#endif
237#elif defined(como40)
238#define _CC_EDG_
239#define _CC_COMEAU_
240#define Q_HAS_BOOL_TYPE
241#define Q_C_CALLBACKS
242#elif defined(__USLC__)
243#define _CC_USLC_
244#ifdef __EDG__ // UnixWare7
245#define Q_HAS_BOOL_TYPE
246#endif
247#elif defined(__DECCXX)
248#define _CC_DEC_
249#if __DECCXX_VER >= 60060005
250#define Q_HAS_BOOL_TYPE
251#endif
252#elif defined(__EDG) || defined(__EDG__)
253// one observed on SGI DCC, the other documented
254#define _CC_EDG_
255#elif defined(OBJECTCENTER) || defined(CENTERLINE_CLPP)
256#define _CC_OC_
257#if defined(_BOOL)
258#define Q_HAS_BOOL_TYPE
259#endif
260#elif defined(__SUNPRO_CC)
261#define _CC_SUN_
262#if __SUNPRO_CC >= 0x500
263#define Q_HAS_BOOL_TYPE
264#define Q_C_CALLBACKS
265#endif
266#elif defined(__CDS__)
267#define _CC_CDS_
268#define Q_HAS_BOOL_TYPE
269#elif defined(_OS_HPUX_)
270// this test is from aCC online help
271#if defined(__HP_aCC) || __cplusplus >= 199707L
272// this is the aCC
273#define _CC_HP_ACC_
274#define Q_HAS_BOOL_TYPE
275#else
276// this is the CC
277#define _CC_HP_
278#define Q_FULL_TEMPLATE_INSTANTIATION
279#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
280#endif // __HP_aCC
281#else
282#error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
283#endif
284
285// detect Microsoft compiler version
286#ifdef _CC_MSVC_
287#if _MSC_VER >= 1400
288#define _CC_V2005
289#elif _MSC_VER >= 1310
290#define _CC_V2003
291#elif _MSC_VER > 1300
292#define _CC_V2002
293#else
294#define _CC_V1998
295#endif
296#endif
297
298#ifndef Q_PACKED
299#define Q_PACKED
300#endif
301
302// Window system setting
303
304#if defined(_OS_MAC_)
305#define _WS_MAC_
306#elif defined(_OS_MSDOS_)
307#define _WS_WIN16_
308#error "Qt requires Win32 and does not work with Windows 3.x"
309#elif defined(_WIN32_X11_)
310#define _WS_X11_
311#elif defined(_OS_WIN32_)
312#define _WS_WIN32_
313#elif defined(_OS_OS2_)
314#error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
315#elif defined(_OS_UNIX_)
316#ifdef QWS
317#define _WS_QWS_
318#else
319#define _WS_X11_
320#endif
321#endif
322
323#if defined(_WS_WIN16_) || defined(_WS_WIN32_)
324#define _WS_WIN_
325#endif
326
327
328//
329// Some classes do not permit copies to be made of an object.
330// These classes contains a private copy constructor and operator=
331// to disable copying (the compiler gives an error message).
332// Undefine Q_DISABLE_COPY to turn off this checking.
333//
334
335#define Q_DISABLE_COPY
336
337
338//
339// Useful type definitions for Qt
340//
341
342#if defined(bool)
343#define Q_HAS_BOOL_TYPE
344#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)
345#define Q_HAS_BOOL_TYPE
346#elif _MSC_VER >= 1100 || __BORLANDC__ >= 0x500
347#define Q_HAS_BOOL_TYPE
348#elif defined(sgi) && defined(_BOOL)
349#define Q_HAS_BOOL_TYPE
350#endif
351
352#if (QT_VERSION >= 300)
353#error "Use an enum for bool"
354#endif
355
356#if !defined(Q_HAS_BOOL_TYPE)
357#if defined(_CC_MSVC_)
358#define _CC_BOOL_DEF_
359#define boolint
360#else
361typedef intbool;
362#endif
363#endif
364
365typedef unsigned charuchar;
366typedef unsigned shortushort;
367typedef unsigneduint;
368typedef unsigned longulong;
369typedef char *pchar;
370typedef uchar *puchar;
371typedef const char *pcchar;
372#if defined(_OS_WIN32_) && !defined(_CC_GNU_)
373typedef __int64 int64;
374typedef unsigned __int64 uint64;
375#else
376typedef long long int64;
377typedef unsigned long long uint64;
378#endif
379
380
381//
382// Constant bool values
383//
384
385#ifndef TRUE
386const bool FALSE = 0;
387const bool TRUE = !0;
388#endif
389
390
391#if defined(_CC_MSVC_)
392// Workaround for static const members.
393#define QT_STATIC_CONST static
394#define QT_STATIC_CONST_IMPL
395#else
396#define QT_STATIC_CONST static const
397#define QT_STATIC_CONST_IMPL const
398#endif
399
400
401
402//
403// Utility macros and inline functions
404//
405
406#define QMAX(a,b)((a) > (b) ? (a) : (b))
407#define QMIN(a,b)((a) < (b) ? (a) : (b))
408#define QABS(a)((a) >= 0 ? (a) : -(a))
409
410inline int qRound( double d )
411{
412 return d > 0.0 ? int(d+0.5) : int(d-0.5);
413}
414
415
416//
417// Size-dependent types (architechture-dependent byte order)
418//
419
420// QT_CLEAN_NAMESPACE is not defined by default; it would break too
421// much code.
422#if !defined(QT_CLEAN_NAMESPACE)
423typedef signed charINT8;// 8 bit signed
424typedef unsigned charUINT8;// 8 bit unsigned
425typedef shortINT16;// 16 bit signed
426typedef unsigned shortUINT16;// 16 bit unsigned
427typedef intINT32;// 32 bit signed
428typedef unsigned intUINT32;// 32 bit unsigned
429#endif
430
431typedef signed charQ_INT8;// 8 bit signed
432typedef unsigned charQ_UINT8;// 8 bit unsigned
433typedef shortQ_INT16;// 16 bit signed
434typedef unsigned shortQ_UINT16;// 16 bit unsigned
435typedef intQ_INT32;// 32 bit signed
436typedef unsigned intQ_UINT32;// 32 bit unsigned
437typedef longQ_INT64;// up to 64 bit signed
438typedef unsigned longQ_UINT64;// up to 64 bit unsigned
439
440//
441// Data stream functions is provided by many classes (defined in qdatastream.h)
442//
443
444class QDataStream;
445
446
447
448#ifdef _WS_WIN_
449extern bool qt_winunicode;
450#endif
451
452#ifndef QT_H
453#include <qfeatures.h>
454#endif // QT_H
455
456//
457// Create Qt DLL if QT_DLL is defined (Windows only)
458//
459
460#if defined(_OS_WIN32_)
461#if defined(QT_NODLL)
462#undef QT_MAKEDLL
463#undef QT_DLL
464#endif
465#ifdef QT_DLL
466#if defined(QT_MAKEDLL)/* create a Qt DLL library */
467#undef QT_DLL
468#define Q_EXPORT __declspec(dllexport)
469#define Q_TEMPLATEDLL
470#undef Q_DISABLE_COPY/* avoid unresolved externals */
471#endif
472#endif
473#if defined(QT_DLL)/* use a Qt DLL library */
474#define Q_EXPORT __declspec(dllimport)
475#define Q_TEMPLATEDLL
476#undef Q_DISABLE_COPY/* avoid unresolved externals */
477#endif
478#else // ! _OS_WIN32_
479#undef QT_MAKEDLL/* ignore these for other platforms */
480#undef QT_DLL
481#endif
482
483#ifndef Q_EXPORT
484#define Q_EXPORT
485#endif
486
487//
488// System information
489//
490
491Q_EXPORT const char *qVersion();
492Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
493
494
495//
496// Debugging and error handling
497//
498
499#if !defined(NO_CHECK)
500#define CHECK_STATE// check state of objects etc.
501#define CHECK_RANGE// check range of indexes etc.
502#define CHECK_NULL// check null pointers
503#define CHECK_MATH// check math functions
504#endif
505
506#if !defined(NO_DEBUG) && !defined(DEBUG)
507#define DEBUG// display debug messages
508#endif
509
510//
511// Avoid some particularly useless warnings from some stupid compilers.
512// To get ALL C++ compiler warnings, define CC_WARNINGS or comment out
513// the line "#define Q_NO_WARNINGS"
514//
515
516#if !defined(CC_WARNINGS)
517#define Q_NO_WARNINGS
518#endif
519#if defined(Q_NO_WARNINGS)
520#if defined(_CC_MSVC_)
521#pragma warning(disable: 4244)
522#pragma warning(disable: 4275)
523#pragma warning(disable: 4514)
524#pragma warning(disable: 4800)
525#pragma warning(disable: 4097)
526#pragma warning(disable: 4706)
527#elif defined(_CC_BOR_)
528#pragma option -w-inl
529#pragma option -w-aus
530#pragma warn -inl
531#pragma warn -pia
532#pragma warn -ccc
533#pragma warn -rch
534#pragma warn -sig
535#elif defined(_CC_MWERKS_)
536#pragma warn_possunwant off
537#endif
538#endif // Q_NO_WARNINGS
539
540//
541// Avoid dead code
542//
543
544#if defined(_CC_EDG_) || defined(_CC_WAT_)
545#define Q_NO_DEAD_CODE
546#endif
547
548//
549// Use to avoid "unused parameter" warnings
550//
551
552#define Q_UNUSED(x) x=x;
553#define Q_CONST_UNUSED(x) (void)x;
554
555Q_EXPORT void qDebug( const char *, ... )// print debug message
556#if defined(_CC_GNU_) && !defined(__INSURE__)
557 __attribute__ ((format (printf, 1, 2)))
558#endif
559;
560
561Q_EXPORT void qWarning( const char *, ... )// print warning message
562#if defined(_CC_GNU_) && !defined(__INSURE__)
563 __attribute__ ((format (printf, 1, 2)))
564#endif
565;
566
567Q_EXPORT void qFatal( const char *, ... )// print fatal message and exit
568#if defined(_CC_GNU_)
569 __attribute__ ((format (printf, 1, 2)))
570#endif
571;
572
573
574// QT_CLEAN_NAMESPACE is not defined by default; it would break too
575// much code.
576#if !defined(QT_CLEAN_NAMESPACE)
577// in that case, also define the old ones...
578
579Q_EXPORT void debug( const char *, ... )// print debug message
580#if defined(_CC_GNU_) && !defined(__INSURE__)
581 __attribute__ ((format (printf, 1, 2)))
582#endif
583;
584
585Q_EXPORT void warning( const char *, ... )// print warning message
586#if defined(_CC_GNU_) && !defined(__INSURE__)
587 __attribute__ ((format (printf, 1, 2)))
588#endif
589;
590
591Q_EXPORT void fatal( const char *, ... )// print fatal message and exit
592#if defined(_CC_GNU_) && !defined(__INSURE__)
593 __attribute__ ((format (printf, 1, 2)))
594#endif
595;
596
597// okay, that was debug()/warning()/fatal()
598#endif
599
600#if !defined(ASSERT)
601#if defined(CHECK_STATE)
602#if defined(QT_FATAL_ASSERT)
603#define ASSERT(x) if ( !(x) )\
604qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)
605#else
606#define ASSERT(x) if ( !(x) )\
607qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)
608#endif
609#else
610#define ASSERT(x)
611#endif
612#endif
613
614Q_EXPORT bool qt_check_pointer( bool c, const char *, int );
615
616#if defined(CHECK_NULL)
617#define CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))
618#else
619#define CHECK_PTR(p)
620#endif
621
622enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
623
624typedef void (*msg_handler)(QtMsgType, const char *);
625Q_EXPORT msg_handler qInstallMsgHandler( msg_handler );
626
627
628Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );
629
630#if !defined(QT_REJECT_OBSOLETE)
631#define QT_OBSOLETE
632Q_EXPORT void qObsolete( const char *obj, const char *oldfunc,
633 const char *newfunc );
634Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );
635Q_EXPORT void qObsolete( const char *message );
636#endif
637
638// DvH: added to avoid warnings on recent gcc versions
639#define Q_DELETING_VOID_UNDEFINED
640
641#endif // QGLOBAL_H
642

Archive Download this file

Revision: 1322