OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / SGI / util / SGI / include / tkInt.h
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  *
10  * See the file "license.terms" for information on usage and redistribution
11  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12  *
13  * SCCS: @(#) tkInt.h 1.204 97/10/31 09:55:20
14  */
15
16 #ifndef _TKINT
17 #define _TKINT
18
19 #ifndef _TK
20 #include "tk.h"
21 #endif
22 #ifndef _TCL
23 #include "tcl.h"
24 #endif
25 #ifndef _TKPORT
26 #include <tkPort.h>
27 #endif
28
29 /*
30  * Opaque type declarations:
31  */
32
33 typedef struct TkColormap TkColormap;
34 typedef struct TkGrabEvent TkGrabEvent;
35 typedef struct Tk_PostscriptInfo Tk_PostscriptInfo;
36 typedef struct TkpCursor_ *TkpCursor;
37 typedef struct TkRegion_ *TkRegion;
38 typedef struct TkStressedCmap TkStressedCmap;
39 typedef struct TkBindInfo_ *TkBindInfo;
40
41 /*
42  * Procedure types.
43  */
44
45 typedef int (TkBindEvalProc) _ANSI_ARGS_((ClientData clientData,
46         Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin,
47         KeySym keySym));
48 typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData));
49 typedef Window (TkClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin,
50         Window parent, ClientData instanceData));
51 typedef void (TkClassGeometryProc) _ANSI_ARGS_((ClientData instanceData));
52 typedef void (TkClassModalProc) _ANSI_ARGS_((Tk_Window tkwin,
53         XEvent *eventPtr));
54 \f
55
56 /*
57  * Widget class procedures used to implement platform specific widget
58  * behavior.
59  */
60
61 typedef struct TkClassProcs {
62     TkClassCreateProc *createProc;
63                                 /* Procedure to invoke when the
64                                    platform-dependent window needs to be
65                                    created. */
66     TkClassGeometryProc *geometryProc;
67                                 /* Procedure to invoke when the geometry of a
68                                    window needs to be recalculated as a result
69                                    of some change in the system. */
70     TkClassModalProc *modalProc;
71                                 /* Procedure to invoke after all bindings on a
72                                    widget have been triggered in order to
73                                    handle a modal loop. */
74 } TkClassProcs;
75
76 /*
77  * One of the following structures is maintained for each cursor in
78  * use in the system.  This structure is used by tkCursor.c and the
79  * various system specific cursor files.
80  */
81
82 typedef struct TkCursor {
83     Tk_Cursor cursor;           /* System specific identifier for cursor. */
84     int refCount;               /* Number of active uses of cursor. */
85     Tcl_HashTable *otherTable;  /* Second table (other than idTable) used
86                                  * to index this entry. */
87     Tcl_HashEntry *hashPtr;     /* Entry in otherTable for this structure
88                                  * (needed when deleting). */
89 } TkCursor;
90
91 /*
92  * One of the following structures is maintained for each display
93  * containing a window managed by Tk:
94  */
95
96 typedef struct TkDisplay {
97     Display *display;           /* Xlib's info about display. */
98     struct TkDisplay *nextPtr;  /* Next in list of all displays. */
99     char *name;                 /* Name of display (with any screen
100                                  * identifier removed).  Malloc-ed. */
101     Time lastEventTime;         /* Time of last event received for this
102                                  * display. */
103
104     /*
105      * Information used primarily by tkBind.c:
106      */
107
108     int bindInfoStale;          /* Non-zero means the variables in this
109                                  * part of the structure are potentially
110                                  * incorrect and should be recomputed. */
111     unsigned int modeModMask;   /* Has one bit set to indicate the modifier
112                                  * corresponding to "mode shift".  If no
113                                  * such modifier, than this is zero. */
114     unsigned int metaModMask;   /* Has one bit set to indicate the modifier
115                                  * corresponding to the "Meta" key.  If no
116                                  * such modifier, then this is zero. */
117     unsigned int altModMask;    /* Has one bit set to indicate the modifier
118                                  * corresponding to the "Meta" key.  If no
119                                  * such modifier, then this is zero. */
120     enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
121                                 /* Indicates how to interpret lock modifier. */
122     int numModKeyCodes;         /* Number of entries in modKeyCodes array
123                                  * below. */
124     KeyCode *modKeyCodes;       /* Pointer to an array giving keycodes for
125                                  * all of the keys that have modifiers
126                                  * associated with them.  Malloc'ed, but
127                                  * may be NULL. */
128
129     /*
130      * Information used by tkError.c only:
131      */
132
133     struct TkErrorHandler *errorPtr;
134                                 /* First in list of error handlers
135                                  * for this display.  NULL means
136                                  * no handlers exist at present. */
137     int deleteCount;            /* Counts # of handlers deleted since
138                                  * last time inactive handlers were
139                                  * garbage-collected.  When this number
140                                  * gets big, handlers get cleaned up. */
141
142     /*
143      * Information used by tkSend.c only:
144      */
145
146     Tk_Window commTkwin;        /* Window used for communication
147                                  * between interpreters during "send"
148                                  * commands.  NULL means send info hasn't
149                                  * been initialized yet. */
150     Atom commProperty;          /* X's name for comm property. */
151     Atom registryProperty;      /* X's name for property containing
152                                  * registry of interpreter names. */
153     Atom appNameProperty;       /* X's name for property used to hold the
154                                  * application name on each comm window. */
155
156     /*
157      * Information used by tkSelect.c and tkClipboard.c only:
158      */
159
160     struct TkSelectionInfo *selectionInfoPtr;
161                                 /* First in list of selection information
162                                  * records.  Each entry contains information
163                                  * about the current owner of a particular
164                                  * selection on this display. */
165     Atom multipleAtom;          /* Atom for MULTIPLE.  None means
166                                  * selection stuff isn't initialized. */
167     Atom incrAtom;              /* Atom for INCR. */
168     Atom targetsAtom;           /* Atom for TARGETS. */
169     Atom timestampAtom;         /* Atom for TIMESTAMP. */
170     Atom textAtom;              /* Atom for TEXT. */
171     Atom compoundTextAtom;      /* Atom for COMPOUND_TEXT. */
172     Atom applicationAtom;       /* Atom for TK_APPLICATION. */
173     Atom windowAtom;            /* Atom for TK_WINDOW. */
174     Atom clipboardAtom;         /* Atom for CLIPBOARD. */
175
176     Tk_Window clipWindow;       /* Window used for clipboard ownership and to
177                                  * retrieve selections between processes. NULL
178                                  * means clipboard info hasn't been
179                                  * initialized. */
180     int clipboardActive;        /* 1 means we currently own the clipboard
181                                  * selection, 0 means we don't. */
182     struct TkMainInfo *clipboardAppPtr;
183                                 /* Last application that owned clipboard. */
184     struct TkClipboardTarget *clipTargetPtr;
185                                 /* First in list of clipboard type information
186                                  * records.  Each entry contains information
187                                  * about the buffers for a given selection
188                                  * target. */
189
190     /*
191      * Information used by tkAtom.c only:
192      */
193
194     int atomInit;               /* 0 means stuff below hasn't been
195                                  * initialized yet. */
196     Tcl_HashTable nameTable;    /* Maps from names to Atom's. */
197     Tcl_HashTable atomTable;    /* Maps from Atom's back to names. */
198
199     /*
200      * Information used by tkCursor.c only:
201      */
202
203     Font cursorFont;            /* Font to use for standard cursors.
204                                  * None means font not loaded yet. */
205
206     /*
207      * Information used by tkGrab.c only:
208      */
209
210     struct TkWindow *grabWinPtr;
211                                 /* Window in which the pointer is currently
212                                  * grabbed, or NULL if none. */
213     struct TkWindow *eventualGrabWinPtr;
214                                 /* Value that grabWinPtr will have once the
215                                  * grab event queue (below) has been
216                                  * completely emptied. */
217     struct TkWindow *buttonWinPtr;
218                                 /* Window in which first mouse button was
219                                  * pressed while grab was in effect, or NULL
220                                  * if no such press in effect. */
221     struct TkWindow *serverWinPtr;
222                                 /* If no application contains the pointer then
223                                  * this is NULL.  Otherwise it contains the
224                                  * last window for which we've gotten an
225                                  * Enter or Leave event from the server (i.e.
226                                  * the last window known to have contained
227                                  * the pointer).  Doesn't reflect events
228                                  * that were synthesized in tkGrab.c. */
229     TkGrabEvent *firstGrabEventPtr;
230                                 /* First in list of enter/leave events
231                                  * synthesized by grab code.  These events
232                                  * must be processed in order before any other
233                                  * events are processed.  NULL means no such
234                                  * events. */
235     TkGrabEvent *lastGrabEventPtr;
236                                 /* Last in list of synthesized events, or NULL
237                                  * if list is empty. */
238     int grabFlags;              /* Miscellaneous flag values.  See definitions
239                                  * in tkGrab.c. */
240
241     /*
242      * Information used by tkXId.c only:
243      */
244
245     struct TkIdStack *idStackPtr;
246                                 /* First in list of chunks of free resource
247                                  * identifiers, or NULL if there are no free
248                                  * resources. */
249     XID (*defaultAllocProc) _ANSI_ARGS_((Display *display));
250                                 /* Default resource allocator for display. */
251     struct TkIdStack *windowStackPtr;
252                                 /* First in list of chunks of window
253                                  * identifers that can't be reused right
254                                  * now. */
255     int idCleanupScheduled;     /* 1 means a call to WindowIdCleanup has
256                                  * already been scheduled, 0 means it
257                                  * hasn't. */
258
259     /*
260      * Information maintained by tkWindow.c for use later on by tkXId.c:
261      */
262
263
264     int destroyCount;           /* Number of Tk_DestroyWindow operations
265                                  * in progress. */
266     unsigned long lastDestroyRequest;
267                                 /* Id of most recent XDestroyWindow request;
268                                  * can re-use ids in windowStackPtr when
269                                  * server has seen this request and event
270                                  * queue is empty. */
271
272     /*
273      * Information used by tkVisual.c only:
274      */
275
276     TkColormap *cmapPtr;        /* First in list of all non-default colormaps
277                                  * allocated for this display. */
278
279     /*
280      * Information used by tkFocus.c only:
281      */
282
283     struct TkWindow *implicitWinPtr;
284                                 /* If the focus arrived at a toplevel window
285                                  * implicitly via an Enter event (rather
286                                  * than via a FocusIn event), this points
287                                  * to the toplevel window.  Otherwise it is
288                                  * NULL. */
289     struct TkWindow *focusPtr;  /* Points to the window on this display that
290                                  * should be receiving keyboard events.  When
291                                  * multiple applications on the display have
292                                  * the focus, this will refer to the
293                                  * innermost window in the innermost
294                                  * application.  This information isn't used
295                                  * under Unix or Windows, but it's needed on
296                                  * the Macintosh. */
297
298     /*
299      * Used by tkColor.c only:
300      */
301
302     TkStressedCmap *stressPtr;  /* First in list of colormaps that have
303                                  * filled up, so we have to pick an
304                                  * approximate color. */
305
306     /*
307      * Used by tkEvent.c only:
308      */
309
310     struct TkWindowEvent *delayedMotionPtr;
311                                 /* Points to a malloc-ed motion event
312                                  * whose processing has been delayed in
313                                  * the hopes that another motion event
314                                  * will come along right away and we can
315                                  * merge the two of them together.  NULL
316                                  * means that there is no delayed motion
317                                  * event. */
318
319     /*
320      * Miscellaneous information:
321      */
322
323 #ifdef TK_USE_INPUT_METHODS
324     XIM inputMethod;            /* Input method for this display */
325 #endif /* TK_USE_INPUT_METHODS */
326     Tcl_HashTable winTable;     /* Maps from X window ids to TkWindow ptrs. */
327
328     int refCount;               /* Reference count of how many Tk applications
329                                  * are using this display. Used to clean up
330                                  * the display when we no longer have any
331                                  * Tk applications using it.
332                                  */
333 } TkDisplay;
334
335 /*
336  * One of the following structures exists for each error handler
337  * created by a call to Tk_CreateErrorHandler.  The structure
338  * is managed by tkError.c.
339  */
340
341 typedef struct TkErrorHandler {
342     TkDisplay *dispPtr;         /* Display to which handler applies. */
343     unsigned long firstRequest; /* Only errors with serial numbers
344                                  * >= to this are considered. */
345     unsigned long lastRequest;  /* Only errors with serial numbers
346                                  * <= to this are considered.  This
347                                  * field is filled in when XUnhandle
348                                  * is called.  -1 means XUnhandle
349                                  * hasn't been called yet. */
350     int error;                  /* Consider only errors with this
351                                  * error_code (-1 means consider
352                                  * all errors). */
353     int request;                /* Consider only errors with this
354                                  * major request code (-1 means
355                                  * consider all major codes). */
356     int minorCode;              /* Consider only errors with this
357                                  * minor request code (-1 means
358                                  * consider all minor codes). */
359     Tk_ErrorProc *errorProc;    /* Procedure to invoke when a matching
360                                  * error occurs.  NULL means just ignore
361                                  * errors. */
362     ClientData clientData;      /* Arbitrary value to pass to
363                                  * errorProc. */
364     struct TkErrorHandler *nextPtr;
365                                 /* Pointer to next older handler for
366                                  * this display, or NULL for end of
367                                  * list. */
368 } TkErrorHandler;
369
370 /*
371  * One of the following structures exists for each event handler
372  * created by calling Tk_CreateEventHandler.  This information
373  * is used by tkEvent.c only.
374  */
375
376 typedef struct TkEventHandler {
377     unsigned long mask;         /* Events for which to invoke
378                                  * proc. */
379     Tk_EventProc *proc;         /* Procedure to invoke when an event
380                                  * in mask occurs. */
381     ClientData clientData;      /* Argument to pass to proc. */
382     struct TkEventHandler *nextPtr;
383                                 /* Next in list of handlers
384                                  * associated with window (NULL means
385                                  * end of list). */
386 } TkEventHandler;
387
388 /*
389  * Tk keeps one of the following data structures for each main
390  * window (created by a call to Tk_CreateMainWindow).  It stores
391  * information that is shared by all of the windows associated
392  * with a particular main window.
393  */
394
395 typedef struct TkMainInfo {
396     int refCount;               /* Number of windows whose "mainPtr" fields
397                                  * point here.  When this becomes zero, can
398                                  * free up the structure (the reference
399                                  * count is zero because windows can get
400                                  * deleted in almost any order;  the main
401                                  * window isn't necessarily the last one
402                                  * deleted). */
403     struct TkWindow *winPtr;    /* Pointer to main window. */
404     Tcl_Interp *interp;         /* Interpreter associated with application. */
405     Tcl_HashTable nameTable;    /* Hash table mapping path names to TkWindow
406                                  * structs for all windows related to this
407                                  * main window.  Managed by tkWindow.c. */
408     Tk_BindingTable bindingTable;
409                                 /* Used in conjunction with "bind" command
410                                  * to bind events to Tcl commands. */
411     TkBindInfo bindInfo;        /* Information used by tkBind.c on a per
412                                  * interpreter basis. */
413     struct TkFontInfo *fontInfoPtr;
414                                 /* Hold named font tables.  Used only by
415                                  * tkFont.c. */
416
417     /*
418      * Information used only by tkFocus.c and tk*Embed.c:
419      */
420
421     struct TkToplevelFocusInfo *tlFocusPtr;
422                                 /* First in list of records containing focus
423                                  * information for each top-level in the
424                                  * application.  Used only by tkFocus.c. */
425     struct TkDisplayFocusInfo *displayFocusPtr;
426                                 /* First in list of records containing focus
427                                  * information for each display that this
428                                  * application has ever used.  Used only
429                                  * by tkFocus.c. */
430
431     struct ElArray *optionRootPtr;
432                                 /* Top level of option hierarchy for this
433                                  * main window.  NULL means uninitialized.
434                                  * Managed by tkOption.c. */
435     Tcl_HashTable imageTable;   /* Maps from image names to Tk_ImageMaster
436                                  * structures.  Managed by tkImage.c. */
437     int strictMotif;            /* This is linked to the tk_strictMotif
438                                  * global variable. */
439     struct TkMainInfo *nextPtr; /* Next in list of all main windows managed by
440                                  * this process. */
441 } TkMainInfo;
442
443 /*
444  * Tk keeps the following data structure for each of it's builtin
445  * bitmaps.  This structure is only used by tkBitmap.c and other
446  * platform specific bitmap files.
447  */
448
449 typedef struct {
450     char *source;               /* Bits for bitmap. */
451     int width, height;          /* Dimensions of bitmap. */
452     int native;                 /* 0 means generic (X style) bitmap,
453                                  * 1 means native style bitmap. */
454 } TkPredefBitmap;
455
456 /*
457  * Tk keeps one of the following structures for each window.
458  * Some of the information (like size and location) is a shadow
459  * of information managed by the X server, and some is special
460  * information used here, such as event and geometry management
461  * information.  This information is (mostly) managed by tkWindow.c.
462  * WARNING: the declaration below must be kept consistent with the
463  * Tk_FakeWin structure in tk.h.  If you change one, be sure to
464  * change the other!!
465  */
466
467 typedef struct TkWindow {
468
469     /*
470      * Structural information:
471      */
472
473     Display *display;           /* Display containing window. */
474     TkDisplay *dispPtr;         /* Tk's information about display
475                                  * for window. */
476     int screenNum;              /* Index of screen for window, among all
477                                  * those for dispPtr. */
478     Visual *visual;             /* Visual to use for window.  If not default,
479                                  * MUST be set before X window is created. */
480     int depth;                  /* Number of bits/pixel. */
481     Window window;              /* X's id for window.   NULL means window
482                                  * hasn't actually been created yet, or it's
483                                  * been deleted. */
484     struct TkWindow *childList; /* First in list of child windows,
485                                  * or NULL if no children.  List is in
486                                  * stacking order, lowest window first.*/
487     struct TkWindow *lastChildPtr;
488                                 /* Last in list of child windows (highest
489                                  * in stacking order), or NULL if no
490                                  * children. */
491     struct TkWindow *parentPtr; /* Pointer to parent window (logical
492                                  * parent, not necessarily X parent).  NULL
493                                  * means either this is the main window, or
494                                  * the window's parent has already been
495                                  * deleted. */
496     struct TkWindow *nextPtr;   /* Next higher sibling (in stacking order)
497                                  * in list of children with same parent.  NULL
498                                  * means end of list. */
499     TkMainInfo *mainPtr;        /* Information shared by all windows
500                                  * associated with a particular main
501                                  * window.  NULL means this window is
502                                  * a rogue that isn't associated with
503                                  * any application (at present, this
504                                  * only happens for the dummy windows
505                                  * used for "send" communication).  */
506
507     /*
508      * Name and type information for the window:
509      */
510
511     char *pathName;             /* Path name of window (concatenation
512                                  * of all names between this window and
513                                  * its top-level ancestor).  This is a
514                                  * pointer into an entry in
515                                  * mainPtr->nameTable.  NULL means that
516                                  * the window hasn't been completely
517                                  * created yet. */
518     Tk_Uid nameUid;             /* Name of the window within its parent
519                                  * (unique within the parent). */
520     Tk_Uid classUid;            /* Class of the window.  NULL means window
521                                  * hasn't been given a class yet. */
522
523     /*
524      * Geometry and other attributes of window.  This information
525      * may not be updated on the server immediately;  stuff that
526      * hasn't been reflected in the server yet is called "dirty".
527      * At present, information can be dirty only if the window
528      * hasn't yet been created.
529      */
530
531     XWindowChanges changes;     /* Geometry and other info about
532                                  * window. */
533     unsigned int dirtyChanges;  /* Bits indicate fields of "changes"
534                                  * that are dirty. */
535     XSetWindowAttributes atts;  /* Current attributes of window. */
536     unsigned long dirtyAtts;    /* Bits indicate fields of "atts"
537                                  * that are dirty. */
538
539     unsigned int flags;         /* Various flag values:  these are all
540                                  * defined in tk.h (confusing, but they're
541                                  * needed there for some query macros). */
542
543     /*
544      * Information kept by the event manager (tkEvent.c):
545      */
546
547     TkEventHandler *handlerList;/* First in list of event handlers
548                                  * declared for this window, or
549                                  * NULL if none. */
550 #ifdef TK_USE_INPUT_METHODS
551     XIC inputContext;           /* Input context (for input methods). */
552 #endif /* TK_USE_INPUT_METHODS */
553
554     /*
555      * Information used for event bindings (see "bind" and "bindtags"
556      * commands in tkCmds.c):
557      */
558
559     ClientData *tagPtr;         /* Points to array of tags used for bindings
560                                  * on this window.  Each tag is a Tk_Uid.
561                                  * Malloc'ed.  NULL means no tags. */
562     int numTags;                /* Number of tags at *tagPtr. */
563
564     /*
565      * Information used by tkOption.c to manage options for the
566      * window.
567      */
568
569     int optionLevel;            /* -1 means no option information is
570                                  * currently cached for this window.
571                                  * Otherwise this gives the level in
572                                  * the option stack at which info is
573                                  * cached. */
574     /*
575      * Information used by tkSelect.c to manage the selection.
576      */
577
578     struct TkSelHandler *selHandlerList;
579                                 /* First in list of handlers for
580                                  * returning the selection in various
581                                  * forms. */
582
583     /*
584      * Information used by tkGeometry.c for geometry management.
585      */
586
587     Tk_GeomMgr *geomMgrPtr;     /* Information about geometry manager for
588                                  * this window. */
589     ClientData geomData;        /* Argument for geometry manager procedures. */
590     int reqWidth, reqHeight;    /* Arguments from last call to
591                                  * Tk_GeometryRequest, or 0's if
592                                  * Tk_GeometryRequest hasn't been
593                                  * called. */
594     int internalBorderWidth;    /* Width of internal border of window
595                                  * (0 means no internal border).  Geometry
596                                  * managers should not normally place children
597                                  * on top of the border. */
598
599     /*
600      * Information maintained by tkWm.c for window manager communication.
601      */
602
603     struct TkWmInfo *wmInfoPtr; /* For top-level windows (and also
604                                  * for special Unix menubar and wrapper
605                                  * windows), points to structure with
606                                  * wm-related info (see tkWm.c).  For
607                                  * other windows, this is NULL. */
608
609     /*
610      * Information used by widget classes.
611      */
612
613     TkClassProcs *classProcsPtr;
614     ClientData instanceData;
615
616     /*
617      * Platform specific information private to each port.
618      */
619
620     struct TkWindowPrivate *privatePtr;
621 } TkWindow;
622
623 /*
624  * The following structure is used as a two way map between integers
625  * and strings, usually to map between an internal C representation
626  * and the strings used in Tcl.
627  */
628
629 typedef struct TkStateMap {
630     int numKey;                 /* Integer representation of a value. */
631     char *strKey;               /* String representation of a value. */
632 } TkStateMap;
633
634 /*
635  * This structure is used by the Mac and Window porting layers as
636  * the internal representation of a clip_mask in a GC.
637  */
638
639 typedef struct TkpClipMask {
640     int type;                   /* One of TKP_CLIP_PIXMAP or TKP_CLIP_REGION */
641     union {
642         Pixmap pixmap;
643         TkRegion region;
644     } value;
645 } TkpClipMask;
646
647 #define TKP_CLIP_PIXMAP 0
648 #define TKP_CLIP_REGION 1
649
650 /*
651  * Pointer to first entry in list of all displays currently known.
652  */
653
654 extern TkDisplay *tkDisplayList;
655
656 /*
657  * Return values from TkGrabState:
658  */
659
660 #define TK_GRAB_NONE            0
661 #define TK_GRAB_IN_TREE         1
662 #define TK_GRAB_ANCESTOR        2
663 #define TK_GRAB_EXCLUDED        3
664
665 /*
666  * The macro below is used to modify a "char" value (e.g. by casting
667  * it to an unsigned character) so that it can be used safely with
668  * macros such as isspace.
669  */
670
671 #define UCHAR(c) ((unsigned char) (c))
672
673 /*
674  * The following symbol is used in the mode field of FocusIn events
675  * generated by an embedded application to request the input focus from
676  * its container.
677  */
678
679 #define EMBEDDED_APP_WANTS_FOCUS (NotifyNormal + 20)
680
681 /*
682  * Miscellaneous variables shared among Tk modules but not exported
683  * to the outside world:
684  */
685
686 extern Tk_Uid                   tkActiveUid;
687 extern Tk_ImageType             tkBitmapImageType;
688 extern Tk_Uid                   tkDisabledUid;
689 extern Tk_PhotoImageFormat      tkImgFmtGIF;
690 extern void                     (*tkHandleEventProc) _ANSI_ARGS_((
691                                     XEvent* eventPtr));
692 extern Tk_PhotoImageFormat      tkImgFmtPPM;
693 extern TkMainInfo               *tkMainWindowList;
694 extern Tk_Uid                   tkNormalUid;
695 extern Tk_ImageType             tkPhotoImageType;
696 extern Tcl_HashTable            tkPredefBitmapTable;
697 extern int                      tkSendSerial;
698
699 /*
700  * Internal procedures shared among Tk modules but not exported
701  * to the outside world:
702  */
703
704 EXTERN char *           TkAlignImageData _ANSI_ARGS_((XImage *image,
705                             int alignment, int bitOrder));
706 EXTERN TkWindow *       TkAllocWindow _ANSI_ARGS_((TkDisplay *dispPtr,
707                             int screenNum, TkWindow *parentPtr));
708 EXTERN int              TkAreaToPolygon _ANSI_ARGS_((double *polyPtr,
709                             int numPoints, double *rectPtr));
710 EXTERN void             TkBezierPoints _ANSI_ARGS_((double control[],
711                             int numSteps, double *coordPtr));
712 EXTERN void             TkBezierScreenPoints _ANSI_ARGS_((Tk_Canvas canvas,
713                             double control[], int numSteps,
714                             XPoint *xPointPtr));
715 EXTERN void             TkBindDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
716 EXTERN void             TkBindEventProc _ANSI_ARGS_((TkWindow *winPtr,
717                             XEvent *eventPtr));
718 EXTERN void             TkBindFree _ANSI_ARGS_((TkMainInfo *mainPtr));
719 EXTERN void             TkBindInit _ANSI_ARGS_((TkMainInfo *mainPtr));
720 EXTERN void             TkChangeEventWindow _ANSI_ARGS_((XEvent *eventPtr,
721                             TkWindow *winPtr));
722 #ifndef TkClipBox
723 EXTERN void             TkClipBox _ANSI_ARGS_((TkRegion rgn,
724                             XRectangle* rect_return));
725 #endif
726 EXTERN int              TkClipInit _ANSI_ARGS_((Tcl_Interp *interp,
727                             TkDisplay *dispPtr));
728 EXTERN void             TkComputeAnchor _ANSI_ARGS_((Tk_Anchor anchor,
729                             Tk_Window tkwin, int padX, int padY,
730                             int innerWidth, int innerHeight, int *xPtr,
731                             int *yPtr));
732 EXTERN int              TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp,
733                             char *script));
734 EXTERN unsigned long    TkCreateBindingProcedure _ANSI_ARGS_((
735                             Tcl_Interp *interp, Tk_BindingTable bindingTable,
736                             ClientData object, char *eventString,
737                             TkBindEvalProc *evalProc, TkBindFreeProc *freeProc,
738                             ClientData clientData));
739 EXTERN TkCursor *       TkCreateCursorFromData _ANSI_ARGS_((Tk_Window tkwin,
740                             char *source, char *mask, int width, int height,
741                             int xHot, int yHot, XColor fg, XColor bg));
742 EXTERN int              TkCreateFrame _ANSI_ARGS_((ClientData clientData,
743                             Tcl_Interp *interp, int argc, char **argv,
744                             int toplevel, char *appName));
745 EXTERN Tk_Window        TkCreateMainWindow _ANSI_ARGS_((Tcl_Interp *interp,
746                             char *screenName, char *baseName));
747 #ifndef TkCreateRegion
748 EXTERN TkRegion         TkCreateRegion _ANSI_ARGS_((void));
749 #endif
750 EXTERN Time             TkCurrentTime _ANSI_ARGS_((TkDisplay *dispPtr));
751 EXTERN int              TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
752                             Tcl_Interp *interp, int argc, char **argv));
753 EXTERN void             TkDeleteAllImages _ANSI_ARGS_((TkMainInfo *mainPtr));
754 #ifndef TkDestroyRegion
755 EXTERN void             TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
756 #endif
757 EXTERN void             TkDoConfigureNotify _ANSI_ARGS_((TkWindow *winPtr));
758 EXTERN void             TkDrawInsetFocusHighlight _ANSI_ARGS_((
759                             Tk_Window tkwin, GC gc, int width,
760                             Drawable drawable, int padding));
761 EXTERN void             TkEventCleanupProc _ANSI_ARGS_((
762                             ClientData clientData, Tcl_Interp *interp));
763 EXTERN void             TkEventDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
764 EXTERN void             TkFillPolygon _ANSI_ARGS_((Tk_Canvas canvas,
765                             double *coordPtr, int numPoints, Display *display,
766                             Drawable drawable, GC gc, GC outlineGC));
767 EXTERN int              TkFindStateNum _ANSI_ARGS_((Tcl_Interp *interp,
768                             CONST char *option, CONST TkStateMap *mapPtr,
769                             CONST char *strKey));
770 EXTERN char *           TkFindStateString _ANSI_ARGS_((
771                             CONST TkStateMap *mapPtr, int numKey));
772 EXTERN void             TkFocusDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
773 EXTERN int              TkFocusFilterEvent _ANSI_ARGS_((TkWindow *winPtr,
774                             XEvent *eventPtr));
775 EXTERN TkWindow *       TkFocusKeyEvent _ANSI_ARGS_((TkWindow *winPtr,
776                             XEvent *eventPtr));
777 EXTERN void             TkFontPkgInit _ANSI_ARGS_((TkMainInfo *mainPtr));
778 EXTERN void             TkFontPkgFree _ANSI_ARGS_((TkMainInfo *mainPtr));
779 EXTERN void             TkFreeBindingTags _ANSI_ARGS_((TkWindow *winPtr));
780 EXTERN void             TkFreeCursor _ANSI_ARGS_((TkCursor *cursorPtr));
781 EXTERN void             TkFreeWindowId _ANSI_ARGS_((TkDisplay *dispPtr,
782                             Window w));
783 EXTERN void             TkGenerateActivateEvents _ANSI_ARGS_((
784                             TkWindow *winPtr, int active));
785 EXTERN char *           TkGetBitmapData _ANSI_ARGS_((Tcl_Interp *interp,
786                             char *string, char *fileName, int *widthPtr,
787                             int *heightPtr, int *hotXPtr, int *hotYPtr));
788 EXTERN void             TkGetButtPoints _ANSI_ARGS_((double p1[], double p2[],
789                             double width, int project, double m1[],
790                             double m2[]));
791 EXTERN TkCursor *       TkGetCursorByName _ANSI_ARGS_((Tcl_Interp *interp,
792                             Tk_Window tkwin, Tk_Uid string));
793 EXTERN char *           TkGetDefaultScreenName _ANSI_ARGS_((Tcl_Interp *interp,
794                             char *screenName));
795 EXTERN TkDisplay *      TkGetDisplay _ANSI_ARGS_((Display *display));
796 EXTERN int              TkGetDisplayOf _ANSI_ARGS_((Tcl_Interp *interp,
797                             int objc, Tcl_Obj *CONST objv[],
798                             Tk_Window *tkwinPtr));
799 EXTERN TkWindow *       TkGetFocusWin _ANSI_ARGS_((TkWindow *winPtr));
800 EXTERN int              TkGetInterpNames _ANSI_ARGS_((Tcl_Interp *interp,
801                             Tk_Window tkwin));
802 EXTERN int              TkGetMiterPoints _ANSI_ARGS_((double p1[], double p2[],
803                             double p3[], double width, double m1[],
804                             double m2[]));
805 #ifndef TkGetNativeProlog
806 EXTERN int              TkGetNativeProlog _ANSI_ARGS_((Tcl_Interp *interp));
807 #endif
808 EXTERN void             TkGetPointerCoords _ANSI_ARGS_((Tk_Window tkwin,
809                             int *xPtr, int *yPtr));
810 EXTERN int              TkGetProlog _ANSI_ARGS_((Tcl_Interp *interp));
811 EXTERN void             TkGetServerInfo _ANSI_ARGS_((Tcl_Interp *interp,
812                             Tk_Window tkwin));
813 EXTERN void             TkGrabDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
814 EXTERN int              TkGrabState _ANSI_ARGS_((TkWindow *winPtr));
815 EXTERN TkWindow *       TkIDToWindow _ANSI_ARGS_((Window window, 
816                             TkDisplay *display));
817 EXTERN void             TkIncludePoint _ANSI_ARGS_((Tk_Item *itemPtr,
818                             double *pointPtr));
819 EXTERN void             TkInitXId _ANSI_ARGS_((TkDisplay *dispPtr));
820 EXTERN void             TkInOutEvents _ANSI_ARGS_((XEvent *eventPtr,
821                             TkWindow *sourcePtr, TkWindow *destPtr,
822                             int leaveType, int enterType,
823                             Tcl_QueuePosition position));
824 EXTERN void             TkInstallFrameMenu _ANSI_ARGS_((Tk_Window tkwin));
825 #ifndef TkIntersectRegion
826 EXTERN void             TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
827                             TkRegion srcb, TkRegion dr_return));
828 #endif
829 EXTERN char *           TkKeysymToString _ANSI_ARGS_((KeySym keysym));
830 EXTERN int              TkLineToArea _ANSI_ARGS_((double end1Ptr[2],
831                             double end2Ptr[2], double rectPtr[4]));
832 EXTERN double           TkLineToPoint _ANSI_ARGS_((double end1Ptr[2],
833                             double end2Ptr[2], double pointPtr[2]));
834 EXTERN int              TkListAppend _ANSI_ARGS_((void **headPtrPtr,
835                             void *itemPtr, size_t size));
836 EXTERN int              TkListDelete _ANSI_ARGS_((void **headPtrPtr,
837                             void *itemPtr, size_t size));
838 EXTERN void *           TkListFind _ANSI_ARGS_((void *headPtr, void *itemPtr,
839                             size_t size));
840 EXTERN int              TkMakeBezierCurve _ANSI_ARGS_((Tk_Canvas canvas,
841                             double *pointPtr, int numPoints, int numSteps,
842                             XPoint xPoints[], double dblPoints[]));
843 EXTERN void             TkMakeBezierPostscript _ANSI_ARGS_((Tcl_Interp *interp,
844                             Tk_Canvas canvas, double *pointPtr,
845                             int numPoints));
846 EXTERN void             TkOptionClassChanged _ANSI_ARGS_((TkWindow *winPtr));
847 EXTERN void             TkOptionDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
848 EXTERN int              TkOvalToArea _ANSI_ARGS_((double *ovalPtr,
849                             double *rectPtr));
850 EXTERN double           TkOvalToPoint _ANSI_ARGS_((double ovalPtr[4],
851                             double width, int filled, double pointPtr[2]));
852 EXTERN int              TkpChangeFocus _ANSI_ARGS_((TkWindow *winPtr,
853                             int force));
854 EXTERN void             TkpCloseDisplay _ANSI_ARGS_((TkDisplay *dispPtr));
855 EXTERN void             TkpClaimFocus _ANSI_ARGS_((TkWindow *topLevelPtr,
856                             int force));
857 #ifndef TkpCmapStressed
858 EXTERN int              TkpCmapStressed _ANSI_ARGS_((Tk_Window tkwin,
859                             Colormap colormap));
860 #endif
861 #ifndef TkpCreateNativeBitmap
862 EXTERN Pixmap           TkpCreateNativeBitmap _ANSI_ARGS_((Display *display,
863                             char * source));
864 #endif
865 #ifndef TkpDefineNativeBitmaps
866 EXTERN void             TkpDefineNativeBitmaps _ANSI_ARGS_((void));
867 #endif
868 EXTERN void             TkpDisplayWarning _ANSI_ARGS_((char *msg,
869                             char *title));
870 EXTERN void             TkpGetAppName _ANSI_ARGS_((Tcl_Interp *interp,
871                             Tcl_DString *name));
872 EXTERN unsigned long    TkpGetMS _ANSI_ARGS_((void));
873 #ifndef TkpGetNativeAppBitmap
874 EXTERN Pixmap           TkpGetNativeAppBitmap _ANSI_ARGS_((Display *display,
875                             char *name, int *width, int *height));
876 #endif
877 EXTERN TkWindow *       TkpGetOtherWindow _ANSI_ARGS_((TkWindow *winPtr));
878 EXTERN TkWindow *       TkpGetWrapperWindow _ANSI_ARGS_((TkWindow *winPtr));
879 EXTERN int              TkpInit _ANSI_ARGS_((Tcl_Interp *interp));
880 EXTERN void             TkpInitializeMenuBindings _ANSI_ARGS_((
881                             Tcl_Interp *interp, Tk_BindingTable bindingTable));
882 EXTERN void             TkpMakeContainer _ANSI_ARGS_((Tk_Window tkwin));
883 EXTERN void             TkpMakeMenuWindow _ANSI_ARGS_((Tk_Window tkwin,
884                             int transient));
885 EXTERN Window           TkpMakeWindow _ANSI_ARGS_((TkWindow *winPtr,
886                             Window parent));
887 EXTERN void             TkpMenuNotifyToplevelCreate _ANSI_ARGS_((
888                             Tcl_Interp *, char *menuName));
889 EXTERN TkDisplay *      TkpOpenDisplay _ANSI_ARGS_((char *display_name));
890 EXTERN void             TkPointerDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
891 EXTERN int              TkPointerEvent _ANSI_ARGS_((XEvent *eventPtr,
892                             TkWindow *winPtr));
893 EXTERN int              TkPolygonToArea _ANSI_ARGS_((double *polyPtr,
894                             int numPoints, double *rectPtr));
895 EXTERN double           TkPolygonToPoint _ANSI_ARGS_((double *polyPtr,
896                             int numPoints, double *pointPtr));
897 EXTERN int              TkPositionInTree _ANSI_ARGS_((TkWindow *winPtr,
898                             TkWindow *treePtr));
899 #ifndef TkpPrintWindowId
900 EXTERN void             TkpPrintWindowId _ANSI_ARGS_((char *buf,
901                             Window window));
902 #endif
903 EXTERN void             TkpRedirectKeyEvent _ANSI_ARGS_((TkWindow *winPtr,
904                             XEvent *eventPtr));
905 #ifndef TkpScanWindowId
906 EXTERN int              TkpScanWindowId _ANSI_ARGS_((Tcl_Interp *interp,
907                             char *string, int *idPtr));
908 #endif
909 EXTERN void             TkpSetCapture _ANSI_ARGS_((TkWindow *winPtr));
910 EXTERN void             TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
911 EXTERN void             TkpSetMainMenubar _ANSI_ARGS_((Tcl_Interp *interp,
912                             Tk_Window tkwin, char *menuName));
913 #ifndef TkpSync
914 EXTERN void             TkpSync _ANSI_ARGS_((Display *display));
915 #endif
916 EXTERN int              TkpTestembedCmd _ANSI_ARGS_((ClientData clientData,
917                             Tcl_Interp *interp, int argc, char **argv));
918 EXTERN int              TkpUseWindow _ANSI_ARGS_((Tcl_Interp *interp,
919                             Tk_Window tkwin, char *string));
920 #ifndef TkPutImage
921 EXTERN void             TkPutImage _ANSI_ARGS_((unsigned long *colors,
922                             int ncolors, Display* display, Drawable d,
923                             GC gc, XImage* image, int src_x, int src_y,
924                             int dest_x, int dest_y, unsigned int width,
925                             unsigned int height));
926 #endif
927 EXTERN int              TkpWindowWasRecentlyDeleted _ANSI_ARGS_((Window win,
928                             TkDisplay *dispPtr));
929 EXTERN void             TkpWmSetState _ANSI_ARGS_((TkWindow *winPtr,
930                             int state));
931 EXTERN void             TkQueueEventForAllChildren _ANSI_ARGS_((
932                             TkWindow *winPtr, XEvent *eventPtr));
933 #ifndef TkRectInRegion
934 EXTERN int              TkRectInRegion _ANSI_ARGS_((TkRegion rgn,
935                             int x, int y, unsigned int width,
936                             unsigned int height));
937 #endif
938 EXTERN int              TkScrollWindow _ANSI_ARGS_((Tk_Window tkwin, GC gc,
939                             int x, int y, int width, int height, int dx,
940                             int dy, TkRegion damageRgn));
941 EXTERN void             TkSelDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
942 EXTERN void             TkSelEventProc _ANSI_ARGS_((Tk_Window tkwin,
943                             XEvent *eventPtr));
944 EXTERN void             TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
945 EXTERN void             TkSelPropProc _ANSI_ARGS_((XEvent *eventPtr));
946 EXTERN void             TkSetClassProcs _ANSI_ARGS_((Tk_Window tkwin,
947                             TkClassProcs *procs, ClientData instanceData));
948 #ifndef TkSetPixmapColormap
949 EXTERN void             TkSetPixmapColormap _ANSI_ARGS_((Pixmap pixmap,
950                             Colormap colormap));
951 #endif
952 #ifndef TkSetRegion
953 EXTERN void             TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
954                             TkRegion rgn));
955 #endif
956 EXTERN void             TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp *interp,
957                             Tk_Window tkwin, char *oldMenuName, 
958                             char *menuName));
959 EXTERN KeySym           TkStringToKeysym _ANSI_ARGS_((char *name));
960 EXTERN int              TkThickPolyLineToArea _ANSI_ARGS_((double *coordPtr,
961                             int numPoints, double width, int capStyle,
962                             int joinStyle, double *rectPtr));
963 #ifndef TkUnionRectWithRegion
964 EXTERN void             TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
965                             TkRegion src, TkRegion dr_return));
966 #endif
967 EXTERN void             TkWmAddToColormapWindows _ANSI_ARGS_((
968                             TkWindow *winPtr));
969 EXTERN void             TkWmDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
970 EXTERN TkWindow *       TkWmFocusToplevel _ANSI_ARGS_((TkWindow *winPtr));
971 EXTERN void             TkWmMapWindow _ANSI_ARGS_((TkWindow *winPtr));
972 EXTERN void             TkWmNewWindow _ANSI_ARGS_((TkWindow *winPtr));
973 EXTERN void             TkWmProtocolEventProc _ANSI_ARGS_((TkWindow *winPtr,
974                             XEvent *evenvPtr));
975 EXTERN void             TkWmRemoveFromColormapWindows _ANSI_ARGS_((
976                             TkWindow *winPtr));
977 EXTERN void             TkWmRestackToplevel _ANSI_ARGS_((TkWindow *winPtr,
978                             int aboveBelow, TkWindow *otherPtr));
979 EXTERN void             TkWmSetClass _ANSI_ARGS_((TkWindow *winPtr));
980 EXTERN void             TkWmUnmapWindow _ANSI_ARGS_((TkWindow *winPtr));
981 EXTERN int              TkXFileProc _ANSI_ARGS_((ClientData clientData,
982                             int mask, int flags));
983
984 /* 
985  * Unsupported commands.
986  */
987 EXTERN int              TkUnsupported1Cmd _ANSI_ARGS_((ClientData clientData,
988                             Tcl_Interp *interp, int argc, char **argv));
989
990 #endif  /* _TKINT */