|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _TKMACPORT |
|
|
#define _TKMACPORT |
|
|
|
|
|
#include <stdio.h> |
|
|
#include <pwd.h> |
|
|
#include <assert.h> |
|
|
#include <errno.h> |
|
|
#include <fcntl.h> |
|
|
#include <ctype.h> |
|
|
#include <math.h> |
|
|
#include <string.h> |
|
|
#include <limits.h> |
|
|
#include <stdlib.h> |
|
|
#include <sys/types.h> |
|
|
#include <sys/file.h> |
|
|
#ifdef HAVE_SYS_SELECT_H |
|
|
# include <sys/select.h> |
|
|
#endif |
|
|
#include <sys/stat.h> |
|
|
#ifndef _TCL |
|
|
# include <tcl.h> |
|
|
#endif |
|
|
#ifdef HAVE_SYS_TIME_H |
|
|
# include <sys/time.h> |
|
|
#endif |
|
|
#include <time.h> |
|
|
#ifdef HAVE_INTTYPES_H |
|
|
# include <inttypes.h> |
|
|
#endif |
|
|
#include <unistd.h> |
|
|
#if defined(__GNUC__) && !defined(__cplusplus) |
|
|
# pragma GCC diagnostic ignored "-Wc++-compat" |
|
|
#endif |
|
|
#include <X11/Xlib.h> |
|
|
#include <X11/cursorfont.h> |
|
|
#include <X11/keysym.h> |
|
|
#include <X11/Xatom.h> |
|
|
#include <X11/Xfuncproto.h> |
|
|
#include <X11/Xutil.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NO_FD_SET |
|
|
# define SELECT_MASK fd_set |
|
|
#else |
|
|
# ifndef _AIX |
|
|
typedef long fd_mask; |
|
|
# endif |
|
|
# if defined(_IBMR2) |
|
|
# define SELECT_MASK void |
|
|
# else |
|
|
# define SELECT_MASK int |
|
|
# endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef MODULE_SCOPE |
|
|
# ifdef __cplusplus |
|
|
# define MODULE_SCOPE extern "C" |
|
|
# else |
|
|
# define MODULE_SCOPE extern |
|
|
# endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef FD_SETSIZE |
|
|
# ifdef OPEN_MAX |
|
|
# define FD_SETSIZE OPEN_MAX |
|
|
# else |
|
|
# define FD_SETSIZE 256 |
|
|
# endif |
|
|
#endif |
|
|
#if !defined(howmany) |
|
|
# define howmany(x, y) (((x)+((y)-1))/(y)) |
|
|
#endif |
|
|
#ifndef NFDBITS |
|
|
# define NFDBITS NBBY*sizeof(fd_mask) |
|
|
#endif |
|
|
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef NBBY |
|
|
# define NBBY 8 |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define REDO_KEYSYM_LOOKUP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#undef XFlush |
|
|
#define XFlush(display) (0) |
|
|
#undef XFree |
|
|
#define XFree(data) (((data) != NULL) ? (ckfree(data),0) : 0) |
|
|
#undef XGrabServer |
|
|
#define XGrabServer(display) (0) |
|
|
#undef XNoOp |
|
|
#define XNoOp(display) (LastKnownRequestProcessed(display)++,0) |
|
|
#undef XUngrabServer |
|
|
#define XUngrabServer(display) (0) |
|
|
#undef XSynchronize |
|
|
#define XSynchronize(display, onoff) (LastKnownRequestProcessed(display)++,NULL) |
|
|
#undef XVisualIDFromVisual |
|
|
#define XVisualIDFromVisual(visual) (visual->visualid) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TkpCmapStressed(tkwin,colormap) (0) |
|
|
#define TkpFreeColor(tkColPtr) |
|
|
#define TkSetPixmapColormap(p,c) {} |
|
|
#define TkpSync(display) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TkpGetCapture TkMacOSXGetCapture |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TkpPrintWindowId(buf,w) \ |
|
|
snprintf((buf), TCL_INTEGER_SPACE, "0x%lx", (unsigned long) (w)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TK_NO_DOUBLE_BUFFERING 1 |
|
|
#define TK_HAS_DYNAMIC_COLORS 1 |
|
|
#define TK_DYNAMIC_COLORMAP 0x0fffffff |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TK_CAN_RENDER_RGBA |
|
|
|
|
|
MODULE_SCOPE int TkpPutRGBAImage( |
|
|
Display* display, Drawable drawable, GC gc,XImage* image, |
|
|
int src_x, int src_y, int dest_x, int dest_y, |
|
|
unsigned int width, unsigned int height); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MODULE_SCOPE unsigned long TkMacOSXRGBPixel(unsigned long red, unsigned long green, |
|
|
unsigned long blue); |
|
|
#define TkpGetPixel(p) (TkMacOSXRGBPixel(p->red >> 8, p->green >> 8, p->blue >> 8)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define USE_CUSTOM_EXIT_PROC |
|
|
EXTERN int TkpWantsExitProc(void); |
|
|
EXTERN TCL_NORETURN void TkpExitProc(void *); |
|
|
|
|
|
#endif |
|
|
|