/*
* tkInt.h --
*
* Declarations for things used internally by the Tk
* procedures but not exported outside the module.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1996 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* SCCS: @(#) tkInt.h 1.172 96/10/12 17:29:48
*/
#ifndef _TKINT
#define _TKINT
#ifndef _TK
#include "tk.h"
#endif
#ifndef _TCL
#include "tcl.h"
#endif
#ifndef _TKPORT
#include <tkPort.h>
#endif
/*
* Opaque type declarations:
*/
/*
* One of the following structures is maintained for each cursor in
* use in the system. This structure is used by tkCursor.c and the
* various system specific cursor files.
*/
typedef struct TkCursor {
* to index this entry. */
* (needed when deleting). */
} TkCursor;
/*
* One of the following structures is maintained for each display
* containing a window managed by Tk:
*/
typedef struct TkDisplay {
* identifier removed). Malloc-ed. */
* display. */
/*
* Information used primarily by tkBind.c:
*/
* part of the structure are potentially
* incorrect and should be recomputed. */
* corresponding to "mode shift". If no
* such modifier, than this is zero. */
* corresponding to the "Meta" key. If no
* such modifier, then this is zero. */
* corresponding to the "Meta" key. If no
* such modifier, then this is zero. */
/* Indicates how to interpret lock modifier. */
* below. */
* all of the keys that have modifiers
* associated with them. Malloc'ed, but
* may be NULL. */
/*
* Information used by tkError.c only:
*/
/* First in list of error handlers
* for this display. NULL means
* no handlers exist at present. */
* last time inactive handlers were
* garbage-collected. When this number
* gets big, handlers get cleaned up. */
/*
* Information used by tkSend.c only:
*/
* between interpreters during "send"
* commands. NULL means send info hasn't
* been initialized yet. */
* registry of interpreter names. */
* application name on each comm window. */
/*
* Information used by tkSelect.c and tkClipboard.c only:
*/
/* First in list of selection information
* records. Each entry contains information
* about the current owner of a particular
* selection on this display. */
* selection stuff isn't initialized. */
* retrieve selections between processes. NULL
* means clipboard info hasn't been
* initialized. */
* selection, 0 means we don't. */
/* Last application that owned clipboard. */
/* First in list of clipboard type information
* records. Each entry contains information
* about the buffers for a given selection
* target. */
/*
* Information used by tkAtom.c only:
*/
* initialized yet. */
/*
* Information used by tkCursor.c only:
*/
* None means font not loaded yet. */
/*
* Information used by tkGrab.c only:
*/
/* Window in which the pointer is currently
* grabbed, or NULL if none. */
/* Value that grabWinPtr will have once the
* grab event queue (below) has been
* completely emptied. */
/* Window in which first mouse button was
* pressed while grab was in effect, or NULL
* if no such press in effect. */
/* If no application contains the pointer then
* this is NULL. Otherwise it contains the
* last window for which we've gotten an
* Enter or Leave event from the server (i.e.
* the last window known to have contained
* the pointer). Doesn't reflect events
* that were synthesized in tkGrab.c. */
* synthesized by grab code. These events
* must be processed in order before any other
* events are processed. NULL means no such
* events. */
/* Last in list of synthesized events, or NULL
* if list is empty. */
* in tkGrab.c. */
/*
* Information used by tkXId.c only:
*/
/* First in list of chunks of free resource
* identifiers, or NULL if there are no free
* resources. */
/* Default resource allocator for display. */
/* First in list of chunks of window
* identifers that can't be reused right
* now. */
* already been scheduled, 0 means it
* hasn't. */
/*
* Information maintained by tkWindow.c for use later on by tkXId.c:
*/
* in progress. */
unsigned long lastDestroyRequest;
/* Id of most recent XDestroyWindow request;
* can re-use ids in windowStackPtr when
* server has seen this request and event
* queue is empty. */
/*
* Information used by tkVisual.c only:
*/
* allocated for this display. */
/*
* Information used by tkFocus.c only:
*/
/* Window that currently has the focus for
* this display, or NULL if none. */
/* If the focus arrived at a toplevel window
* implicitly via an Enter event (rather
* than via a FocusIn event), this points
* to the toplevel window. Otherwise it is
* NULL. */
/* This points to a toplevel window that is
* supposed to receive the X input focus as
* soon as it is mapped (needed to handle the
* fact that X won't allow the focus on an
* unmapped window). NULL means no delayed
* focus op in progress. */
* means claim the focus even if some other
* application currently has it. */
/*
* Used by tkColor.c only:
*/
* filled up, so we have to pick an
* approximate color. */
/*
* Used by tkEvent.c only:
*/
/* Points to a malloc-ed motion event
* whose processing has been delayed in
* the hopes that another motion event
* will come along right away and we can
* merge the two of them together. NULL
* means that there is no delayed motion
* event. */
/*
* Miscellaneous information:
*/
#ifdef TK_USE_INPUT_METHODS
#endif /* TK_USE_INPUT_METHODS */
} TkDisplay;
/*
* One of the following structures exists for each error handler
* created by a call to Tk_CreateErrorHandler. The structure
* is managed by tkError.c.
*/
typedef struct TkErrorHandler {
* >= to this are considered. */
* <= to this are considered. This
* field is filled in when XUnhandle
* is called. -1 means XUnhandle
* hasn't been called yet. */
* error_code (-1 means consider
* all errors). */
* major request code (-1 means
* consider all major codes). */
* minor request code (-1 means
* consider all minor codes). */
* error occurs. NULL means just ignore
* errors. */
* errorProc. */
/* Pointer to next older handler for
* this display, or NULL for end of
* list. */
/*
* One of the following structures exists for each event handler
* created by calling Tk_CreateEventHandler. This information
* is used by tkEvent.c only.
*/
typedef struct TkEventHandler {
* proc. */
* in mask occurs. */
/* Next in list of handlers
* associated with window (NULL means
* end of list). */
/*
* Tk keeps one of the following data structures for each main
* window (created by a call to Tk_CreateMainWindow). It stores
* information that is shared by all of the windows associated
* with a particular main window.
*/
typedef struct TkMainInfo {
* point here. When this becomes zero, can
* free up the structure (the reference
* count is zero because windows can get
* deleted in almost any order; the main
* window isn't necessarily the last one
* deleted). */
* structs for all windows related to this
* main window. Managed by tkWindow.c. */
/* Used in conjunction with "bind" command
* to bind events to Tcl commands. */
/* Hold definitions of virtual events. */
/* First in list of records containing focus
* information for each top-level in the
* application. Used only by tkFocus.c. */
* change the focus. Used to identify
* stale focus notifications coming from the
* X server. */
/* The most recent window that was given the
* focus via "focus" command. Used to restore
* the focus when we get stale FocusIn
* events. */
/* Top level of option hierarchy for this
* main window. NULL means uninitialized.
* Managed by tkOption.c. */
* structures. Managed by tkImage.c. */
* global variable. */
* this process. */
} TkMainInfo;
/*
* Tk keeps one of the following structures for each window.
* Some of the information (like size and location) is a shadow
* of information managed by the X server, and some is special
* information used here, such as event and geometry management
* information. This information is (mostly) managed by tkWindow.c.
* WARNING: the declaration below must be kept consistent with the
* Tk_FakeWin structure in tk.h. If you change one, be sure to
* change the other!!
*/
typedef struct TkWindow {
/*
* Structural information:
*/
* for window. */
* those for dispPtr. */
* MUST be set before X window is created. */
* hasn't actually been created yet, or it's
* been deleted. */
* or NULL if no children. */
/* Last in list of child windows, or NULL
* if no children. */
* parent, not necessarily X parent). NULL
* means either this is the main window, or
* the window's parent has already been
* deleted. */
* same parent (NULL if end of
* list). */
* associated with a particular main
* window. NULL means this window is
* a rogue that isn't associated with
* any application (at present, this
* only happens for the dummy windows
* used for "send" communication). */
/*
* Name and type information for the window:
*/
* of all names between this window and
* its top-level ancestor). This is a
* pointer into an entry in
* mainPtr->nameTable. NULL means that
* the window hasn't been completely
* created yet. */
* (unique within the parent). */
* hasn't been given a class yet. */
/*
* Geometry and other attributes of window. This information
* may not be updated on the server immediately; stuff that
* hasn't been reflected in the server yet is called "dirty".
* At present, information can be dirty only if the window
* hasn't yet been created.
*/
* window. */
* that are dirty. */
* that are dirty. */
* defined in tk.h (confusing, but they're
* needed there for some query macros). */
/*
* Information kept by the event manager (tkEvent.c):
*/
* declared for this window, or
* NULL if none. */
#ifdef TK_USE_INPUT_METHODS
#endif /* TK_USE_INPUT_METHODS */
/*
* Information used for event bindings (see "bind" and "bindtags"
* commands in tkCmds.c):
*/
* on this window. Each tag is a Tk_Uid.
* Malloc'ed. NULL means no tags. */
/*
* Information used by tkOption.c to manage options for the
* window.
*/
* currently cached for this window.
* Otherwise this gives the level in
* the option stack at which info is
* cached. */
/*
* Information used by tkSelect.c to manage the selection.
*/
/* First in list of handlers for
* returning the selection in various
* forms. */
/*
* Information used by tkGeometry.c for geometry management.
*/
* this window. */
* Tk_GeometryRequest, or 0's if
* Tk_GeometryRequest hasn't been
* called. */
* (0 means no internal border). Geometry
* managers should not normally place children
* on top of the border. */
/*
* Information maintained by tkWm.c for window manager communication.
*/
* structure with wm-related info (see
* tkWm.c). For other windows, this
* is NULL. */
/*
* Platform specific information private to each port.
*/
} TkWindow;
/*
* The following structure is used as a two way map between integers
* and strings, usually to map between an internal C representation
* and the strings used in Tcl.
*/
typedef struct TkStateMap {
} TkStateMap;
/*
* This structure is used by the Mac and Window porting layers as
* the internal representation of a clip_mask in a GC.
*/
typedef struct TkpClipMask {
union {
} value;
} TkpClipMask;
#define TKP_CLIP_PIXMAP 0
/*
* Pointer to first entry in list of all displays currently known.
*/
extern TkDisplay *tkDisplayList;
/*
* Flags passed to TkMeasureChars:
*/
/*
* Return values from TkGrabState:
*/
#define TK_GRAB_NONE 0
/*
* The macro below is used to modify a "char" value (e.g. by casting
* it to an unsigned character) so that it can be used safely with
* macros such as isspace.
*/
#define UCHAR(c) ((unsigned char) (c))
/*
* Miscellaneous variables shared among Tk modules but not exported
* to the outside world:
*/
extern Tk_Uid tkActiveUid;
extern Tk_ImageType tkBitmapImageType;
extern Tk_Uid tkDisabledUid;
extern Tk_PhotoImageFormat tkImgFmtGIF;
extern void (*tkHandleEventProc) _ANSI_ARGS_((
extern Tk_PhotoImageFormat tkImgFmtPPM;
extern TkMainInfo *tkMainWindowList;
extern Tk_Uid tkNormalUid;
extern Tk_ImageType tkPhotoImageType;
extern int tkSendSerial;
/*
* Internal procedures shared among Tk modules but not exported
* to the outside world:
*/
#ifndef TkClipBox
#endif
int *heightPtr));
char *script));
char *screenName, char *baseName));
#ifndef TkCreateRegion
#endif
#ifndef TkDestroyRegion
#endif
int flags));
Window w));
double m2[]));
char *screenName));
double m2[]));
#ifndef TkGetNativeProlog
#endif
double *pointPtr));
#ifndef TkIntersectRegion
#endif
int numPoints));
double *rectPtr));
#ifndef TkPutImage
unsigned int height));
#endif
#ifndef TkRectInRegion
int x, int y, unsigned int width,
unsigned int height));
#endif
#ifndef TkSetPixmapColormap
#endif
#ifndef TkSetRegion
#endif
#ifndef TkUnionRectWithRegion
#endif
/*
* Unsupported commands.
*/
#endif /* _TKINT */