/[dtapublic]/projs/dtats/trunk/shared_source/c_tk_base_7_5_w_mods/tkwinport.h
ViewVC logotype

Diff of /projs/dtats/trunk/shared_source/c_tk_base_7_5_w_mods/tkwinport.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 69 by dashley, Sat Nov 5 10:54:17 2016 UTC revision 71 by dashley, Sat Nov 5 11:07:06 2016 UTC
# Line 1  Line 1 
1  /* $Header$ */  /* $Header$ */
2    
3  /*  /*
4   * tkWinPort.h --   * tkWinPort.h --
5   *   *
6   *      This header file handles porting issues that occur because of   *      This header file handles porting issues that occur because of
7   *      differences between Windows and Unix. It should be the only   *      differences between Windows and Unix. It should be the only
8   *      file that contains #ifdefs to handle different flavors of OS.   *      file that contains #ifdefs to handle different flavors of OS.
9   *   *
10   * Copyright (c) 1995-1996 Sun Microsystems, Inc.   * Copyright (c) 1995-1996 Sun Microsystems, Inc.
11   *   *
12   * See the file "license.terms" for information on usage and redistribution   * See the file "license.terms" for information on usage and redistribution
13   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.   * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14   *   *
15   * RCS: @(#) $Id: tkwinport.h,v 1.1.1.1 2001/06/13 05:14:15 dtashley Exp $   * RCS: @(#) $Id: tkwinport.h,v 1.1.1.1 2001/06/13 05:14:15 dtashley Exp $
16   */   */
17    
18  #ifndef _WINPORT  #ifndef _WINPORT
19  #define _WINPORT  #define _WINPORT
20    
21  #include "Xlib.h"  #include "Xlib.h"
22  #include "cursorfont.h"  #include "cursorfont.h"
23  #include "keysym.h"  #include "keysym.h"
24  #include "Xatom.h"  #include "Xatom.h"
25  #include "Xutil.h"  #include "Xutil.h"
26    
27  #include <malloc.h>  #include <malloc.h>
28  #include <errno.h>  #include <errno.h>
29  #include <ctype.h>  #include <ctype.h>
30  #include <math.h>  #include <math.h>
31  #include <stdlib.h>  #include <stdlib.h>
32  #include <string.h>  #include <string.h>
33  #include <limits.h>  #include <limits.h>
34  #include <fcntl.h>  #include <fcntl.h>
35  #include <io.h>  #include <io.h>
36    
37  /*  /*
38   * Need to block out this include for building extensions with MetroWerks   * Need to block out this include for building extensions with MetroWerks
39   * compiler for Win32.   * compiler for Win32.
40   */   */
41    
42  #ifndef __MWERKS__  #ifndef __MWERKS__
43  #include <sys/stat.h>  #include <sys/stat.h>
44  #endif  #endif
45    
46  #include <time.h>  #include <time.h>
47  #include <tchar.h>  #include <tchar.h>
48    
49  #ifdef _MSC_VER  #ifdef _MSC_VER
50  #    define hypot _hypot  #    define hypot _hypot
51  #endif /* _MSC_VER */  #endif /* _MSC_VER */
52    
53  #ifndef __GNUC__  #ifndef __GNUC__
54  #    define strncasecmp strnicmp  #    define strncasecmp strnicmp
55  #    define strcasecmp stricmp  #    define strcasecmp stricmp
56  #endif  #endif
57    
58  #define NBBY 8  #define NBBY 8
59    
60  #define OPEN_MAX 32  #define OPEN_MAX 32
61    
62  /*  /*
63   * The following define causes Tk to use its internal keysym hash table   * The following define causes Tk to use its internal keysym hash table
64   */   */
65    
66  #define REDO_KEYSYM_LOOKUP  #define REDO_KEYSYM_LOOKUP
67    
68  /*  /*
69   * The following macro checks to see whether there is buffered   * The following macro checks to see whether there is buffered
70   * input data available for a stdio FILE.   * input data available for a stdio FILE.
71   */   */
72    
73  #ifdef _MSC_VER  #ifdef _MSC_VER
74  #    define TK_READ_DATA_PENDING(f) ((f)->_cnt > 0)  #    define TK_READ_DATA_PENDING(f) ((f)->_cnt > 0)
75  #else /* _MSC_VER */  #else /* _MSC_VER */
76  #    define TK_READ_DATA_PENDING(f) ((f)->level > 0)  #    define TK_READ_DATA_PENDING(f) ((f)->level > 0)
77  #endif /* _MSC_VER */  #endif /* _MSC_VER */
78    
79  /*  /*
80   * The following stubs implement various calls that don't do anything   * The following stubs implement various calls that don't do anything
81   * under Windows.   * under Windows.
82   */   */
83    
84  #define TkFreeWindowId(dispPtr,w)  #define TkFreeWindowId(dispPtr,w)
85  #define TkInitXId(dispPtr)  #define TkInitXId(dispPtr)
86  #define TkpCmapStressed(tkwin,colormap) (0)  #define TkpCmapStressed(tkwin,colormap) (0)
87  #define XFlush(display)  #define XFlush(display)
88  #define XGrabServer(display)  #define XGrabServer(display)
89  #define XUngrabServer(display)  #define XUngrabServer(display)
90  #define TkpSync(display)  #define TkpSync(display)
91    
92  /*  /*
93   * The following functions are implemented as macros under Windows.   * The following functions are implemented as macros under Windows.
94   */   */
95    
96  #define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}  #define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
97  #define XNoOp(display) {display->request++;}  #define XNoOp(display) {display->request++;}
98  #define XSynchronize(display, bool) {display->request++;}  #define XSynchronize(display, bool) {display->request++;}
99  #define XSync(display, bool) {display->request++;}  #define XSync(display, bool) {display->request++;}
100  #define XVisualIDFromVisual(visual) (visual->visualid)  #define XVisualIDFromVisual(visual) (visual->visualid)
101    
102  /*  /*
103   * The following Tk functions are implemented as macros under Windows.   * The following Tk functions are implemented as macros under Windows.
104   */   */
105    
106  #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \  #define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \
107          | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)          | ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)
108    
109  /*  /*
110   * These calls implement native bitmaps which are not currently   * These calls implement native bitmaps which are not currently
111   * supported under Windows.  The macros eliminate the calls.   * supported under Windows.  The macros eliminate the calls.
112   */   */
113    
114  #define TkpDefineNativeBitmaps()  #define TkpDefineNativeBitmaps()
115  #define TkpCreateNativeBitmap(display, source) None  #define TkpCreateNativeBitmap(display, source) None
116  #define TkpGetNativeAppBitmap(display, name, w, h) None  #define TkpGetNativeAppBitmap(display, name, w, h) None
117    
118  /*  /*
119   * Define timezone for gettimeofday.   * Define timezone for gettimeofday.
120   */   */
121    
122  struct timezone {  struct timezone {
123      int tz_minuteswest;      int tz_minuteswest;
124      int tz_dsttime;      int tz_dsttime;
125  };  };
126    
127  #ifndef _TCLINT  #ifndef _TCLINT
128  #include <tclInt.h>  #include <tclInt.h>
129  #endif  #endif
130    
131  #endif /* _WINPORT */  #endif /* _WINPORT */
132    
133  /* End of tkwinport.h */  /* End of tkwinport.h */

Legend:
Removed from v.69  
changed lines
  Added in v.71

dashley@gmail.com
ViewVC Help
Powered by ViewVC 1.1.25