Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qt_x11_p.h 3.3.8 edited Jan 11 14:38 $ 00003 ** 00004 ** Includes X11 system header files. 00005 ** 00006 ** Created : 981123 00007 ** 00008 ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. 00009 ** 00010 ** This file is part of the kernel 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 for Unix/X11 may use this file in accordance with the Qt Commercial 00023 ** License 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 QT_X11_H 00039 #define QT_X11_H 00040 00041 00042 // 00043 // W A R N I N G 00044 // ------------- 00045 // 00046 // This file is not part of the Qt API. It exists for the convenience 00047 // of q*_x11.cpp. This header file may change from version to version 00048 // without notice, or even be removed. 00049 // 00050 // 00051 00052 00053 #ifndef QT_H 00054 #include "qwindowdefs.h" 00055 #endif // QT_H 00056 00057 // the following is necessary to work around breakage in many versions 00058 // of XFree86's Xlib.h still in use 00059 // ### which versions? 00060 #if defined(_XLIB_H_) // crude hack, but... 00061 #error "cannot include <X11/Xlib.h> before this file" 00062 #endif 00063 #define XRegisterIMInstantiateCallback qt_XRegisterIMInstantiateCallback 00064 #define XUnregisterIMInstantiateCallback qt_XUnregisterIMInstantiateCallback 00065 #define XSetIMValues qt_XSetIMValues 00066 #include <X11/Xlib.h> 00067 #undef XRegisterIMInstantiateCallback 00068 #undef XUnregisterIMInstantiateCallback 00069 #undef XSetIMValues 00070 00071 #include <X11/Xutil.h> 00072 // don't include Xos.h to avoid duplicated symbols gettimeofday 00073 #ifndef Q_OS_CYGWIN 00074 #include <X11/Xos.h> 00075 #endif 00076 #include <X11/Xatom.h> 00077 00078 00079 //#define QT_NO_SHAPE 00080 #ifdef QT_NO_SHAPE 00081 #define XShapeCombineRegion(a,b,c,d,e,f,g) 00082 #define XShapeCombineMask(a,b,c,d,e,f,g) 00083 #else 00084 #include <X11/extensions/shape.h> 00085 #endif // QT_NO_SHAPE 00086 00087 00088 // the wacom tablet (currently just the IRIX version) 00089 #if defined (QT_TABLET_SUPPORT) 00090 # include <X11/extensions/XInput.h> 00091 #if defined (Q_OS_IRIX) 00092 # include <wacom.h> // wacom driver defines for IRIX (quite handy) 00093 #endif 00094 #endif // QT_TABLET_SUPPORT 00095 00096 00097 // #define QT_NO_XINERAMA 00098 #ifndef QT_NO_XINERAMA 00099 # if 0 // ### Xsun, but how to detect it? 00100 // Xinerama is only supported in Solaris 7 with patches 107648/108376 and 00101 // Solaris 8 or above which introduce the X11R6.4 Xserver. 00102 // To switch the Xinerama functionality on, you need to add the "+xinerama" 00103 // argument to the Xsun start line. 00104 // At least Solaris 7 and 8 are missing Xinerama system headers and function 00105 // declarations (bug 4284701). 00106 // The Xinerama API is not documented. In theory it could change but it 00107 // probably won't because Sun are using it in at least dtlogin (bug 4221829). 00108 extern "C" Bool XPanoramiXQueryExtension( 00109 Display*, 00110 int*, 00111 int* 00112 ); 00113 extern "C" Status XPanoramiXQueryVersion( 00114 Display*, 00115 int*, 00116 int* 00117 ); 00118 extern "C" Status XPanoramiXGetState( 00119 Display*, 00120 Drawable, 00121 XPanoramiXInfo* 00122 ); 00123 extern "C" Status XPanoramiXGetScreenCount( 00124 Display *, 00125 Drawable, 00126 XPanoramiXInfo* 00127 ); 00128 extern "C" Status XPanoramiXGetScreenSize( 00129 Display*, 00130 Drawable, 00131 int, 00132 XPanoramiXInfo* 00133 ); 00134 # else // XFree86 00135 // XFree86 does not C++ify Xinerama (at least up to XFree86 4.0.3). 00136 extern "C" { 00137 # include <X11/extensions/Xinerama.h> 00138 } 00139 # endif 00140 #endif // QT_NO_XINERAMA 00141 00142 // #define QT_NO_XRANDR 00143 #ifndef QT_NO_XRANDR 00144 # include <X11/extensions/Xrandr.h> 00145 #endif // QT_NO_XRANDR 00146 00147 // #define QT_NO_XRENDER 00148 #ifndef QT_NO_XRENDER 00149 # include <X11/extensions/Xrender.h> 00150 // #define QT_NO_XFTFREETYPE 00151 # ifndef QT_NO_XFTFREETYPE 00152 // This hacks around the freetype poeple putting an #error into freetype.h in 2.1.7, making 00153 // it impossible to use an updated freetype with older Xft header files. 00154 # include <ft2build.h> 00155 # ifdef QT_USE_XFT2_HEADER 00156 # include <X11/Xft/Xft2.h> 00157 # else 00158 # include <X11/Xft/Xft.h> 00159 # endif // QT_USE_XFT2_HEADER 00160 # if defined(XFT_VERSION) && XFT_VERSION >= 20000 00161 # define QT_XFT2 00162 # else 00163 # include <X11/Xft/XftFreetype.h> 00164 // Xft1 doesn't have these functions, so we implement them in qtaddons_x11.cpp 00165 extern "C" { 00166 Qt::HANDLE XftDrawPicture( XftDraw * ); 00167 void XftDrawSetClipRectangles(XftDraw *, int, int, XRectangle *, int); 00168 void XftDrawSetSubwindowMode(XftDraw *, int); 00169 } 00170 # endif // XFT_VERSION 00171 # endif // QT_NO_XFTFREETYPE 00172 #else 00173 // make sure QT_NO_XFTFREETYPE is defined if QT_NO_XRENDER is defined 00174 # ifndef QT_NO_XFTFREETYPE 00175 # define QT_NO_XFTFREETYPE 00176 # endif 00177 #endif // QT_NO_XRENDER 00178 00179 00180 #ifndef QT_NO_XKB 00181 # include <X11/XKBlib.h> 00182 #endif // QT_NO_XKB 00183 00184 00185 #if !defined(XlibSpecificationRelease) 00186 # define X11R4 00187 typedef char *XPointer; 00188 #else 00189 # undef X11R4 00190 #endif 00191 00192 // #define QT_NO_XIM 00193 #if defined(X11R4) 00194 // X11R4 does not have XIM 00195 #define QT_NO_XIM 00196 #elif defined(Q_OS_OSF) && (XlibSpecificationRelease < 6) 00197 // broken in Xlib up to OSF/1 3.2 00198 #define QT_NO_XIM 00199 #elif defined(Q_OS_AIX) 00200 // broken in Xlib up to what version of AIX? 00201 #define QT_NO_XIM 00202 #elif defined(QT_NO_DEBUG) && defined(Q_OS_IRIX) 00203 // XmbLookupString broken on IRIX 00204 // XCreateIC broken when compiling -64 on IRIX 6.5.2 00205 #define QT_NO_XIM 00206 #elif defined(Q_OS_HPUX) && defined(__LP64__) 00207 // XCreateIC broken when compiling 64-bit ELF on HP-UX 11.0 00208 #define QT_NO_XIM 00209 #elif defined(Q_OS_SCO) 00210 // ### suggested by user... 00211 // ### #define QT_NO_XIM 00212 #endif // QT_NO_XIM 00213 00214 00215 /* 00216 * Solaris patch 108652-47 and higher fixes crases in 00217 * XRegisterIMInstantiateCallback, but the function doesn't seem to 00218 * work. 00219 * 00220 * Instead, we disabled R6 input, and open the input method 00221 * immediately at application start. 00222 */ 00223 #if !defined(QT_NO_XIM) && (XlibSpecificationRelease >= 6) && \ 00224 !defined(Q_OS_SOLARIS) 00225 #define USE_X11R6_XIM 00226 00227 //######### XFree86 has wrong declarations for XRegisterIMInstantiateCallback 00228 //######### and XUnregisterIMInstantiateCallback in at least version 3.3.2. 00229 //######### Many old X11R6 header files lack XSetIMValues. 00230 //######### Therefore, we have to declare these functions ourselves. 00231 00232 extern "C" Bool XRegisterIMInstantiateCallback( 00233 Display*, 00234 struct _XrmHashBucketRec*, 00235 char*, 00236 char*, 00237 XIMProc, //XFree86 has XIDProc, which has to be wrong 00238 XPointer 00239 ); 00240 00241 extern "C" Bool XUnregisterIMInstantiateCallback( 00242 Display*, 00243 struct _XrmHashBucketRec*, 00244 char*, 00245 char*, 00246 XIMProc, //XFree86 has XIDProc, which has to be wrong 00247 XPointer 00248 ); 00249 00250 extern "C" char *XSetIMValues( XIM /* im */, ... ); 00251 00252 #endif 00253 00254 #ifndef QT_NO_XIM 00255 // some platforms (eg. Solaris 2.51) don't have these defines in Xlib.h 00256 #ifndef XNResetState 00257 #define XNResetState "resetState" 00258 #endif 00259 #ifndef XIMPreserveState 00260 #define XIMPreserveState (1L<<1) 00261 #endif 00262 #endif 00263 00264 00265 #ifndef X11R4 00266 # include <X11/Xlocale.h> 00267 #endif // X11R4 00268 00269 00270 #ifdef QT_MITSHM 00271 # include <X11/extensions/XShm.h> 00272 #endif // QT_MITSHM 00273 00274 00275 #endif // QT_X11_H