OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tk/] [win/] [tkWinPort.h] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.