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

  1. /****************************************************************************
  2. ** $Id$
  3. **
  4. ** Includes X11 system header files.
  5. **
  6. ** Created : 981123
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the kernel 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 for Unix/X11 may use this file in accordance with the Qt Commercial
  23. ** License 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 QT_X11_H
  39. #define QT_X11_H
  40.  
  41.  
  42. //
  43. //  W A R N I N G
  44. //  -------------
  45. //
  46. // This file is not part of the Qt API.  It exists for the convenience
  47. // of q*_x11.cpp.  This header file may change from version to version
  48. // without notice, or even be removed.
  49. //
  50. //
  51.  
  52.  
  53. #include "qwindowdefs.h"
  54.  
  55. // the following is necessary to work around breakage in many versions
  56. // of XFree86's Xlib.h still in use
  57. // ### which versions?
  58. #if defined(_XLIB_H_) // crude hack, but...
  59. #error "cannot include <X11/Xlib.h> before this file"
  60. #endif
  61. #define XRegisterIMInstantiateCallback qt_XRegisterIMInstantiateCallback
  62. #define XUnregisterIMInstantiateCallback qt_XUnregisterIMInstantiateCallback
  63. #define XSetIMValues qt_XSetIMValues
  64. #include <X11/Xlib.h>
  65. #undef XRegisterIMInstantiateCallback
  66. #undef XUnregisterIMInstantiateCallback
  67. #undef XSetIMValues
  68.  
  69. #include <X11/Xutil.h>
  70. #include <X11/Xos.h>
  71. #include <X11/Xatom.h>
  72.  
  73.  
  74. //#define QT_NO_SHAPE
  75. #ifdef QT_NO_SHAPE
  76. #define XShapeCombineRegion(a,b,c,d,e,f,g)
  77. #define XShapeCombineMask(a,b,c,d,e,f,g)
  78. #else
  79. #include <X11/extensions/shape.h>
  80. #endif // QT_NO_SHAPE
  81.  
  82.  
  83. // the wacom tablet (currently just the IRIX version)
  84. #if defined (QT_TABLET_SUPPORT)
  85. #  include <X11/extensions/XInput.h>
  86. #  include <wacom.h>  // wacom driver defines for IRIX (quite handy)
  87. #endif // QT_TABLET_SUPPORT
  88.  
  89.  
  90. // #define QT_NO_XINERAMA
  91. #ifndef QT_NO_XINERAMA
  92. #  if 0 // ### Xsun, but how to detect it?
  93. // Xinerama is only supported in Solaris 7 with patches 107648/108376 and
  94. // Solaris 8 or above which introduce the X11R6.4 Xserver.
  95. // To switch the Xinerama functionality on, you need to add the "+xinerama"
  96. // argument to the Xsun start line.
  97. // At least Solaris 7 and 8 are missing Xinerama system headers and function
  98. // declarations (bug 4284701).
  99. // The Xinerama API is not documented. In theory it could change but it
  100. // probably won't because Sun are using it in at least dtlogin (bug 4221829).
  101. extern "C" Bool XPanoramiXQueryExtension(
  102.     Display*,
  103.     int*,
  104.     int*
  105. );
  106. extern "C" Status XPanoramiXQueryVersion(
  107.     Display*,
  108.     int*,
  109.     int*
  110. );
  111. extern "C" Status XPanoramiXGetState(
  112.     Display*,
  113.     Drawable,
  114.     XPanoramiXInfo*
  115. );
  116. extern "C" Status XPanoramiXGetScreenCount(
  117.     Display *,
  118.     Drawable,
  119.     XPanoramiXInfo*
  120. );
  121. extern "C" Status XPanoramiXGetScreenSize(
  122.     Display*,
  123.     Drawable,
  124.     int,
  125.     XPanoramiXInfo*
  126. );
  127. #  else // XFree86
  128. // XFree86 does not C++ify Xinerama (at least up to XFree86 4.0.3).
  129. extern "C" {
  130. #    include <X11/extensions/Xinerama.h>
  131. }
  132. #  endif
  133. #endif // QT_NO_XINERAMA
  134.  
  135.  
  136. // #define QT_NO_XRENDER
  137. #ifndef QT_NO_XRENDER
  138. #  include <X11/extensions/Xrender.h>
  139. // #define QT_NO_XFTFREETYPE
  140. #  ifndef QT_NO_XFTFREETYPE
  141. #    include <X11/Xft/XftFreetype.h>
  142. #  endif // QT_NO_XFTFREETYPE
  143. #else
  144. // make sure QT_NO_XFTTREETYPE is defined if QT_NO_XRENDER is defined
  145. #  ifndef QT_NO_XFTFREETYPE
  146. #    define QT_NO_XFTFREETYPE
  147. #  endif
  148. #endif // QT_NO_XRENDER
  149.  
  150.  
  151. #ifndef QT_NO_XKB
  152. #  include <X11/XKBlib.h>
  153. #endif // QT_NO_XKB
  154.  
  155.  
  156. #if !defined(XlibSpecificationRelease)
  157. #  define X11R4
  158. typedef char *XPointer;
  159. #else
  160. #  undef X11R4
  161. #endif
  162.  
  163. // #define QT_NO_XIM
  164. #if defined(X11R4)
  165. // X11R4 does not have XIM
  166. #define QT_NO_XIM
  167. #elif defined(Q_OS_OSF) && (XlibSpecificationRelease < 6)
  168. // broken in Xlib up to OSF/1 3.2
  169. #define QT_NO_XIM
  170. #elif defined(Q_OS_AIX)
  171. // broken in Xlib up to what version of AIX?
  172. #define QT_NO_XIM
  173. #elif defined(Q_OS_SOLARIS)
  174. // XRegisterIMInstantiateCallback broken under "C" locale on Solaris
  175. #define QT_NO_XIM
  176. #elif defined(QT_NO_DEBUG) && defined(Q_OS_IRIX) && defined(Q_CC_EDG)
  177. // XCreateIC broken when compiling -64 on IRIX 6.5.2
  178. #define QT_NO_XIM
  179. #elif defined(Q_OS_HPUX) && defined(__LP64__)
  180. // XCreateIC broken when compiling 64-bit ELF on HP-UX 11.0
  181. #define QT_NO_XIM
  182. #endif // QT_NO_XIM
  183.  
  184.  
  185. #if !defined(QT_NO_XIM) && (XlibSpecificationRelease >= 6)
  186. #define USE_X11R6_XIM
  187.  
  188. //######### XFree86 has wrong declarations for XRegisterIMInstantiateCallback
  189. //######### and XUnregisterIMInstantiateCallback in at least version 3.3.2.
  190. //######### Many old X11R6 header files lack XSetIMValues.
  191. //######### Therefore, we have to declare these functions ourselves.
  192.  
  193. extern "C" Bool XRegisterIMInstantiateCallback(
  194.     Display*,
  195.     struct _XrmHashBucketRec*,
  196.     char*,
  197.     char*,
  198.     XIMProc, //XFree86 has XIDProc, which has to be wrong
  199.     XPointer
  200. );
  201.  
  202. extern "C" Bool XUnregisterIMInstantiateCallback(
  203.     Display*,
  204.     struct _XrmHashBucketRec*,
  205.     char*,
  206.     char*,
  207.     XIMProc, //XFree86 has XIDProc, which has to be wrong
  208.     XPointer
  209. );
  210.  
  211. extern "C" char *XSetIMValues( XIM /* im */, ... );
  212.  
  213. #endif
  214.  
  215.  
  216. #ifndef X11R4
  217. #  include <X11/Xlocale.h>
  218. #endif // X11R4
  219.  
  220.  
  221. #ifdef QT_MITSHM
  222. #  include <X11/extensions/XShm.h>
  223. #endif // QT_MITSHM
  224.  
  225.  
  226. #endif // QT_X11_H
  227.