Debian Codegraph @

pTk/mTk/generic/tkInt.h

raw symbols SCIP
1 /*
2 * tkInt.h --
3 *
4 * Declarations for things used internally by the Tk
5 * procedures but not exported outside the module.
6 *
7 * Copyright (c) 1990-1994 The Regents of the University of California.
8 * Copyright (c) 1994-1997 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: tkInt.h,v 1.56.2.1 2003/10/13 03:30:05 hobbs Exp $
15 */
16
17 #ifndef _TKINT
18 #define _TKINT
19
20 #ifndef _TK
21 #include "tk.h"
22 #endif
23 #ifdef BUILD_tk
24 # undef TCL_STORAGE_CLASS
25 # define TCL_STORAGE_CLASS DLLEXPORT
26 #endif
27
28 /*
29 * Opaque type declarations:
30 */
31
32 typedef struct TkColormap TkColormap;
33 typedef struct TkGrabEvent TkGrabEvent;
34 typedef struct TkpCursor_ *TkpCursor;
35 typedef struct TkRegion_ *TkRegion;
36 typedef struct TkStressedCmap TkStressedCmap;
37 typedef struct TkBindInfo_ *TkBindInfo;
38
39 /*
40 * Procedure types.
41 */
42
43 typedef int (TkBindEvalProc) _ANSI_ARGS_((ClientData clientData,
44 Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin,
45 KeySym keySym));
46 typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData));
47
48 /*
49 * One of the following structures is maintained for each cursor in
50 * use in the system. This structure is used by tkCursor.c and the
51 * various system specific cursor files.
52 */
53
54 typedef struct TkCursor {
55 Tk_Cursor cursor; /* System specific identifier for cursor. */
56 Display *display; /* Display containing cursor. Needed for
57 * disposal and retrieval of cursors. */
58 int resourceRefCount; /* Number of active uses of this cursor (each
59 * active use corresponds to a call to
60 * Tk_AllocPreserveFromObj or Tk_Preserve).
61 * If this count is 0, then this structure
62 * is no longer valid and it isn't present
63 * in a hash table: it is being kept around
64 * only because there are objects referring
65 * to it. The structure is freed when
66 * resourceRefCount and objRefCount are
67 * both 0. */
68 int objRefCount; /* Number of Tcl objects that reference
69 * this structure.. */
70 Tcl_HashTable *otherTable; /* Second table (other than idTable) used
71 * to index this entry. */
72 Tcl_HashEntry *hashPtr; /* Entry in otherTable for this structure
73 * (needed when deleting). */
74 Tcl_HashEntry *idHashPtr; /* Entry in idTable for this structure
75 * (needed when deleting). */
76 struct TkCursor *nextPtr; /* Points to the next TkCursor structure with
77 * the same name. Cursors with the same
78 * name but different displays are chained
79 * together off a single hash table entry. */
80 } TkCursor;
81
82 /*
83 * This defines whether we should try to use XIM over-the-spot style
84 * input. Allow users to override it. It is a much more elegant use
85 * of XIM, but uses a bit more memory.
86 */
87
88 #ifndef TK_XIM_SPOT
89 # define TK_XIM_SPOT 1
90 #endif
91
92 /*
93 * The following structure is kept one-per-TkDisplay to maintain information
94 * about the caret (cursor location) on this display. This is used to
95 * dictate global focus location (Windows Accessibility guidelines) and to
96 * position the IME or XIM over-the-spot window.
97 */
98
99 typedef struct TkCaret {
100 struct TkWindow *winPtr; /* the window on which we requested caret
101 * placement */
102 int x; /* relative x coord of the caret */
103 int y; /* relative y coord of the caret */
104 int height; /* specified height of the window */
105 } TkCaret;
106
107 /*
108 * One of the following structures is maintained for each display
109 * containing a window managed by Tk. In part, the structure is
110 * used to store thread-specific data, since each thread will have
111 * its own TkDisplay structure.
112 */
113
114 typedef struct TkDisplay {
115 Display *display; /* Xlib's info about display. */
116 struct TkDisplay *nextPtr; /* Next in list of all displays. */
117 char *name; /* Name of display (with any screen
118 * identifier removed). Malloc-ed. */
119 Time lastEventTime; /* Time of last event received for this
120 * display. */
121
122 /*
123 * Information used primarily by tk3d.c:
124 */
125
126 int borderInit; /* 0 means borderTable needs initializing. */
127 Tcl_HashTable borderTable; /* Maps from color name to TkBorder
128 * structure. */
129
130 /*
131 * Information used by tkAtom.c only:
132 */
133
134 int atomInit; /* 0 means stuff below hasn't been
135 * initialized yet. */
136 Tcl_HashTable nameTable; /* Maps from names to Atom's. */
137 Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
138
139 /*
140 * Information used primarily by tkBind.c:
141 */
142
143 int bindInfoStale; /* Non-zero means the variables in this
144 * part of the structure are potentially
145 * incorrect and should be recomputed. */
146 unsigned int modeModMask; /* Has one bit set to indicate the modifier
147 * corresponding to "mode shift". If no
148 * such modifier, than this is zero. */
149 unsigned int metaModMask; /* Has one bit set to indicate the modifier
150 * corresponding to the "Meta" key. If no
151 * such modifier, then this is zero. */
152 unsigned int altModMask; /* Has one bit set to indicate the modifier
153 * corresponding to the "Meta" key. If no
154 * such modifier, then this is zero. */
155 enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
156 /* Indicates how to interpret lock modifier. */
157 int numModKeyCodes; /* Number of entries in modKeyCodes array
158 * below. */
159 KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
160 * all of the keys that have modifiers
161 * associated with them. Malloc'ed, but
162 * may be NULL. */
163
164 /*
165 * Information used by tkBitmap.c only:
166 */
167
168 int bitmapInit; /* 0 means tables above need initializing. */
169 int bitmapAutoNumber; /* Used to number bitmaps. */
170 Tcl_HashTable bitmapNameTable;
171 /* Maps from name of bitmap to the first
172 * TkBitmap record for that name. */
173 Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
174 * structure for the bitmap. */
175 Tcl_HashTable bitmapDataTable;
176 /* Used by Tk_GetBitmapFromData to map from
177 * a collection of in-core data about a
178 * bitmap to a reference giving an auto-
179 * matically-generated name for the bitmap. */
180
181 /*
182 * Information used by tkCanvas.c only:
183 */
184
185 int numIdSearches;
186 int numSlowSearches;
187
188 /*
189 * Used by tkColor.c only:
190 */
191
192 int colorInit; /* 0 means color module needs initializing. */
193 TkStressedCmap *stressPtr; /* First in list of colormaps that have
194 * filled up, so we have to pick an
195 * approximate color. */
196 Tcl_HashTable colorNameTable;
197 /* Maps from color name to TkColor structure
198 * for that color. */
199 Tcl_HashTable colorValueTable;
200 /* Maps from integer RGB values to TkColor
201 * structures. */
202
203 /*
204 * Used by tkCursor.c only:
205 */
206
207 int cursorInit; /* 0 means cursor module need initializing. */
208 Tcl_HashTable cursorNameTable;
209 /* Maps from a string name to a cursor to the
210 * TkCursor record for the cursor. */
211 Tcl_HashTable cursorDataTable;
212 /* Maps from a collection of in-core data
213 * about a cursor to a TkCursor structure. */
214 Tcl_HashTable cursorIdTable;
215 /* Maps from a cursor id to the TkCursor
216 * structure for the cursor. */
217 char cursorString[20]; /* Used to store a cursor id string. */
218 Font cursorFont; /* Font to use for standard cursors.
219 * None means font not loaded yet. */
220
221 /*
222 * Information used by tkError.c only:
223 */
224
225 struct TkErrorHandler *errorPtr;
226 /* First in list of error handlers
227 * for this display. NULL means
228 * no handlers exist at present. */
229 int deleteCount; /* Counts # of handlers deleted since
230 * last time inactive handlers were
231 * garbage-collected. When this number
232 * gets big, handlers get cleaned up. */
233
234 /*
235 * Used by tkEvent.c only:
236 */
237
238 struct TkWindowEvent *delayedMotionPtr;
239 /* Points to a malloc-ed motion event
240 * whose processing has been delayed in
241 * the hopes that another motion event
242 * will come along right away and we can
243 * merge the two of them together. NULL
244 * means that there is no delayed motion
245 * event. */
246
247 /*
248 * Information used by tkFocus.c only:
249 */
250
251 int focusDebug; /* 1 means collect focus debugging
252 * statistics. */
253 struct TkWindow *implicitWinPtr;
254 /* If the focus arrived at a toplevel window
255 * implicitly via an Enter event (rather
256 * than via a FocusIn event), this points
257 * to the toplevel window. Otherwise it is
258 * NULL. */
259 struct TkWindow *focusPtr; /* Points to the window on this display that
260 * should be receiving keyboard events. When
261 * multiple applications on the display have
262 * the focus, this will refer to the
263 * innermost window in the innermost
264 * application. This information isn't used
265 * under Unix or Windows, but it's needed on
266 * the Macintosh. */
267
268 /*
269 * Information used by tkGC.c only:
270 */
271
272 Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure
273 * describing a GC with those values. */
274 Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
275 int gcInit; /* 0 means the tables below need
276 * initializing. */
277
278 /*
279 * Information used by tkGeometry.c only:
280 */
281
282 Tcl_HashTable maintainHashTable;
283 /* Hash table that maps from a master's
284 * Tk_Window token to a list of slaves
285 * managed by that master. */
286 int geomInit;
287
288 /*
289 * Information used by tkGet.c only:
290 */
291
292 Tcl_HashTable uidTable; /* Stores all Tk_Uid used in a thread. */
293 int uidInit; /* 0 means uidTable needs initializing. */
294
295 /*
296 * Information used by tkGrab.c only:
297 */
298
299 struct TkWindow *grabWinPtr;
300 /* Window in which the pointer is currently
301 * grabbed, or NULL if none. */
302 struct TkWindow *eventualGrabWinPtr;
303 /* Value that grabWinPtr will have once the
304 * grab event queue (below) has been
305 * completely emptied. */
306 struct TkWindow *buttonWinPtr;
307 /* Window in which first mouse button was
308 * pressed while grab was in effect, or NULL
309 * if no such press in effect. */
310 struct TkWindow *serverWinPtr;
311 /* If no application contains the pointer then
312 * this is NULL. Otherwise it contains the
313 * last window for which we've gotten an
314 * Enter or Leave event from the server (i.e.
315 * the last window known to have contained
316 * the pointer). Doesn't reflect events
317 * that were synthesized in tkGrab.c. */
318 TkGrabEvent *firstGrabEventPtr;
319 /* First in list of enter/leave events
320 * synthesized by grab code. These events
321 * must be processed in order before any other
322 * events are processed. NULL means no such
323 * events. */
324 TkGrabEvent *lastGrabEventPtr;
325 /* Last in list of synthesized events, or NULL
326 * if list is empty. */
327 int grabFlags; /* Miscellaneous flag values. See definitions
328 * in tkGrab.c. */
329
330 /*
331 * Information used by tkGrid.c only:
332 */
333
334 int gridInit; /* 0 means table below needs initializing. */
335 Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to
336 * corresponding Grid structures. */
337
338 /*
339 * Information used by tkImage.c only:
340 */
341
342 int imageId; /* Value used to number image ids. */
343
344 /*
345 * Information used by tkMacWinMenu.c only:
346 */
347
348 int postCommandGeneration;
349
350 /*
351 * Information used by tkOption.c only.
352 */
353
354
355
356 /*
357 * Information used by tkPack.c only.
358 */
359
360 int packInit; /* 0 means table below needs initializing. */
361 Tcl_HashTable packerHashTable;
362 /* Maps from Tk_Window tokens to
363 * corresponding Packer structures. */
364
365
366 /*
367 * Information used by tkPlace.c only.
368 */
369
370 int placeInit; /* 0 means tables below need initializing. */
371 Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
372 * structure for the window, if it exists. */
373 Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
374 * structure for the window, if it exists. */
375
376 /*
377 * Information used by tkSelect.c and tkClipboard.c only:
378 */
379
380 struct TkSelectionInfo *selectionInfoPtr;
381 /* First in list of selection information
382 * records. Each entry contains information
383 * about the current owner of a particular
384 * selection on this display. */
385 Atom multipleAtom; /* Atom for MULTIPLE. None means
386 * selection stuff isn't initialized. */
387 Atom incrAtom; /* Atom for INCR. */
388 Atom targetsAtom; /* Atom for TARGETS. */
389 Atom timestampAtom; /* Atom for TIMESTAMP. */
390 Atom textAtom; /* Atom for TEXT. */
391 Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
392 Atom applicationAtom; /* Atom for TK_APPLICATION. */
393 Atom windowAtom; /* Atom for TK_WINDOW. */
394 Atom clipboardAtom; /* Atom for CLIPBOARD. */
395 Atom utf8Atom; /* Atom for UTF8_STRING. */
396
397 Tk_Window clipWindow; /* Window used for clipboard ownership and to
398 * retrieve selections between processes. NULL
399 * means clipboard info hasn't been
400 * initialized. */
401 int clipboardActive; /* 1 means we currently own the clipboard
402 * selection, 0 means we don't. */
403 struct TkMainInfo *clipboardAppPtr;
404 /* Last application that owned clipboard. */
405 struct TkClipboardTarget *clipTargetPtr;
406 /* First in list of clipboard type information
407 * records. Each entry contains information
408 * about the buffers for a given selection
409 * target. */
410
411 /*
412 * Information used by tkSend.c only:
413 */
414
415 Tk_Window commTkwin; /* Window used for communication
416 * between interpreters during "send"
417 * commands. NULL means send info hasn't
418 * been initialized yet. */
419 Atom commProperty; /* X's name for comm property. */
420 Atom registryProperty; /* X's name for property containing
421 * registry of interpreter names. */
422 Atom appNameProperty; /* X's name for property used to hold the
423 * application name on each comm window. */
424
425 /*
426 * Information used by tkXId.c only:
427 */
428
429 struct TkIdStack *idStackPtr;
430 /* First in list of chunks of free resource
431 * identifiers, or NULL if there are no free
432 * resources. */
433 XID (*defaultAllocProc) _ANSI_ARGS_((Display *display));
434 /* Default resource allocator for display. */
435 struct TkIdStack *windowStackPtr;
436 /* First in list of chunks of window
437 * identifers that can't be reused right
438 * now. */
439 Tcl_TimerToken idCleanupScheduled;
440 /* If set, it means a call to WindowIdCleanup
441 * has already been scheduled, 0 means it
442 * hasn't. */
443
444 /*
445 * Information used by tkUnixWm.c and tkWinWm.c only:
446 */
447
448 struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
449 struct TkWmInfo *foregroundWmPtr;
450 /* Points to the foreground window. */
451
452 /*
453 * Information maintained by tkWindow.c for use later on by tkXId.c:
454 */
455
456
457 int destroyCount; /* Number of Tk_DestroyWindow operations
458 * in progress. */
459 unsigned long lastDestroyRequest;
460 /* Id of most recent XDestroyWindow request;
461 * can re-use ids in windowStackPtr when
462 * server has seen this request and event
463 * queue is empty. */
464
465 /*
466 * Information used by tkVisual.c only:
467 */
468
469 TkColormap *cmapPtr; /* First in list of all non-default colormaps
470 * allocated for this display. */
471
472 /*
473 * Miscellaneous information:
474 */
475
476 #ifdef TK_USE_INPUT_METHODS
477 XIM inputMethod; /* Input method for this display */
478 #if TK_XIM_SPOT
479 XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
480 #endif
481 #endif /* TK_USE_INPUT_METHODS */
482 Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
483
484 int refCount; /* Reference count of how many Tk applications
485 * are using this display. Used to clean up
486 * the display when we no longer have any
487 * Tk applications using it.
488 */
489 /*
490 * The following field were all added for Tk8.3
491 */
492 int mouseButtonState; /* current mouse button state for this
493 * display */
494 Window mouseButtonWindow; /* Window the button state was set in,
495 * added in Tk 8.4. */
496 Window warpWindow;
497 int warpX;
498 int warpY;
499
500 /*
501 * The following field(s) were all added for Tk8.4
502 */
503 unsigned int flags; /* Various flag values: these are all
504 * defined in below. */
505 TkCaret caret; /* information about the caret for this
506 * display. This is not a pointer. */
507 int iconDataSize; /* Size of default iconphoto image data */
508 unsigned char *iconDataPtr; /* Default iconphoto image data, if set */
509 } TkDisplay;
510
511 /*
512 * Flag values for TkDisplay flags.
513 * TK_DISPLAY_COLLAPSE_MOTION_EVENTS: (default on)
514 * Indicates that we should collapse motion events on this display
515 * TK_DISPLAY_USE_IM: (default on, set via tk.tcl)
516 * Whether to use input methods for this display
517 * TK_DISPLAY_XIM_SPOT: (default off)
518 * Indicates that we should use over-the-spot XIM on this display
519 * TK_DISPLAY_WM_TRACING: (default off)
520 * Whether we should do wm tracing on this display.
521 * TK_DISPLAY_IN_WARP: (default off)
522 * Indicates that we are in a pointer warp
523 */
524
525 #define TK_DISPLAY_COLLAPSE_MOTION_EVENTS (1 << 0)
526 #define TK_DISPLAY_USE_IM (1 << 1)
527 #define TK_DISPLAY_XIM_SPOT (1 << 2)
528 #define TK_DISPLAY_WM_TRACING (1 << 3)
529 #define TK_DISPLAY_IN_WARP (1 << 4)
530
531 /*
532 * One of the following structures exists for each error handler
533 * created by a call to Tk_CreateErrorHandler. The structure
534 * is managed by tkError.c.
535 */
536
537 typedef struct TkErrorHandler {
538 TkDisplay *dispPtr; /* Display to which handler applies. */
539 unsigned long firstRequest; /* Only errors with serial numbers
540 * >= to this are considered. */
541 unsigned long lastRequest; /* Only errors with serial numbers
542 * <= to this are considered. This
543 * field is filled in when XUnhandle
544 * is called. -1 means XUnhandle
545 * hasn't been called yet. */
546 int error; /* Consider only errors with this
547 * error_code (-1 means consider
548 * all errors). */
549 int request; /* Consider only errors with this
550 * major request code (-1 means
551 * consider all major codes). */
552 int minorCode; /* Consider only errors with this
553 * minor request code (-1 means
554 * consider all minor codes). */
555 Tk_ErrorProc *errorProc; /* Procedure to invoke when a matching
556 * error occurs. NULL means just ignore
557 * errors. */
558 ClientData clientData; /* Arbitrary value to pass to
559 * errorProc. */
560 struct TkErrorHandler *nextPtr;
561 /* Pointer to next older handler for
562 * this display, or NULL for end of
563 * list. */
564 } TkErrorHandler;
565
566
567 /*
568 * One of the following structures exists for each event handler
569 * created by calling Tk_CreateEventHandler. This information
570 * is used by tkEvent.c only.
571 */
572
573 typedef struct TkEventHandler {
574 unsigned long mask; /* Events for which to invoke
575 * proc. */
576 Tk_EventProc *proc; /* Procedure to invoke when an event
577 * in mask occurs. */
578 ClientData clientData; /* Argument to pass to proc. */
579 struct TkEventHandler *nextPtr;
580 /* Next in list of handlers
581 * associated with window (NULL means
582 * end of list). */
583 } TkEventHandler;
584
585 /*
586 * Tk keeps one of the following data structures for each main
587 * window (created by a call to TkCreateMainWindow). It stores
588 * information that is shared by all of the windows associated
589 * with a particular main window.
590 */
591
592 typedef struct TkMainInfo {
593 int refCount; /* Number of windows whose "mainPtr" fields
594 * point here. When this becomes zero, can
595 * free up the structure (the reference
596 * count is zero because windows can get
597 * deleted in almost any order; the main
598 * window isn't necessarily the last one
599 * deleted). */
600 struct TkWindow *winPtr; /* Pointer to main window. */
601 Tcl_Interp *interp; /* Interpreter associated with application. */
602 Tcl_HashTable nameTable; /* Hash table mapping path names to TkWindow
603 * structs for all windows related to this
604 * main window. Managed by tkWindow.c. */
605 long deletionEpoch; /* Incremented by window deletions */
606 Tk_BindingTable bindingTable;
607 /* Used in conjunction with "bind" command
608 * to bind events to Tcl commands. */
609 TkBindInfo bindInfo; /* Information used by tkBind.c on a per
610 * application basis. */
611 struct TkFontInfo *fontInfoPtr;
612 /* Information used by tkFont.c on a per
613 * application basis. */
614
615 /*
616 * Information used only by tkFocus.c and tk*Embed.c:
617 */
618
619 struct TkToplevelFocusInfo *tlFocusPtr;
620 /* First in list of records containing focus
621 * information for each top-level in the
622 * application. Used only by tkFocus.c. */
623 struct TkDisplayFocusInfo *displayFocusPtr;
624 /* First in list of records containing focus
625 * information for each display that this
626 * application has ever used. Used only
627 * by tkFocus.c. */
628
629 struct ElArray *optionRootPtr;
630 /* Top level of option hierarchy for this
631 * main window. NULL means uninitialized.
632 * Managed by tkOption.c. */
633 Tcl_HashTable imageTable; /* Maps from image names to Tk_ImageMaster
634 * structures. Managed by tkImage.c. */
635 int strictMotif; /* This is linked to the tk_strictMotif
636 * global variable. */
637 struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by
638 * this process. */
639 } TkMainInfo;
640
641 /*
642 * Tk keeps the following data structure for each of it's builtin
643 * bitmaps. This structure is only used by tkBitmap.c and other
644 * platform specific bitmap files.
645 */
646
647 typedef struct {
648 CONST char *source; /* Bits for bitmap. */
649 int width, height; /* Dimensions of bitmap. */
650 int native; /* 0 means generic (X style) bitmap,
651 * 1 means native style bitmap. */
652 } TkPredefBitmap;
653
654 /*
655 * Tk keeps one of the following structures for each window.
656 * Some of the information (like size and location) is a shadow
657 * of information managed by the X server, and some is special
658 * information used here, such as event and geometry management
659 * information. This information is (mostly) managed by tkWindow.c.
660 * WARNING: the declaration below must be kept consistent with the
661 * Tk_FakeWin structure in tk.h. If you change one, be sure to
662 * change the other!!
663 */
664
665 typedef struct TkWindow {
666
667 /*
668 * Structural information:
669 */
670
671 Display *display; /* Display containing window. */
672 TkDisplay *dispPtr; /* Tk's information about display
673 * for window. */
674 int screenNum; /* Index of screen for window, among all
675 * those for dispPtr. */
676 Visual *visual; /* Visual to use for window. If not default,
677 * MUST be set before X window is created. */
678 int depth; /* Number of bits/pixel. */
679 Window window; /* X's id for window. NULL means window
680 * hasn't actually been created yet, or it's
681 * been deleted. */
682 struct TkWindow *childList; /* First in list of child windows,
683 * or NULL if no children. List is in
684 * stacking order, lowest window first.*/
685 struct TkWindow *lastChildPtr;
686 /* Last in list of child windows (highest
687 * in stacking order), or NULL if no
688 * children. */
689 struct TkWindow *parentPtr; /* Pointer to parent window (logical
690 * parent, not necessarily X parent). NULL
691 * means either this is the main window, or
692 * the window's parent has already been
693 * deleted. */
694 struct TkWindow *nextPtr; /* Next higher sibling (in stacking order)
695 * in list of children with same parent. NULL
696 * means end of list. */
697 TkMainInfo *mainPtr; /* Information shared by all windows
698 * associated with a particular main
699 * window. NULL means this window is
700 * a rogue that isn't associated with
701 * any application (at present, this
702 * only happens for the dummy windows
703 * used for "send" communication). */
704
705 /*
706 * Name and type information for the window:
707 */
708
709 char *pathName; /* Path name of window (concatenation
710 * of all names between this window and
711 * its top-level ancestor). This is a
712 * pointer into an entry in
713 * mainPtr->nameTable. NULL means that
714 * the window hasn't been completely
715 * created yet. */
716 Tk_Uid nameUid; /* Name of the window within its parent
717 * (unique within the parent). */
718 Tk_Uid classUid; /* Class of the window. NULL means window
719 * hasn't been given a class yet. */
720
721 /*
722 * Geometry and other attributes of window. This information
723 * may not be updated on the server immediately; stuff that
724 * hasn't been reflected in the server yet is called "dirty".
725 * At present, information can be dirty only if the window
726 * hasn't yet been created.
727 */
728
729 XWindowChanges changes; /* Geometry and other info about
730 * window. */
731 unsigned int dirtyChanges; /* Bits indicate fields of "changes"
732 * that are dirty. */
733 XSetWindowAttributes atts; /* Current attributes of window. */
734 unsigned long dirtyAtts; /* Bits indicate fields of "atts"
735 * that are dirty. */
736
737 unsigned int flags; /* Various flag values: these are all
738 * defined in tk.h (confusing, but they're
739 * needed there for some query macros). */
740
741 /*
742 * Information kept by the event manager (tkEvent.c):
743 */
744
745 TkEventHandler *handlerList;/* First in list of event handlers
746 * declared for this window, or
747 * NULL if none. */
748 #ifdef TK_USE_INPUT_METHODS
749 XIC inputContext; /* XIM input context. */
750 #endif /* TK_USE_INPUT_METHODS */
751
752 /*
753 * Information used for event bindings (see "bind" and "bindtags"
754 * commands in tkCmds.c):
755 */
756
757 ClientData *tagPtr; /* Points to array of tags used for bindings
758 * on this window. Each tag is a Tk_Uid.
759 * Malloc'ed. NULL means no tags. */
760 int numTags; /* Number of tags at *tagPtr. */
761
762 /*
763 * Information used by tkOption.c to manage options for the
764 * window.
765 */
766
767 int optionLevel; /* -1 means no option information is
768 * currently cached for this window.
769 * Otherwise this gives the level in
770 * the option stack at which info is
771 * cached. */
772 /*
773 * Information used by tkSelect.c to manage the selection.
774 */
775
776 struct TkSelHandler *selHandlerList;
777 /* First in list of handlers for
778 * returning the selection in various
779 * forms. */
780
781 /*
782 * Information used by tkGeometry.c for geometry management.
783 */
784
785 Tk_GeomMgr *geomMgrPtr; /* Information about geometry manager for
786 * this window. */
787 ClientData geomData; /* Argument for geometry manager procedures. */
788 int reqWidth, reqHeight; /* Arguments from last call to
789 * Tk_GeometryRequest, or 0's if
790 * Tk_GeometryRequest hasn't been
791 * called. */
792 int internalBorderLeft; /* Width of internal border of window
793 * (0 means no internal border). Geometry
794 * managers should not normally place children
795 * on top of the border.
796 * Fields for the other three sides are found
797 * below. */
798
799 /*
800 * Information maintained by tkWm.c for window manager communication.
801 */
802
803 struct TkWmInfo *wmInfoPtr; /* For top-level windows (and also
804 * for special Unix menubar and wrapper
805 * windows), points to structure with
806 * wm-related info (see tkWm.c). For
807 * other windows, this is NULL. */
808
809 /*
810 * Information used by widget classes.
811 */
812
813 Tk_ClassProcs *classProcsPtr;
814 ClientData instanceData;
815
816 /*
817 * Platform specific information private to each port.
818 */
819
820 struct TkWindowPrivate *privatePtr;
821
822 /*
823 * More information used by tkGeometry.c for geometry management.
824 */
825
826 /* The remaining fields of internal border. */
827 int internalBorderRight;
828 int internalBorderTop;
829 int internalBorderBottom;
830
831 int minReqWidth; /* Minimum requested width. */
832 int minReqHeight; /* Minimum requested height. */
833 } TkWindow;
834
835 /*
836 * The following structure is used as a two way map between integers
837 * and strings, usually to map between an internal C representation
838 * and the strings used in Tcl.
839 */
840
841 typedef struct TkStateMap {
842 int numKey; /* Integer representation of a value. */
843 char *strKey; /* String representation of a value. */
844 } TkStateMap;
845
846 /*
847 * This structure is used by the Mac and Window porting layers as
848 * the internal representation of a clip_mask in a GC.
849 */
850
851 typedef struct TkpClipMask {
852 int type; /* One of TKP_CLIP_PIXMAP or TKP_CLIP_REGION */
853 union {
854 Pixmap pixmap;
855 TkRegion region;
856 } value;
857 } TkpClipMask;
858
859 #define TKP_CLIP_PIXMAP 0
860 #define TKP_CLIP_REGION 1
861
862 /*
863 * Pointer to first entry in list of all displays currently known.
864 */
865
866 extern TkDisplay *tkDisplayList;
867
868 /*
869 * Return values from TkGrabState:
870 */
871
872 #define TK_GRAB_NONE 0
873 #define TK_GRAB_IN_TREE 1
874 #define TK_GRAB_ANCESTOR 2
875 #define TK_GRAB_EXCLUDED 3
876
877 /*
878 * The macro below is used to modify a "char" value (e.g. by casting
879 * it to an unsigned character) so that it can be used safely with
880 * macros such as isspace.
881 */
882
883 #define UCHAR(c) ((unsigned char) (c))
884
885 /*
886 * The following symbol is used in the mode field of FocusIn events
887 * generated by an embedded application to request the input focus from
888 * its container.
889 */
890
891 #define EMBEDDED_APP_WANTS_FOCUS (NotifyNormal + 20)
892
893 /*
894 * The following special modifier mask bits are defined, to indicate
895 * logical modifiers such as Meta and Alt that may float among the
896 * actual modifier bits.
897 */
898
899 #define META_MASK (AnyModifier<<1)
900 #define ALT_MASK (AnyModifier<<2)
901
902 /*
903 * Object types not declared in tkObj.c need to be mentioned here so
904 * they can be properly registered with Tcl:
905 */
906
907 extern Tcl_ObjType tkBorderObjType;
908 extern Tcl_ObjType tkBitmapObjType;
909 extern Tcl_ObjType tkColorObjType;
910 extern Tcl_ObjType tkCursorObjType;
911 extern Tcl_ObjType tkFontObjType;
912 extern Tcl_ObjType tkOptionObjType;
913 extern Tcl_ObjType tkStateKeyObjType;
914
915 /*
916 * Miscellaneous variables shared among Tk modules but not exported
917 * to the outside world:
918 */
919 typedef void TkDelayedEventProc _ANSI_ARGS_((void));
920 typedef void tkHandleEventProc_t _ANSI_ARGS_((XEvent* eventPtr));
921
922 extern Tk_SmoothMethod tkBezierSmoothMethod;
923 extern Tk_ImageType tkBitmapImageType;
924 extern Tk_PhotoImageFormat tkImgFmtGIF;
925 extern void (*tkHandleEventProc) _ANSI_ARGS_((
926 XEvent* eventPtr));
927 extern Tk_PhotoImageFormat tkImgFmtPPM;
928 extern TkMainInfo *tkMainWindowList;
929 extern Tk_ImageType tkPhotoImageType;
930 extern Tcl_HashTable tkPredefBitmapTable;
931 extern int tkSendSerial;
932
933 #include "tkIntDecls.h"
934
935 #ifdef BUILD_tk
936 # undef TCL_STORAGE_CLASS
937 # define TCL_STORAGE_CLASS DLLEXPORT
938 #endif
939
940 /*
941 * Internal procedures shared among Tk modules but not exported
942 * to the outside world:
943 */
944
945 EXTERN int Tk_BellObjCmd _ANSI_ARGS_((ClientData clientData,
946 Tcl_Interp *interp, int objc,
947 Tcl_Obj *CONST objv[]));
948 EXTERN int Tk_BindObjCmd _ANSI_ARGS_((ClientData clientData,
949 Tcl_Interp *interp, int objc,
950 Tcl_Obj *CONST objv[]));
951 EXTERN int Tk_BindtagsObjCmd _ANSI_ARGS_((ClientData clientData,
952 Tcl_Interp *interp, int objc,
953 Tcl_Obj *CONST objv[]));
954 EXTERN int Tk_ButtonObjCmd _ANSI_ARGS_((ClientData clientData,
955 Tcl_Interp *interp, int objc,
956 Tcl_Obj *CONST objv[]));
957 EXTERN int Tk_CanvasObjCmd _ANSI_ARGS_((ClientData clientData,
958 Tcl_Interp *interp, int argc,
959 Tcl_Obj *CONST objv[]));
960 EXTERN int Tk_CheckbuttonObjCmd _ANSI_ARGS_((
961 ClientData clientData,
962 Tcl_Interp *interp, int objc,
963 Tcl_Obj *CONST objv[]));
964 EXTERN int Tk_ClipboardObjCmd _ANSI_ARGS_((
965 ClientData clientData, Tcl_Interp *interp,
966 int objc, Tcl_Obj *CONST objv[]));
967 EXTERN int Tk_ChooseColorObjCmd _ANSI_ARGS_((
968 ClientData clientData, Tcl_Interp *interp,
969 int objc, Tcl_Obj *CONST objv[]));
970 EXTERN int Tk_ChooseDirectoryObjCmd _ANSI_ARGS_((
971 ClientData clientData, Tcl_Interp *interp,
972 int objc, Tcl_Obj *CONST objv[]));
973 EXTERN int Tk_ChooseFontObjCmd _ANSI_ARGS_((ClientData clientData,
974 Tcl_Interp *interp, int objc,
975 Tcl_Obj *CONST objv[]));
976 EXTERN int Tk_DestroyObjCmd _ANSI_ARGS_((ClientData clientData,
977 Tcl_Interp *interp, int objc,
978 Tcl_Obj *CONST objv[]));
979 EXTERN int Tk_EntryObjCmd _ANSI_ARGS_((ClientData clientData,
980 Tcl_Interp *interp, int objc,
981 Tcl_Obj *CONST objv[]));
982 EXTERN int Tk_EventObjCmd _ANSI_ARGS_((ClientData clientData,
983 Tcl_Interp *interp, int objc,
984 Tcl_Obj *CONST objv[]));
985 EXTERN int Tk_FileeventCmd _ANSI_ARGS_((ClientData clientData,
986 Tcl_Interp *interp, int argc, char **argv));
987 EXTERN int Tk_FrameObjCmd _ANSI_ARGS_((ClientData clientData,
988 Tcl_Interp *interp, int objc,
989 Tcl_Obj *CONST objv[]));
990 EXTERN int Tk_FocusObjCmd _ANSI_ARGS_((ClientData clientData,
991 Tcl_Interp *interp, int objc,
992 Tcl_Obj *CONST objv[]));
993 EXTERN int Tk_FontObjCmd _ANSI_ARGS_((ClientData clientData,
994 Tcl_Interp *interp, int objc,
995 Tcl_Obj *CONST objv[]));
996 EXTERN int Tk_GetOpenFileObjCmd _ANSI_ARGS_((
997 ClientData clientData,
998 Tcl_Interp *interp, int objc,
999 Tcl_Obj *CONST objv[]));
1000 EXTERN int Tk_GetSaveFileObjCmd _ANSI_ARGS_((
1001 ClientData clientData,
1002 Tcl_Interp *interp, int objc,
1003 Tcl_Obj *CONST objv[]));
1004 EXTERN int Tk_GrabObjCmd _ANSI_ARGS_((ClientData clientData,
1005 Tcl_Interp *interp, int objc,
1006 Tcl_Obj *CONST objv[]));
1007 EXTERN int Tk_GridObjCmd _ANSI_ARGS_((ClientData clientData,
1008 Tcl_Interp *interp, int objc,
1009 Tcl_Obj *CONST objv[]));
1010 EXTERN int Tk_ImageObjCmd _ANSI_ARGS_((ClientData clientData,
1011 Tcl_Interp *interp, int objc,
1012 Tcl_Obj *CONST objv[]));
1013 EXTERN int Tk_LabelObjCmd _ANSI_ARGS_((ClientData clientData,
1014 Tcl_Interp *interp, int objc,
1015 Tcl_Obj *CONST objv[]));
1016 EXTERN int Tk_LabelframeObjCmd _ANSI_ARGS_((ClientData clientData,
1017 Tcl_Interp *interp, int objc,
1018 Tcl_Obj *CONST objv[]));
1019 EXTERN int Tk_ListboxObjCmd _ANSI_ARGS_((ClientData clientData,
1020 Tcl_Interp *interp, int objc,
1021 Tcl_Obj *CONST objv[]));
1022 EXTERN int Tk_LowerObjCmd _ANSI_ARGS_((ClientData clientData,
1023 Tcl_Interp *interp, int objc,
1024 Tcl_Obj *CONST objv[]));
1025 EXTERN int Tk_MenubuttonObjCmd _ANSI_ARGS_((ClientData clientData,
1026 Tcl_Interp *interp, int objc,
1027 Tcl_Obj *CONST objv[]));
1028 EXTERN int Tk_MessageBoxObjCmd _ANSI_ARGS_((ClientData clientData,
1029 Tcl_Interp *interp, int objc,
1030 Tcl_Obj *CONST objv[]));
1031 EXTERN int Tk_MessageObjCmd _ANSI_ARGS_((ClientData clientData,
1032 Tcl_Interp *interp, int objc,
1033 Tcl_Obj *CONST objv[]));
1034 EXTERN int Tk_PanedWindowObjCmd _ANSI_ARGS_((
1035 ClientData clientData,
1036 Tcl_Interp *interp, int objc,
1037 Tcl_Obj *CONST objv[]));
1038 EXTERN int Tk_OptionObjCmd _ANSI_ARGS_((ClientData clientData,
1039 Tcl_Interp *interp, int objc,
1040 Tcl_Obj *CONST objv[]));
1041 EXTERN int Tk_PackObjCmd _ANSI_ARGS_((ClientData clientData,
1042 Tcl_Interp *interp, int objc,
1043 Tcl_Obj *CONST objv[]));
1044 EXTERN int Tk_PlaceObjCmd _ANSI_ARGS_((ClientData clientData,
1045 Tcl_Interp *interp, int objc,
1046 Tcl_Obj *CONST objv[]));
1047 EXTERN int Tk_RadiobuttonObjCmd _ANSI_ARGS_((
1048 ClientData clientData,
1049 Tcl_Interp *interp, int objc,
1050 Tcl_Obj *CONST objv[]));
1051 EXTERN int Tk_RaiseObjCmd _ANSI_ARGS_((ClientData clientData,
1052 Tcl_Interp *interp, int objc,
1053 Tcl_Obj *CONST objv[]));
1054 EXTERN int Tk_ScaleObjCmd _ANSI_ARGS_((ClientData clientData,
1055 Tcl_Interp *interp, int objc,
1056 Tcl_Obj *CONST objv[]));
1057 EXTERN int Tk_ScrollbarCmd _ANSI_ARGS_((ClientData clientData,
1058 Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[]));
1059 EXTERN int Tk_SelectionObjCmd _ANSI_ARGS_((ClientData clientData,
1060 Tcl_Interp *interp, int objc,
1061 Tcl_Obj *CONST objv[]));
1062 EXTERN int Tk_SendCmd _ANSI_ARGS_((ClientData clientData,
1063 Tcl_Interp *interp, int argc, char **argv));
1064 EXTERN int Tk_SendObjCmd _ANSI_ARGS_((ClientData clientData,
1065 Tcl_Interp *interp, int objc,
1066 Tcl_Obj *CONST objv[]));
1067 EXTERN int Tk_SpinboxObjCmd _ANSI_ARGS_((ClientData clientData,
1068 Tcl_Interp *interp, int objc,
1069 Tcl_Obj *CONST objv[]));
1070 EXTERN int Tk_TextCmd _ANSI_ARGS_((ClientData clientData,
1071 Tcl_Interp *interp, int argc, char **argv));
1072 EXTERN int Tk_TkObjCmd _ANSI_ARGS_((ClientData clientData,
1073 Tcl_Interp *interp, int objc,
1074 Tcl_Obj *CONST objv[]));
1075 EXTERN int Tk_TkwaitObjCmd _ANSI_ARGS_((ClientData clientData,
1076 Tcl_Interp *interp, int objc,
1077 Tcl_Obj *CONST objv[]));
1078 EXTERN int Tk_ToplevelObjCmd _ANSI_ARGS_((ClientData clientData,
1079 Tcl_Interp *interp, int objc,
1080 Tcl_Obj *CONST objv[]));
1081 EXTERN int Tk_UpdateObjCmd _ANSI_ARGS_((ClientData clientData,
1082 Tcl_Interp *interp, int objc,
1083 Tcl_Obj *CONST objv[]));
1084 EXTERN int Tk_WinfoObjCmd _ANSI_ARGS_((ClientData clientData,
1085 Tcl_Interp *interp, int objc,
1086 Tcl_Obj *CONST objv[]));
1087 EXTERN int Tk_WmObjCmd _ANSI_ARGS_((ClientData clientData,
1088 Tcl_Interp *interp, int objc,
1089 Tcl_Obj *CONST objv[]));
1090
1091 EXTERN void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
1092 int devId, CONST char *buffer, long size));
1093
1094 EXTERN void TkEventInit _ANSI_ARGS_((void));
1095
1096 EXTERN void TkRegisterObjTypes _ANSI_ARGS_((void));
1097
1098 EXTERN int TkCreateMenuCmd _ANSI_ARGS_((Tcl_Interp *interp));
1099 EXTERN int TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
1100 Tcl_Interp *interp, int argc, char **argv));
1101
1102 EXTERN int TkpTestembedCmd _ANSI_ARGS_((ClientData clientData,
1103 Tcl_Interp *interp, int argc, char **argv));
1104 EXTERN int TkCanvasGetCoordObj _ANSI_ARGS_((Tcl_Interp *interp,
1105 Tk_Canvas canvas, Tcl_Obj *obj,
1106 double *doublePtr));
1107 EXTERN int TkCanvasDashParseProc _ANSI_ARGS_((
1108 ClientData clientData, Tcl_Interp *interp,
1109 Tk_Window tkwin, Tcl_Obj *value, char *widgRec,
1110 int offset));
1111 EXTERN Tcl_Obj * TkCanvasDashPrintProc _ANSI_ARGS_((
1112 ClientData clientData, Tk_Window tkwin,
1113 char *widgRec, int offset,
1114 Tcl_FreeProc **freeProcPtr));
1115 EXTERN int TkGetDoublePixels _ANSI_ARGS_((Tcl_Interp *interp,
1116 Tk_Window tkwin, CONST char *string,
1117 double *doublePtr));
1118 EXTERN int TkOffsetParseProc _ANSI_ARGS_((
1119 ClientData clientData, Tcl_Interp *interp,
1120 Tk_Window tkwin, Tcl_Obj *value, char *widgRec,
1121 int offset));
1122 EXTERN Tcl_Obj * TkOffsetPrintProc _ANSI_ARGS_((
1123 ClientData clientData, Tk_Window tkwin,
1124 char *widgRec, int offset,
1125 Tcl_FreeProc **freeProcPtr));
1126 EXTERN int TkOrientParseProc _ANSI_ARGS_((
1127 ClientData clientData, Tcl_Interp *interp,
1128 Tk_Window tkwin, Tcl_Obj *value,
1129 char *widgRec, int offset));
1130 EXTERN Tcl_Obj * TkOrientPrintProc _ANSI_ARGS_((
1131 ClientData clientData, Tk_Window tkwin,
1132 char *widgRec, int offset,
1133 Tcl_FreeProc **freeProcPtr));
1134 EXTERN int TkPixelParseProc _ANSI_ARGS_((
1135 ClientData clientData, Tcl_Interp *interp,
1136 Tk_Window tkwin, Tcl_Obj *value, char *widgRec,
1137 int offset));
1138 EXTERN Tcl_Obj * TkPixelPrintProc _ANSI_ARGS_((
1139 ClientData clientData, Tk_Window tkwin,
1140 char *widgRec, int offset,
1141 Tcl_FreeProc **freeProcPtr));
1142 EXTERN int TkPostscriptImage _ANSI_ARGS_((Tcl_Interp *interp,
1143 Tk_Window tkwin, Tk_PostscriptInfo psInfo,
1144 XImage *ximage, int x, int y, int width,
1145 int height));
1146 EXTERN int TkSmoothParseProc _ANSI_ARGS_((ClientData clientData,
1147 Tcl_Interp *interp, Tk_Window tkwin,
1148 Tcl_Obj *value, char *recordPtr, int offset));
1149 EXTERN Tcl_Obj * TkSmoothPrintProc _ANSI_ARGS_((ClientData clientData,
1150 Tk_Window tkwin, char *recordPtr, int offset,
1151 Tcl_FreeProc **freeProcPtr));
1152 EXTERN int TkStateParseProc _ANSI_ARGS_((
1153 ClientData clientData, Tcl_Interp *interp,
1154 Tk_Window tkwin, Tcl_Obj *value,
1155 char *widgRec, int offset));
1156 EXTERN Tcl_Obj * TkStatePrintProc _ANSI_ARGS_((
1157 ClientData clientData, Tk_Window tkwin,
1158 char *widgRec, int offset,
1159 Tcl_FreeProc **freeProcPtr));
1160 EXTERN int Tk_StateParseProc _ANSI_ARGS_((
1161 ClientData clientData, Tcl_Interp *interp,
1162 Tk_Window tkwin, Tcl_Obj *value,
1163 char *widgRec, int offset));
1164 EXTERN Tcl_Obj * Tk_StatePrintProc _ANSI_ARGS_((
1165 ClientData clientData, Tk_Window tkwin,
1166 char *widgRec, int offset,
1167 Tcl_FreeProc **freeProcPtr));
1168 EXTERN int TkTileParseProc _ANSI_ARGS_((
1169 ClientData clientData, Tcl_Interp *interp,
1170 Tk_Window tkwin, Tcl_Obj *value, char *widgRec,
1171 int offset));
1172 EXTERN Tcl_Obj * TkTilePrintProc _ANSI_ARGS_((
1173 ClientData clientData, Tk_Window tkwin,
1174 char *widgRec, int offset,
1175 Tcl_FreeProc **freeProcPtr));
1176
1177 /*
1178 * Unsupported commands.
1179 */
1180 EXTERN int TkUnsupported1Cmd _ANSI_ARGS_((ClientData clientData,
1181 Tcl_Interp *interp, int argc, CONST char **argv));
1182
1183 /*
1184 * Canvas-related procedures that are shared among Tk modules but not
1185 * exported to the outside world:
1186 */
1187
1188 struct TkCanvas;
1189 extern int TkCanvPostscriptCmd _ANSI_ARGS_((struct TkCanvas *canvasPtr,
1190 Tcl_Interp *interp, int argc, CONST84 Tcl_Obj *CONST *objv));
1191
1192 # undef TCL_STORAGE_CLASS
1193 # define TCL_STORAGE_CLASS DLLIMPORT
1194
1195 #endif /* _TKINT */
1196
1197
1198
1199
1200