Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:30:24

0001 /*
0002  * tk.h --
0003  *
0004  *  Declarations for Tk-related things that are visible outside of the Tk
0005  *  module itself.
0006  *
0007  * Copyright (c) 1989-1994 The Regents of the University of California.
0008  * Copyright (c) 1994 The Australian National University.
0009  * Copyright (c) 1994-1998 Sun Microsystems, Inc.
0010  * Copyright (c) 1998-2000 Ajuba Solutions.
0011  *
0012  * See the file "license.terms" for information on usage and redistribution of
0013  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
0014  */
0015 
0016 #ifndef _TK
0017 #define _TK
0018 
0019 #include <tcl.h>
0020 #if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION < 6)
0021 #   error Tk 8.6 must be compiled with tcl.h from Tcl 8.6 or better
0022 #endif
0023 
0024 #ifndef CONST84
0025 #   define CONST84 const
0026 #   define CONST84_RETURN const
0027 #endif
0028 #ifndef CONST86
0029 #   define CONST86 CONST84
0030 #endif
0031 #ifndef EXTERN
0032 #   define EXTERN extern TCL_STORAGE_CLASS
0033 #endif
0034 
0035 /*
0036  * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
0037  * quotation marks), JOIN joins two arguments.
0038  */
0039 
0040 #ifndef STRINGIFY
0041 #  define STRINGIFY(x) STRINGIFY1(x)
0042 #  define STRINGIFY1(x) #x
0043 #endif
0044 #ifndef JOIN
0045 #  define JOIN(a,b) JOIN1(a,b)
0046 #  define JOIN1(a,b) a##b
0047 #endif
0048 
0049 /*
0050  * For C++ compilers, use extern "C"
0051  */
0052 
0053 #ifdef __cplusplus
0054 extern "C" {
0055 #endif
0056 
0057 /*
0058  * When version numbers change here, you must also go into the following files
0059  * and update the version numbers:
0060  *
0061  * library/tk.tcl   (1 LOC patch)
0062  * unix/configure.in    (2 LOC Major, 2 LOC minor, 1 LOC patch)
0063  * win/configure.in (as above)
0064  * README       (sections 0 and 1)
0065  * macosx/Tk-Common.xcconfig (not patchlevel) 1 LOC
0066  * win/README       (not patchlevel)
0067  * unix/README      (not patchlevel)
0068  * unix/tk.spec     (1 LOC patch)
0069  * win/tcl.m4       (not patchlevel)
0070  *
0071  * You may also need to update some of these files when the numbers change for
0072  * the version of Tcl that this release of Tk is compiled against.
0073  */
0074 
0075 #define TK_MAJOR_VERSION    8
0076 #define TK_MINOR_VERSION    6
0077 #define TK_RELEASE_LEVEL    TCL_FINAL_RELEASE
0078 #define TK_RELEASE_SERIAL   11
0079 
0080 #define TK_VERSION      "8.6"
0081 #define TK_PATCH_LEVEL      "8.6.11"
0082 
0083 /*
0084  * A special definition used to allow this header file to be included from
0085  * windows or mac resource files so that they can obtain version information.
0086  * RC_INVOKED is defined by default by the windows RC tool and manually set
0087  * for macintosh.
0088  *
0089  * Resource compilers don't like all the C stuff, like typedefs and procedure
0090  * declarations, that occur below, so block them out.
0091  */
0092 
0093 #ifndef RC_INVOKED
0094 
0095 #if !defined(_XLIB_H) && !defined(_X11_XLIB_H_)
0096 #   include <X11/Xlib.h>
0097 #   ifdef MAC_OSX_TK
0098 #   include <X11/X.h>
0099 #   endif
0100 #endif
0101 #if defined(STDC_HEADERS) || defined(__STDC__) || defined(__C99__FUNC__) \
0102      || defined(__cplusplus) || defined(_MSC_VER) || defined(__ICC)
0103 #   include <stddef.h>
0104 #endif
0105 
0106 #ifdef BUILD_tk
0107 #undef TCL_STORAGE_CLASS
0108 #define TCL_STORAGE_CLASS   DLLEXPORT
0109 #endif
0110 
0111 /*
0112  *----------------------------------------------------------------------
0113  *
0114  * Decide whether or not to use input methods.
0115  */
0116 
0117 #ifdef XNQueryInputStyle
0118 #define TK_USE_INPUT_METHODS
0119 #endif
0120 
0121 /*
0122  * Dummy types that are used by clients:
0123  */
0124 
0125 #define Tk_ImageModel Tk_ImageMaster
0126 typedef struct Tk_BindingTable_ *Tk_BindingTable;
0127 typedef struct Tk_Canvas_ *Tk_Canvas;
0128 typedef struct Tk_Cursor_ *Tk_Cursor;
0129 typedef struct Tk_ErrorHandler_ *Tk_ErrorHandler;
0130 typedef struct Tk_Font_ *Tk_Font;
0131 typedef struct Tk_Image__ *Tk_Image;
0132 typedef struct Tk_ImageMaster_ *Tk_ImageMaster;
0133 typedef struct Tk_OptionTable_ *Tk_OptionTable;
0134 typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo;
0135 typedef struct Tk_TextLayout_ *Tk_TextLayout;
0136 typedef struct Tk_Window_ *Tk_Window;
0137 typedef struct Tk_3DBorder_ *Tk_3DBorder;
0138 typedef struct Tk_Style_ *Tk_Style;
0139 typedef struct Tk_StyleEngine_ *Tk_StyleEngine;
0140 typedef struct Tk_StyledElement_ *Tk_StyledElement;
0141 
0142 /*
0143  * Additional types exported to clients.
0144  */
0145 
0146 typedef const char *Tk_Uid;
0147 
0148 /*
0149  *----------------------------------------------------------------------
0150  *
0151  * The enum below defines the valid types for Tk configuration options as
0152  * implemented by Tk_InitOptions, Tk_SetOptions, etc.
0153  */
0154 
0155 typedef enum {
0156     TK_OPTION_BOOLEAN,
0157     TK_OPTION_INT,
0158     TK_OPTION_DOUBLE,
0159     TK_OPTION_STRING,
0160     TK_OPTION_STRING_TABLE,
0161     TK_OPTION_COLOR,
0162     TK_OPTION_FONT,
0163     TK_OPTION_BITMAP,
0164     TK_OPTION_BORDER,
0165     TK_OPTION_RELIEF,
0166     TK_OPTION_CURSOR,
0167     TK_OPTION_JUSTIFY,
0168     TK_OPTION_ANCHOR,
0169     TK_OPTION_SYNONYM,
0170     TK_OPTION_PIXELS,
0171     TK_OPTION_WINDOW,
0172     TK_OPTION_END,
0173     TK_OPTION_CUSTOM,
0174     TK_OPTION_STYLE
0175 } Tk_OptionType;
0176 
0177 /*
0178  * Structures of the following type are used by widgets to specify their
0179  * configuration options. Typically each widget has a static array of these
0180  * structures, where each element of the array describes a single
0181  * configuration option. The array is passed to Tk_CreateOptionTable.
0182  */
0183 
0184 typedef struct Tk_OptionSpec {
0185     Tk_OptionType type;     /* Type of option, such as TK_OPTION_COLOR;
0186                  * see definitions above. Last option in table
0187                  * must have type TK_OPTION_END. */
0188     const char *optionName; /* Name used to specify option in Tcl
0189                  * commands. */
0190     const char *dbName;     /* Name for option in option database. */
0191     const char *dbClass;    /* Class for option in database. */
0192     const char *defValue;   /* Default value for option if not specified
0193                  * in command line, the option database, or
0194                  * the system. */
0195     int objOffset;      /* Where in record to store a Tcl_Obj * that
0196                  * holds the value of this option, specified
0197                  * as an offset in bytes from the start of the
0198                  * record. Use the Tk_Offset macro to generate
0199                  * values for this. -1 means don't store the
0200                  * Tcl_Obj in the record. */
0201     int internalOffset;     /* Where in record to store the internal
0202                  * representation of the value of this option,
0203                  * such as an int or XColor *. This field is
0204                  * specified as an offset in bytes from the
0205                  * start of the record. Use the Tk_Offset
0206                  * macro to generate values for it. -1 means
0207                  * don't store the internal representation in
0208                  * the record. */
0209     int flags;          /* Any combination of the values defined
0210                  * below. */
0211     const void *clientData; /* An alternate place to put option-specific
0212                  * data. Used for the monochrome default value
0213                  * for colors, etc. */
0214     int typeMask;       /* An arbitrary bit mask defined by the class
0215                  * manager; typically bits correspond to
0216                  * certain kinds of options such as all those
0217                  * that require a redisplay when they change.
0218                  * Tk_SetOptions returns the bit-wise OR of
0219                  * the typeMasks of all options that were
0220                  * changed. */
0221 } Tk_OptionSpec;
0222 
0223 /*
0224  * Flag values for Tk_OptionSpec structures. These flags are shared by
0225  * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully.
0226  */
0227 
0228 #define TK_OPTION_NULL_OK       (1 << 0)
0229 #define TK_OPTION_DONT_SET_DEFAULT  (1 << 3)
0230 
0231 /*
0232  * The following structure and function types are used by TK_OPTION_CUSTOM
0233  * options; the structure holds pointers to the functions needed by the Tk
0234  * option config code to handle a custom option.
0235  */
0236 
0237 typedef int (Tk_CustomOptionSetProc) (ClientData clientData,
0238     Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec,
0239     int offset, char *saveInternalPtr, int flags);
0240 typedef Tcl_Obj *(Tk_CustomOptionGetProc) (ClientData clientData,
0241     Tk_Window tkwin, char *widgRec, int offset);
0242 typedef void (Tk_CustomOptionRestoreProc) (ClientData clientData,
0243     Tk_Window tkwin, char *internalPtr, char *saveInternalPtr);
0244 typedef void (Tk_CustomOptionFreeProc) (ClientData clientData, Tk_Window tkwin,
0245     char *internalPtr);
0246 
0247 typedef struct Tk_ObjCustomOption {
0248     const char *name;       /* Name of the custom option. */
0249     Tk_CustomOptionSetProc *setProc;
0250                 /* Function to use to set a record's option
0251                  * value from a Tcl_Obj */
0252     Tk_CustomOptionGetProc *getProc;
0253                 /* Function to use to get a Tcl_Obj
0254                  * representation from an internal
0255                  * representation of an option. */
0256     Tk_CustomOptionRestoreProc *restoreProc;
0257                 /* Function to use to restore a saved value
0258                  * for the internal representation. */
0259     Tk_CustomOptionFreeProc *freeProc;
0260                 /* Function to use to free the internal
0261                  * representation of an option. */
0262     ClientData clientData;  /* Arbitrary one-word value passed to the
0263                  * handling procs. */
0264 } Tk_ObjCustomOption;
0265 
0266 /*
0267  * Macro to use to fill in "offset" fields of the Tk_OptionSpec structure.
0268  * Computes number of bytes from beginning of structure to a given field.
0269  */
0270 
0271 #define Tk_Offset(type, field) ((int) offsetof(type, field))
0272 /* Workaround for platforms missing offsetof(), e.g. VC++ 6.0 */
0273 #ifndef offsetof
0274 #   define offsetof(type, field) ((size_t) ((char *) &((type *) 0)->field))
0275 #endif
0276 
0277 /*
0278  * The following two structures are used for error handling. When config
0279  * options are being modified, the old values are saved in a Tk_SavedOptions
0280  * structure. If an error occurs, then the contents of the structure can be
0281  * used to restore all of the old values. The contents of this structure are
0282  * for the private use Tk. No-one outside Tk should ever read or write any of
0283  * the fields of these structures.
0284  */
0285 
0286 typedef struct Tk_SavedOption {
0287     struct TkOption *optionPtr; /* Points to information that describes the
0288                  * option. */
0289     Tcl_Obj *valuePtr;      /* The old value of the option, in the form of
0290                  * a Tcl object; may be NULL if the value was
0291                  * not saved as an object. */
0292     double internalForm;    /* The old value of the option, in some
0293                  * internal representation such as an int or
0294                  * (XColor *). Valid only if the field
0295                  * optionPtr->specPtr->objOffset is < 0. The
0296                  * space must be large enough to accommodate a
0297                  * double, a long, or a pointer; right now it
0298                  * looks like a double (i.e., 8 bytes) is big
0299                  * enough. Also, using a double guarantees
0300                  * that the field is properly aligned for
0301                  * storing large values. */
0302 } Tk_SavedOption;
0303 
0304 #ifdef TCL_MEM_DEBUG
0305 #   define TK_NUM_SAVED_OPTIONS 2
0306 #else
0307 #   define TK_NUM_SAVED_OPTIONS 20
0308 #endif
0309 
0310 typedef struct Tk_SavedOptions {
0311     char *recordPtr;        /* The data structure in which to restore
0312                  * configuration options. */
0313     Tk_Window tkwin;        /* Window associated with recordPtr; needed to
0314                  * restore certain options. */
0315     int numItems;       /* The number of valid items in items field. */
0316     Tk_SavedOption items[TK_NUM_SAVED_OPTIONS];
0317                 /* Items used to hold old values. */
0318     struct Tk_SavedOptions *nextPtr;
0319                 /* Points to next structure in list; needed if
0320                  * too many options changed to hold all the
0321                  * old values in a single structure. NULL
0322                  * means no more structures. */
0323 } Tk_SavedOptions;
0324 
0325 /*
0326  * Structure used to describe application-specific configuration options:
0327  * indicates procedures to call to parse an option and to return a text string
0328  * describing an option. THESE ARE DEPRECATED; PLEASE USE THE NEW STRUCTURES
0329  * LISTED ABOVE.
0330  */
0331 
0332 /*
0333  * This is a temporary flag used while tkObjConfig and new widgets are in
0334  * development.
0335  */
0336 
0337 #ifndef __NO_OLD_CONFIG
0338 
0339 typedef int (Tk_OptionParseProc) (ClientData clientData, Tcl_Interp *interp,
0340     Tk_Window tkwin, CONST84 char *value, char *widgRec, int offset);
0341 typedef CONST86 char *(Tk_OptionPrintProc) (ClientData clientData,
0342     Tk_Window tkwin, char *widgRec, int offset, Tcl_FreeProc **freeProcPtr);
0343 
0344 typedef struct Tk_CustomOption {
0345     Tk_OptionParseProc *parseProc;
0346                 /* Procedure to call to parse an option and
0347                  * store it in converted form. */
0348     Tk_OptionPrintProc *printProc;
0349                 /* Procedure to return a printable string
0350                  * describing an existing option. */
0351     ClientData clientData;  /* Arbitrary one-word value used by option
0352                  * parser: passed to parseProc and
0353                  * printProc. */
0354 } Tk_CustomOption;
0355 
0356 /*
0357  * Structure used to specify information for Tk_ConfigureWidget. Each
0358  * structure gives complete information for one option, including how the
0359  * option is specified on the command line, where it appears in the option
0360  * database, etc.
0361  */
0362 
0363 typedef struct Tk_ConfigSpec {
0364     int type;           /* Type of option, such as TK_CONFIG_COLOR;
0365                  * see definitions below. Last option in table
0366                  * must have type TK_CONFIG_END. */
0367     CONST86 char *argvName; /* Switch used to specify option in argv. NULL
0368                  * means this spec is part of a group. */
0369     Tk_Uid dbName;      /* Name for option in option database. */
0370     Tk_Uid dbClass;     /* Class for option in database. */
0371     Tk_Uid defValue;        /* Default value for option if not specified
0372                  * in command line or database. */
0373     int offset;         /* Where in widget record to store value; use
0374                  * Tk_Offset macro to generate values for
0375                  * this. */
0376     int specFlags;      /* Any combination of the values defined
0377                  * below; other bits are used internally by
0378                  * tkConfig.c. */
0379     CONST86 Tk_CustomOption *customPtr;
0380                 /* If type is TK_CONFIG_CUSTOM then this is a
0381                  * pointer to info about how to parse and
0382                  * print the option. Otherwise it is
0383                  * irrelevant. */
0384 } Tk_ConfigSpec;
0385 
0386 /*
0387  * Type values for Tk_ConfigSpec structures. See the user documentation for
0388  * details.
0389  */
0390 
0391 typedef enum {
0392     TK_CONFIG_BOOLEAN, TK_CONFIG_INT, TK_CONFIG_DOUBLE, TK_CONFIG_STRING,
0393     TK_CONFIG_UID, TK_CONFIG_COLOR, TK_CONFIG_FONT, TK_CONFIG_BITMAP,
0394     TK_CONFIG_BORDER, TK_CONFIG_RELIEF, TK_CONFIG_CURSOR,
0395     TK_CONFIG_ACTIVE_CURSOR, TK_CONFIG_JUSTIFY, TK_CONFIG_ANCHOR,
0396     TK_CONFIG_SYNONYM, TK_CONFIG_CAP_STYLE, TK_CONFIG_JOIN_STYLE,
0397     TK_CONFIG_PIXELS, TK_CONFIG_MM, TK_CONFIG_WINDOW, TK_CONFIG_CUSTOM,
0398     TK_CONFIG_END
0399 } Tk_ConfigTypes;
0400 
0401 /*
0402  * Possible values for flags argument to Tk_ConfigureWidget:
0403  */
0404 
0405 #define TK_CONFIG_ARGV_ONLY 1
0406 #define TK_CONFIG_OBJS      0x80
0407 
0408 /*
0409  * Possible flag values for Tk_ConfigSpec structures. Any bits at or above
0410  * TK_CONFIG_USER_BIT may be used by clients for selecting certain entries.
0411  * Before changing any values here, coordinate with tkOldConfig.c
0412  * (internal-use-only flags are defined there).
0413  */
0414 
0415 #define TK_CONFIG_NULL_OK       (1 << 0)
0416 #define TK_CONFIG_COLOR_ONLY        (1 << 1)
0417 #define TK_CONFIG_MONO_ONLY     (1 << 2)
0418 #define TK_CONFIG_DONT_SET_DEFAULT  (1 << 3)
0419 #define TK_CONFIG_OPTION_SPECIFIED      (1 << 4)
0420 #define TK_CONFIG_USER_BIT      0x100
0421 #endif /* __NO_OLD_CONFIG */
0422 
0423 /*
0424  * Structure used to specify how to handle argv options.
0425  */
0426 
0427 typedef struct {
0428     CONST86 char *key;      /* The key string that flags the option in the
0429                  * argv array. */
0430     int type;           /* Indicates option type; see below. */
0431     char *src;          /* Value to be used in setting dst; usage
0432                  * depends on type. */
0433     char *dst;          /* Address of value to be modified; usage
0434                  * depends on type. */
0435     CONST86 char *help;     /* Documentation message describing this
0436                  * option. */
0437 } Tk_ArgvInfo;
0438 
0439 /*
0440  * Legal values for the type field of a Tk_ArgvInfo: see the user
0441  * documentation for details.
0442  */
0443 
0444 #define TK_ARGV_CONSTANT        15
0445 #define TK_ARGV_INT         16
0446 #define TK_ARGV_STRING          17
0447 #define TK_ARGV_UID         18
0448 #define TK_ARGV_REST            19
0449 #define TK_ARGV_FLOAT           20
0450 #define TK_ARGV_FUNC            21
0451 #define TK_ARGV_GENFUNC         22
0452 #define TK_ARGV_HELP            23
0453 #define TK_ARGV_CONST_OPTION        24
0454 #define TK_ARGV_OPTION_VALUE        25
0455 #define TK_ARGV_OPTION_NAME_VALUE   26
0456 #define TK_ARGV_END         27
0457 
0458 /*
0459  * Flag bits for passing to Tk_ParseArgv:
0460  */
0461 
0462 #define TK_ARGV_NO_DEFAULTS     0x1
0463 #define TK_ARGV_NO_LEFTOVERS        0x2
0464 #define TK_ARGV_NO_ABBREV       0x4
0465 #define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8
0466 
0467 /*
0468  * Enumerated type for describing actions to be taken in response to a
0469  * restrictProc established by Tk_RestrictEvents.
0470  */
0471 
0472 typedef enum {
0473     TK_DEFER_EVENT, TK_PROCESS_EVENT, TK_DISCARD_EVENT
0474 } Tk_RestrictAction;
0475 
0476 /*
0477  * Priority levels to pass to Tk_AddOption:
0478  */
0479 
0480 #define TK_WIDGET_DEFAULT_PRIO  20
0481 #define TK_STARTUP_FILE_PRIO    40
0482 #define TK_USER_DEFAULT_PRIO    60
0483 #define TK_INTERACTIVE_PRIO 80
0484 #define TK_MAX_PRIO     100
0485 
0486 /*
0487  * Relief values returned by Tk_GetRelief:
0488  */
0489 
0490 #define TK_RELIEF_NULL      -1
0491 #define TK_RELIEF_FLAT      0
0492 #define TK_RELIEF_GROOVE    1
0493 #define TK_RELIEF_RAISED    2
0494 #define TK_RELIEF_RIDGE     3
0495 #define TK_RELIEF_SOLID     4
0496 #define TK_RELIEF_SUNKEN    5
0497 
0498 /*
0499  * "Which" argument values for Tk_3DBorderGC:
0500  */
0501 
0502 #define TK_3D_FLAT_GC       1
0503 #define TK_3D_LIGHT_GC      2
0504 #define TK_3D_DARK_GC       3
0505 
0506 /*
0507  * Special EnterNotify/LeaveNotify "mode" for use in events generated by
0508  * tkShare.c. Pick a high enough value that it's unlikely to conflict with
0509  * existing values (like NotifyNormal) or any new values defined in the
0510  * future.
0511  */
0512 
0513 #define TK_NOTIFY_SHARE     20
0514 
0515 /*
0516  * Enumerated type for describing a point by which to anchor something:
0517  */
0518 
0519 typedef enum {
0520     TK_ANCHOR_N, TK_ANCHOR_NE, TK_ANCHOR_E, TK_ANCHOR_SE,
0521     TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW,
0522     TK_ANCHOR_CENTER
0523 } Tk_Anchor;
0524 
0525 /*
0526  * Enumerated type for describing a style of justification:
0527  */
0528 
0529 typedef enum {
0530     TK_JUSTIFY_LEFT, TK_JUSTIFY_RIGHT, TK_JUSTIFY_CENTER
0531 } Tk_Justify;
0532 
0533 /*
0534  * The following structure is used by Tk_GetFontMetrics() to return
0535  * information about the properties of a Tk_Font.
0536  */
0537 
0538 typedef struct Tk_FontMetrics {
0539     int ascent;         /* The amount in pixels that the tallest
0540                  * letter sticks up above the baseline, plus
0541                  * any extra blank space added by the designer
0542                  * of the font. */
0543     int descent;        /* The largest amount in pixels that any
0544                  * letter sticks below the baseline, plus any
0545                  * extra blank space added by the designer of
0546                  * the font. */
0547     int linespace;      /* The sum of the ascent and descent. How far
0548                  * apart two lines of text in the same font
0549                  * should be placed so that none of the
0550                  * characters in one line overlap any of the
0551                  * characters in the other line. */
0552 } Tk_FontMetrics;
0553 
0554 /*
0555  * Flags passed to Tk_MeasureChars:
0556  */
0557 
0558 #define TK_WHOLE_WORDS      1
0559 #define TK_AT_LEAST_ONE     2
0560 #define TK_PARTIAL_OK       4
0561 
0562 /*
0563  * Flags passed to Tk_ComputeTextLayout:
0564  */
0565 
0566 #define TK_IGNORE_TABS      8
0567 #define TK_IGNORE_NEWLINES  16
0568 
0569 /*
0570  * Widget class procedures used to implement platform specific widget
0571  * behavior.
0572  */
0573 
0574 typedef Window (Tk_ClassCreateProc) (Tk_Window tkwin, Window parent,
0575     ClientData instanceData);
0576 typedef void (Tk_ClassWorldChangedProc) (ClientData instanceData);
0577 typedef void (Tk_ClassModalProc) (Tk_Window tkwin, XEvent *eventPtr);
0578 
0579 typedef struct Tk_ClassProcs {
0580     unsigned int size;
0581     Tk_ClassWorldChangedProc *worldChangedProc;
0582                 /* Procedure to invoke when the widget needs
0583                  * to respond in some way to a change in the
0584                  * world (font changes, etc.) */
0585     Tk_ClassCreateProc *createProc;
0586                 /* Procedure to invoke when the platform-
0587                  * dependent window needs to be created. */
0588     Tk_ClassModalProc *modalProc;
0589                 /* Procedure to invoke after all bindings on a
0590                  * widget have been triggered in order to
0591                  * handle a modal loop. */
0592 } Tk_ClassProcs;
0593 
0594 /*
0595  * Simple accessor for Tk_ClassProcs structure. Checks that the structure is
0596  * not NULL, then checks the size field and returns either the requested
0597  * field, if present, or NULL if the structure is too small to have the field
0598  * (or NULL if the structure is NULL).
0599  *
0600  * A more general version of this function may be useful if other
0601  * size-versioned structure pop up in the future:
0602  *
0603  *  #define Tk_GetField(name, who, which) \
0604  *      (((who) == NULL) ? NULL :
0605  *      (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which))
0606  */
0607 
0608 #define Tk_GetClassProc(procs, which) \
0609     (((procs) == NULL) ? NULL : \
0610     (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which))
0611 
0612 /*
0613  * Each geometry manager (the packer, the placer, etc.) is represented by a
0614  * structure of the following form, which indicates procedures to invoke in
0615  * the geometry manager to carry out certain functions.
0616  */
0617 
0618 #define Tk_GeomLostContentProc Tk_GeomLostSlaveProc
0619 typedef void (Tk_GeomRequestProc) (ClientData clientData, Tk_Window tkwin);
0620 typedef void (Tk_GeomLostContentProc) (ClientData clientData, Tk_Window tkwin);
0621 
0622 typedef struct Tk_GeomMgr {
0623     const char *name;       /* Name of the geometry manager (command used
0624                  * to invoke it, or name of widget class that
0625                  * allows embedded widgets). */
0626     Tk_GeomRequestProc *requestProc;
0627                 /* Procedure to invoke when a content's
0628                  * requested geometry changes. */
0629     Tk_GeomLostContentProc *lostSlaveProc;
0630                 /* Procedure to invoke when content is taken
0631                  * away from one geometry manager by another.
0632                  * NULL means geometry manager doesn't care
0633                  * when content lost. */
0634 } Tk_GeomMgr;
0635 
0636 /*
0637  * Result values returned by Tk_GetScrollInfo:
0638  */
0639 
0640 #define TK_SCROLL_MOVETO    1
0641 #define TK_SCROLL_PAGES     2
0642 #define TK_SCROLL_UNITS     3
0643 #define TK_SCROLL_ERROR     4
0644 
0645 /*
0646  *----------------------------------------------------------------------
0647  *
0648  * Extensions to the X event set
0649  *
0650  *----------------------------------------------------------------------
0651  */
0652 
0653 #define VirtualEvent        (MappingNotify + 1)
0654 #define ActivateNotify      (MappingNotify + 2)
0655 #define DeactivateNotify    (MappingNotify + 3)
0656 #define MouseWheelEvent     (MappingNotify + 4)
0657 #define TK_LASTEVENT        (MappingNotify + 5)
0658 
0659 #define MouseWheelMask      (1L << 28)
0660 #define ActivateMask        (1L << 29)
0661 #define VirtualEventMask    (1L << 30)
0662 
0663 /*
0664  * A virtual event shares most of its fields with the XKeyEvent and
0665  * XButtonEvent structures. 99% of the time a virtual event will be an
0666  * abstraction of a key or button event, so this structure provides the most
0667  * information to the user. The only difference is the changing of the detail
0668  * field for a virtual event so that it holds the name of the virtual event
0669  * being triggered.
0670  *
0671  * When using this structure, you should ensure that you zero out all the
0672  * fields first using memset() or bzero().
0673  */
0674 
0675 typedef struct {
0676     int type;
0677     unsigned long serial;   /* # of last request processed by server. */
0678     Bool send_event;        /* True if this came from a SendEvent
0679                  * request. */
0680     Display *display;       /* Display the event was read from. */
0681     Window event;       /* Window on which event was requested. */
0682     Window root;        /* Root window that the event occurred on. */
0683     Window subwindow;       /* Child window. */
0684     Time time;          /* Milliseconds. */
0685     int x, y;           /* Pointer x, y coordinates in event
0686                  * window. */
0687     int x_root, y_root;     /* Coordinates relative to root. */
0688     unsigned int state;     /* Key or button mask */
0689     Tk_Uid name;        /* Name of virtual event. */
0690     Bool same_screen;       /* Same screen flag. */
0691     Tcl_Obj *user_data;     /* Application-specific data reference; Tk
0692                  * will decrement the reference count *once*
0693                  * when it has finished processing the
0694                  * event. */
0695 } XVirtualEvent;
0696 
0697 typedef struct {
0698     int type;
0699     unsigned long serial;   /* # of last request processed by server. */
0700     Bool send_event;        /* True if this came from a SendEvent
0701                  * request. */
0702     Display *display;       /* Display the event was read from. */
0703     Window window;      /* Window in which event occurred. */
0704 } XActivateDeactivateEvent;
0705 typedef XActivateDeactivateEvent XActivateEvent;
0706 typedef XActivateDeactivateEvent XDeactivateEvent;
0707 
0708 /*
0709  *----------------------------------------------------------------------
0710  *
0711  * Macros for querying Tk_Window structures. See the manual entries for
0712  * documentation.
0713  *
0714  *----------------------------------------------------------------------
0715  */
0716 
0717 #define Tk_Display(tkwin)   (((Tk_FakeWin *) (tkwin))->display)
0718 #define Tk_ScreenNumber(tkwin)  (((Tk_FakeWin *) (tkwin))->screenNum)
0719 #define Tk_Screen(tkwin) \
0720     (ScreenOfDisplay(Tk_Display(tkwin), Tk_ScreenNumber(tkwin)))
0721 #define Tk_Depth(tkwin)     (((Tk_FakeWin *) (tkwin))->depth)
0722 #define Tk_Visual(tkwin)    (((Tk_FakeWin *) (tkwin))->visual)
0723 #define Tk_WindowId(tkwin)  (((Tk_FakeWin *) (tkwin))->window)
0724 #define Tk_PathName(tkwin)  (((Tk_FakeWin *) (tkwin))->pathName)
0725 #define Tk_Name(tkwin)      (((Tk_FakeWin *) (tkwin))->nameUid)
0726 #define Tk_Class(tkwin)     (((Tk_FakeWin *) (tkwin))->classUid)
0727 #define Tk_X(tkwin)     (((Tk_FakeWin *) (tkwin))->changes.x)
0728 #define Tk_Y(tkwin)     (((Tk_FakeWin *) (tkwin))->changes.y)
0729 #define Tk_Width(tkwin)     (((Tk_FakeWin *) (tkwin))->changes.width)
0730 #define Tk_Height(tkwin) \
0731     (((Tk_FakeWin *) (tkwin))->changes.height)
0732 #define Tk_Changes(tkwin)   (&((Tk_FakeWin *) (tkwin))->changes)
0733 #define Tk_Attributes(tkwin)    (&((Tk_FakeWin *) (tkwin))->atts)
0734 #define Tk_IsEmbedded(tkwin) \
0735     (((Tk_FakeWin *) (tkwin))->flags & TK_EMBEDDED)
0736 #define Tk_IsContainer(tkwin) \
0737     (((Tk_FakeWin *) (tkwin))->flags & TK_CONTAINER)
0738 #define Tk_IsMapped(tkwin) \
0739     (((Tk_FakeWin *) (tkwin))->flags & TK_MAPPED)
0740 #define Tk_IsTopLevel(tkwin) \
0741     (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL)
0742 #define Tk_HasWrapper(tkwin) \
0743     (((Tk_FakeWin *) (tkwin))->flags & TK_HAS_WRAPPER)
0744 #define Tk_WinManaged(tkwin) \
0745     (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED)
0746 #define Tk_TopWinHierarchy(tkwin) \
0747     (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY)
0748 #define Tk_IsManageable(tkwin) \
0749     (((Tk_FakeWin *) (tkwin))->flags & TK_WM_MANAGEABLE)
0750 #define Tk_ReqWidth(tkwin)  (((Tk_FakeWin *) (tkwin))->reqWidth)
0751 #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
0752 /* Tk_InternalBorderWidth is deprecated */
0753 #define Tk_InternalBorderWidth(tkwin) \
0754     (((Tk_FakeWin *) (tkwin))->internalBorderLeft)
0755 #define Tk_InternalBorderLeft(tkwin) \
0756     (((Tk_FakeWin *) (tkwin))->internalBorderLeft)
0757 #define Tk_InternalBorderRight(tkwin) \
0758     (((Tk_FakeWin *) (tkwin))->internalBorderRight)
0759 #define Tk_InternalBorderTop(tkwin) \
0760     (((Tk_FakeWin *) (tkwin))->internalBorderTop)
0761 #define Tk_InternalBorderBottom(tkwin) \
0762     (((Tk_FakeWin *) (tkwin))->internalBorderBottom)
0763 #define Tk_MinReqWidth(tkwin)   (((Tk_FakeWin *) (tkwin))->minReqWidth)
0764 #define Tk_MinReqHeight(tkwin)  (((Tk_FakeWin *) (tkwin))->minReqHeight)
0765 #define Tk_Parent(tkwin)    (((Tk_FakeWin *) (tkwin))->parentPtr)
0766 #define Tk_Colormap(tkwin)  (((Tk_FakeWin *) (tkwin))->atts.colormap)
0767 
0768 /*
0769  * The structure below is needed by the macros above so that they can access
0770  * the fields of a Tk_Window. The fields not needed by the macros are declared
0771  * as "dummyX". The structure has its own type in order to prevent apps from
0772  * accessing Tk_Window fields except using official macros. WARNING!! The
0773  * structure definition must be kept consistent with the TkWindow structure in
0774  * tkInt.h. If you change one, then change the other. See the declaration in
0775  * tkInt.h for documentation on what the fields are used for internally.
0776  */
0777 
0778 typedef struct Tk_FakeWin {
0779     Display *display;
0780     char *dummy1;       /* dispPtr */
0781     int screenNum;
0782     Visual *visual;
0783     int depth;
0784     Window window;
0785     char *dummy2;       /* childList */
0786     char *dummy3;       /* lastChildPtr */
0787     Tk_Window parentPtr;    /* parentPtr */
0788     char *dummy4;       /* nextPtr */
0789     char *dummy5;       /* mainPtr */
0790     char *pathName;
0791     Tk_Uid nameUid;
0792     Tk_Uid classUid;
0793     XWindowChanges changes;
0794     unsigned int dummy6;    /* dirtyChanges */
0795     XSetWindowAttributes atts;
0796     unsigned long dummy7;   /* dirtyAtts */
0797     unsigned int flags;
0798     char *dummy8;       /* handlerList */
0799 #ifdef TK_USE_INPUT_METHODS
0800     XIC dummy9;         /* inputContext */
0801 #endif /* TK_USE_INPUT_METHODS */
0802     ClientData *dummy10;    /* tagPtr */
0803     int dummy11;        /* numTags */
0804     int dummy12;        /* optionLevel */
0805     char *dummy13;      /* selHandlerList */
0806     char *dummy14;      /* geomMgrPtr */
0807     ClientData dummy15;     /* geomData */
0808     int reqWidth, reqHeight;
0809     int internalBorderLeft;
0810     char *dummy16;      /* wmInfoPtr */
0811     char *dummy17;      /* classProcPtr */
0812     ClientData dummy18;     /* instanceData */
0813     char *dummy19;      /* privatePtr */
0814     int internalBorderRight;
0815     int internalBorderTop;
0816     int internalBorderBottom;
0817     int minReqWidth;
0818     int minReqHeight;
0819 #ifdef TK_USE_INPUT_METHODS
0820     int dummy20;
0821 #endif /* TK_USE_INPUT_METHODS */
0822     char *dummy21;      /* geomMgrName */
0823     Tk_Window dummy22;      /* maintainerPtr */
0824 } Tk_FakeWin;
0825 
0826 /*
0827  * Flag values for TkWindow (and Tk_FakeWin) structures are:
0828  *
0829  * TK_MAPPED:           1 means window is currently mapped,
0830  *              0 means unmapped.
0831  * TK_TOP_LEVEL:        1 means this is a top-level widget.
0832  * TK_ALREADY_DEAD:     1 means the window is in the process of
0833  *              being destroyed already.
0834  * TK_NEED_CONFIG_NOTIFY:   1 means that the window has been reconfigured
0835  *              before it was made to exist. At the time of
0836  *              making it exist a ConfigureNotify event needs
0837  *              to be generated.
0838  * TK_GRAB_FLAG:        Used to manage grabs. See tkGrab.c for details
0839  * TK_CHECKED_IC:       1 means we've already tried to get an input
0840  *              context for this window; if the ic field is
0841  *              NULL it means that there isn't a context for
0842  *              the field.
0843  * TK_DONT_DESTROY_WINDOW:  1 means that Tk_DestroyWindow should not
0844  *              invoke XDestroyWindow to destroy this widget's
0845  *              X window. The flag is set when the window has
0846  *              already been destroyed elsewhere (e.g. by
0847  *              another application) or when it will be
0848  *              destroyed later (e.g. by destroying its parent)
0849  * TK_WM_COLORMAP_WINDOW:   1 means that this window has at some time
0850  *              appeared in the WM_COLORMAP_WINDOWS property
0851  *              for its toplevel, so we have to remove it from
0852  *              that property if the window is deleted and the
0853  *              toplevel isn't.
0854  * TK_EMBEDDED:         1 means that this window (which must be a
0855  *              toplevel) is not a free-standing window but
0856  *              rather is embedded in some other application.
0857  * TK_CONTAINER:        1 means that this window is a container, and
0858  *              that some other application (either in this
0859  *              process or elsewhere) may be embedding itself
0860  *              inside the window.
0861  * TK_BOTH_HALVES:      1 means that this window is used for
0862  *              application embedding (either as container or
0863  *              embedded application), and both the containing
0864  *              and embedded halves are associated with
0865  *              windows in this particular process.
0866  * TK_WRAPPER:          1 means that this window is the extra wrapper
0867  *              window created around a toplevel to hold the
0868  *              menubar under Unix. See tkUnixWm.c for more
0869  *              information.
0870  * TK_REPARENTED:       1 means that this window has been reparented
0871  *              so that as far as the window system is
0872  *              concerned it isn't a child of its Tk parent.
0873  *              Initially this is used only for special Unix
0874  *              menubar windows.
0875  * TK_ANONYMOUS_WINDOW:     1 means that this window has no name, and is
0876  *              thus not accessible from Tk.
0877  * TK_HAS_WRAPPER       1 means that this window has a wrapper window
0878  * TK_WIN_MANAGED       1 means that this window is a child of the root
0879  *              window, and is managed by the window manager.
0880  * TK_TOP_HIERARCHY     1 means this window is at the top of a physical
0881  *              window hierarchy within this process, i.e. the
0882  *              window's parent either doesn't exist or is not
0883  *              owned by this Tk application.
0884  * TK_PROP_PROPCHANGE       1 means that PropertyNotify events in the
0885  *              window's children should propagate up to this
0886  *              window.
0887  * TK_WM_MANAGEABLE     1 marks a window as capable of being converted
0888  *              into a toplevel using [wm manage].
0889  * TK_CAN_INPUT_TEXT            1 means that this window accepts text input.
0890  *                              Used on macOS to indicate that key events can be
0891  *                              processed with the NSTextInputClient protocol.
0892  *                              Not currently accessible through the public API.
0893  */
0894 
0895 #define TK_MAPPED       1
0896 #define TK_TOP_LEVEL        2
0897 #define TK_ALREADY_DEAD     4
0898 #define TK_NEED_CONFIG_NOTIFY   8
0899 #define TK_GRAB_FLAG        0x10
0900 #define TK_CHECKED_IC       0x20
0901 #define TK_DONT_DESTROY_WINDOW  0x40
0902 #define TK_WM_COLORMAP_WINDOW   0x80
0903 #define TK_EMBEDDED     0x100
0904 #define TK_CONTAINER        0x200
0905 #define TK_BOTH_HALVES      0x400
0906 
0907 #define TK_WRAPPER      0x1000
0908 #define TK_REPARENTED       0x2000
0909 #define TK_ANONYMOUS_WINDOW 0x4000
0910 #define TK_HAS_WRAPPER      0x8000
0911 #define TK_WIN_MANAGED      0x10000
0912 #define TK_TOP_HIERARCHY    0x20000
0913 #define TK_PROP_PROPCHANGE  0x40000
0914 #define TK_WM_MANAGEABLE    0x80000
0915 #define TK_CAN_INPUT_TEXT       0x100000
0916 
0917 /*
0918  *----------------------------------------------------------------------
0919  *
0920  * Procedure prototypes and structures used for defining new canvas items:
0921  *
0922  *----------------------------------------------------------------------
0923  */
0924 
0925 typedef enum {
0926     TK_STATE_NULL = -1, TK_STATE_ACTIVE, TK_STATE_DISABLED,
0927     TK_STATE_NORMAL, TK_STATE_HIDDEN
0928 } Tk_State;
0929 
0930 typedef struct Tk_SmoothMethod {
0931     CONST86 char *name;
0932     int (*coordProc) (Tk_Canvas canvas, double *pointPtr, int numPoints,
0933         int numSteps, XPoint xPoints[], double dblPoints[]);
0934     void (*postscriptProc) (Tcl_Interp *interp, Tk_Canvas canvas,
0935         double *coordPtr, int numPoints, int numSteps);
0936 } Tk_SmoothMethod;
0937 
0938 /*
0939  * For each item in a canvas widget there exists one record with the following
0940  * structure. Each actual item is represented by a record with the following
0941  * stuff at its beginning, plus additional type-specific stuff after that.
0942  */
0943 
0944 #define TK_TAG_SPACE 3
0945 
0946 typedef struct Tk_Item {
0947     int id;         /* Unique identifier for this item (also
0948                  * serves as first tag for item). */
0949     struct Tk_Item *nextPtr;    /* Next in display list of all items in this
0950                  * canvas. Later items in list are drawn on
0951                  * top of earlier ones. */
0952     Tk_Uid staticTagSpace[TK_TAG_SPACE];
0953                 /* Built-in space for limited # of tags. */
0954     Tk_Uid *tagPtr;     /* Pointer to array of tags. Usually points to
0955                  * staticTagSpace, but may point to malloc-ed
0956                  * space if there are lots of tags. */
0957     int tagSpace;       /* Total amount of tag space available at
0958                  * tagPtr. */
0959     int numTags;        /* Number of tag slots actually used at
0960                  * *tagPtr. */
0961     struct Tk_ItemType *typePtr;/* Table of procedures that implement this
0962                  * type of item. */
0963     int x1, y1, x2, y2;     /* Bounding box for item, in integer canvas
0964                  * units. Set by item-specific code and
0965                  * guaranteed to contain every pixel drawn in
0966                  * item. Item area includes x1 and y1 but not
0967                  * x2 and y2. */
0968     struct Tk_Item *prevPtr;    /* Previous in display list of all items in
0969                  * this canvas. Later items in list are drawn
0970                  * just below earlier ones. */
0971     Tk_State state;     /* State of item. */
0972     char *reserved1;        /* reserved for future use */
0973     int redraw_flags;       /* Some flags used in the canvas */
0974 
0975     /*
0976      *------------------------------------------------------------------
0977      * Starting here is additional type-specific stuff; see the declarations
0978      * for individual types to see what is part of each type. The actual space
0979      * below is determined by the "itemInfoSize" of the type's Tk_ItemType
0980      * record.
0981      *------------------------------------------------------------------
0982      */
0983 } Tk_Item;
0984 
0985 /*
0986  * Flag bits for canvases (redraw_flags):
0987  *
0988  * TK_ITEM_STATE_DEPENDANT -    1 means that object needs to be redrawn if the
0989  *              canvas state changes.
0990  * TK_ITEM_DONT_REDRAW -    1 means that the object redraw is already been
0991  *              prepared, so the general canvas code doesn't
0992  *              need to do that any more.
0993  */
0994 
0995 #define TK_ITEM_STATE_DEPENDANT     1
0996 #define TK_ITEM_DONT_REDRAW     2
0997 
0998 /*
0999  * Records of the following type are used to describe a type of item (e.g.
1000  * lines, circles, etc.) that can form part of a canvas widget.
1001  */
1002 
1003 #ifdef USE_OLD_CANVAS
1004 typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1005             Tk_Item *itemPtr, int argc, char **argv);
1006 typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1007             Tk_Item *itemPtr, int argc, char **argv, int flags);
1008 typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1009             Tk_Item *itemPtr, int argc, char **argv);
1010 #else
1011 typedef int (Tk_ItemCreateProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1012             Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[]);
1013 typedef int (Tk_ItemConfigureProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1014             Tk_Item *itemPtr, int argc, Tcl_Obj *const objv[],
1015             int flags);
1016 typedef int (Tk_ItemCoordProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1017             Tk_Item *itemPtr, int argc, Tcl_Obj *const argv[]);
1018 #endif /* USE_OLD_CANVAS */
1019 typedef void    (Tk_ItemDeleteProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1020             Display *display);
1021 typedef void    (Tk_ItemDisplayProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1022             Display *display, Drawable dst, int x, int y, int width,
1023             int height);
1024 typedef double  (Tk_ItemPointProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1025             double *pointPtr);
1026 typedef int (Tk_ItemAreaProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1027             double *rectPtr);
1028 typedef int (Tk_ItemPostscriptProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1029             Tk_Item *itemPtr, int prepass);
1030 typedef void    (Tk_ItemScaleProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1031             double originX, double originY, double scaleX,
1032             double scaleY);
1033 typedef void    (Tk_ItemTranslateProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1034             double deltaX, double deltaY);
1035 #ifdef USE_OLD_CANVAS
1036 typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1037             Tk_Item *itemPtr, char *indexString, int *indexPtr);
1038 #else
1039 typedef int (Tk_ItemIndexProc)(Tcl_Interp *interp, Tk_Canvas canvas,
1040             Tk_Item *itemPtr, Tcl_Obj *indexString, int *indexPtr);
1041 #endif /* USE_OLD_CANVAS */
1042 typedef void    (Tk_ItemCursorProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1043             int index);
1044 typedef int (Tk_ItemSelectionProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1045             int offset, char *buffer, int maxBytes);
1046 #ifdef USE_OLD_CANVAS
1047 typedef void    (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1048             int beforeThis, char *string);
1049 #else
1050 typedef void    (Tk_ItemInsertProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1051             int beforeThis, Tcl_Obj *string);
1052 #endif /* USE_OLD_CANVAS */
1053 typedef void    (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr,
1054             int first, int last);
1055 
1056 #ifndef __NO_OLD_CONFIG
1057 
1058 typedef struct Tk_ItemType {
1059     CONST86 char *name;     /* The name of this type of item, such as
1060                  * "line". */
1061     int itemSize;       /* Total amount of space needed for item's
1062                  * record. */
1063     Tk_ItemCreateProc *createProc;
1064                 /* Procedure to create a new item of this
1065                  * type. */
1066     CONST86 Tk_ConfigSpec *configSpecs; /* Pointer to array of configuration specs for
1067                  * this type. Used for returning configuration
1068                  * info. */
1069     Tk_ItemConfigureProc *configProc;
1070                 /* Procedure to call to change configuration
1071                  * options. */
1072     Tk_ItemCoordProc *coordProc;/* Procedure to call to get and set the item's
1073                  * coordinates. */
1074     Tk_ItemDeleteProc *deleteProc;
1075                 /* Procedure to delete existing item of this
1076                  * type. */
1077     Tk_ItemDisplayProc *displayProc;
1078                 /* Procedure to display items of this type. */
1079     int alwaysRedraw;       /* Non-zero means displayProc should be called
1080                  * even when the item has been moved
1081                  * off-screen. */
1082     Tk_ItemPointProc *pointProc;/* Computes distance from item to a given
1083                  * point. */
1084     Tk_ItemAreaProc *areaProc;  /* Computes whether item is inside, outside,
1085                  * or overlapping an area. */
1086     Tk_ItemPostscriptProc *postscriptProc;
1087                 /* Procedure to write a Postscript description
1088                  * for items of this type. */
1089     Tk_ItemScaleProc *scaleProc;/* Procedure to rescale items of this type. */
1090     Tk_ItemTranslateProc *translateProc;
1091                 /* Procedure to translate items of this
1092                  * type. */
1093     Tk_ItemIndexProc *indexProc;/* Procedure to determine index of indicated
1094                  * character. NULL if item doesn't support
1095                  * indexing. */
1096     Tk_ItemCursorProc *icursorProc;
1097                 /* Procedure to set insert cursor posn to just
1098                  * before a given position. */
1099     Tk_ItemSelectionProc *selectionProc;
1100                 /* Procedure to return selection (in STRING
1101                  * format) when it is in this item. */
1102     Tk_ItemInsertProc *insertProc;
1103                 /* Procedure to insert something into an
1104                  * item. */
1105     Tk_ItemDCharsProc *dCharsProc;
1106                 /* Procedure to delete characters from an
1107                  * item. */
1108     struct Tk_ItemType *nextPtr;/* Used to link types together into a list. */
1109     char *reserved1;        /* Reserved for future extension. */
1110     int reserved2;      /* Carefully compatible with */
1111     char *reserved3;        /* Jan Nijtmans dash patch */
1112     char *reserved4;
1113 } Tk_ItemType;
1114 
1115 /*
1116  * Flag (used in the alwaysRedraw field) to say whether an item supports
1117  * point-level manipulation like the line and polygon items.
1118  */
1119 
1120 #define TK_MOVABLE_POINTS   2
1121 
1122 #endif /* __NO_OLD_CONFIG */
1123 
1124 /*
1125  * The following structure provides information about the selection and the
1126  * insertion cursor. It is needed by only a few items, such as those that
1127  * display text. It is shared by the generic canvas code and the item-specific
1128  * code, but most of the fields should be written only by the canvas generic
1129  * code.
1130  */
1131 
1132 typedef struct Tk_CanvasTextInfo {
1133     Tk_3DBorder selBorder;  /* Border and background for selected
1134                  * characters. Read-only to items.*/
1135     int selBorderWidth;     /* Width of border around selection. Read-only
1136                  * to items. */
1137     XColor *selFgColorPtr;  /* Foreground color for selected text.
1138                  * Read-only to items. */
1139     Tk_Item *selItemPtr;    /* Pointer to selected item. NULL means
1140                  * selection isn't in this canvas. Writable by
1141                  * items. */
1142     int selectFirst;        /* Character index of first selected
1143                  * character. Writable by items. */
1144     int selectLast;     /* Character index of last selected character.
1145                  * Writable by items. */
1146     Tk_Item *anchorItemPtr; /* Item corresponding to "selectAnchor": not
1147                  * necessarily selItemPtr. Read-only to
1148                  * items. */
1149     int selectAnchor;       /* Character index of fixed end of selection
1150                  * (i.e. "select to" operation will use this
1151                  * as one end of the selection). Writable by
1152                  * items. */
1153     Tk_3DBorder insertBorder;   /* Used to draw vertical bar for insertion
1154                  * cursor. Read-only to items. */
1155     int insertWidth;        /* Total width of insertion cursor. Read-only
1156                  * to items. */
1157     int insertBorderWidth;  /* Width of 3-D border around insert cursor.
1158                  * Read-only to items. */
1159     Tk_Item *focusItemPtr;  /* Item that currently has the input focus, or
1160                  * NULL if no such item. Read-only to items. */
1161     int gotFocus;       /* Non-zero means that the canvas widget has
1162                  * the input focus. Read-only to items.*/
1163     int cursorOn;       /* Non-zero means that an insertion cursor
1164                  * should be displayed in focusItemPtr.
1165                  * Read-only to items.*/
1166 } Tk_CanvasTextInfo;
1167 
1168 /*
1169  * Structures used for Dashing and Outline.
1170  */
1171 
1172 typedef struct Tk_Dash {
1173     int number;
1174     union {
1175     char *pt;
1176     char array[sizeof(char *)];
1177     } pattern;
1178 } Tk_Dash;
1179 
1180 typedef struct Tk_TSOffset {
1181     int flags;          /* Flags; see below for possible values */
1182     int xoffset;        /* x offset */
1183     int yoffset;        /* y offset */
1184 } Tk_TSOffset;
1185 
1186 /*
1187  * Bit fields in Tk_TSOffset->flags:
1188  */
1189 
1190 #define TK_OFFSET_INDEX     1
1191 #define TK_OFFSET_RELATIVE  2
1192 #define TK_OFFSET_LEFT      4
1193 #define TK_OFFSET_CENTER    8
1194 #define TK_OFFSET_RIGHT     16
1195 #define TK_OFFSET_TOP       32
1196 #define TK_OFFSET_MIDDLE    64
1197 #define TK_OFFSET_BOTTOM    128
1198 
1199 typedef struct Tk_Outline {
1200     GC gc;          /* Graphics context. */
1201     double width;       /* Width of outline. */
1202     double activeWidth;     /* Width of outline. */
1203     double disabledWidth;   /* Width of outline. */
1204     int offset;         /* Dash offset. */
1205     Tk_Dash dash;       /* Dash pattern. */
1206     Tk_Dash activeDash;     /* Dash pattern if state is active. */
1207     Tk_Dash disabledDash;   /* Dash pattern if state is disabled. */
1208     void *reserved1;        /* Reserved for future expansion. */
1209     void *reserved2;
1210     void *reserved3;
1211     Tk_TSOffset tsoffset;   /* Stipple offset for outline. */
1212     XColor *color;      /* Outline color. */
1213     XColor *activeColor;    /* Outline color if state is active. */
1214     XColor *disabledColor;  /* Outline color if state is disabled. */
1215     Pixmap stipple;     /* Outline Stipple pattern. */
1216     Pixmap activeStipple;   /* Outline Stipple pattern if state is
1217                  * active. */
1218     Pixmap disabledStipple; /* Outline Stipple pattern if state is
1219                  * disabled. */
1220 } Tk_Outline;
1221 
1222 /*
1223  *----------------------------------------------------------------------
1224  *
1225  * Procedure prototypes and structures used for managing images:
1226  *
1227  *----------------------------------------------------------------------
1228  */
1229 
1230 typedef struct Tk_ImageType Tk_ImageType;
1231 #ifdef USE_OLD_IMAGE
1232 typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, char *name, int argc,
1233     char **argv, Tk_ImageType *typePtr, Tk_ImageMaster model,
1234     ClientData *clientDataPtr);
1235 #else
1236 typedef int (Tk_ImageCreateProc) (Tcl_Interp *interp, CONST86 char *name, int objc,
1237     Tcl_Obj *const objv[], CONST86 Tk_ImageType *typePtr, Tk_ImageMaster model,
1238     ClientData *clientDataPtr);
1239 #endif /* USE_OLD_IMAGE */
1240 typedef ClientData (Tk_ImageGetProc) (Tk_Window tkwin, ClientData clientData);
1241 typedef void (Tk_ImageDisplayProc) (ClientData clientData, Display *display,
1242     Drawable drawable, int imageX, int imageY, int width, int height,
1243     int drawableX, int drawableY);
1244 typedef void (Tk_ImageFreeProc) (ClientData clientData, Display *display);
1245 typedef void (Tk_ImageDeleteProc) (ClientData clientData);
1246 typedef void (Tk_ImageChangedProc) (ClientData clientData, int x, int y,
1247     int width, int height, int imageWidth, int imageHeight);
1248 typedef int (Tk_ImagePostscriptProc) (ClientData clientData,
1249     Tcl_Interp *interp, Tk_Window tkwin, Tk_PostscriptInfo psinfo,
1250     int x, int y, int width, int height, int prepass);
1251 
1252 /*
1253  * The following structure represents a particular type of image (bitmap, xpm
1254  * image, etc.). It provides information common to all images of that type,
1255  * such as the type name and a collection of procedures in the image manager
1256  * that respond to various events. Each image manager is represented by one of
1257  * these structures.
1258  */
1259 
1260 struct Tk_ImageType {
1261     CONST86 char *name;     /* Name of image type. */
1262     Tk_ImageCreateProc *createProc;
1263                 /* Procedure to call to create a new image of
1264                  * this type. */
1265     Tk_ImageGetProc *getProc;   /* Procedure to call the first time
1266                  * Tk_GetImage is called in a new way (new
1267                  * visual or screen). */
1268     Tk_ImageDisplayProc *displayProc;
1269                 /* Call to draw image, in response to
1270                  * Tk_RedrawImage calls. */
1271     Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage is
1272                  * called to release an instance of an
1273                  * image. */
1274     Tk_ImageDeleteProc *deleteProc;
1275                 /* Procedure to call to delete image. It will
1276                  * not be called until after freeProc has been
1277                  * called for each instance of the image. */
1278     Tk_ImagePostscriptProc *postscriptProc;
1279                 /* Procedure to call to produce postscript
1280                  * output for the image. */
1281     struct Tk_ImageType *nextPtr;
1282                 /* Next in list of all image types currently
1283                  * known. Filled in by Tk, not by image
1284                  * manager. */
1285     char *reserved;     /* reserved for future expansion */
1286 };
1287 
1288 /*
1289  *----------------------------------------------------------------------
1290  *
1291  * Additional definitions used to manage images of type "photo".
1292  *
1293  *----------------------------------------------------------------------
1294  */
1295 
1296 /*
1297  * The following type is used to identify a particular photo image to be
1298  * manipulated:
1299  */
1300 
1301 typedef void *Tk_PhotoHandle;
1302 
1303 /*
1304  * The following structure describes a block of pixels in memory:
1305  */
1306 
1307 typedef struct Tk_PhotoImageBlock {
1308     unsigned char *pixelPtr;    /* Pointer to the first pixel. */
1309     int width;          /* Width of block, in pixels. */
1310     int height;         /* Height of block, in pixels. */
1311     int pitch;          /* Address difference between corresponding
1312                  * pixels in successive lines. */
1313     int pixelSize;      /* Address difference between successive
1314                  * pixels in the same line. */
1315     int offset[4];      /* Address differences between the red, green,
1316                  * blue and alpha components of the pixel and
1317                  * the pixel as a whole. */
1318 } Tk_PhotoImageBlock;
1319 
1320 /*
1321  * The following values control how blocks are combined into photo images when
1322  * the alpha component of a pixel is not 255, a.k.a. the compositing rule.
1323  */
1324 
1325 #define TK_PHOTO_COMPOSITE_OVERLAY  0
1326 #define TK_PHOTO_COMPOSITE_SET      1
1327 
1328 /*
1329  * Procedure prototypes and structures used in reading and writing photo
1330  * images:
1331  */
1332 
1333 typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat;
1334 #ifdef USE_OLD_IMAGE
1335 typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, char *fileName,
1336     char *formatString, int *widthPtr, int *heightPtr);
1337 typedef int (Tk_ImageStringMatchProc) (char *string, char *formatString,
1338     int *widthPtr, int *heightPtr);
1339 typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan,
1340     char *fileName, char *formatString, Tk_PhotoHandle imageHandle,
1341     int destX, int destY, int width, int height, int srcX, int srcY);
1342 typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, char *string,
1343     char *formatString, Tk_PhotoHandle imageHandle, int destX, int destY,
1344     int width, int height, int srcX, int srcY);
1345 typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, char *fileName,
1346     char *formatString, Tk_PhotoImageBlock *blockPtr);
1347 typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp,
1348     Tcl_DString *dataPtr, char *formatString, Tk_PhotoImageBlock *blockPtr);
1349 #else
1350 typedef int (Tk_ImageFileMatchProc) (Tcl_Channel chan, const char *fileName,
1351     Tcl_Obj *format, int *widthPtr, int *heightPtr, Tcl_Interp *interp);
1352 typedef int (Tk_ImageStringMatchProc) (Tcl_Obj *dataObj, Tcl_Obj *format,
1353     int *widthPtr, int *heightPtr, Tcl_Interp *interp);
1354 typedef int (Tk_ImageFileReadProc) (Tcl_Interp *interp, Tcl_Channel chan,
1355     const char *fileName, Tcl_Obj *format, Tk_PhotoHandle imageHandle,
1356     int destX, int destY, int width, int height, int srcX, int srcY);
1357 typedef int (Tk_ImageStringReadProc) (Tcl_Interp *interp, Tcl_Obj *dataObj,
1358     Tcl_Obj *format, Tk_PhotoHandle imageHandle, int destX, int destY,
1359     int width, int height, int srcX, int srcY);
1360 typedef int (Tk_ImageFileWriteProc) (Tcl_Interp *interp, const char *fileName,
1361     Tcl_Obj *format, Tk_PhotoImageBlock *blockPtr);
1362 typedef int (Tk_ImageStringWriteProc) (Tcl_Interp *interp, Tcl_Obj *format,
1363     Tk_PhotoImageBlock *blockPtr);
1364 #endif /* USE_OLD_IMAGE */
1365 
1366 /*
1367  * The following structure represents a particular file format for storing
1368  * images (e.g., PPM, GIF, JPEG, etc.). It provides information to allow image
1369  * files of that format to be recognized and read into a photo image.
1370  */
1371 
1372 struct Tk_PhotoImageFormat {
1373     CONST86 char *name;     /* Name of image file format */
1374     Tk_ImageFileMatchProc *fileMatchProc;
1375                 /* Procedure to call to determine whether an
1376                  * image file matches this format. */
1377     Tk_ImageStringMatchProc *stringMatchProc;
1378                 /* Procedure to call to determine whether the
1379                  * data in a string matches this format. */
1380     Tk_ImageFileReadProc *fileReadProc;
1381                 /* Procedure to call to read data from an
1382                  * image file into a photo image. */
1383     Tk_ImageStringReadProc *stringReadProc;
1384                 /* Procedure to call to read data from a
1385                  * string into a photo image. */
1386     Tk_ImageFileWriteProc *fileWriteProc;
1387                 /* Procedure to call to write data from a
1388                  * photo image to a file. */
1389     Tk_ImageStringWriteProc *stringWriteProc;
1390                 /* Procedure to call to obtain a string
1391                  * representation of the data in a photo
1392                  * image.*/
1393     struct Tk_PhotoImageFormat *nextPtr;
1394                 /* Next in list of all photo image formats
1395                  * currently known. Filled in by Tk, not by
1396                  * image format handler. */
1397 };
1398 
1399 /*
1400  *----------------------------------------------------------------------
1401  *
1402  * Procedure prototypes and structures used for managing styles:
1403  *
1404  *----------------------------------------------------------------------
1405  */
1406 
1407 /*
1408  * Style support version tag.
1409  */
1410 
1411 #define TK_STYLE_VERSION_1      0x1
1412 #define TK_STYLE_VERSION        TK_STYLE_VERSION_1
1413 
1414 /*
1415  * The following structures and prototypes are used as static templates to
1416  * declare widget elements.
1417  */
1418 
1419 typedef void (Tk_GetElementSizeProc) (ClientData clientData, char *recordPtr,
1420     const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int width,
1421     int height, int inner, int *widthPtr, int *heightPtr);
1422 typedef void (Tk_GetElementBoxProc) (ClientData clientData, char *recordPtr,
1423     const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, int x, int y,
1424     int width, int height, int inner, int *xPtr, int *yPtr, int *widthPtr,
1425     int *heightPtr);
1426 typedef int (Tk_GetElementBorderWidthProc) (ClientData clientData,
1427     char *recordPtr, const Tk_OptionSpec **optionsPtr, Tk_Window tkwin);
1428 typedef void (Tk_DrawElementProc) (ClientData clientData, char *recordPtr,
1429     const Tk_OptionSpec **optionsPtr, Tk_Window tkwin, Drawable d, int x,
1430     int y, int width, int height, int state);
1431 
1432 typedef struct Tk_ElementOptionSpec {
1433     char *name;         /* Name of the required option. */
1434     Tk_OptionType type;     /* Accepted option type. TK_OPTION_END means
1435                  * any. */
1436 } Tk_ElementOptionSpec;
1437 
1438 typedef struct Tk_ElementSpec {
1439     int version;        /* Version of the style support. */
1440     char *name;         /* Name of element. */
1441     Tk_ElementOptionSpec *options;
1442                 /* List of required options. Last one's name
1443                  * must be NULL. */
1444     Tk_GetElementSizeProc *getSize;
1445                 /* Compute the external (resp. internal) size
1446                  * of the element from its desired internal
1447                  * (resp. external) size. */
1448     Tk_GetElementBoxProc *getBox;
1449                 /* Compute the inscribed or bounding boxes
1450                  * within a given area. */
1451     Tk_GetElementBorderWidthProc *getBorderWidth;
1452                 /* Return the element's internal border width.
1453                  * Mostly useful for widgets. */
1454     Tk_DrawElementProc *draw;   /* Draw the element in the given bounding
1455                  * box. */
1456 } Tk_ElementSpec;
1457 
1458 /*
1459  * Element state flags. Can be OR'ed.
1460  */
1461 
1462 #define TK_ELEMENT_STATE_ACTIVE         1<<0
1463 #define TK_ELEMENT_STATE_DISABLED       1<<1
1464 #define TK_ELEMENT_STATE_FOCUS          1<<2
1465 #define TK_ELEMENT_STATE_PRESSED        1<<3
1466 
1467 /*
1468  *----------------------------------------------------------------------
1469  *
1470  * The definitions below provide backward compatibility for functions and
1471  * types related to event handling that used to be in Tk but have moved to
1472  * Tcl.
1473  *
1474  *----------------------------------------------------------------------
1475  */
1476 
1477 #define TK_READABLE     TCL_READABLE
1478 #define TK_WRITABLE     TCL_WRITABLE
1479 #define TK_EXCEPTION        TCL_EXCEPTION
1480 
1481 #define TK_DONT_WAIT        TCL_DONT_WAIT
1482 #define TK_X_EVENTS     TCL_WINDOW_EVENTS
1483 #define TK_WINDOW_EVENTS    TCL_WINDOW_EVENTS
1484 #define TK_FILE_EVENTS      TCL_FILE_EVENTS
1485 #define TK_TIMER_EVENTS     TCL_TIMER_EVENTS
1486 #define TK_IDLE_EVENTS      TCL_IDLE_EVENTS
1487 #define TK_ALL_EVENTS       TCL_ALL_EVENTS
1488 
1489 #define Tk_IdleProc     Tcl_IdleProc
1490 #define Tk_FileProc     Tcl_FileProc
1491 #define Tk_TimerProc        Tcl_TimerProc
1492 #define Tk_TimerToken       Tcl_TimerToken
1493 
1494 #define Tk_BackgroundError  Tcl_BackgroundError
1495 #define Tk_CancelIdleCall   Tcl_CancelIdleCall
1496 #define Tk_CreateFileHandler    Tcl_CreateFileHandler
1497 #define Tk_CreateTimerHandler   Tcl_CreateTimerHandler
1498 #define Tk_DeleteFileHandler    Tcl_DeleteFileHandler
1499 #define Tk_DeleteTimerHandler   Tcl_DeleteTimerHandler
1500 #define Tk_DoOneEvent       Tcl_DoOneEvent
1501 #define Tk_DoWhenIdle       Tcl_DoWhenIdle
1502 #define Tk_Sleep        Tcl_Sleep
1503 
1504 /* Additional stuff that has moved to Tcl: */
1505 
1506 #define Tk_EventuallyFree   Tcl_EventuallyFree
1507 #define Tk_FreeProc     Tcl_FreeProc
1508 #define Tk_Preserve     Tcl_Preserve
1509 #define Tk_Release      Tcl_Release
1510 
1511 /* Removed Tk_Main, use macro instead */
1512 #if defined(_WIN32) || defined(__CYGWIN__)
1513 #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
1514     (Tcl_FindExecutable(0), (Tcl_CreateInterp)()))
1515 #else
1516 #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \
1517     (Tcl_FindExecutable(argv[0]), (Tcl_CreateInterp)()))
1518 #endif
1519 const char *        Tk_InitStubs(Tcl_Interp *interp, const char *version,
1520                 int exact);
1521 EXTERN const char * Tk_PkgInitStubsCheck(Tcl_Interp *interp,
1522                 const char *version, int exact);
1523 
1524 #ifndef USE_TK_STUBS
1525 #define Tk_InitStubs(interp, version, exact) \
1526     Tk_PkgInitStubsCheck(interp, version, exact)
1527 #endif /* USE_TK_STUBS */
1528 
1529 #define Tk_InitImageArgs(interp, argc, argv) /**/
1530 
1531 /*
1532  *----------------------------------------------------------------------
1533  *
1534  * Additional procedure types defined by Tk.
1535  *
1536  *----------------------------------------------------------------------
1537  */
1538 
1539 typedef int (Tk_ErrorProc) (ClientData clientData, XErrorEvent *errEventPtr);
1540 typedef void (Tk_EventProc) (ClientData clientData, XEvent *eventPtr);
1541 typedef int (Tk_GenericProc) (ClientData clientData, XEvent *eventPtr);
1542 typedef int (Tk_ClientMessageProc) (Tk_Window tkwin, XEvent *eventPtr);
1543 typedef int (Tk_GetSelProc) (ClientData clientData, Tcl_Interp *interp,
1544     CONST86 char *portion);
1545 typedef void (Tk_LostSelProc) (ClientData clientData);
1546 typedef Tk_RestrictAction (Tk_RestrictProc) (ClientData clientData,
1547     XEvent *eventPtr);
1548 typedef int (Tk_SelectionProc) (ClientData clientData, int offset,
1549     char *buffer, int maxBytes);
1550 
1551 /*
1552  *----------------------------------------------------------------------
1553  *
1554  * Platform independent exported procedures and variables.
1555  *
1556  *----------------------------------------------------------------------
1557  */
1558 
1559 #include "tkDecls.h"
1560 
1561 #ifdef USE_OLD_IMAGE
1562 #undef Tk_CreateImageType
1563 #define Tk_CreateImageType      Tk_CreateOldImageType
1564 #undef Tk_CreatePhotoImageFormat
1565 #define Tk_CreatePhotoImageFormat   Tk_CreateOldPhotoImageFormat
1566 #endif /* USE_OLD_IMAGE */
1567 
1568 /*
1569  *----------------------------------------------------------------------
1570  *
1571  * Allow users to say that they don't want to alter their source to add extra
1572  * arguments to Tk_PhotoPutBlock() et al; DO NOT DEFINE THIS WHEN BUILDING TK.
1573  *
1574  * This goes after the inclusion of the stubbed-decls so that the declarations
1575  * of what is actually there can be correct.
1576  */
1577 
1578 #ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK
1579 #   ifdef Tk_PhotoPutBlock
1580 #   undef Tk_PhotoPutBlock
1581 #   endif
1582 #   define Tk_PhotoPutBlock     Tk_PhotoPutBlock_NoComposite
1583 #   ifdef Tk_PhotoPutZoomedBlock
1584 #   undef Tk_PhotoPutZoomedBlock
1585 #   endif
1586 #   define Tk_PhotoPutZoomedBlock   Tk_PhotoPutZoomedBlock_NoComposite
1587 #   define USE_PANIC_ON_PHOTO_ALLOC_FAILURE
1588 #else /* !USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
1589 #   ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
1590 #   ifdef Tk_PhotoPutBlock
1591 #       undef Tk_PhotoPutBlock
1592 #   endif
1593 #   define Tk_PhotoPutBlock     Tk_PhotoPutBlock_Panic
1594 #   ifdef Tk_PhotoPutZoomedBlock
1595 #       undef Tk_PhotoPutZoomedBlock
1596 #   endif
1597 #   define Tk_PhotoPutZoomedBlock   Tk_PhotoPutZoomedBlock_Panic
1598 #   endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
1599 #endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
1600 #ifdef USE_PANIC_ON_PHOTO_ALLOC_FAILURE
1601 #   ifdef Tk_PhotoExpand
1602 #   undef Tk_PhotoExpand
1603 #   endif
1604 #   define Tk_PhotoExpand       Tk_PhotoExpand_Panic
1605 #   ifdef Tk_PhotoSetSize
1606 #   undef Tk_PhotoSetSize
1607 #   endif
1608 #   define Tk_PhotoSetSize      Tk_PhotoSetSize_Panic
1609 #endif /* USE_PANIC_ON_PHOTO_ALLOC_FAILURE */
1610 
1611 #undef TCL_STORAGE_CLASS
1612 #define TCL_STORAGE_CLASS DLLIMPORT
1613 
1614 #endif /* RC_INVOKED */
1615 
1616 /*
1617  * end block for C++
1618  */
1619 
1620 #ifdef __cplusplus
1621 }
1622 #endif
1623 
1624 #endif /* _TK */
1625 
1626 /*
1627  * Local Variables:
1628  * mode: c
1629  * c-basic-offset: 4
1630  * fill-column: 78
1631  * End:
1632  */