Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
00001 /******************************************************************************** 00002 * * 00003 * F O X P r i v a t e I n c l u d e F i l e s * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2005 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: xincs.h,v 1.65 2005/01/28 23:07:35 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef XINCS_H 00025 #define XINCS_H 00026 00027 00028 //////////////////// DO NOT INCLUDE THIS PRIVATE HEADER FILE ////////////////// 00029 00030 // Thread safe 00031 #ifndef _POSIX_PTHREAD_SEMANTICS 00032 #define _POSIX_PTHREAD_SEMANTICS 00033 #endif 00034 00035 // GNU extras if we can get them 00036 #ifndef _GNU_SOURCE 00037 #define _GNU_SOURCE 00038 #endif 00039 00040 // Use 64-bit files 00041 #ifndef WIN32 00042 #ifndef _FILE_OFFSET_BITS 00043 #define _FILE_OFFSET_BITS 64 00044 #endif 00045 #endif 00046 00047 // Basic includes 00048 #include <stdio.h> 00049 #include <stdlib.h> 00050 #include <stdarg.h> 00051 #include <limits.h> 00052 #include <math.h> 00053 #include <float.h> 00054 #include <string.h> 00055 #include <errno.h> 00056 #include <signal.h> 00057 #include <time.h> 00058 #include <ctype.h> 00059 #include <locale.h> 00060 #include <fcntl.h> 00061 #include <sys/types.h> 00062 #include <sys/stat.h> 00063 00064 #ifndef WIN32 00065 00066 #include <grp.h> 00067 #include <pwd.h> 00068 #include <sys/ioctl.h> 00069 #ifdef HAVE_SYS_FILIO_H // Get FIONREAD on Solaris 00070 #include <sys/filio.h> 00071 #endif 00072 #else 00073 00074 #include <io.h> // For _access() 00075 #if defined(_MSC_VER) || defined(__WATCOMC__) // Microsoft Visual C++ or Watcom C++ 00076 #include <direct.h> 00077 #define stat _stat 00078 #define lstat _stat 00079 #define getcwd _getcwd 00080 #define mkdir _mkdir 00081 #define access _access 00082 #define vsnprintf _vsnprintf 00083 #define execl _execl 00084 #define execlp _execlp 00085 #define execle _execle 00086 #define execv _execv 00087 #define execve _execve 00088 #define execvp _execvp 00089 #define strdup _strdup 00090 #endif 00091 #ifdef __BORLANDC__ // Borland C++ Builder 00092 #include <dir.h> 00093 #if __BORLANDC__ <= 0x0530 // C++ Builder 3.0 00094 #define vsnprintf(a, b, c, d) vsprintf(a, c, d) 00095 #endif 00096 #define lstat stat 00097 #endif 00098 #ifdef __MINGW32__ // GCC MingW32 00099 #include <direct.h> 00100 #define vsnprintf _vsnprintf 00101 #endif 00102 #ifdef __SC__ // Digital Mars C++ Compiler 00103 #include <direct.h> 00104 #include <io.h> // For _access() 00105 #define vsnprintf _vsnprintf 00106 #endif 00107 00108 #endif 00109 00110 #ifdef HAVE_UNISTD_H 00111 #include <unistd.h> 00112 #endif 00113 #ifdef HAVE_SYS_WAIT_H 00114 #include <sys/wait.h> 00115 #endif 00116 #ifdef TIME_WITH_SYS_TIME 00117 #include <sys/time.h> 00118 #include <time.h> 00119 #else 00120 #ifdef HAVE_SYS_TIME_H 00121 #include <sys/time.h> 00122 #else 00123 #include <time.h> 00124 #endif 00125 #endif 00126 #ifdef HAVE_SYS_PARAM_H 00127 #include <sys/param.h> 00128 #endif 00129 #ifdef HAVE_SYS_SELECT_H 00130 #if (!defined(__MINGW32__)) && (!defined(hpux)) 00131 #include <sys/select.h> 00132 #endif 00133 #endif 00134 #ifdef HAVE_DIRENT_H 00135 #include <dirent.h> 00136 #define NAMLEN(dirent) strlen((dirent)->d_name) 00137 #else 00138 #define dirent direct 00139 #define NAMLEN(dirent) (dirent)->d_namlen 00140 #ifdef HAVE_SYS_NDIR_H 00141 #include <sys/ndir.h> 00142 #endif 00143 #ifdef HAVE_SYS_DIR_H 00144 #include <sys/dir.h> 00145 #endif 00146 #ifdef HAVE_NDIR_H 00147 #include <ndir.h> 00148 #endif 00149 #endif 00150 #ifdef HAVE_XSHM_H 00151 #include <sys/ipc.h> 00152 #include <sys/shm.h> 00153 #endif 00154 #ifdef HAVE_MMAP 00155 #include <sys/mman.h> 00156 #endif 00157 00158 00159 // For thread-safe readdir_r, we sometimes need extra 00160 // space above and beyond the space for dirent itself 00161 #ifdef HAVE_DIRENT_H 00162 #ifndef WIN32 00163 struct fxdirent : dirent { 00164 char buffer[256]; 00165 }; 00166 #endif 00167 #endif 00168 00169 00170 // MS-Windows 00171 #ifdef WIN32 00172 #ifndef STRICT 00173 #define STRICT 00174 #endif 00175 #ifndef WIN32_LEAN_AND_MEAN 00176 #define WIN32_LEAN_AND_MEAN 00177 #endif 00178 #include <windows.h> 00179 #ifndef __CYGWIN__ 00180 #include <winsock2.h> 00181 #endif 00182 #include <commctrl.h> // For _TrackMouseEvent 00183 00184 // X windows includes 00185 #else 00186 #include <X11/X.h> 00187 #include <X11/Xlib.h> 00188 #include <X11/Xcms.h> 00189 #include <X11/Xutil.h> 00190 #include <X11/Xresource.h> 00191 #include <X11/Xatom.h> 00192 #include <X11/cursorfont.h> 00193 #ifdef HUMMINGBIRD 00194 #include <X11/XlibXtra.h> 00195 #endif 00196 #ifdef HAVE_XSHM_H 00197 #include <X11/extensions/XShm.h> 00198 #endif 00199 #ifdef HAVE_XCURSOR_H 00200 #include <X11/Xcursor/Xcursor.h> 00201 #endif 00202 #ifdef HAVE_XFT_H 00203 #include <X11/Xft/Xft.h> 00204 #endif 00205 #ifdef HAVE_XSHAPE_H 00206 #include <X11/extensions/shape.h> 00207 #endif 00208 #ifdef HAVE_XRANDR_H 00209 #include <X11/extensions/Xrandr.h> 00210 #endif 00211 #ifndef XlibSpecificationRelease // Not defined until X11R5 00212 #define NO_XIM 00213 #elif XlibSpecificationRelease < 6 // Need at least Xlib X11R6 00214 #define NO_XIM 00215 #endif 00216 #endif 00217 00218 00219 // OpenGL includes 00220 #ifdef HAVE_GL_H 00221 #ifndef SUN_OGL_NO_VERTEX_MACROS 00222 #define SUN_OGL_NO_VERTEX_MACROS 00223 #endif 00224 #ifndef HPOGL_SUPPRESS_FAST_API 00225 #define HPOGL_SUPPRESS_FAST_API 00226 #endif 00227 #include <GL/gl.h> 00228 #ifndef WIN32 00229 #include <GL/glx.h> 00230 #endif 00231 #endif 00232 #ifndef GLAPIENTRY 00233 #define GLAPIENTRY 00234 #endif 00235 #ifndef GLAPI 00236 #define GLAPI 00237 #endif 00238 #ifdef HAVE_GLU_H 00239 #include <GL/glu.h> 00240 #endif 00241 00242 // Maximum path length 00243 #ifndef MAXPATHLEN 00244 #if defined(PATH_MAX) 00245 #define MAXPATHLEN PATH_MAX 00246 #elif defined(_MAX_PATH) 00247 #define MAXPATHLEN _MAX_PATH 00248 #elif defined(MAX_PATH) 00249 #define MAXPATHLEN MAX_PATH 00250 #else 00251 #define MAXPATHLEN 1024 00252 #endif 00253 #endif 00254 00255 // Modes for access(filename,mode) on Windows 00256 #ifdef WIN32 00257 #ifndef R_OK 00258 #define R_OK 4 00259 #endif 00260 #ifndef W_OK 00261 #define W_OK 2 00262 #endif 00263 #ifndef X_OK 00264 #define X_OK 1 00265 #endif 00266 #ifndef F_OK 00267 #define F_OK 0 00268 #endif 00269 #endif 00270 00271 // File open modes on Windows 00272 #ifdef WIN32 00273 #if defined(_MSC_VER) 00274 #define O_APPEND _O_APPEND 00275 #define O_CREAT _O_CREAT 00276 #define O_EXCL _O_EXCL 00277 #define O_RDONLY _O_RDONLY 00278 #define O_RDWR _O_RDWR 00279 #define O_TRUNC _O_TRUNC 00280 #define O_WRONLY _O_WRONLY 00281 #define O_BINARY _O_BINARY 00282 #endif 00283 #endif 00284 00285 // Some systems don't have it 00286 #ifndef SEEK_SET 00287 #define SEEK_SET 0 00288 #endif 00289 #ifndef SEEK_CUR 00290 #define SEEK_CUR 1 00291 #endif 00292 #ifndef SEEK_END 00293 #define SEEK_END 2 00294 #endif 00295 00296 // Printer stuff 00297 #ifdef WIN32 00298 #include <winspool.h> 00299 #endif 00300 00301 00302 // Wheel support (OS >= W98, OS>=NT4.0) 00303 #ifdef WIN32 00304 00305 // Missing wheel message id's 00306 #ifndef SPI_GETWHEELSCROLLLINES 00307 #define SPI_GETWHEELSCROLLLINES 104 00308 #endif 00309 #ifndef WM_MOUSEWHEEL 00310 #define WM_MOUSEWHEEL 0x020A 00311 #endif 00312 00313 // GetSystemMetrics parameters missing in header files 00314 #ifndef SM_XVIRTUALSCREEN 00315 #define SM_XVIRTUALSCREEN 76 00316 #endif 00317 #ifndef SM_YVIRTUALSCREEN 00318 #define SM_YVIRTUALSCREEN 77 00319 #endif 00320 #ifndef SM_CXVIRTUALSCREEN 00321 #define SM_CXVIRTUALSCREEN 78 00322 #endif 00323 #ifndef SM_CYVIRTUALSCREEN 00324 #define SM_CYVIRTUALSCREEN 79 00325 #endif 00326 #ifndef SM_CMONITORS 00327 #define SM_CMONITORS 80 00328 #endif 00329 #ifndef SM_SAMEDISPLAYFORMAT 00330 #define SM_SAMEDISPLAYFORMAT 81 00331 #endif 00332 00333 // Missing in CYGWIN 00334 #ifndef IMAGE_SUBSYSTEM_NATIVE_WINDOWS 00335 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 00336 #endif 00337 #ifndef IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 00338 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 00339 #endif 00340 #endif 00341 00342 00343 // IBM VisualAge for C++ 3.5 00344 #if defined(__IBMCPP__) && defined(WIN32) 00345 #include <direct.h> 00346 #include <io.h> // for _access() 00347 #define _mkdir(x) mkdir((char *)(x)) 00348 #define _vsnprintf(a, b, c, d) vsprintf(a, c, d) 00349 #define ICON_SMALL 0 00350 #define ICON_BIG 1 00351 #define bool int 00352 00353 // This declarations come from Microsoft SDK 00354 #define TME_HOVER 0x00000001 00355 #define TME_LEAVE 0x00000002 00356 #define TME_QUERY 0x40000000 00357 #define TME_CANCEL 0x80000000 00358 #define HOVER_DEFAULT 0xFFFFFFFF 00359 #define WM_MOUSEHOVER 0x02A1 00360 #define WM_MOUSELEAVE 0x02A3 00361 00362 typedef struct tagTRACKMOUSEEVENT { 00363 DWORD cbSize; 00364 DWORD dwFlags; 00365 HWND hwndTrack; 00366 DWORD dwHoverTime; 00367 } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT; 00368 00369 WINUSERAPI 00370 BOOL 00371 WINAPI 00372 TrackMouseEvent( 00373 IN OUT LPTRACKMOUSEEVENT lpEventTrack); 00374 00375 #ifdef __GL_H__ 00376 #define GL_COLOR_LOGIC_OP 0x0BF2 00377 #define GL_POLYGON_OFFSET_POINT 0x2A01 00378 #define GL_POLYGON_OFFSET_LINE 0x2A02 00379 WINGDIAPI void APIENTRY glPolygonOffset (GLfloat factor,GLfloat units); 00380 #endif 00381 00382 #endif 00383 00384 #endif
Copyright © 1997-2005 Jeroen van der Zijp |