Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

xincs.h

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,2004 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.56 2004/02/08 17:17:34 fox Exp $                             *
00023 ********************************************************************************/
00024 #ifndef XINCS_H
00025 #define XINCS_H
00026 
00027 
00028 ////////////////////  DO NOT INCLUDE THIS PRIVATE HEADER FILE  //////////////////
00029 
00030 
00031 // Basic includes
00032 #include <stdio.h>
00033 #include <stdlib.h>
00034 #include <stdarg.h>
00035 #include <limits.h>
00036 #include <math.h>
00037 #include <float.h>
00038 #include <string.h>
00039 #include <errno.h>
00040 #include <signal.h>
00041 #include <time.h>
00042 #include <ctype.h>
00043 #include <locale.h>
00044 #include <fcntl.h>
00045 #include <sys/types.h>
00046 #include <sys/stat.h>
00047 
00048 #ifndef WIN32
00049 
00050 #include <grp.h>
00051 #include <pwd.h>
00052 
00053 #else
00054 
00055 #include <io.h>             // for _access()
00056 #if defined(_MSC_VER) || defined(__WATCOMC__)   // Microsoft Visual C++ or Watcom C++
00057 #include <direct.h>
00058 #define stat _stat
00059 #define lstat _stat
00060 #define getcwd _getcwd
00061 #define mkdir _mkdir
00062 #define access _access
00063 #define vsnprintf _vsnprintf
00064 #define execl _execl
00065 #define execlp _execlp
00066 #define execle _execle
00067 #define execv _execv
00068 #define execve _execve
00069 #define execvp _execvp
00070 #define strdup _strdup
00071 #endif
00072 #ifdef __BORLANDC__         // Borland C++ Builder
00073 #include <dir.h>
00074 #if __BORLANDC__ <= 0x0530  // C++ Builder 3.0
00075 #define vsnprintf(a, b, c, d) vsprintf(a, c, d)
00076 #endif
00077 #define lstat stat
00078 #endif
00079 #ifdef __MINGW32__          // GCC MingW32
00080 #include <direct.h>
00081 #define vsnprintf _vsnprintf
00082 #endif
00083 #ifdef __SC__               // Digital Mars C++ Compiler
00084 #include <direct.h>
00085 #include <io.h>             // for _access()
00086 #define vsnprintf _vsnprintf
00087 #endif
00088 
00089 #endif
00090 
00091 #ifdef HAVE_UNISTD_H
00092 #include <unistd.h>
00093 #endif
00094 #ifdef HAVE_SYS_WAIT_H
00095 #include <sys/wait.h>
00096 #endif
00097 #ifdef TIME_WITH_SYS_TIME
00098 #include <sys/time.h>
00099 #include <time.h>
00100 #else
00101 #ifdef HAVE_SYS_TIME_H
00102 #include <sys/time.h>
00103 #else
00104 #include <time.h>
00105 #endif
00106 #endif
00107 #ifdef HAVE_SYS_PARAM_H
00108 #include <sys/param.h>
00109 #endif
00110 #ifdef HAVE_SYS_SELECT_H
00111 #if (!defined(__MINGW32__)) && (!defined(hpux))
00112 #include <sys/select.h>
00113 #endif
00114 #endif
00115 #ifdef HAVE_DIRENT_H
00116 #include <dirent.h>
00117 #define NAMLEN(dirent) strlen((dirent)->d_name)
00118 #else
00119 #define dirent direct
00120 #define NAMLEN(dirent) (dirent)->d_namlen
00121 #ifdef HAVE_SYS_NDIR_H
00122 #include <sys/ndir.h>
00123 #endif
00124 #ifdef HAVE_SYS_DIR_H
00125 #include <sys/dir.h>
00126 #endif
00127 #ifdef HAVE_NDIR_H
00128 #include <ndir.h>
00129 #endif
00130 #endif
00131 #ifdef HAVE_XSHM_H
00132 #include <sys/ipc.h>
00133 #include <sys/shm.h>
00134 #endif
00135 
00136 
00137 // For thread-safe readdir_r, we sometimes need extra
00138 // space above and beyond the space for dirent itself
00139 #ifdef HAVE_DIRENT_H
00140 #ifndef WIN32
00141 struct fxdirent : dirent {
00142   char buffer[256];
00143   };
00144 #endif
00145 #endif
00146 
00147 
00148 // MS-Windows
00149 #ifdef WIN32
00150 #ifndef STRICT
00151 #define STRICT
00152 #endif
00153 #ifndef WIN32_LEAN_AND_MEAN
00154 #define WIN32_LEAN_AND_MEAN
00155 #endif
00156 #include <windows.h>
00157 #ifndef __CYGWIN__
00158 #include <winsock2.h>
00159 #endif
00160 #include <commctrl.h>   // For _TrackMouseEvent
00161 
00162 // X windows includes
00163 #else
00164 #include <X11/X.h>
00165 #include <X11/Xlib.h>
00166 #include <X11/Xcms.h>
00167 #include <X11/Xutil.h>
00168 #include <X11/Xresource.h>
00169 #include <X11/Xatom.h>
00170 #include <X11/cursorfont.h>
00171 #ifdef HUMMINGBIRD
00172 #include <X11/XlibXtra.h>
00173 #endif
00174 #ifdef HAVE_XSHM_H
00175 #include <X11/extensions/XShm.h>
00176 #endif
00177 #ifdef HAVE_XCURSOR_H
00178 #include <X11/Xcursor/Xcursor.h>
00179 #endif
00180 #ifdef HAVE_XFT_H
00181 #include <X11/Xft/Xft.h>
00182 #endif
00183 #ifndef XlibSpecificationRelease        // not defined until X11R5
00184 #define NO_XIM
00185 #elif XlibSpecificationRelease < 6      // need at least Xlib X11R6
00186 #define NO_XIM
00187 #endif
00188 #endif
00189 
00190 
00191 // OpenGL includes
00192 #ifdef HAVE_GL_H
00193 #include <GL/gl.h>
00194 #ifndef WIN32
00195 #include <GL/glx.h>
00196 #endif
00197 #endif
00198 #ifndef GLAPIENTRY
00199 #define GLAPIENTRY
00200 #endif
00201 #ifndef GLAPI
00202 #define GLAPI
00203 #endif
00204 #ifdef HAVE_GLU_H
00205 #include <GL/glu.h>
00206 #endif
00207 
00208 // Maximum path length
00209 #ifndef MAXPATHLEN
00210 #if defined(PATH_MAX)
00211 #define MAXPATHLEN   PATH_MAX
00212 #elif defined(_MAX_PATH)
00213 #define MAXPATHLEN   _MAX_PATH
00214 #elif defined(MAX_PATH)
00215 #define MAXPATHLEN   MAX_PATH
00216 #else
00217 #define MAXPATHLEN   1024
00218 #endif
00219 #endif
00220 
00221 // Modes for access(filename,mode) on Windows
00222 #ifdef WIN32
00223 #ifndef R_OK
00224 #define R_OK 4
00225 #endif
00226 #ifndef W_OK
00227 #define W_OK 2
00228 #endif
00229 #ifndef X_OK
00230 #define X_OK 1
00231 #endif
00232 #ifndef F_OK
00233 #define F_OK 0
00234 #endif
00235 #endif
00236 
00237 // File open modes on Windows
00238 #ifdef WIN32
00239 #if defined(_MSC_VER)
00240 #define O_APPEND _O_APPEND
00241 #define O_CREAT  _O_CREAT
00242 #define O_EXCL   _O_EXCL
00243 #define O_RDONLY _O_RDONLY
00244 #define O_RDWR   _O_RDWR
00245 #define O_TRUNC  _O_TRUNC
00246 #define O_WRONLY _O_WRONLY
00247 #define O_BINARY _O_BINARY
00248 #endif
00249 #endif
00250 
00251 // Some systems don't have it
00252 #ifndef SEEK_SET
00253 #define SEEK_SET 0
00254 #endif
00255 #ifndef SEEK_CUR
00256 #define SEEK_CUR 1
00257 #endif
00258 #ifndef SEEK_END
00259 #define SEEK_END 2
00260 #endif
00261 
00262 // Printer stuff
00263 #ifdef WIN32
00264 #include <winspool.h>
00265 #endif
00266 
00267 
00268 // Wheel support (OS >= W98, OS>=NT4.0)
00269 #ifdef WIN32
00270 
00271 // Missing wheel message id's
00272 #ifndef SPI_GETWHEELSCROLLLINES
00273 #define SPI_GETWHEELSCROLLLINES   104
00274 #endif
00275 #ifndef WM_MOUSEWHEEL
00276 #define WM_MOUSEWHEEL             0x020A
00277 #endif
00278 
00279 // GetSystemMetrics parameters missing in header files
00280 #ifndef SM_XVIRTUALSCREEN
00281 #define SM_XVIRTUALSCREEN       76
00282 #endif
00283 #ifndef SM_YVIRTUALSCREEN
00284 #define SM_YVIRTUALSCREEN       77
00285 #endif
00286 #ifndef SM_CXVIRTUALSCREEN
00287 #define SM_CXVIRTUALSCREEN      78
00288 #endif
00289 #ifndef SM_CYVIRTUALSCREEN
00290 #define SM_CYVIRTUALSCREEN      79
00291 #endif
00292 #ifndef SM_CMONITORS
00293 #define SM_CMONITORS            80
00294 #endif
00295 #ifndef SM_SAMEDISPLAYFORMAT
00296 #define SM_SAMEDISPLAYFORMAT    81
00297 #endif
00298 
00299 // Missing in CYGWIN
00300 #ifndef IMAGE_SUBSYSTEM_NATIVE_WINDOWS
00301 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
00302 #endif
00303 #ifndef IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
00304 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
00305 #endif
00306 #endif
00307 
00308 
00309 // IBM VisualAge for C++ 3.5
00310 #if defined(__IBMCPP__) && defined(WIN32)
00311 #include <direct.h>
00312 #include <io.h>         // for _access()
00313 #define _mkdir(x) mkdir((char *)(x))
00314 #define _vsnprintf(a, b, c, d) vsprintf(a, c, d)
00315 #define ICON_SMALL      0
00316 #define ICON_BIG        1
00317 #define bool            int
00318 
00319 // This declarations come from Microsoft SDK
00320 #define TME_HOVER       0x00000001
00321 #define TME_LEAVE       0x00000002
00322 #define TME_QUERY       0x40000000
00323 #define TME_CANCEL      0x80000000
00324 #define HOVER_DEFAULT   0xFFFFFFFF
00325 #define WM_MOUSEHOVER   0x02A1
00326 #define WM_MOUSELEAVE   0x02A3
00327 
00328 typedef struct tagTRACKMOUSEEVENT {
00329     DWORD cbSize;
00330     DWORD dwFlags;
00331     HWND  hwndTrack;
00332     DWORD dwHoverTime;
00333 } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
00334 
00335 WINUSERAPI
00336 BOOL
00337 WINAPI
00338 TrackMouseEvent(
00339     IN OUT LPTRACKMOUSEEVENT lpEventTrack);
00340 
00341 #ifdef __GL_H__
00342 #define GL_COLOR_LOGIC_OP                 0x0BF2
00343 #define GL_POLYGON_OFFSET_POINT           0x2A01
00344 #define GL_POLYGON_OFFSET_LINE            0x2A02
00345 WINGDIAPI void APIENTRY glPolygonOffset (GLfloat factor,GLfloat units);
00346 #endif
00347 
00348 #endif
00349 
00350 #endif

Copyright © 1997-2004 Jeroen van der Zijp