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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tk/] [mac/] [tkMacPort.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
 * tkMacPort.h --
3
 *
4
 *      This file is included by all of the Tk C files.  It contains
5
 *      information that may be configuration-dependent, such as
6
 *      #includes for system include files and a few other things.
7
 *
8
 * Copyright (c) 1994-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: tkMacPort.h,v 1.1.1.1 2002-01-16 10:25:56 markom Exp $
15
 */
16
 
17
#ifndef _TKMACPORT
18
#define _TKMACPORT
19
 
20
/*
21
 * Macro to use instead of "void" for arguments that must have
22
 * type "void *" in ANSI C;  maps them to type "char *" in
23
 * non-ANSI systems.  This macro may be used in some of the include
24
 * files below, which is why it is defined here.
25
 */
26
 
27
#ifndef VOID
28
#   ifdef __STDC__
29
#       define VOID void
30
#   else
31
#       define VOID char
32
#   endif
33
#endif
34
 
35
#ifndef _TCL
36
#   include <tcl.h>
37
#endif
38
 
39
#include <time.h>
40
#include <stdlib.h>
41
#include <string.h>
42
#include "tclMath.h"
43
#include <ctype.h>
44
#include <limits.h>
45
 
46
#include <Xlib.h>
47
#include <cursorfont.h>
48
#include <keysym.h>
49
#include <Xatom.h>
50
#include <Xfuncproto.h>
51
#include <Xutil.h>
52
 
53
/*
54
 * Not all systems declare the errno variable in errno.h. so this
55
 * file does it explicitly.
56
 */
57
 
58
extern int errno;
59
 
60
/*
61
 * Define "NBBY" (number of bits per byte) if it's not already defined.
62
 */
63
 
64
#ifndef NBBY
65
#   define NBBY 8
66
#endif
67
 
68
/*
69
 * Declarations for various library procedures that may not be declared
70
 * in any other header file.
71
 */
72
 
73
extern void             panic  _ANSI_ARGS_(TCL_VARARGS(char *, string));
74
extern int              strcasecmp _ANSI_ARGS_((CONST char *s1,
75
                            CONST char *s2));
76
extern int              strncasecmp _ANSI_ARGS_((CONST char *s1,
77
                            CONST char *s2, size_t n));
78
 
79
/*
80
 * Defines for X functions that are used by Tk but are treated as
81
 * no-op functions on the Macintosh.
82
 */
83
 
84
#define XFlush(display)
85
#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
86
#define XGrabServer(display)
87
#define XNoOp(display) {display->request++;}
88
#define XUngrabServer(display)
89
#define XSynchronize(display, bool) {display->request++;}
90
#define XSync(display, bool) {display->request++;}
91
#define XVisualIDFromVisual(visual) (visual->visualid)
92
 
93
/*
94
 * The following functions are not used on the Mac, so we stub it out.
95
 */
96
 
97
#define TkFreeWindowId(dispPtr,w)
98
#define TkInitXId(dispPtr)
99
#define TkpCmapStressed(tkwin,colormap) (0)
100
#define TkpFreeColor(tkColPtr)
101
#define TkSetPixmapColormap(p,c) {}
102
#define Tk_FreeXId(display,xid)
103
#define TkpSync(display)
104
 
105
/*
106
 * The following macro returns the pixel value that corresponds to the
107
 * RGB values in the given XColor structure.
108
 */
109
 
110
#define PIXEL_MAGIC ((unsigned char) 0x69)
111
#define TkpGetPixel(p) ((((((PIXEL_MAGIC << 8) \
112
        | (((p)->red >> 8) & 0xff)) << 8) \
113
        | (((p)->green >> 8) & 0xff)) << 8) \
114
        | (((p)->blue >> 8) & 0xff))
115
 
116
/*
117
 * This macro stores a representation of the window handle in a string.
118
 */
119
 
120
#define TkpPrintWindowId(buf,w) \
121
        sprintf((buf), "0x%x", (unsigned int) (w))
122
 
123
/*
124
 * TkpScanWindowId is just an alias for Tcl_GetInt on Unix.
125
 */
126
 
127
#define TkpScanWindowId(i,s,wp) \
128
        Tcl_GetInt((i),(s),(wp))
129
 
130
/*
131
 * Magic pixel values for dynamic (or active) colors.
132
 */
133
 
134
#define HIGHLIGHT_PIXEL                 31
135
#define HIGHLIGHT_TEXT_PIXEL            33
136
#define CONTROL_TEXT_PIXEL              35
137
#define CONTROL_BODY_PIXEL              37
138
#define CONTROL_FRAME_PIXEL             39
139
#define WINDOW_BODY_PIXEL               41
140
#define MENU_ACTIVE_PIXEL               43
141
#define MENU_ACTIVE_TEXT_PIXEL          45
142
#define MENU_BACKGROUND_PIXEL           47
143
#define MENU_DISABLED_PIXEL             49
144
#define MENU_TEXT_PIXEL                 51
145
#define APPEARANCE_PIXEL                52
146
 
147
#endif /* _TKMACPORT */

powered by: WebSVN 2.1.0

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