annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/tkInt.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /*
jpayne@69 2 * tkInt.h --
jpayne@69 3 *
jpayne@69 4 * Declarations for things used internally by the Tk functions but not
jpayne@69 5 * exported outside the module.
jpayne@69 6 *
jpayne@69 7 * Copyright (c) 1990-1994 The Regents of the University of California.
jpayne@69 8 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
jpayne@69 9 * Copyright (c) 1998 by Scriptics Corporation.
jpayne@69 10 *
jpayne@69 11 * See the file "license.terms" for information on usage and redistribution of
jpayne@69 12 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
jpayne@69 13 */
jpayne@69 14
jpayne@69 15 #ifndef _TKINT
jpayne@69 16 #define _TKINT
jpayne@69 17
jpayne@69 18 #ifndef _TKPORT
jpayne@69 19 #include "tkPort.h"
jpayne@69 20 #endif
jpayne@69 21
jpayne@69 22 #define TK_OPTION_ENUM_VAR ((int)(sizeof(Tk_OptionType)&(sizeof(int)-1))<<6)
jpayne@69 23
jpayne@69 24 /*
jpayne@69 25 * Ensure WORDS_BIGENDIAN is defined correctly:
jpayne@69 26 * Needs to happen here in addition to configure to work with fat compiles on
jpayne@69 27 * Darwin (where configure runs only once for multiple architectures).
jpayne@69 28 */
jpayne@69 29
jpayne@69 30 #include <stdio.h>
jpayne@69 31 #ifdef HAVE_SYS_TYPES_H
jpayne@69 32 # include <sys/types.h>
jpayne@69 33 #endif
jpayne@69 34 #ifdef HAVE_SYS_PARAM_H
jpayne@69 35 # include <sys/param.h>
jpayne@69 36 #endif
jpayne@69 37 #ifdef BYTE_ORDER
jpayne@69 38 # ifdef BIG_ENDIAN
jpayne@69 39 # if BYTE_ORDER == BIG_ENDIAN
jpayne@69 40 # undef WORDS_BIGENDIAN
jpayne@69 41 # define WORDS_BIGENDIAN 1
jpayne@69 42 # endif
jpayne@69 43 # endif
jpayne@69 44 # ifdef LITTLE_ENDIAN
jpayne@69 45 # if BYTE_ORDER == LITTLE_ENDIAN
jpayne@69 46 # undef WORDS_BIGENDIAN
jpayne@69 47 # endif
jpayne@69 48 # endif
jpayne@69 49 #endif
jpayne@69 50
jpayne@69 51 /*
jpayne@69 52 * Used to tag functions that are only to be visible within the module being
jpayne@69 53 * built and not outside it (where this is supported by the linker).
jpayne@69 54 */
jpayne@69 55
jpayne@69 56 #ifndef MODULE_SCOPE
jpayne@69 57 # ifdef __cplusplus
jpayne@69 58 # define MODULE_SCOPE extern "C"
jpayne@69 59 # else
jpayne@69 60 # define MODULE_SCOPE extern
jpayne@69 61 # endif
jpayne@69 62 #endif
jpayne@69 63
jpayne@69 64 #ifndef JOIN
jpayne@69 65 # define JOIN(a,b) JOIN1(a,b)
jpayne@69 66 # define JOIN1(a,b) a##b
jpayne@69 67 #endif
jpayne@69 68
jpayne@69 69 #ifndef TCL_UNUSED
jpayne@69 70 # if defined(__cplusplus)
jpayne@69 71 # define TCL_UNUSED(T) T
jpayne@69 72 # elif defined(__GNUC__) && (__GNUC__ > 2)
jpayne@69 73 # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) __attribute__((unused))
jpayne@69 74 # else
jpayne@69 75 # define TCL_UNUSED(T) T JOIN(dummy, __LINE__)
jpayne@69 76 # endif
jpayne@69 77 #endif
jpayne@69 78
jpayne@69 79 #if defined(_WIN32) && (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7)
jpayne@69 80 # if TCL_UTF_MAX > 3
jpayne@69 81 # define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c)
jpayne@69 82 # define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c)
jpayne@69 83 # else
jpayne@69 84 # define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int len, Tcl_DString *))Tcl_UniCharToUtfDString)
jpayne@69 85 # define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int len, Tcl_DString *))Tcl_UtfToUniCharDString)
jpayne@69 86 # endif
jpayne@69 87 #endif
jpayne@69 88
jpayne@69 89 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
jpayne@69 90 # define TKFLEXARRAY
jpayne@69 91 #elif defined(__GNUC__) && (__GNUC__ > 2)
jpayne@69 92 # define TKFLEXARRAY 0
jpayne@69 93 #else
jpayne@69 94 # define TKFLEXARRAY 1
jpayne@69 95 #endif
jpayne@69 96
jpayne@69 97 #ifndef Tcl_GetParent
jpayne@69 98 # define Tcl_GetParent Tcl_GetMaster
jpayne@69 99 #endif
jpayne@69 100
jpayne@69 101 /*
jpayne@69 102 * Macros used to cast between pointers and integers (e.g. when storing an int
jpayne@69 103 * in ClientData), on 64-bit architectures they avoid gcc warning about "cast
jpayne@69 104 * to/from pointer from/to integer of different size".
jpayne@69 105 */
jpayne@69 106
jpayne@69 107 #if !defined(INT2PTR) && !defined(PTR2INT)
jpayne@69 108 # if defined(HAVE_INTPTR_T) || defined(intptr_t)
jpayne@69 109 # define INT2PTR(p) ((void*)(intptr_t)(p))
jpayne@69 110 # define PTR2INT(p) ((int)(intptr_t)(p))
jpayne@69 111 # else
jpayne@69 112 # define INT2PTR(p) ((void*)(p))
jpayne@69 113 # define PTR2INT(p) ((int)(p))
jpayne@69 114 # endif
jpayne@69 115 #endif
jpayne@69 116 #if !defined(UINT2PTR) && !defined(PTR2UINT)
jpayne@69 117 # if defined(HAVE_UINTPTR_T) || defined(uintptr_t)
jpayne@69 118 # define UINT2PTR(p) ((void*)(uintptr_t)(p))
jpayne@69 119 # define PTR2UINT(p) ((unsigned int)(uintptr_t)(p))
jpayne@69 120 # else
jpayne@69 121 # define UINT2PTR(p) ((void*)(p))
jpayne@69 122 # define PTR2UINT(p) ((unsigned int)(p))
jpayne@69 123 # endif
jpayne@69 124 #endif
jpayne@69 125
jpayne@69 126 #ifndef TCL_Z_MODIFIER
jpayne@69 127 # if defined(_WIN64)
jpayne@69 128 # define TCL_Z_MODIFIER "I"
jpayne@69 129 # elif defined(__GNUC__) && !defined(_WIN32)
jpayne@69 130 # define TCL_Z_MODIFIER "z"
jpayne@69 131 # else
jpayne@69 132 # define TCL_Z_MODIFIER ""
jpayne@69 133 # endif
jpayne@69 134 #endif /* !TCL_Z_MODIFIER */
jpayne@69 135
jpayne@69 136 /*
jpayne@69 137 * Opaque type declarations:
jpayne@69 138 */
jpayne@69 139
jpayne@69 140 typedef struct TkColormap TkColormap;
jpayne@69 141 typedef struct TkFontAttributes TkFontAttributes;
jpayne@69 142 typedef struct TkGrabEvent TkGrabEvent;
jpayne@69 143 typedef struct TkpCursor_ *TkpCursor;
jpayne@69 144 typedef struct TkRegion_ *TkRegion;
jpayne@69 145 typedef struct TkStressedCmap TkStressedCmap;
jpayne@69 146 typedef struct TkBindInfo_ *TkBindInfo;
jpayne@69 147 typedef struct Busy *TkBusy;
jpayne@69 148
jpayne@69 149 /*
jpayne@69 150 * One of the following structures is maintained for each cursor in use in the
jpayne@69 151 * system. This structure is used by tkCursor.c and the various system-
jpayne@69 152 * specific cursor files.
jpayne@69 153 */
jpayne@69 154
jpayne@69 155 typedef struct TkCursor {
jpayne@69 156 Tk_Cursor cursor; /* System specific identifier for cursor. */
jpayne@69 157 Display *display; /* Display containing cursor. Needed for
jpayne@69 158 * disposal and retrieval of cursors. */
jpayne@69 159 int resourceRefCount; /* Number of active uses of this cursor (each
jpayne@69 160 * active use corresponds to a call to
jpayne@69 161 * Tk_AllocPreserveFromObj or Tk_Preserve). If
jpayne@69 162 * this count is 0, then this structure is no
jpayne@69 163 * longer valid and it isn't present in a hash
jpayne@69 164 * table: it is being kept around only because
jpayne@69 165 * there are objects referring to it. The
jpayne@69 166 * structure is freed when resourceRefCount
jpayne@69 167 * and objRefCount are both 0. */
jpayne@69 168 int objRefCount; /* Number of Tcl objects that reference this
jpayne@69 169 * structure.. */
jpayne@69 170 Tcl_HashTable *otherTable; /* Second table (other than idTable) used to
jpayne@69 171 * index this entry. */
jpayne@69 172 Tcl_HashEntry *hashPtr; /* Entry in otherTable for this structure
jpayne@69 173 * (needed when deleting). */
jpayne@69 174 Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure (needed
jpayne@69 175 * when deleting). */
jpayne@69 176 struct TkCursor *nextPtr; /* Points to the next TkCursor structure with
jpayne@69 177 * the same name. Cursors with the same name
jpayne@69 178 * but different displays are chained together
jpayne@69 179 * off a single hash table entry. */
jpayne@69 180 } TkCursor;
jpayne@69 181
jpayne@69 182 /*
jpayne@69 183 * The following structure is kept one-per-TkDisplay to maintain information
jpayne@69 184 * about the caret (cursor location) on this display. This is used to dictate
jpayne@69 185 * global focus location (Windows Accessibility guidelines) and to position
jpayne@69 186 * the IME or XIM over-the-spot window.
jpayne@69 187 */
jpayne@69 188
jpayne@69 189 typedef struct TkCaret {
jpayne@69 190 struct TkWindow *winPtr; /* The window on which we requested caret
jpayne@69 191 * placement. */
jpayne@69 192 int x; /* Relative x coord of the caret. */
jpayne@69 193 int y; /* Relative y coord of the caret. */
jpayne@69 194 int height; /* Specified height of the window. */
jpayne@69 195 } TkCaret;
jpayne@69 196
jpayne@69 197 /*
jpayne@69 198 * One of the following structures is maintained for each display containing a
jpayne@69 199 * window managed by Tk. In part, the structure is used to store thread-
jpayne@69 200 * specific data, since each thread will have its own TkDisplay structure.
jpayne@69 201 */
jpayne@69 202
jpayne@69 203 typedef struct TkDisplay {
jpayne@69 204 Display *display; /* Xlib's info about display. */
jpayne@69 205 struct TkDisplay *nextPtr; /* Next in list of all displays. */
jpayne@69 206 char *name; /* Name of display (with any screen identifier
jpayne@69 207 * removed). Malloc-ed. */
jpayne@69 208 Time lastEventTime; /* Time of last event received for this
jpayne@69 209 * display. */
jpayne@69 210
jpayne@69 211 /*
jpayne@69 212 * Information used primarily by tk3d.c:
jpayne@69 213 */
jpayne@69 214
jpayne@69 215 int borderInit; /* 0 means borderTable needs initializing. */
jpayne@69 216 Tcl_HashTable borderTable; /* Maps from color name to TkBorder
jpayne@69 217 * structure. */
jpayne@69 218
jpayne@69 219 /*
jpayne@69 220 * Information used by tkAtom.c only:
jpayne@69 221 */
jpayne@69 222
jpayne@69 223 int atomInit; /* 0 means stuff below hasn't been initialized
jpayne@69 224 * yet. */
jpayne@69 225 Tcl_HashTable nameTable; /* Maps from names to Atom's. */
jpayne@69 226 Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
jpayne@69 227
jpayne@69 228 /*
jpayne@69 229 * Information used primarily by tkBind.c:
jpayne@69 230 */
jpayne@69 231
jpayne@69 232 int bindInfoStale; /* Non-zero means the variables in this part
jpayne@69 233 * of the structure are potentially incorrect
jpayne@69 234 * and should be recomputed. */
jpayne@69 235 unsigned int modeModMask; /* Has one bit set to indicate the modifier
jpayne@69 236 * corresponding to "mode shift". If no such
jpayne@69 237 * modifier, than this is zero. */
jpayne@69 238 unsigned int metaModMask; /* Has one bit set to indicate the modifier
jpayne@69 239 * corresponding to the "Meta" key. If no such
jpayne@69 240 * modifier, then this is zero. */
jpayne@69 241 unsigned int altModMask; /* Has one bit set to indicate the modifier
jpayne@69 242 * corresponding to the "Meta" key. If no such
jpayne@69 243 * modifier, then this is zero. */
jpayne@69 244 enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
jpayne@69 245 /* Indicates how to interpret lock
jpayne@69 246 * modifier. */
jpayne@69 247 int numModKeyCodes; /* Number of entries in modKeyCodes array
jpayne@69 248 * below. */
jpayne@69 249 KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for all
jpayne@69 250 * of the keys that have modifiers associated
jpayne@69 251 * with them. Malloc'ed, but may be NULL. */
jpayne@69 252
jpayne@69 253 /*
jpayne@69 254 * Information used by tkBitmap.c only:
jpayne@69 255 */
jpayne@69 256
jpayne@69 257 int bitmapInit; /* 0 means tables above need initializing. */
jpayne@69 258 int bitmapAutoNumber; /* Used to number bitmaps. */
jpayne@69 259 Tcl_HashTable bitmapNameTable;
jpayne@69 260 /* Maps from name of bitmap to the first
jpayne@69 261 * TkBitmap record for that name. */
jpayne@69 262 Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
jpayne@69 263 * structure for the bitmap. */
jpayne@69 264 Tcl_HashTable bitmapDataTable;
jpayne@69 265 /* Used by Tk_GetBitmapFromData to map from a
jpayne@69 266 * collection of in-core data about a bitmap
jpayne@69 267 * to a reference giving an automatically-
jpayne@69 268 * generated name for the bitmap. */
jpayne@69 269
jpayne@69 270 /*
jpayne@69 271 * Information used by tkCanvas.c only:
jpayne@69 272 */
jpayne@69 273
jpayne@69 274 int numIdSearches;
jpayne@69 275 int numSlowSearches;
jpayne@69 276
jpayne@69 277 /*
jpayne@69 278 * Used by tkColor.c only:
jpayne@69 279 */
jpayne@69 280
jpayne@69 281 int colorInit; /* 0 means color module needs initializing. */
jpayne@69 282 TkStressedCmap *stressPtr; /* First in list of colormaps that have filled
jpayne@69 283 * up, so we have to pick an approximate
jpayne@69 284 * color. */
jpayne@69 285 Tcl_HashTable colorNameTable;
jpayne@69 286 /* Maps from color name to TkColor structure
jpayne@69 287 * for that color. */
jpayne@69 288 Tcl_HashTable colorValueTable;
jpayne@69 289 /* Maps from integer RGB values to TkColor
jpayne@69 290 * structures. */
jpayne@69 291
jpayne@69 292 /*
jpayne@69 293 * Used by tkCursor.c only:
jpayne@69 294 */
jpayne@69 295
jpayne@69 296 int cursorInit; /* 0 means cursor module need initializing. */
jpayne@69 297 Tcl_HashTable cursorNameTable;
jpayne@69 298 /* Maps from a string name to a cursor to the
jpayne@69 299 * TkCursor record for the cursor. */
jpayne@69 300 Tcl_HashTable cursorDataTable;
jpayne@69 301 /* Maps from a collection of in-core data
jpayne@69 302 * about a cursor to a TkCursor structure. */
jpayne@69 303 Tcl_HashTable cursorIdTable;
jpayne@69 304 /* Maps from a cursor id to the TkCursor
jpayne@69 305 * structure for the cursor. */
jpayne@69 306 char cursorString[20]; /* Used to store a cursor id string. */
jpayne@69 307 Font cursorFont; /* Font to use for standard cursors. None
jpayne@69 308 * means font not loaded yet. */
jpayne@69 309
jpayne@69 310 /*
jpayne@69 311 * Information used by tkError.c only:
jpayne@69 312 */
jpayne@69 313
jpayne@69 314 struct TkErrorHandler *errorPtr;
jpayne@69 315 /* First in list of error handlers for this
jpayne@69 316 * display. NULL means no handlers exist at
jpayne@69 317 * present. */
jpayne@69 318 int deleteCount; /* Counts # of handlers deleted since last
jpayne@69 319 * time inactive handlers were garbage-
jpayne@69 320 * collected. When this number gets big,
jpayne@69 321 * handlers get cleaned up. */
jpayne@69 322
jpayne@69 323 /*
jpayne@69 324 * Used by tkEvent.c only:
jpayne@69 325 */
jpayne@69 326
jpayne@69 327 struct TkWindowEvent *delayedMotionPtr;
jpayne@69 328 /* Points to a malloc-ed motion event whose
jpayne@69 329 * processing has been delayed in the hopes
jpayne@69 330 * that another motion event will come along
jpayne@69 331 * right away and we can merge the two of them
jpayne@69 332 * together. NULL means that there is no
jpayne@69 333 * delayed motion event. */
jpayne@69 334
jpayne@69 335 /*
jpayne@69 336 * Information used by tkFocus.c only:
jpayne@69 337 */
jpayne@69 338
jpayne@69 339 int focusDebug; /* 1 means collect focus debugging
jpayne@69 340 * statistics. */
jpayne@69 341 struct TkWindow *implicitWinPtr;
jpayne@69 342 /* If the focus arrived at a toplevel window
jpayne@69 343 * implicitly via an Enter event (rather than
jpayne@69 344 * via a FocusIn event), this points to the
jpayne@69 345 * toplevel window. Otherwise it is NULL. */
jpayne@69 346 struct TkWindow *focusPtr; /* Points to the window on this display that
jpayne@69 347 * should be receiving keyboard events. When
jpayne@69 348 * multiple applications on the display have
jpayne@69 349 * the focus, this will refer to the innermost
jpayne@69 350 * window in the innermost application. This
jpayne@69 351 * information isn't used on Windows, but it's
jpayne@69 352 * needed on the Mac, and also on X11 when XIM
jpayne@69 353 * processing is being done. */
jpayne@69 354
jpayne@69 355 /*
jpayne@69 356 * Information used by tkGC.c only:
jpayne@69 357 */
jpayne@69 358
jpayne@69 359 Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure
jpayne@69 360 * describing a GC with those values. */
jpayne@69 361 Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
jpayne@69 362 int gcInit; /* 0 means the tables below need
jpayne@69 363 * initializing. */
jpayne@69 364
jpayne@69 365 /*
jpayne@69 366 * Information used by tkGeometry.c only:
jpayne@69 367 */
jpayne@69 368
jpayne@69 369 Tcl_HashTable maintainHashTable;
jpayne@69 370 /* Hash table that maps from a container's
jpayne@69 371 * Tk_Window token to a list of windows managed
jpayne@69 372 * by that container. */
jpayne@69 373 int geomInit;
jpayne@69 374
jpayne@69 375 /*
jpayne@69 376 * Information used by tkGrid.c, tkPack.c, tkPlace.c, tkPointer.c,
jpayne@69 377 * and ttkMacOSXTheme.c:
jpayne@69 378 */
jpayne@69 379
jpayne@69 380 #define TkGetContainer(tkwin) (Tk_TopWinHierarchy((TkWindow *)tkwin) ? NULL : \
jpayne@69 381 (((TkWindow *)tkwin)->maintainerPtr != NULL ? \
jpayne@69 382 ((TkWindow *)tkwin)->maintainerPtr : ((TkWindow *)tkwin)->parentPtr))
jpayne@69 383
jpayne@69 384 /*
jpayne@69 385 * Information used by tkGet.c only:
jpayne@69 386 */
jpayne@69 387
jpayne@69 388 Tcl_HashTable uidTable; /* Stores all Tk_Uid used in a thread. */
jpayne@69 389 int uidInit; /* 0 means uidTable needs initializing. */
jpayne@69 390
jpayne@69 391 /*
jpayne@69 392 * Information used by tkGrab.c only:
jpayne@69 393 */
jpayne@69 394
jpayne@69 395 struct TkWindow *grabWinPtr;/* Window in which the pointer is currently
jpayne@69 396 * grabbed, or NULL if none. */
jpayne@69 397 struct TkWindow *eventualGrabWinPtr;
jpayne@69 398 /* Value that grabWinPtr will have once the
jpayne@69 399 * grab event queue (below) has been
jpayne@69 400 * completely emptied. */
jpayne@69 401 struct TkWindow *buttonWinPtr;
jpayne@69 402 /* Window in which first mouse button was
jpayne@69 403 * pressed while grab was in effect, or NULL
jpayne@69 404 * if no such press in effect. */
jpayne@69 405 struct TkWindow *serverWinPtr;
jpayne@69 406 /* If no application contains the pointer then
jpayne@69 407 * this is NULL. Otherwise it contains the
jpayne@69 408 * last window for which we've gotten an Enter
jpayne@69 409 * or Leave event from the server (i.e. the
jpayne@69 410 * last window known to have contained the
jpayne@69 411 * pointer). Doesn't reflect events that were
jpayne@69 412 * synthesized in tkGrab.c. */
jpayne@69 413 TkGrabEvent *firstGrabEventPtr;
jpayne@69 414 /* First in list of enter/leave events
jpayne@69 415 * synthesized by grab code. These events must
jpayne@69 416 * be processed in order before any other
jpayne@69 417 * events are processed. NULL means no such
jpayne@69 418 * events. */
jpayne@69 419 TkGrabEvent *lastGrabEventPtr;
jpayne@69 420 /* Last in list of synthesized events, or NULL
jpayne@69 421 * if list is empty. */
jpayne@69 422 int grabFlags; /* Miscellaneous flag values. See definitions
jpayne@69 423 * in tkGrab.c. */
jpayne@69 424
jpayne@69 425 /*
jpayne@69 426 * Information used by tkGrid.c only:
jpayne@69 427 */
jpayne@69 428
jpayne@69 429 int gridInit; /* 0 means table below needs initializing. */
jpayne@69 430 Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to corresponding
jpayne@69 431 * Grid structures. */
jpayne@69 432
jpayne@69 433 /*
jpayne@69 434 * Information used by tkImage.c only:
jpayne@69 435 */
jpayne@69 436
jpayne@69 437 int imageId; /* Value used to number image ids. */
jpayne@69 438
jpayne@69 439 /*
jpayne@69 440 * Information used by tkMacWinMenu.c only:
jpayne@69 441 */
jpayne@69 442
jpayne@69 443 int postCommandGeneration;
jpayne@69 444
jpayne@69 445 /*
jpayne@69 446 * Information used by tkPack.c only.
jpayne@69 447 */
jpayne@69 448
jpayne@69 449 int packInit; /* 0 means table below needs initializing. */
jpayne@69 450 Tcl_HashTable packerHashTable;
jpayne@69 451 /* Maps from Tk_Window tokens to corresponding
jpayne@69 452 * Packer structures. */
jpayne@69 453
jpayne@69 454 /*
jpayne@69 455 * Information used by tkPlace.c only.
jpayne@69 456 */
jpayne@69 457
jpayne@69 458 int placeInit; /* 0 means tables below need initializing. */
jpayne@69 459 Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
jpayne@69 460 * structure for the window, if it exists. */
jpayne@69 461 Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
jpayne@69 462 * structure for the window, if it exists. */
jpayne@69 463
jpayne@69 464 /*
jpayne@69 465 * Information used by tkSelect.c and tkClipboard.c only:
jpayne@69 466 */
jpayne@69 467
jpayne@69 468 struct TkSelectionInfo *selectionInfoPtr;
jpayne@69 469 /* First in list of selection information
jpayne@69 470 * records. Each entry contains information
jpayne@69 471 * about the current owner of a particular
jpayne@69 472 * selection on this display. */
jpayne@69 473 Atom multipleAtom; /* Atom for MULTIPLE. None means selection
jpayne@69 474 * stuff isn't initialized. */
jpayne@69 475 Atom incrAtom; /* Atom for INCR. */
jpayne@69 476 Atom targetsAtom; /* Atom for TARGETS. */
jpayne@69 477 Atom timestampAtom; /* Atom for TIMESTAMP. */
jpayne@69 478 Atom textAtom; /* Atom for TEXT. */
jpayne@69 479 Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
jpayne@69 480 Atom applicationAtom; /* Atom for TK_APPLICATION. */
jpayne@69 481 Atom windowAtom; /* Atom for TK_WINDOW. */
jpayne@69 482 Atom clipboardAtom; /* Atom for CLIPBOARD. */
jpayne@69 483 Atom utf8Atom; /* Atom for UTF8_STRING. */
jpayne@69 484 Atom atomPairAtom; /* Atom for ATOM_PAIR. */
jpayne@69 485
jpayne@69 486 Tk_Window clipWindow; /* Window used for clipboard ownership and to
jpayne@69 487 * retrieve selections between processes. NULL
jpayne@69 488 * means clipboard info hasn't been
jpayne@69 489 * initialized. */
jpayne@69 490 int clipboardActive; /* 1 means we currently own the clipboard
jpayne@69 491 * selection, 0 means we don't. */
jpayne@69 492 struct TkMainInfo *clipboardAppPtr;
jpayne@69 493 /* Last application that owned clipboard. */
jpayne@69 494 struct TkClipboardTarget *clipTargetPtr;
jpayne@69 495 /* First in list of clipboard type information
jpayne@69 496 * records. Each entry contains information
jpayne@69 497 * about the buffers for a given selection
jpayne@69 498 * target. */
jpayne@69 499
jpayne@69 500 /*
jpayne@69 501 * Information used by tkSend.c only:
jpayne@69 502 */
jpayne@69 503
jpayne@69 504 Tk_Window commTkwin; /* Window used for communication between
jpayne@69 505 * interpreters during "send" commands. NULL
jpayne@69 506 * means send info hasn't been initialized
jpayne@69 507 * yet. */
jpayne@69 508 Atom commProperty; /* X's name for comm property. */
jpayne@69 509 Atom registryProperty; /* X's name for property containing registry
jpayne@69 510 * of interpreter names. */
jpayne@69 511 Atom appNameProperty; /* X's name for property used to hold the
jpayne@69 512 * application name on each comm window. */
jpayne@69 513
jpayne@69 514 /*
jpayne@69 515 * Information used by tkUnixWm.c and tkWinWm.c only:
jpayne@69 516 */
jpayne@69 517
jpayne@69 518 struct TkWmInfo *firstWmPtr;/* Points to first top-level window. */
jpayne@69 519 struct TkWmInfo *foregroundWmPtr;
jpayne@69 520 /* Points to the foreground window. */
jpayne@69 521
jpayne@69 522 /*
jpayne@69 523 * Information used by tkVisual.c only:
jpayne@69 524 */
jpayne@69 525
jpayne@69 526 TkColormap *cmapPtr; /* First in list of all non-default colormaps
jpayne@69 527 * allocated for this display. */
jpayne@69 528
jpayne@69 529 /*
jpayne@69 530 * Miscellaneous information:
jpayne@69 531 */
jpayne@69 532
jpayne@69 533 #ifdef TK_USE_INPUT_METHODS
jpayne@69 534 XIM inputMethod; /* Input method for this display. */
jpayne@69 535 XIMStyle inputStyle; /* Input style selected for this display. */
jpayne@69 536 XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
jpayne@69 537 #endif /* TK_USE_INPUT_METHODS */
jpayne@69 538 Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
jpayne@69 539
jpayne@69 540 int refCount; /* Reference count of how many Tk applications
jpayne@69 541 * are using this display. Used to clean up
jpayne@69 542 * the display when we no longer have any Tk
jpayne@69 543 * applications using it. */
jpayne@69 544
jpayne@69 545 /*
jpayne@69 546 * The following field were all added for Tk8.3
jpayne@69 547 */
jpayne@69 548
jpayne@69 549 int mouseButtonState; /* Current mouse button state for this
jpayne@69 550 * display. NOT USED as of 8.6.10 */
jpayne@69 551 Window mouseButtonWindow; /* Window the button state was set in, added
jpayne@69 552 * in Tk 8.4. */
jpayne@69 553 Tk_Window warpWindow;
jpayne@69 554 Tk_Window warpMainwin; /* For finding the root window for warping
jpayne@69 555 * purposes. */
jpayne@69 556 int warpX;
jpayne@69 557 int warpY;
jpayne@69 558
jpayne@69 559 /*
jpayne@69 560 * The following field(s) were all added for Tk8.4
jpayne@69 561 */
jpayne@69 562
jpayne@69 563 unsigned int flags; /* Various flag values: these are all defined
jpayne@69 564 * in below. */
jpayne@69 565 TkCaret caret; /* Information about the caret for this
jpayne@69 566 * display. This is not a pointer. */
jpayne@69 567
jpayne@69 568 int iconDataSize; /* Size of default iconphoto image data. */
jpayne@69 569 unsigned char *iconDataPtr; /* Default iconphoto image data, if set. */
jpayne@69 570 #ifdef TK_USE_INPUT_METHODS
jpayne@69 571 int ximGeneration; /* Used to invalidate XIC */
jpayne@69 572 #endif /* TK_USE_INPUT_METHODS */
jpayne@69 573 } TkDisplay;
jpayne@69 574
jpayne@69 575 /*
jpayne@69 576 * Flag values for TkDisplay flags.
jpayne@69 577 * TK_DISPLAY_COLLAPSE_MOTION_EVENTS: (default on)
jpayne@69 578 * Indicates that we should collapse motion events on this display
jpayne@69 579 * TK_DISPLAY_USE_IM: (default on, set via tk.tcl)
jpayne@69 580 * Whether to use input methods for this display
jpayne@69 581 * TK_DISPLAY_WM_TRACING: (default off)
jpayne@69 582 * Whether we should do wm tracing on this display.
jpayne@69 583 * TK_DISPLAY_IN_WARP: (default off)
jpayne@69 584 * Indicates that we are in a pointer warp
jpayne@69 585 */
jpayne@69 586
jpayne@69 587 #define TK_DISPLAY_COLLAPSE_MOTION_EVENTS (1 << 0)
jpayne@69 588 #define TK_DISPLAY_USE_IM (1 << 1)
jpayne@69 589 #define TK_DISPLAY_WM_TRACING (1 << 3)
jpayne@69 590 #define TK_DISPLAY_IN_WARP (1 << 4)
jpayne@69 591 #define TK_DISPLAY_USE_XKB (1 << 5)
jpayne@69 592
jpayne@69 593 /*
jpayne@69 594 * One of the following structures exists for each error handler created by a
jpayne@69 595 * call to Tk_CreateErrorHandler. The structure is managed by tkError.c.
jpayne@69 596 */
jpayne@69 597
jpayne@69 598 typedef struct TkErrorHandler {
jpayne@69 599 TkDisplay *dispPtr; /* Display to which handler applies. */
jpayne@69 600 unsigned long firstRequest; /* Only errors with serial numbers >= to this
jpayne@69 601 * are considered. */
jpayne@69 602 unsigned long lastRequest; /* Only errors with serial numbers <= to this
jpayne@69 603 * are considered. This field is filled in
jpayne@69 604 * when XUnhandle is called. -1 means
jpayne@69 605 * XUnhandle hasn't been called yet. */
jpayne@69 606 int error; /* Consider only errors with this error_code
jpayne@69 607 * (-1 means consider all errors). */
jpayne@69 608 int request; /* Consider only errors with this major
jpayne@69 609 * request code (-1 means consider all major
jpayne@69 610 * codes). */
jpayne@69 611 int minorCode; /* Consider only errors with this minor
jpayne@69 612 * request code (-1 means consider all minor
jpayne@69 613 * codes). */
jpayne@69 614 Tk_ErrorProc *errorProc; /* Function to invoke when a matching error
jpayne@69 615 * occurs. NULL means just ignore errors. */
jpayne@69 616 ClientData clientData; /* Arbitrary value to pass to errorProc. */
jpayne@69 617 struct TkErrorHandler *nextPtr;
jpayne@69 618 /* Pointer to next older handler for this
jpayne@69 619 * display, or NULL for end of list. */
jpayne@69 620 } TkErrorHandler;
jpayne@69 621
jpayne@69 622 /*
jpayne@69 623 * One of the following structures exists for each event handler created by
jpayne@69 624 * calling Tk_CreateEventHandler. This information is used by tkEvent.c only.
jpayne@69 625 */
jpayne@69 626
jpayne@69 627 typedef struct TkEventHandler {
jpayne@69 628 unsigned long mask; /* Events for which to invoke proc. */
jpayne@69 629 Tk_EventProc *proc; /* Function to invoke when an event in mask
jpayne@69 630 * occurs. */
jpayne@69 631 ClientData clientData; /* Argument to pass to proc. */
jpayne@69 632 struct TkEventHandler *nextPtr;
jpayne@69 633 /* Next in list of handlers associated with
jpayne@69 634 * window (NULL means end of list). */
jpayne@69 635 } TkEventHandler;
jpayne@69 636
jpayne@69 637 /*
jpayne@69 638 * Tk keeps one of the following data structures for each main window (created
jpayne@69 639 * by a call to TkCreateMainWindow). It stores information that is shared by
jpayne@69 640 * all of the windows associated with a particular main window.
jpayne@69 641 */
jpayne@69 642
jpayne@69 643 typedef struct TkMainInfo {
jpayne@69 644 int refCount; /* Number of windows whose "mainPtr" fields
jpayne@69 645 * point here. When this becomes zero, can
jpayne@69 646 * free up the structure (the reference count
jpayne@69 647 * is zero because windows can get deleted in
jpayne@69 648 * almost any order; the main window isn't
jpayne@69 649 * necessarily the last one deleted). */
jpayne@69 650 struct TkWindow *winPtr; /* Pointer to main window. */
jpayne@69 651 Tcl_Interp *interp; /* Interpreter associated with application. */
jpayne@69 652 Tcl_HashTable nameTable; /* Hash table mapping path names to TkWindow
jpayne@69 653 * structs for all windows related to this
jpayne@69 654 * main window. Managed by tkWindow.c. */
jpayne@69 655 long deletionEpoch; /* Incremented by window deletions. */
jpayne@69 656 Tk_BindingTable bindingTable;
jpayne@69 657 /* Used in conjunction with "bind" command to
jpayne@69 658 * bind events to Tcl commands. */
jpayne@69 659 TkBindInfo bindInfo; /* Information used by tkBind.c on a per
jpayne@69 660 * application basis. */
jpayne@69 661 struct TkFontInfo *fontInfoPtr;
jpayne@69 662 /* Information used by tkFont.c on a per
jpayne@69 663 * application basis. */
jpayne@69 664
jpayne@69 665 /*
jpayne@69 666 * Information used only by tkFocus.c and tk*Embed.c:
jpayne@69 667 */
jpayne@69 668
jpayne@69 669 struct TkToplevelFocusInfo *tlFocusPtr;
jpayne@69 670 /* First in list of records containing focus
jpayne@69 671 * information for each top-level in the
jpayne@69 672 * application. Used only by tkFocus.c. */
jpayne@69 673 struct TkDisplayFocusInfo *displayFocusPtr;
jpayne@69 674 /* First in list of records containing focus
jpayne@69 675 * information for each display that this
jpayne@69 676 * application has ever used. Used only by
jpayne@69 677 * tkFocus.c. */
jpayne@69 678
jpayne@69 679 struct ElArray *optionRootPtr;
jpayne@69 680 /* Top level of option hierarchy for this main
jpayne@69 681 * window. NULL means uninitialized. Managed
jpayne@69 682 * by tkOption.c. */
jpayne@69 683 Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageModel
jpayne@69 684 * structures. Managed by tkImage.c. */
jpayne@69 685 int strictMotif; /* This is linked to the tk_strictMotif global
jpayne@69 686 * variable. */
jpayne@69 687 int alwaysShowSelection; /* This is linked to the
jpayne@69 688 * ::tk::AlwaysShowSelection variable. */
jpayne@69 689 struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by
jpayne@69 690 * this process. */
jpayne@69 691 Tcl_HashTable busyTable; /* Information used by [tk busy] command. */
jpayne@69 692 Tcl_ObjCmdProc *tclUpdateObjProc;
jpayne@69 693 /* Saved Tcl [update] command, used to restore
jpayne@69 694 * Tcl's version of [update] after Tk is shut
jpayne@69 695 * down */
jpayne@69 696 } TkMainInfo;
jpayne@69 697
jpayne@69 698 /*
jpayne@69 699 * Tk keeps the following data structure for each of it's builtin bitmaps.
jpayne@69 700 * This structure is only used by tkBitmap.c and other platform specific
jpayne@69 701 * bitmap files.
jpayne@69 702 */
jpayne@69 703
jpayne@69 704 typedef struct {
jpayne@69 705 const void *source; /* Bits for bitmap. */
jpayne@69 706 int width, height; /* Dimensions of bitmap. */
jpayne@69 707 int native; /* 0 means generic (X style) bitmap, 1 means
jpayne@69 708 * native style bitmap. */
jpayne@69 709 } TkPredefBitmap;
jpayne@69 710
jpayne@69 711 /*
jpayne@69 712 * Tk keeps one of the following structures for each window. Some of the
jpayne@69 713 * information (like size and location) is a shadow of information managed by
jpayne@69 714 * the X server, and some is special information used here, such as event and
jpayne@69 715 * geometry management information. This information is (mostly) managed by
jpayne@69 716 * tkWindow.c. WARNING: the declaration below must be kept consistent with the
jpayne@69 717 * Tk_FakeWin structure in tk.h. If you change one, be sure to change the
jpayne@69 718 * other!
jpayne@69 719 */
jpayne@69 720
jpayne@69 721 typedef struct TkWindow {
jpayne@69 722 /*
jpayne@69 723 * Structural information:
jpayne@69 724 */
jpayne@69 725
jpayne@69 726 Display *display; /* Display containing window. */
jpayne@69 727 TkDisplay *dispPtr; /* Tk's information about display for
jpayne@69 728 * window. */
jpayne@69 729 int screenNum; /* Index of screen for window, among all those
jpayne@69 730 * for dispPtr. */
jpayne@69 731 Visual *visual; /* Visual to use for window. If not default,
jpayne@69 732 * MUST be set before X window is created. */
jpayne@69 733 int depth; /* Number of bits/pixel. */
jpayne@69 734 Window window; /* X's id for window. None means window hasn't
jpayne@69 735 * actually been created yet, or it's been
jpayne@69 736 * deleted. */
jpayne@69 737 struct TkWindow *childList; /* First in list of child windows, or NULL if
jpayne@69 738 * no children. List is in stacking order,
jpayne@69 739 * lowest window first.*/
jpayne@69 740 struct TkWindow *lastChildPtr;
jpayne@69 741 /* Last in list of child windows (highest in
jpayne@69 742 * stacking order), or NULL if no children. */
jpayne@69 743 struct TkWindow *parentPtr; /* Pointer to parent window (logical parent,
jpayne@69 744 * not necessarily X parent). NULL means
jpayne@69 745 * either this is the main window, or the
jpayne@69 746 * window's parent has already been deleted. */
jpayne@69 747 struct TkWindow *nextPtr; /* Next higher sibling (in stacking order) in
jpayne@69 748 * list of children with same parent. NULL
jpayne@69 749 * means end of list. */
jpayne@69 750 TkMainInfo *mainPtr; /* Information shared by all windows
jpayne@69 751 * associated with a particular main window.
jpayne@69 752 * NULL means this window is a rogue that is
jpayne@69 753 * not associated with any application (at
jpayne@69 754 * present, this only happens for the dummy
jpayne@69 755 * windows used for "send" communication). */
jpayne@69 756
jpayne@69 757 /*
jpayne@69 758 * Name and type information for the window:
jpayne@69 759 */
jpayne@69 760
jpayne@69 761 char *pathName; /* Path name of window (concatenation of all
jpayne@69 762 * names between this window and its top-level
jpayne@69 763 * ancestor). This is a pointer into an entry
jpayne@69 764 * in mainPtr->nameTable. NULL means that the
jpayne@69 765 * window hasn't been completely created
jpayne@69 766 * yet. */
jpayne@69 767 Tk_Uid nameUid; /* Name of the window within its parent
jpayne@69 768 * (unique within the parent). */
jpayne@69 769 Tk_Uid classUid; /* Class of the window. NULL means window
jpayne@69 770 * hasn't been given a class yet. */
jpayne@69 771
jpayne@69 772 /*
jpayne@69 773 * Geometry and other attributes of window. This information may not be
jpayne@69 774 * updated on the server immediately; stuff that hasn't been reflected in
jpayne@69 775 * the server yet is called "dirty". At present, information can be dirty
jpayne@69 776 * only if the window hasn't yet been created.
jpayne@69 777 */
jpayne@69 778
jpayne@69 779 XWindowChanges changes; /* Geometry and other info about window. */
jpayne@69 780 unsigned int dirtyChanges; /* Bits indicate fields of "changes" that are
jpayne@69 781 * dirty. */
jpayne@69 782 XSetWindowAttributes atts; /* Current attributes of window. */
jpayne@69 783 unsigned long dirtyAtts; /* Bits indicate fields of "atts" that are
jpayne@69 784 * dirty. */
jpayne@69 785
jpayne@69 786 unsigned int flags; /* Various flag values: these are all defined
jpayne@69 787 * in tk.h (confusing, but they're needed
jpayne@69 788 * there for some query macros). */
jpayne@69 789
jpayne@69 790 /*
jpayne@69 791 * Information kept by the event manager (tkEvent.c):
jpayne@69 792 */
jpayne@69 793
jpayne@69 794 TkEventHandler *handlerList;/* First in list of event handlers declared
jpayne@69 795 * for this window, or NULL if none. */
jpayne@69 796 #ifdef TK_USE_INPUT_METHODS
jpayne@69 797 XIC inputContext; /* XIM input context. */
jpayne@69 798 #endif /* TK_USE_INPUT_METHODS */
jpayne@69 799
jpayne@69 800 /*
jpayne@69 801 * Information used for event bindings (see "bind" and "bindtags" commands
jpayne@69 802 * in tkCmds.c):
jpayne@69 803 */
jpayne@69 804
jpayne@69 805 ClientData *tagPtr; /* Points to array of tags used for bindings
jpayne@69 806 * on this window. Each tag is a Tk_Uid.
jpayne@69 807 * Malloc'ed. NULL means no tags. */
jpayne@69 808 int numTags; /* Number of tags at *tagPtr. */
jpayne@69 809
jpayne@69 810 /*
jpayne@69 811 * Information used by tkOption.c to manage options for the window.
jpayne@69 812 */
jpayne@69 813
jpayne@69 814 int optionLevel; /* -1 means no option information is currently
jpayne@69 815 * cached for this window. Otherwise this
jpayne@69 816 * gives the level in the option stack at
jpayne@69 817 * which info is cached. */
jpayne@69 818 /*
jpayne@69 819 * Information used by tkSelect.c to manage the selection.
jpayne@69 820 */
jpayne@69 821
jpayne@69 822 struct TkSelHandler *selHandlerList;
jpayne@69 823 /* First in list of handlers for returning the
jpayne@69 824 * selection in various forms. */
jpayne@69 825
jpayne@69 826 /*
jpayne@69 827 * Information used by tkGeometry.c for geometry management.
jpayne@69 828 */
jpayne@69 829
jpayne@69 830 const Tk_GeomMgr *geomMgrPtr;
jpayne@69 831 /* Information about geometry manager for this
jpayne@69 832 * window. */
jpayne@69 833 ClientData geomData; /* Argument for geometry manager functions. */
jpayne@69 834 int reqWidth, reqHeight; /* Arguments from last call to
jpayne@69 835 * Tk_GeometryRequest, or 0's if
jpayne@69 836 * Tk_GeometryRequest hasn't been called. */
jpayne@69 837 int internalBorderLeft; /* Width of internal border of window (0 means
jpayne@69 838 * no internal border). Geometry managers
jpayne@69 839 * should not normally place children on top
jpayne@69 840 * of the border. Fields for the other three
jpayne@69 841 * sides are found below. */
jpayne@69 842
jpayne@69 843 /*
jpayne@69 844 * Information maintained by tkWm.c for window manager communication.
jpayne@69 845 */
jpayne@69 846
jpayne@69 847 struct TkWmInfo *wmInfoPtr; /* For top-level windows (and also for special
jpayne@69 848 * Unix menubar and wrapper windows), points
jpayne@69 849 * to structure with wm-related info (see
jpayne@69 850 * tkWm.c). For other windows, this is
jpayne@69 851 * NULL. */
jpayne@69 852
jpayne@69 853 /*
jpayne@69 854 * Information used by widget classes.
jpayne@69 855 */
jpayne@69 856
jpayne@69 857 const Tk_ClassProcs *classProcsPtr;
jpayne@69 858 ClientData instanceData;
jpayne@69 859
jpayne@69 860 /*
jpayne@69 861 * Platform specific information private to each port.
jpayne@69 862 */
jpayne@69 863
jpayne@69 864 struct TkWindowPrivate *privatePtr;
jpayne@69 865
jpayne@69 866 /*
jpayne@69 867 * More information used by tkGeometry.c for geometry management.
jpayne@69 868 */
jpayne@69 869
jpayne@69 870 /* The remaining fields of internal border. */
jpayne@69 871 int internalBorderRight;
jpayne@69 872 int internalBorderTop;
jpayne@69 873 int internalBorderBottom;
jpayne@69 874
jpayne@69 875 int minReqWidth; /* Minimum requested width. */
jpayne@69 876 int minReqHeight; /* Minimum requested height. */
jpayne@69 877 #ifdef TK_USE_INPUT_METHODS
jpayne@69 878 int ximGeneration; /* Used to invalidate XIC */
jpayne@69 879 #endif /* TK_USE_INPUT_METHODS */
jpayne@69 880 char *geomMgrName; /* Records the name of the geometry manager. */
jpayne@69 881 struct TkWindow *maintainerPtr;
jpayne@69 882 /* The geometry container for this window. The
jpayne@69 883 * value is NULL if the window has no container or
jpayne@69 884 * if its container is its parent. */
jpayne@69 885 } TkWindow;
jpayne@69 886
jpayne@69 887 /*
jpayne@69 888 * String tables:
jpayne@69 889 */
jpayne@69 890
jpayne@69 891 MODULE_SCOPE const char *const tkStateStrings[];
jpayne@69 892 MODULE_SCOPE const char *const tkCompoundStrings[];
jpayne@69 893
jpayne@69 894 /*
jpayne@69 895 * Real definition of some events. Note that these events come from outside
jpayne@69 896 * but have internally generated pieces added to them.
jpayne@69 897 */
jpayne@69 898
jpayne@69 899 typedef struct {
jpayne@69 900 XKeyEvent keyEvent; /* The real event from X11. */
jpayne@69 901 #ifdef _WIN32
jpayne@69 902 char trans_chars[XMaxTransChars];
jpayne@69 903 /* translated characters */
jpayne@69 904 unsigned char nbytes;
jpayne@69 905 #elif !defined(MAC_OSX_TK)
jpayne@69 906 char *charValuePtr; /* A pointer to a string that holds the key's
jpayne@69 907 * %A substitution text (before backslash
jpayne@69 908 * adding), or NULL if that has not been
jpayne@69 909 * computed yet. If non-NULL, this string was
jpayne@69 910 * allocated with ckalloc(). */
jpayne@69 911 int charValueLen; /* Length of string in charValuePtr when that
jpayne@69 912 * is non-NULL. */
jpayne@69 913 KeySym keysym; /* Key symbol computed after input methods
jpayne@69 914 * have been invoked */
jpayne@69 915 #endif
jpayne@69 916 } TkKeyEvent;
jpayne@69 917
jpayne@69 918 /*
jpayne@69 919 * Flags passed to TkpMakeMenuWindow's 'transient' argument.
jpayne@69 920 */
jpayne@69 921
jpayne@69 922 #define TK_MAKE_MENU_TEAROFF 0 /* Only non-transient case. */
jpayne@69 923 #define TK_MAKE_MENU_POPUP 1
jpayne@69 924 #define TK_MAKE_MENU_DROPDOWN 2
jpayne@69 925
jpayne@69 926 /*
jpayne@69 927 * The following structure is used with TkMakeEnsemble to create ensemble
jpayne@69 928 * commands and optionally to create sub-ensembles.
jpayne@69 929 */
jpayne@69 930
jpayne@69 931 typedef struct TkEnsemble {
jpayne@69 932 const char *name;
jpayne@69 933 Tcl_ObjCmdProc *proc;
jpayne@69 934 const struct TkEnsemble *subensemble;
jpayne@69 935 } TkEnsemble;
jpayne@69 936
jpayne@69 937 /*
jpayne@69 938 * The following structure is used as a two way map between integers and
jpayne@69 939 * strings, usually to map between an internal C representation and the
jpayne@69 940 * strings used in Tcl.
jpayne@69 941 */
jpayne@69 942
jpayne@69 943 typedef struct TkStateMap {
jpayne@69 944 int numKey; /* Integer representation of a value. */
jpayne@69 945 const char *strKey; /* String representation of a value. */
jpayne@69 946 } TkStateMap;
jpayne@69 947
jpayne@69 948 /*
jpayne@69 949 * This structure is used by the Mac and Window porting layers as the internal
jpayne@69 950 * representation of a clip_mask in a GC.
jpayne@69 951 */
jpayne@69 952
jpayne@69 953 typedef struct TkpClipMask {
jpayne@69 954 int type; /* TKP_CLIP_PIXMAP or TKP_CLIP_REGION. */
jpayne@69 955 union {
jpayne@69 956 Pixmap pixmap;
jpayne@69 957 TkRegion region;
jpayne@69 958 } value;
jpayne@69 959 } TkpClipMask;
jpayne@69 960
jpayne@69 961 #define TKP_CLIP_PIXMAP 0
jpayne@69 962 #define TKP_CLIP_REGION 1
jpayne@69 963
jpayne@69 964 /*
jpayne@69 965 * Return values from TkGrabState:
jpayne@69 966 */
jpayne@69 967
jpayne@69 968 #define TK_GRAB_NONE 0
jpayne@69 969 #define TK_GRAB_IN_TREE 1
jpayne@69 970 #define TK_GRAB_ANCESTOR 2
jpayne@69 971 #define TK_GRAB_EXCLUDED 3
jpayne@69 972
jpayne@69 973 /*
jpayne@69 974 * Additional flag for TkpMeasureCharsInContext. Coordinate with other flags
jpayne@69 975 * for this routine, but don't make public until TkpMeasureCharsInContext is
jpayne@69 976 * made public, too.
jpayne@69 977 */
jpayne@69 978
jpayne@69 979 #define TK_ISOLATE_END 32
jpayne@69 980
jpayne@69 981 /*
jpayne@69 982 * The macro below is used to modify a "char" value (e.g. by casting it to an
jpayne@69 983 * unsigned character) so that it can be used safely with macros such as
jpayne@69 984 * isspace().
jpayne@69 985 */
jpayne@69 986
jpayne@69 987 #define UCHAR(c) ((unsigned char) (c))
jpayne@69 988
jpayne@69 989 /*
jpayne@69 990 * The following symbol is used in the mode field of FocusIn events generated
jpayne@69 991 * by an embedded application to request the input focus from its container.
jpayne@69 992 */
jpayne@69 993
jpayne@69 994 #define EMBEDDED_APP_WANTS_FOCUS (NotifyNormal + 20)
jpayne@69 995
jpayne@69 996 /*
jpayne@69 997 * The following special modifier mask bits are defined, to indicate logical
jpayne@69 998 * modifiers such as Meta and Alt that may float among the actual modifier
jpayne@69 999 * bits.
jpayne@69 1000 */
jpayne@69 1001
jpayne@69 1002 #define META_MASK (AnyModifier<<1)
jpayne@69 1003 #define ALT_MASK (AnyModifier<<2)
jpayne@69 1004 #define EXTENDED_MASK (AnyModifier<<3)
jpayne@69 1005
jpayne@69 1006 /*
jpayne@69 1007 * Mask that selects any of the state bits corresponding to buttons, plus
jpayne@69 1008 * masks that select individual buttons' bits:
jpayne@69 1009 */
jpayne@69 1010
jpayne@69 1011 #define ALL_BUTTONS \
jpayne@69 1012 (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
jpayne@69 1013
jpayne@69 1014
jpayne@69 1015 MODULE_SCOPE unsigned TkGetButtonMask(unsigned);
jpayne@69 1016
jpayne@69 1017 /*
jpayne@69 1018 * Object types not declared in tkObj.c need to be mentioned here so they can
jpayne@69 1019 * be properly registered with Tcl:
jpayne@69 1020 */
jpayne@69 1021
jpayne@69 1022 MODULE_SCOPE const Tcl_ObjType tkBorderObjType;
jpayne@69 1023 MODULE_SCOPE const Tcl_ObjType tkBitmapObjType;
jpayne@69 1024 MODULE_SCOPE const Tcl_ObjType tkColorObjType;
jpayne@69 1025 MODULE_SCOPE const Tcl_ObjType tkCursorObjType;
jpayne@69 1026 MODULE_SCOPE const Tcl_ObjType tkFontObjType;
jpayne@69 1027 MODULE_SCOPE const Tcl_ObjType tkStateKeyObjType;
jpayne@69 1028 MODULE_SCOPE const Tcl_ObjType tkTextIndexType;
jpayne@69 1029
jpayne@69 1030 /*
jpayne@69 1031 * Miscellaneous variables shared among Tk modules but not exported to the
jpayne@69 1032 * outside world:
jpayne@69 1033 */
jpayne@69 1034
jpayne@69 1035 MODULE_SCOPE const Tk_SmoothMethod tkBezierSmoothMethod;
jpayne@69 1036 MODULE_SCOPE Tk_ImageType tkBitmapImageType;
jpayne@69 1037 MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtGIF;
jpayne@69 1038 MODULE_SCOPE void (*tkHandleEventProc) (XEvent* eventPtr);
jpayne@69 1039 MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtPNG;
jpayne@69 1040 MODULE_SCOPE Tk_PhotoImageFormat tkImgFmtPPM;
jpayne@69 1041 MODULE_SCOPE TkMainInfo *tkMainWindowList;
jpayne@69 1042 MODULE_SCOPE Tk_ImageType tkPhotoImageType;
jpayne@69 1043 MODULE_SCOPE Tcl_HashTable tkPredefBitmapTable;
jpayne@69 1044
jpayne@69 1045 MODULE_SCOPE const char *const tkWebColors[20];
jpayne@69 1046
jpayne@69 1047 /*
jpayne@69 1048 * The definition of pi, at least from the perspective of double-precision
jpayne@69 1049 * floats.
jpayne@69 1050 */
jpayne@69 1051
jpayne@69 1052 #ifndef PI
jpayne@69 1053 #ifdef M_PI
jpayne@69 1054 #define PI M_PI
jpayne@69 1055 #else
jpayne@69 1056 #define PI 3.14159265358979323846
jpayne@69 1057 #endif
jpayne@69 1058 #endif
jpayne@69 1059
jpayne@69 1060 /*
jpayne@69 1061 * Support for Clang Static Analyzer <https://clang-analyzer.llvm.org/>
jpayne@69 1062 */
jpayne@69 1063
jpayne@69 1064 #if defined(PURIFY) && defined(__clang__)
jpayne@69 1065 #if __has_feature(attribute_analyzer_noreturn) && \
jpayne@69 1066 !defined(Tcl_Panic) && defined(Tcl_Panic_TCL_DECLARED)
jpayne@69 1067 void Tcl_Panic(const char *, ...) __attribute__((analyzer_noreturn));
jpayne@69 1068 #endif
jpayne@69 1069 #if !defined(CLANG_ASSERT)
jpayne@69 1070 #define CLANG_ASSERT(x) assert(x)
jpayne@69 1071 #endif
jpayne@69 1072 #elif !defined(CLANG_ASSERT)
jpayne@69 1073 #define CLANG_ASSERT(x)
jpayne@69 1074 #endif /* PURIFY && __clang__ */
jpayne@69 1075
jpayne@69 1076 /*
jpayne@69 1077 * The following magic value is stored in the "send_event" field of FocusIn
jpayne@69 1078 * and FocusOut events. This allows us to separate "real" events coming from
jpayne@69 1079 * the server from those that we generated.
jpayne@69 1080 */
jpayne@69 1081
jpayne@69 1082 #define GENERATED_FOCUS_EVENT_MAGIC ((Bool) 0x547321ac)
jpayne@69 1083
jpayne@69 1084 /*
jpayne@69 1085 * Exported internals.
jpayne@69 1086 */
jpayne@69 1087
jpayne@69 1088 #include "tkIntDecls.h"
jpayne@69 1089
jpayne@69 1090 #ifdef __cplusplus
jpayne@69 1091 extern "C" {
jpayne@69 1092 #endif
jpayne@69 1093
jpayne@69 1094 /*
jpayne@69 1095 * Themed widget set init function:
jpayne@69 1096 */
jpayne@69 1097
jpayne@69 1098 MODULE_SCOPE int Ttk_Init(Tcl_Interp *interp);
jpayne@69 1099
jpayne@69 1100 /*
jpayne@69 1101 * Internal functions shared among Tk modules but not exported to the outside
jpayne@69 1102 * world:
jpayne@69 1103 */
jpayne@69 1104
jpayne@69 1105 MODULE_SCOPE int Tk_BellObjCmd(ClientData clientData,
jpayne@69 1106 Tcl_Interp *interp, int objc,
jpayne@69 1107 Tcl_Obj *const objv[]);
jpayne@69 1108 MODULE_SCOPE int Tk_BindObjCmd(ClientData clientData,
jpayne@69 1109 Tcl_Interp *interp, int objc,
jpayne@69 1110 Tcl_Obj *const objv[]);
jpayne@69 1111 MODULE_SCOPE int Tk_BindtagsObjCmd(ClientData clientData,
jpayne@69 1112 Tcl_Interp *interp, int objc,
jpayne@69 1113 Tcl_Obj *const objv[]);
jpayne@69 1114 MODULE_SCOPE int Tk_BusyObjCmd(ClientData clientData,
jpayne@69 1115 Tcl_Interp *interp, int objc,
jpayne@69 1116 Tcl_Obj *const objv[]);
jpayne@69 1117 MODULE_SCOPE int Tk_ButtonObjCmd(ClientData clientData,
jpayne@69 1118 Tcl_Interp *interp, int objc,
jpayne@69 1119 Tcl_Obj *const objv[]);
jpayne@69 1120 MODULE_SCOPE int Tk_CanvasObjCmd(ClientData clientData,
jpayne@69 1121 Tcl_Interp *interp, int argc,
jpayne@69 1122 Tcl_Obj *const objv[]);
jpayne@69 1123 MODULE_SCOPE int Tk_CheckbuttonObjCmd(ClientData clientData,
jpayne@69 1124 Tcl_Interp *interp, int objc,
jpayne@69 1125 Tcl_Obj *const objv[]);
jpayne@69 1126 MODULE_SCOPE int Tk_ClipboardObjCmd(ClientData clientData,
jpayne@69 1127 Tcl_Interp *interp, int objc,
jpayne@69 1128 Tcl_Obj *const objv[]);
jpayne@69 1129 MODULE_SCOPE int Tk_ChooseColorObjCmd(ClientData clientData,
jpayne@69 1130 Tcl_Interp *interp, int objc,
jpayne@69 1131 Tcl_Obj *const objv[]);
jpayne@69 1132 MODULE_SCOPE int Tk_ChooseDirectoryObjCmd(ClientData clientData,
jpayne@69 1133 Tcl_Interp *interp, int objc,
jpayne@69 1134 Tcl_Obj *const objv[]);
jpayne@69 1135 MODULE_SCOPE int Tk_DestroyObjCmd(ClientData clientData,
jpayne@69 1136 Tcl_Interp *interp, int objc,
jpayne@69 1137 Tcl_Obj *const objv[]);
jpayne@69 1138 MODULE_SCOPE int Tk_EntryObjCmd(ClientData clientData,
jpayne@69 1139 Tcl_Interp *interp, int objc,
jpayne@69 1140 Tcl_Obj *const objv[]);
jpayne@69 1141 MODULE_SCOPE int Tk_EventObjCmd(ClientData clientData,
jpayne@69 1142 Tcl_Interp *interp, int objc,
jpayne@69 1143 Tcl_Obj *const objv[]);
jpayne@69 1144 MODULE_SCOPE int Tk_FrameObjCmd(ClientData clientData,
jpayne@69 1145 Tcl_Interp *interp, int objc,
jpayne@69 1146 Tcl_Obj *const objv[]);
jpayne@69 1147 MODULE_SCOPE int Tk_FocusObjCmd(ClientData clientData,
jpayne@69 1148 Tcl_Interp *interp, int objc,
jpayne@69 1149 Tcl_Obj *const objv[]);
jpayne@69 1150 MODULE_SCOPE int Tk_FontObjCmd(ClientData clientData,
jpayne@69 1151 Tcl_Interp *interp, int objc,
jpayne@69 1152 Tcl_Obj *const objv[]);
jpayne@69 1153 MODULE_SCOPE int Tk_GetOpenFileObjCmd(ClientData clientData,
jpayne@69 1154 Tcl_Interp *interp, int objc,
jpayne@69 1155 Tcl_Obj *const objv[]);
jpayne@69 1156 MODULE_SCOPE int Tk_GetSaveFileObjCmd(ClientData clientData,
jpayne@69 1157 Tcl_Interp *interp, int objc,
jpayne@69 1158 Tcl_Obj *const objv[]);
jpayne@69 1159 MODULE_SCOPE int Tk_GrabObjCmd(ClientData clientData,
jpayne@69 1160 Tcl_Interp *interp, int objc,
jpayne@69 1161 Tcl_Obj *const objv[]);
jpayne@69 1162 MODULE_SCOPE int Tk_GridObjCmd(ClientData clientData,
jpayne@69 1163 Tcl_Interp *interp, int objc,
jpayne@69 1164 Tcl_Obj *const objv[]);
jpayne@69 1165 MODULE_SCOPE int Tk_ImageObjCmd(ClientData clientData,
jpayne@69 1166 Tcl_Interp *interp, int objc,
jpayne@69 1167 Tcl_Obj *const objv[]);
jpayne@69 1168 MODULE_SCOPE int Tk_LabelObjCmd(ClientData clientData,
jpayne@69 1169 Tcl_Interp *interp, int objc,
jpayne@69 1170 Tcl_Obj *const objv[]);
jpayne@69 1171 MODULE_SCOPE int Tk_LabelframeObjCmd(ClientData clientData,
jpayne@69 1172 Tcl_Interp *interp, int objc,
jpayne@69 1173 Tcl_Obj *const objv[]);
jpayne@69 1174 MODULE_SCOPE int Tk_ListboxObjCmd(ClientData clientData,
jpayne@69 1175 Tcl_Interp *interp, int objc,
jpayne@69 1176 Tcl_Obj *const objv[]);
jpayne@69 1177 MODULE_SCOPE int Tk_LowerObjCmd(ClientData clientData,
jpayne@69 1178 Tcl_Interp *interp, int objc,
jpayne@69 1179 Tcl_Obj *const objv[]);
jpayne@69 1180 MODULE_SCOPE int Tk_MenuObjCmd(ClientData clientData,
jpayne@69 1181 Tcl_Interp *interp, int objc,
jpayne@69 1182 Tcl_Obj *const objv[]);
jpayne@69 1183 MODULE_SCOPE int Tk_MenubuttonObjCmd(ClientData clientData,
jpayne@69 1184 Tcl_Interp *interp, int objc,
jpayne@69 1185 Tcl_Obj *const objv[]);
jpayne@69 1186 MODULE_SCOPE int Tk_MessageBoxObjCmd(ClientData clientData,
jpayne@69 1187 Tcl_Interp *interp, int objc,
jpayne@69 1188 Tcl_Obj *const objv[]);
jpayne@69 1189 MODULE_SCOPE int Tk_MessageObjCmd(ClientData clientData,
jpayne@69 1190 Tcl_Interp *interp, int objc,
jpayne@69 1191 Tcl_Obj *const objv[]);
jpayne@69 1192 MODULE_SCOPE int Tk_PanedWindowObjCmd(ClientData clientData,
jpayne@69 1193 Tcl_Interp *interp, int objc,
jpayne@69 1194 Tcl_Obj *const objv[]);
jpayne@69 1195 MODULE_SCOPE int Tk_OptionObjCmd(ClientData clientData,
jpayne@69 1196 Tcl_Interp *interp, int objc,
jpayne@69 1197 Tcl_Obj *const objv[]);
jpayne@69 1198 MODULE_SCOPE int Tk_PackObjCmd(ClientData clientData,
jpayne@69 1199 Tcl_Interp *interp, int objc,
jpayne@69 1200 Tcl_Obj *const objv[]);
jpayne@69 1201 MODULE_SCOPE int Tk_PlaceObjCmd(ClientData clientData,
jpayne@69 1202 Tcl_Interp *interp, int objc,
jpayne@69 1203 Tcl_Obj *const objv[]);
jpayne@69 1204 MODULE_SCOPE int Tk_RadiobuttonObjCmd(ClientData clientData,
jpayne@69 1205 Tcl_Interp *interp, int objc,
jpayne@69 1206 Tcl_Obj *const objv[]);
jpayne@69 1207 MODULE_SCOPE int Tk_RaiseObjCmd(ClientData clientData,
jpayne@69 1208 Tcl_Interp *interp, int objc,
jpayne@69 1209 Tcl_Obj *const objv[]);
jpayne@69 1210 MODULE_SCOPE int Tk_ScaleObjCmd(ClientData clientData,
jpayne@69 1211 Tcl_Interp *interp, int objc,
jpayne@69 1212 Tcl_Obj *const objv[]);
jpayne@69 1213 MODULE_SCOPE int Tk_ScrollbarObjCmd(ClientData clientData,
jpayne@69 1214 Tcl_Interp *interp, int objc,
jpayne@69 1215 Tcl_Obj *const objv[]);
jpayne@69 1216 MODULE_SCOPE int Tk_SelectionObjCmd(ClientData clientData,
jpayne@69 1217 Tcl_Interp *interp, int objc,
jpayne@69 1218 Tcl_Obj *const objv[]);
jpayne@69 1219 MODULE_SCOPE int Tk_SendObjCmd(ClientData clientData,
jpayne@69 1220 Tcl_Interp *interp,int objc,
jpayne@69 1221 Tcl_Obj *const objv[]);
jpayne@69 1222 MODULE_SCOPE int Tk_SpinboxObjCmd(ClientData clientData,
jpayne@69 1223 Tcl_Interp *interp, int objc,
jpayne@69 1224 Tcl_Obj *const objv[]);
jpayne@69 1225 MODULE_SCOPE int Tk_TextObjCmd(ClientData clientData,
jpayne@69 1226 Tcl_Interp *interp, int objc,
jpayne@69 1227 Tcl_Obj *const objv[]);
jpayne@69 1228 MODULE_SCOPE int Tk_TkwaitObjCmd(ClientData clientData,
jpayne@69 1229 Tcl_Interp *interp, int objc,
jpayne@69 1230 Tcl_Obj *const objv[]);
jpayne@69 1231 MODULE_SCOPE int Tk_ToplevelObjCmd(ClientData clientData,
jpayne@69 1232 Tcl_Interp *interp, int objc,
jpayne@69 1233 Tcl_Obj *const objv[]);
jpayne@69 1234 MODULE_SCOPE int Tk_UpdateObjCmd(ClientData clientData,
jpayne@69 1235 Tcl_Interp *interp, int objc,
jpayne@69 1236 Tcl_Obj *const objv[]);
jpayne@69 1237 MODULE_SCOPE int Tk_WinfoObjCmd(ClientData clientData,
jpayne@69 1238 Tcl_Interp *interp, int objc,
jpayne@69 1239 Tcl_Obj *const objv[]);
jpayne@69 1240 MODULE_SCOPE int Tk_WmObjCmd(ClientData clientData, Tcl_Interp *interp,
jpayne@69 1241 int objc, Tcl_Obj *const objv[]);
jpayne@69 1242
jpayne@69 1243 MODULE_SCOPE int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp,
jpayne@69 1244 Tk_Window tkwin, Tcl_Obj *objPtr,
jpayne@69 1245 double *doublePtr);
jpayne@69 1246 #define TkSetGeometryContainer TkSetGeometryMaster
jpayne@69 1247 MODULE_SCOPE int TkSetGeometryContainer(Tcl_Interp *interp,
jpayne@69 1248 Tk_Window tkwin, const char *name);
jpayne@69 1249 #define TkFreeGeometryContainer TkFreeGeometryMaster
jpayne@69 1250 MODULE_SCOPE void TkFreeGeometryContainer(Tk_Window tkwin,
jpayne@69 1251 const char *name);
jpayne@69 1252
jpayne@69 1253 MODULE_SCOPE void TkEventInit(void);
jpayne@69 1254 MODULE_SCOPE void TkRegisterObjTypes(void);
jpayne@69 1255 MODULE_SCOPE int TkDeadAppObjCmd(ClientData clientData,
jpayne@69 1256 Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
jpayne@69 1257 MODULE_SCOPE int TkCanvasGetCoordObj(Tcl_Interp *interp,
jpayne@69 1258 Tk_Canvas canvas, Tcl_Obj *obj,
jpayne@69 1259 double *doublePtr);
jpayne@69 1260 MODULE_SCOPE int TkGetDoublePixels(Tcl_Interp *interp, Tk_Window tkwin,
jpayne@69 1261 const char *string, double *doublePtr);
jpayne@69 1262 MODULE_SCOPE int TkPostscriptImage(Tcl_Interp *interp, Tk_Window tkwin,
jpayne@69 1263 Tk_PostscriptInfo psInfo, XImage *ximage,
jpayne@69 1264 int x, int y, int width, int height);
jpayne@69 1265 MODULE_SCOPE void TkMapTopFrame(Tk_Window tkwin);
jpayne@69 1266 MODULE_SCOPE XEvent * TkpGetBindingXEvent(Tcl_Interp *interp);
jpayne@69 1267 MODULE_SCOPE void TkCreateExitHandler(Tcl_ExitProc *proc,
jpayne@69 1268 void *clientData);
jpayne@69 1269 MODULE_SCOPE void TkDeleteExitHandler(Tcl_ExitProc *proc,
jpayne@69 1270 ClientData clientData);
jpayne@69 1271 MODULE_SCOPE Tcl_ExitProc TkFinalize;
jpayne@69 1272 MODULE_SCOPE Tcl_ExitProc TkFinalizeThread;
jpayne@69 1273 MODULE_SCOPE void TkpBuildRegionFromAlphaData(TkRegion region,
jpayne@69 1274 unsigned x, unsigned y, unsigned width,
jpayne@69 1275 unsigned height, unsigned char *dataPtr,
jpayne@69 1276 unsigned pixelStride, unsigned lineStride);
jpayne@69 1277 MODULE_SCOPE void TkAppendPadAmount(Tcl_Obj *bufferObj,
jpayne@69 1278 const char *buffer, int pad1, int pad2);
jpayne@69 1279 MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp,
jpayne@69 1280 Tk_Window tkwin, Tcl_Obj *objPtr,
jpayne@69 1281 int *pad1Ptr, int *pad2Ptr);
jpayne@69 1282 MODULE_SCOPE void TkFocusSplit(TkWindow *winPtr);
jpayne@69 1283 MODULE_SCOPE void TkFocusJoin(TkWindow *winPtr);
jpayne@69 1284 MODULE_SCOPE int TkpAlwaysShowSelection(Tk_Window tkwin);
jpayne@69 1285 MODULE_SCOPE void TkpDrawCharsInContext(Display * display,
jpayne@69 1286 Drawable drawable, GC gc, Tk_Font tkfont,
jpayne@69 1287 const char *source, int numBytes, int rangeStart,
jpayne@69 1288 int rangeLength, int x, int y);
jpayne@69 1289 MODULE_SCOPE void TkpDrawAngledCharsInContext(Display * display,
jpayne@69 1290 Drawable drawable, GC gc, Tk_Font tkfont,
jpayne@69 1291 const char *source, int numBytes, int rangeStart,
jpayne@69 1292 int rangeLength, double x, double y, double angle);
jpayne@69 1293 MODULE_SCOPE int TkpMeasureCharsInContext(Tk_Font tkfont,
jpayne@69 1294 const char *source, int numBytes, int rangeStart,
jpayne@69 1295 int rangeLength, int maxLength, int flags,
jpayne@69 1296 int *lengthPtr);
jpayne@69 1297 MODULE_SCOPE void TkUnderlineCharsInContext(Display *display,
jpayne@69 1298 Drawable drawable, GC gc, Tk_Font tkfont,
jpayne@69 1299 const char *string, int numBytes, int x, int y,
jpayne@69 1300 int firstByte, int lastByte);
jpayne@69 1301 MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont,
jpayne@69 1302 int c, struct TkFontAttributes *faPtr);
jpayne@69 1303 MODULE_SCOPE Tcl_Obj * TkNewWindowObj(Tk_Window tkwin);
jpayne@69 1304 MODULE_SCOPE void TkpShowBusyWindow(TkBusy busy);
jpayne@69 1305 MODULE_SCOPE void TkpHideBusyWindow(TkBusy busy);
jpayne@69 1306 MODULE_SCOPE void TkpMakeTransparentWindowExist(Tk_Window tkwin,
jpayne@69 1307 Window parent);
jpayne@69 1308 MODULE_SCOPE void TkpCreateBusy(Tk_FakeWin *winPtr, Tk_Window tkRef,
jpayne@69 1309 Window *parentPtr, Tk_Window tkParent,
jpayne@69 1310 TkBusy busy);
jpayne@69 1311 MODULE_SCOPE int TkBackgroundEvalObjv(Tcl_Interp *interp,
jpayne@69 1312 int objc, Tcl_Obj *const *objv, int flags);
jpayne@69 1313 MODULE_SCOPE void TkSendVirtualEvent(Tk_Window tgtWin,
jpayne@69 1314 const char *eventName, Tcl_Obj *detail);
jpayne@69 1315 MODULE_SCOPE Tcl_Command TkMakeEnsemble(Tcl_Interp *interp,
jpayne@69 1316 const char *nsname, const char *name,
jpayne@69 1317 ClientData clientData, const TkEnsemble *map);
jpayne@69 1318 MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp,
jpayne@69 1319 ClientData clientData);
jpayne@69 1320 MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp,
jpayne@69 1321 ClientData clientData);
jpayne@69 1322 MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr);
jpayne@69 1323 MODULE_SCOPE void TkpCancelWarp(TkDisplay *dispPtr);
jpayne@69 1324 MODULE_SCOPE int TkListCreateFrame(ClientData clientData,
jpayne@69 1325 Tcl_Interp *interp, Tcl_Obj *listObj,
jpayne@69 1326 int toplevel, Tcl_Obj *nameObj);
jpayne@69 1327
jpayne@69 1328 #ifdef _WIN32
jpayne@69 1329 #define TkParseColor XParseColor
jpayne@69 1330 #else
jpayne@69 1331 MODULE_SCOPE Status TkParseColor (Display * display,
jpayne@69 1332 Colormap map, const char* spec,
jpayne@69 1333 XColor * colorPtr);
jpayne@69 1334 #endif
jpayne@69 1335 #ifdef HAVE_XFT
jpayne@69 1336 MODULE_SCOPE void TkUnixSetXftClipRegion(TkRegion clipRegion);
jpayne@69 1337 #endif
jpayne@69 1338
jpayne@69 1339 #if !defined(__cplusplus) && !defined(c_plusplus)
jpayne@69 1340 # define c_class class
jpayne@69 1341 #endif
jpayne@69 1342
jpayne@69 1343 /* Tcl 8.6 has a different definition of Tcl_UniChar than other Tcl versions for TCL_UTF_MAX > 3 */
jpayne@69 1344 #if TCL_UTF_MAX > (3 + (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 6))
jpayne@69 1345 # define TkUtfToUniChar Tcl_UtfToUniChar
jpayne@69 1346 # define TkUniCharToUtf Tcl_UniCharToUtf
jpayne@69 1347 # define TkUtfPrev Tcl_UtfPrev
jpayne@69 1348 # define TkUtfAtIndex Tcl_UtfAtIndex
jpayne@69 1349 #else
jpayne@69 1350 MODULE_SCOPE int TkUtfToUniChar(const char *, int *);
jpayne@69 1351 MODULE_SCOPE int TkUniCharToUtf(int, char *);
jpayne@69 1352 MODULE_SCOPE const char *TkUtfPrev(const char *, const char *);
jpayne@69 1353 MODULE_SCOPE const char *TkUtfAtIndex(const char *src, int index);
jpayne@69 1354 #endif
jpayne@69 1355
jpayne@69 1356 /*
jpayne@69 1357 * Unsupported commands.
jpayne@69 1358 */
jpayne@69 1359
jpayne@69 1360 MODULE_SCOPE int TkUnsupported1ObjCmd(ClientData clientData,
jpayne@69 1361 Tcl_Interp *interp, int objc,
jpayne@69 1362 Tcl_Obj *const objv[]);
jpayne@69 1363
jpayne@69 1364 /*
jpayne@69 1365 * For Tktest.
jpayne@69 1366 */
jpayne@69 1367 MODULE_SCOPE int SquareObjCmd(ClientData clientData,
jpayne@69 1368 Tcl_Interp *interp, int objc,
jpayne@69 1369 Tcl_Obj * const objv[]);
jpayne@69 1370 MODULE_SCOPE int TkOldTestInit(Tcl_Interp *interp);
jpayne@69 1371 #if !(defined(_WIN32) || defined(MAC_OSX_TK))
jpayne@69 1372 #define TkplatformtestInit(x) TCL_OK
jpayne@69 1373 #else
jpayne@69 1374 MODULE_SCOPE int TkplatformtestInit(Tcl_Interp *interp);
jpayne@69 1375 #endif
jpayne@69 1376
jpayne@69 1377 #ifdef __cplusplus
jpayne@69 1378 }
jpayne@69 1379 #endif
jpayne@69 1380
jpayne@69 1381 #endif /* _TKINT */
jpayne@69 1382
jpayne@69 1383 /*
jpayne@69 1384 * Local Variables:
jpayne@69 1385 * mode: c
jpayne@69 1386 * c-basic-offset: 4
jpayne@69 1387 * fill-column: 78
jpayne@69 1388 * End:
jpayne@69 1389 */