* This file is included by all of the Tk C files. It contains
* information that may be configuration-dependent, such as
* #includes for system include files and a few other things.
* Copyright (c) 1991-1993 The Regents of the University of California.
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
* Copyright (c) 1998 by Scriptics Corporation.
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
* RCS: @(#) $Id: tkUnixPort.h,v 1.3 1998/09/30 19:01:22 rjohnson Exp $
* Macro to use instead of "void" for arguments that must have
* type "void *" in ANSI C; maps them to type "char *" in
* non-ANSI systems. This macro may be used in some of the include
* files below, which is why it is defined here.
# include "compat/limits.h"
# include "compat/stdlib.h"
#if 0 /* Used in tk8 merge */
# include "compat/unistd.h"
#include <X11/cursorfont.h>
#include <X11/Xresource.h>
* The following macro defines the type of the mask arguments to
# define SELECT_MASK fd_set
# define SELECT_MASK void
* The following macro defines the number of fd_masks in an fd_set:
# define FD_SETSIZE OPEN_MAX
# define howmany(x, y) (((x)+((y)-1))/(y))
# define NFDBITS NBBY*sizeof(fd_mask)
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
* Not all systems declare the errno variable in errno.h. so this
* file does it explicitly.
* Define "NBBY" (number of bits per byte) if it's not already defined.
* These macros are just wrappers for the equivalent X Region calls.
#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
#define TkCreateRegion() (TkRegion) XCreateRegion()
#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
/* #define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h) */
#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
(Region) src, (Region) ret)
* The TkPutImage macro strips off the color table information, which isn't
#define TkPutImage(colors, ncolors, display, pixels, gc, image, destx, desty, srcx, srcy, width, height) \
XPutImage(display, pixels, gc, image, destx, desty, srcx, \
* Supply macros for seek offsets, if they're not already provided by
* Declarations for various library procedures that may not be declared
* in any other header file.
extern void panic
_ANSI_ARGS_(TCL_VARARGS(char *, string
));
* These functions do nothing under Unix, so we just eliminate calls to them.
#define TkpDestroyButton(butPtr) {}
#define TkSelUpdateClipboard(a,b) {}
#define TkSetPixmapColormap(p,c) {}
* These calls implement native bitmaps which are not supported under
* UNIX. The macros eliminate the calls.
#define TkpDefineNativeBitmaps()
#define TkpCreateNativeBitmap(display, source) None
#define TkpGetNativeAppBitmap(display, name, w, h) None
* This macro stores a representation of the window handle in a string.
#define TkpPrintWindowId(buf,w) \
sprintf((buf), "0x%x", (unsigned int) (w))
* TkpScanWindowId is just an alias for Tcl_GetInt on Unix.
#define TkpScanWindowId(i,s,wp) \
* This macro indicates that entry and text widgets should display
* the selection highlight regardless of which window has the focus.
#define ALWAYS_SHOW_SELECTION
* The following declaration is used to get access to a private Tcl interface
* that is needed for portability reasons.
EXTERN
void TclpGetTime
_ANSI_ARGS_((Tcl_Time
*time
));