/*
* tk.h --
*
* Declarations for Tk-related things that are visible
* outside of the Tk module itself.
*
* Copyright (c) 1989-1994 The Regents of the University of California.
* Copyright (c) 1994 The Australian National University.
* 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: @(#) tk.h 1.195 97/01/29 17:45:58
*/
#ifndef _TK
#define _TK
/*
* When version numbers change here, must also go into the following files
* and update the version numbers:
*
*
* The release level should be 0 for alpha, 1 for beta, and 2 for
* "a", "b", or "p" in the patch level; for example, if the patch level
* is 4.3b2, TK_RELEASE_SERIAL is 2. It restarts at 1 whenever the
* release level is changed, except for the final release, which should
* be 0.
*/
/*
* A special definition used to allow this header file to be included
* in resource files.
*/
#ifndef RESOURCE_INCLUDED
/*
* The following definitions set up the proper options for Macintosh
* compilers. We use this method because there is no autoconf equivalent.
*/
#ifdef MAC_TCL
# ifndef REDO_KEYSYM_LOOKUP
# define REDO_KEYSYM_LOOKUP
# endif
#endif
#ifndef _TCL
# include <tcl.h>
#endif
#ifndef _XLIB_H
# ifdef MAC_TCL
# include <Xlib.h>
# include <X.h>
# else
# if _PACKAGE_ast
# include <Xlib.h>
# else
# endif
# endif
#endif
#ifdef __STDC__
# include <stddef.h>
#endif
/*
* Decide whether or not to use input methods.
*/
#ifdef XNQueryInputStyle
#define TK_USE_INPUT_METHODS
#endif
/*
* Dummy types that are used by clients:
*/
/*
* Additional types exported to clients.
*/
typedef char *Tk_Uid;
/*
* Structure used to specify how to handle argv options.
*/
typedef struct {
* argv array. */
* depends on type. */
* depends on type. */
} Tk_ArgvInfo;
/*
* Legal values for the type field of a Tk_ArgvInfo: see the user
* documentation for details.
*/
/*
* Flag bits for passing to Tk_ParseArgv:
*/
/*
* Structure used to describe application-specific configuration
* options: indicates procedures to call to parse an option and
* to return a text string describing an option.
*/
int offset));
Tcl_FreeProc **freeProcPtr));
typedef struct Tk_CustomOption {
* option and store it in converted
* form. */
* string describing an existing
* option. */
* option parser: passed to
* parseProc and printProc. */
/*
* Structure used to specify information for Tk_ConfigureWidget. Each
* structure gives complete information for one option, including
* how the option is specified on the command line, where it appears
* in the option database, etc.
*/
typedef struct Tk_ConfigSpec {
* see definitions below. Last option in
* table must have type TK_CONFIG_END. */
* NULL means this spec is part of a group. */
* specified in command line or database. */
* use Tk_Offset macro to generate values
* for this. */
* below; other bits are used internally
* by tkConfig.c. */
* a pointer to info about how to parse and
* print the option. Otherwise it is
* irrelevant. */
/*
* Type values for Tk_ConfigSpec structures. See the user
* documentation for details.
*/
/*
* Macro to use to fill in "offset" fields of Tk_ConfigInfos.
* Computes number of bytes from beginning of structure to a
* given field.
*/
#ifdef offsetof
#else
#endif
/*
* Possible values for flags argument to Tk_ConfigureWidget:
*/
/*
* Possible flag values for Tk_ConfigInfo structures. Any bits at
* or above TK_CONFIG_USER_BIT may be used by clients for selecting
* certain entries. Before changing any values here, coordinate with
* tkConfig.c (internal-use-only flags are defined there).
*/
/*
* Enumerated type for describing actions to be taken in response
* to a restrictProc established by Tk_RestrictEvents.
*/
typedef enum {
/*
* Priority levels to pass to Tk_AddOption:
*/
/*
* Relief values returned by Tk_GetRelief:
*/
/*
* "Which" argument values for Tk_3DBorderGC:
*/
/*
* Special EnterNotify/LeaveNotify "mode" for use in events
* generated by tkShare.c. Pick a high enough value that it's
* unlikely to conflict with existing values (like NotifyNormal)
* or any new values defined in the future.
*/
/*
* Enumerated type for describing a point by which to anchor something:
*/
typedef enum {
} Tk_Anchor;
/*
* Enumerated type for describing a style of justification:
*/
typedef enum {
} Tk_Justify;
/*
* Each geometry manager (the packer, the placer, etc.) is represented
* by a structure of the following form, which indicates procedures
* to invoke in the geometry manager to carry out certain functions.
*/
typedef struct Tk_GeomMgr {
* used to invoke it, or name of widget
* class that allows embedded widgets). */
/* Procedure to invoke when a slave's
* requested geometry changes. */
/* Procedure to invoke when a slave is
* taken away from one geometry manager
* by another. NULL means geometry manager
* doesn't care when slaves are lost. */
} Tk_GeomMgr;
/*
* Result values returned by Tk_GetScrollInfo:
*/
/*---------------------------------------------------------------------------
*
* Extensions to the X event set
*
*---------------------------------------------------------------------------
*/
/*
* A virtual event shares most of its fields with the XKeyEvent and
* XButtonEvent structures. 99% of the time a virtual event will be
* an abstraction of a key or button event, so this structure provides
* the most information to the user. The only difference is the changing
* of the detail field for a virtual event so that it holds the name of the
* virtual event being triggered.
*/
typedef struct {
int type;
int x, y; /* pointer x, y coordinates in event window */
typedef struct {
int type;
/*
*--------------------------------------------------------------
*
* Macros for querying Tk_Window structures. See the
* manual entries for documentation.
*
*--------------------------------------------------------------
*/
/*
* The structure below is needed by the macros above so that they can
* access the fields of a Tk_Window. The fields not needed by the macros
* are declared as "dummyX". The structure has its own type in order to
* prevent applications from accessing Tk_Window fields except using
* official macros. WARNING!! The structure definition must be kept
* consistent with the TkWindow structure in tkInt.h. If you change one,
* then change the other. See the declaration in tkInt.h for
* documentation on what the fields are used for internally.
*/
typedef struct Tk_FakeWin {
char *dummy1;
int screenNum;
int depth;
char *dummy2;
char *dummy3;
char *dummy4;
char *dummy5;
char *pathName;
unsigned int dummy6;
unsigned long dummy7;
unsigned int flags;
char *dummy8;
#ifdef TK_USE_INPUT_METHODS
#endif /* TK_USE_INPUT_METHODS */
int dummy11;
int dummy12;
char *dummy13;
char *dummy14;
int internalBorderWidth;
char *dummy16;
char *dummy17;
} Tk_FakeWin;
/*
* Flag values for TkWindow (and Tk_FakeWin) structures are:
*
* TK_MAPPED: 1 means window is currently mapped,
* 0 means unmapped.
* TK_TOP_LEVEL: 1 means this is a top-level window (it
* was or will be created as a child of
* a root window).
* TK_ALREADY_DEAD: 1 means the window is in the process of
* being destroyed already.
* TK_NEED_CONFIG_NOTIFY: 1 means that the window has been reconfigured
* before it was made to exist. At the time of
* making it exist a ConfigureNotify event needs
* to be generated.
* TK_GRAB_FLAG: Used to manage grabs. See tkGrab.c for
* details.
* TK_CHECKED_IC: 1 means we've already tried to get an input
* context for this window; if the ic field
* is NULL it means that there isn't a context
* for the field.
* TK_PARENT_DESTROYED: 1 means that the window's parent has already
* been destroyed or is in the process of being
* destroyed.
* TK_WM_COLORMAP_WINDOW: 1 means that this window has at some time
* appeared in the WM_COLORMAP_WINDOWS property
* for its toplevel, so we have to remove it
* from that property if the window is
* deleted and the toplevel isn't.
*/
/*
*--------------------------------------------------------------
*
* Procedure prototypes and structures used for defining new canvas
* items:
*
*--------------------------------------------------------------
*/
/*
* For each item in a canvas widget there exists one record with
* the following structure. Each actual item is represented by
* a record with the following stuff at its beginning, plus additional
* type-specific stuff after that.
*/
typedef struct Tk_Item {
* (also serves as first tag for
* item). */
* items in this canvas. Later items
* in list are drawn on top of earlier
* ones. */
* tags. */
* points to staticTagSpace, but
* may point to malloc-ed space if
* there are lots of tags. */
* at tagPtr. */
* at *tagPtr. */
* this type of item. */
* canvas units. Set by item-specific
* code and guaranteed to contain every
* pixel drawn in item. Item area
* includes x1 and y1 but not x2
* and y2. */
/*
*------------------------------------------------------------------
* Starting here is additional type-specific stuff; see the
* declarations for individual types to see what is part of
* each type. The actual space below is determined by the
* "itemInfoSize" of the type's Tk_ItemType record.
*------------------------------------------------------------------
*/
} Tk_Item;
/*
* Records of the following type are used to describe a type of
* item (e.g. lines, circles, etc.) that can form part of a
* canvas widget.
*/
char **argv));
char **argv));
int *indexPtr));
int maxBytes));
typedef struct Tk_ItemType {
* as "line". */
* item's record. */
* this type. */
* specs for this type. Used for
* returning configuration info. */
* configuration options. */
* the item's coordinates. */
* this type. */
* this type. */
* be called even when the item has
* been moved off-screen. */
* a given point. */
* outside, or overlapping an area. */
/* Procedure to write a Postscript
* description for items of this
* type. */
* this type. */
* this type. */
* indicated character. NULL if
* item doesn't support indexing. */
* to just before a given position. */
* STRING format) when it is in this
* item. */
* an item. */
* from an item. */
* a list. */
} Tk_ItemType;
/*
* The following structure provides information about the selection and
* the insertion cursor. It is needed by only a few items, such as
* those that display text. It is shared by the generic canvas code
* and the item-specific code, but most of the fields should be written
* only by the canvas generic code.
*/
typedef struct Tk_CanvasTextInfo {
* characters. Read-only to items.*/
* Read-only to items. */
* Read-only to items. */
* selection isn't in this canvas.
* Writable by items. */
* Writable by items. */
* Writable by items. */
* not necessarily selItemPtr. Read-only
* to items. */
* operation will use this as one end of the
* selection). Writable by items. */
* cursor. Read-only to items. */
* to items. */
* Read-only to items. */
* or NULL if no such item. Read-only to
* items. */
* the input focus. Read-only to items.*/
* should be displayed in focusItemPtr.
* Read-only to items.*/
/*
*--------------------------------------------------------------
*
* Procedure prototypes and structures used for managing images:
*
*--------------------------------------------------------------
*/
int imageHeight));
/*
* The following structure represents a particular type of image
* (bitmap, xpm image, etc.). It provides information common to
* all images of that type, such as the type name and a collection
* of procedures in the image manager that respond to various
* events. Each image manager is represented by one of these
* structures.
*/
struct Tk_ImageType {
/* Procedure to call to create a new image
* of this type. */
* Tk_GetImage is called in a new way
* (new visual or screen). */
/* Call to draw image, in response to
* Tk_RedrawImage calls. */
* is called to release an instance of an
* image. */
/* Procedure to call to delete image. It
* will not be called until after freeProc
* has been called for each instance of the
* image. */
/* Next in list of all image types currently
* known. Filled in by Tk, not by image
* manager. */
};
/*
*--------------------------------------------------------------
*
* Additional definitions used to manage images of type "photo".
*
*--------------------------------------------------------------
*/
/*
* The following type is used to identify a particular photo image
* to be manipulated:
*/
typedef void *Tk_PhotoHandle;
/*
* The following structure describes a block of pixels in memory:
*/
typedef struct Tk_PhotoImageBlock {
* pixels in successive lines. */
* pixels in the same line. */
* and blue components of the pixel and the
* pixel as a whole. */
/*
* Procedure prototypes and structures used in reading and
* writing photo images:
*/
/*
* The following structure represents a particular file format for
* storing images (e.g., PPM, GIF, JPEG, etc.). It provides information
* to allow image files of that format to be recognized and read into
* a photo image.
*/
struct Tk_PhotoImageFormat {
/* Procedure to call to determine whether
* an image file matches this format. */
/* Procedure to call to determine whether
* the data in a string matches this format. */
/* Procedure to call to read data from
* an image file into a photo image. */
/* Procedure to call to read data from
* a string into a photo image. */
/* Procedure to call to write data from
* a photo image to a file. */
/* Procedure to call to obtain a string
* representation of the data in a photo
* image.*/
/* Next in list of all photo image formats
* currently known. Filled in by Tk, not
* by image format handler. */
};
/*
*--------------------------------------------------------------
*
* The definitions below provide backward compatibility for
* functions and types related to event handling that used to
* be in Tk but have moved to Tcl.
*
*--------------------------------------------------------------
*/
/* Additional stuff that has moved to Tcl: */
/*
*--------------------------------------------------------------
*
* Additional procedure types defined by Tk.
*
*--------------------------------------------------------------
*/
/*
*--------------------------------------------------------------
*
* Exported procedures and variables.
*
*--------------------------------------------------------------
*/
#if _BLD_tk && defined(__EXPORT__)
#define extern __EXPORT__
#endif
int relief));
ClientData *objectPtr));
double x, double y, short *drawableXPtr,
short *drawableYPtr));
int y2));
double *doublePtr));
int offset));
Tcl_FreeProc **freeProcPtr));
double x, double y, short *screenXPtr,
short *screenYPtr));
unsigned long valueMask,
char* buffer));
int flags));
Tk_ImageType *typePtr));
char *pathName, char *screenName));
int height));
char *eventString));
char *name));
int leftRelief));
int relief));
int leftRelief));
int relief));
char *eventString));
char *className));
int *intPtr));
Colormap *colormapPtr));
int *heightPtr));
Tk_ImageMaster master, int x, int y,
int imageHeight));
char *name));
int height));
int y));
int x, int y));
Tk_PhotoImageBlock *blockPtr, int x, int y,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int subsampleX, int subsampleY));
char *name));
char *className));
int gridHeight));
int width));
unsigned long pixel));
unsigned long pixel));
int width));
int *heightPtr));
/*
* Tcl commands exported by Tk:
*/
#undef extern
#endif /* RESOURCE_INCLUDED */
#endif /* _TK */