tkWinPort.h

Go to the documentation of this file.
00001 /*
00002  * tkWinPort.h --
00003  *
00004  *      This header file handles porting issues that occur because of
00005  *      differences between Windows and Unix. It should be the only
00006  *      file that contains #ifdefs to handle different flavors of OS.
00007  *
00008  * Copyright (c) 1995-1996 Sun Microsystems, Inc.
00009  *
00010  * See the file "license.terms" for information on usage and redistribution
00011  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00012  *
00013  * RCS: @(#) $Id: tkWinPort.h,v 1.1 2001/08/18 00:48:57 fmk Exp $
00014  */
00015 
00016 #ifndef _WINPORT
00017 #define _WINPORT
00018 
00019 #include <X11/Xlib.h>
00020 #include <X11/cursorfont.h>
00021 #include <X11/keysym.h>
00022 #include <X11/Xatom.h>
00023 #include <X11/Xutil.h>
00024 
00025 #include <malloc.h>
00026 #include <errno.h>
00027 #include <ctype.h>
00028 #include <math.h>
00029 #include <stdlib.h>
00030 #include <string.h>
00031 #include <limits.h>
00032 #include <fcntl.h>
00033 #include <io.h>
00034 
00035 /*
00036  * Need to block out this include for building extensions with MetroWerks
00037  * compiler for Win32.
00038  */
00039 
00040 #ifndef __MWERKS__
00041 #include <sys/stat.h>
00042 #endif
00043 
00044 #include <time.h>
00045 #include <tchar.h>
00046 
00047 #ifdef _MSC_VER
00048 #    define hypot _hypot
00049 #endif /* _MSC_VER */
00050 
00051 #ifndef __GNUC__
00052 #    define strncasecmp strnicmp
00053 #    define strcasecmp stricmp
00054 #endif
00055 
00056 #define NBBY 8
00057 
00058 #define OPEN_MAX 32
00059 
00060 /*
00061  * The following define causes Tk to use its internal keysym hash table
00062  */
00063 
00064 #define REDO_KEYSYM_LOOKUP
00065 
00066 /*
00067  * The following macro checks to see whether there is buffered
00068  * input data available for a stdio FILE.
00069  */
00070 
00071 #ifdef _MSC_VER
00072 #    define TK_READ_DATA_PENDING(f) ((f)->_cnt > 0)
00073 #else /* _MSC_VER */
00074 #    define TK_READ_DATA_PENDING(f) ((f)->level > 0)
00075 #endif /* _MSC_VER */
00076 
00077 /*
00078  * The following stubs implement various calls that don't do anything
00079  * under Windows.
00080  */
00081 
00082 #define TkFreeWindowId(dispPtr,w)
00083 #define TkInitXId(dispPtr)
00084 #define TkpCmapStressed(tkwin,colormap) (0)
00085 #define XFlush(display)
00086 #define XGrabServer(display)
00087 #define XUngrabServer(display)
00088 #define TkpSync(display)
00089 
00090 /*
00091  * The following functions are implemented as macros under Windows.
00092  */
00093 
00094 #define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
00095 #define XNoOp(display) {display->request++;}
00096 #define XSynchronize(display, bool) {display->request++;}
00097 #define XSync(display, bool) {display->request++;}
00098 #define XVisualIDFromVisual(visual) (visual->visualid)
00099 
00100 /*
00101  * The following Tk functions are implemented as macros under Windows.
00102  */
00103 
00104 #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \
00105         | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)
00106 
00107 /*
00108  * These calls implement native bitmaps which are not currently 
00109  * supported under Windows.  The macros eliminate the calls.
00110  */
00111 
00112 #define TkpDefineNativeBitmaps()
00113 #define TkpCreateNativeBitmap(display, source) None
00114 #define TkpGetNativeAppBitmap(display, name, w, h) None
00115 
00116 /*
00117  * Define timezone for gettimeofday.
00118  */
00119 
00120 struct timezone {
00121     int tz_minuteswest;
00122     int tz_dsttime;
00123 };
00124 
00125 #ifndef _TCLINT
00126 #include <tclInt.h>
00127 #endif
00128 
00129 #endif /* _WINPORT */

Generated on Mon Oct 23 15:05:30 2006 for OpenSees by doxygen 1.5.0