Subversion Repositories Vertical

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * tk.h --
  3.  *
  4.  *      Declarations for Tk-related things that are visible
  5.  *      outside of the Tk module itself.
  6.  *
  7.  * Copyright (c) 1989-1994 The Regents of the University of California.
  8.  * Copyright (c) 1994 The Australian National University.
  9.  * Copyright (c) 1994-1997 Sun Microsystems, Inc.
  10.  * Copyright (c) 1998 by Scriptics Corporation.
  11.  *
  12.  * See the file "license.terms" for information on usage and redistribution
  13.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  14.  *
  15.  * RCS: @(#) $Id: tk.h,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $
  16.  */
  17.  
  18. #ifndef _TK
  19. #define _TK
  20.  
  21. /*
  22.  * When version numbers change here, you must also go into the following files
  23.  * and update the version numbers:
  24.  *
  25.  * README
  26.  * unix/configure.in
  27.  * win/makefile.bc      (Not for patch release updates)
  28.  * win/makefile.vc      (Not for patch release updates)
  29.  * win/README
  30.  * library/tk.tcl
  31.  *
  32.  * The release level should be  0 for alpha, 1 for beta, and 2 for
  33.  * final/patch.  The release serial value is the number that follows the
  34.  * "a", "b", or "p" in the patch level; for example, if the patch level
  35.  * is 4.3b2, TK_RELEASE_SERIAL is 2.  It restarts at 1 whenever the
  36.  * release level is changed, except for the final release, which should
  37.  * be 0.
  38.  *
  39.  * You may also need to update some of these files when the numbers change
  40.  * for the version of Tcl that this release of Tk is compiled against.
  41.  */
  42.  
  43. #define TK_MAJOR_VERSION 8
  44. #define TK_MINOR_VERSION 0
  45. #define TK_RELEASE_LEVEL 2
  46. #define TK_RELEASE_SERIAL 4
  47.  
  48. #define TK_VERSION "8.0"
  49. #define TK_PATCH_LEVEL "8.0.4"
  50.  
  51. /*
  52.  * A special definition used to allow this header file to be included
  53.  * in resource files.
  54.  */
  55.  
  56. #ifndef RESOURCE_INCLUDED
  57.  
  58. /*
  59.  * The following definitions set up the proper options for Macintosh
  60.  * compilers.  We use this method because there is no autoconf equivalent.
  61.  */
  62.  
  63. #ifdef MAC_TCL
  64. #ifndef REDO_KEYSYM_LOOKUP
  65. #define REDO_KEYSYM_LOOKUP
  66. #endif
  67. #endif
  68.  
  69. #ifndef _TCL
  70. #include <tcl.h>
  71. #endif
  72. #ifndef _XLIB_H
  73. #ifdef MAC_TCL
  74. #include <Xlib.h>
  75. #include <X.h>
  76. #else
  77. #include <X11/Xlib.h>
  78. #endif
  79. #endif
  80. #ifdef __STDC__
  81. #include <stddef.h>
  82. #endif
  83.  
  84. #ifdef BUILD_tk
  85. #undef TCL_STORAGE_CLASS
  86. #define TCL_STORAGE_CLASS DLLEXPORT
  87. #endif
  88.  
  89. /*
  90.  * Decide whether or not to use input methods.
  91.  */
  92.  
  93. #ifdef XNQueryInputStyle
  94. #define TK_USE_INPUT_METHODS
  95. #endif
  96.  
  97. /*
  98.  * Dummy types that are used by clients:
  99.  */
  100.  
  101. typedef struct Tk_BindingTable_ *Tk_BindingTable;
  102. typedef struct Tk_Canvas_ *Tk_Canvas;
  103. typedef struct Tk_Cursor_ *Tk_Cursor;
  104. typedef struct Tk_ErrorHandler_ *Tk_ErrorHandler;
  105. typedef struct Tk_Font_ *Tk_Font;
  106. typedef struct Tk_Image__ *Tk_Image;
  107. typedef struct Tk_ImageMaster_ *Tk_ImageMaster;
  108. typedef struct Tk_TextLayout_ *Tk_TextLayout;
  109. typedef struct Tk_Window_ *Tk_Window;
  110. typedef struct Tk_3DBorder_ *Tk_3DBorder;
  111.  
  112. /*
  113.  * Additional types exported to clients.
  114.  */
  115.  
  116. typedef char *Tk_Uid;
  117.  
  118. /*
  119.  * Structure used to specify how to handle argv options.
  120.  */
  121.  
  122. typedef struct
  123. {
  124.         char *key;  /* The key string that flags the option in the
  125.                      * argv array. */
  126.         int type;   /* Indicates option type;  see below. */
  127.         char *src;  /* Value to be used in setting dst;  usage
  128.                      * depends on type. */
  129.         char *dst;  /* Address of value to be modified;  usage
  130.                      * depends on type. */
  131.         char *help; /* Documentation message describing this option. */
  132. } Tk_ArgvInfo;
  133.  
  134. /*
  135.  * Legal values for the type field of a Tk_ArgvInfo: see the user
  136.  * documentation for details.
  137.  */
  138.  
  139. #define TK_ARGV_CONSTANT 15
  140. #define TK_ARGV_INT 16
  141. #define TK_ARGV_STRING 17
  142. #define TK_ARGV_UID 18
  143. #define TK_ARGV_REST 19
  144. #define TK_ARGV_FLOAT 20
  145. #define TK_ARGV_FUNC 21
  146. #define TK_ARGV_GENFUNC 22
  147. #define TK_ARGV_HELP 23
  148. #define TK_ARGV_CONST_OPTION 24
  149. #define TK_ARGV_OPTION_VALUE 25
  150. #define TK_ARGV_OPTION_NAME_VALUE 26
  151. /* CYGNUS LOCAL: Support -version argument.  */
  152. #define TK_ARGV_VERSION 27
  153. #define TK_ARGV_END 28
  154.  
  155. /*
  156.  * Flag bits for passing to Tk_ParseArgv:
  157.  */
  158.  
  159. #define TK_ARGV_NO_DEFAULTS 0x1
  160. #define TK_ARGV_NO_LEFTOVERS 0x2
  161. #define TK_ARGV_NO_ABBREV 0x4
  162. #define TK_ARGV_DONT_SKIP_FIRST_ARG 0x8
  163.  
  164. /*
  165.  * Structure used to describe application-specific configuration
  166.  * options:  indicates procedures to call to parse an option and
  167.  * to return a text string describing an option.
  168.  */
  169.  
  170. typedef int(Tk_OptionParseProc) _ANSI_ARGS_ (
  171.     (ClientData clientData,
  172.      Tcl_Interp *interp,
  173.      Tk_Window tkwin,
  174.      char *value,
  175.      char *widgRec,
  176.      int offset));
  177. typedef char *(Tk_OptionPrintProc) _ANSI_ARGS_ (
  178.     (ClientData clientData,
  179.      Tk_Window tkwin,
  180.      char *widgRec,
  181.      int offset,
  182.      Tcl_FreeProc **freeProcPtr));
  183.  
  184. typedef struct Tk_CustomOption
  185. {
  186.         Tk_OptionParseProc *parseProc; /* Procedure to call to parse an
  187.                                         * option and store it in converted
  188.                                         * form. */
  189.         Tk_OptionPrintProc *printProc; /* Procedure to return a printable
  190.                                         * string describing an existing
  191.                                         * option. */
  192.         ClientData clientData;         /* Arbitrary one-word value used by
  193.                                         * option parser:  passed to
  194.                                         * parseProc and printProc. */
  195. } Tk_CustomOption;
  196.  
  197. /*
  198.  * Structure used to specify information for Tk_ConfigureWidget.  Each
  199.  * structure gives complete information for one option, including
  200.  * how the option is specified on the command line, where it appears
  201.  * in the option database, etc.
  202.  */
  203.  
  204. typedef struct Tk_ConfigSpec
  205. {
  206.         int type;                   /* Type of option, such as TK_CONFIG_COLOR;
  207.                                      * see definitions below.  Last option in
  208.                                      * table must have type TK_CONFIG_END. */
  209.         char *argvName;             /* Switch used to specify option in argv.
  210.                                      * NULL means this spec is part of a group. */
  211.         char *dbName;               /* Name for option in option database. */
  212.         char *dbClass;              /* Class for option in database. */
  213.         char *defValue;             /* Default value for option if not
  214.                                      * specified in command line or database. */
  215.         int offset;                 /* Where in widget record to store value;
  216.                                      * use Tk_Offset macro to generate values
  217.                                      * for this. */
  218.         int specFlags;              /* Any combination of the values defined
  219.                                      * below;  other bits are used internally
  220.                                      * by tkConfig.c. */
  221.         Tk_CustomOption *customPtr; /* If type is TK_CONFIG_CUSTOM then this is
  222.                                      * a pointer to info about how to parse and
  223.                                      * print the option.  Otherwise it is
  224.                                      * irrelevant. */
  225. } Tk_ConfigSpec;
  226.  
  227. /*
  228.  * Type values for Tk_ConfigSpec structures.  See the user
  229.  * documentation for details.
  230.  */
  231.  
  232. #define TK_CONFIG_BOOLEAN 1
  233. #define TK_CONFIG_INT 2
  234. #define TK_CONFIG_DOUBLE 3
  235. #define TK_CONFIG_STRING 4
  236. #define TK_CONFIG_UID 5
  237. #define TK_CONFIG_COLOR 6
  238. #define TK_CONFIG_FONT 7
  239. #define TK_CONFIG_BITMAP 8
  240. #define TK_CONFIG_BORDER 9
  241. #define TK_CONFIG_RELIEF 10
  242. #define TK_CONFIG_CURSOR 11
  243. #define TK_CONFIG_ACTIVE_CURSOR 12
  244. #define TK_CONFIG_JUSTIFY 13
  245. #define TK_CONFIG_ANCHOR 14
  246. #define TK_CONFIG_SYNONYM 15
  247. #define TK_CONFIG_CAP_STYLE 16
  248. #define TK_CONFIG_JOIN_STYLE 17
  249. #define TK_CONFIG_PIXELS 18
  250. #define TK_CONFIG_MM 19
  251. #define TK_CONFIG_WINDOW 20
  252. #define TK_CONFIG_CUSTOM 21
  253. #define TK_CONFIG_END 22
  254.  
  255. /*
  256.  * Macro to use to fill in "offset" fields of Tk_ConfigInfos.
  257.  * Computes number of bytes from beginning of structure to a
  258.  * given field.
  259.  */
  260.  
  261. #ifdef offsetof
  262. #define Tk_Offset(type, field) ((int) offsetof (type, field))
  263. #else
  264. #define Tk_Offset(type, field) ((int) ((char *) &((type *) 0)->field))
  265. #endif
  266.  
  267. /*
  268.  * Possible values for flags argument to Tk_ConfigureWidget:
  269.  */
  270.  
  271. #define TK_CONFIG_ARGV_ONLY 1
  272.  
  273. /*
  274.  * Possible flag values for Tk_ConfigInfo structures.  Any bits at
  275.  * or above TK_CONFIG_USER_BIT may be used by clients for selecting
  276.  * certain entries.  Before changing any values here, coordinate with
  277.  * tkConfig.c (internal-use-only flags are defined there).
  278.  */
  279.  
  280. #define TK_CONFIG_COLOR_ONLY 1
  281. #define TK_CONFIG_MONO_ONLY 2
  282. #define TK_CONFIG_NULL_OK 4
  283. #define TK_CONFIG_DONT_SET_DEFAULT 8
  284. #define TK_CONFIG_OPTION_SPECIFIED 0x10
  285. #define TK_CONFIG_USER_BIT 0x100
  286.  
  287. /*
  288.  * Enumerated type for describing actions to be taken in response
  289.  * to a restrictProc established by Tk_RestrictEvents.
  290.  */
  291.  
  292. typedef enum
  293. {
  294.         TK_DEFER_EVENT,
  295.         TK_PROCESS_EVENT,
  296.         TK_DISCARD_EVENT
  297. } Tk_RestrictAction;
  298.  
  299. /*
  300.  * Priority levels to pass to Tk_AddOption:
  301.  */
  302.  
  303. #define TK_WIDGET_DEFAULT_PRIO 20
  304. #define TK_STARTUP_FILE_PRIO 40
  305. #define TK_USER_DEFAULT_PRIO 60
  306. #define TK_INTERACTIVE_PRIO 80
  307. #define TK_MAX_PRIO 100
  308.  
  309. /*
  310.  * Relief values returned by Tk_GetRelief:
  311.  */
  312.  
  313. #define TK_RELIEF_RAISED 1
  314. #define TK_RELIEF_FLAT 2
  315. #define TK_RELIEF_SUNKEN 4
  316. #define TK_RELIEF_GROOVE 8
  317. #define TK_RELIEF_RIDGE 16
  318. #define TK_RELIEF_SOLID 32
  319.  
  320. /*
  321.  * "Which" argument values for Tk_3DBorderGC:
  322.  */
  323.  
  324. #define TK_3D_FLAT_GC 1
  325. #define TK_3D_LIGHT_GC 2
  326. #define TK_3D_DARK_GC 3
  327.  
  328. /*
  329.  * Special EnterNotify/LeaveNotify "mode" for use in events
  330.  * generated by tkShare.c.  Pick a high enough value that it's
  331.  * unlikely to conflict with existing values (like NotifyNormal)
  332.  * or any new values defined in the future.
  333.  */
  334.  
  335. #define TK_NOTIFY_SHARE 20
  336.  
  337. /*
  338.  * Enumerated type for describing a point by which to anchor something:
  339.  */
  340.  
  341. typedef enum
  342. {
  343.         TK_ANCHOR_N,
  344.         TK_ANCHOR_NE,
  345.         TK_ANCHOR_E,
  346.         TK_ANCHOR_SE,
  347.         TK_ANCHOR_S,
  348.         TK_ANCHOR_SW,
  349.         TK_ANCHOR_W,
  350.         TK_ANCHOR_NW,
  351.         TK_ANCHOR_CENTER
  352. } Tk_Anchor;
  353.  
  354. /*
  355.  * Enumerated type for describing a style of justification:
  356.  */
  357.  
  358. typedef enum
  359. {
  360.         TK_JUSTIFY_LEFT,
  361.         TK_JUSTIFY_RIGHT,
  362.         TK_JUSTIFY_CENTER
  363. } Tk_Justify;
  364.  
  365. /*
  366.  * The following structure is used by Tk_GetFontMetrics() to return
  367.  * information about the properties of a Tk_Font.
  368.  */
  369.  
  370. typedef struct Tk_FontMetrics
  371. {
  372.         int ascent;    /* The amount in pixels that the tallest
  373.                         * letter sticks up above the baseline, plus
  374.                         * any extra blank space added by the designer
  375.                         * of the font. */
  376.         int descent;   /* The largest amount in pixels that any
  377.                         * letter sticks below the baseline, plus any
  378.                         * extra blank space added by the designer of
  379.                         * the font. */
  380.         int linespace; /* The sum of the ascent and descent.  How
  381.                         * far apart two lines of text in the same
  382.                         * font should be placed so that none of the
  383.                         * characters in one line overlap any of the
  384.                         * characters in the other line. */
  385. } Tk_FontMetrics;
  386.  
  387. /*
  388.  * Flags passed to Tk_MeasureChars:
  389.  */
  390.  
  391. #define TK_WHOLE_WORDS 1
  392. #define TK_AT_LEAST_ONE 2
  393. #define TK_PARTIAL_OK 4
  394.  
  395. /*
  396.  * Flags passed to Tk_ComputeTextLayout:
  397.  */
  398.  
  399. #define TK_IGNORE_TABS 8
  400. #define TK_IGNORE_NEWLINES 16
  401.  
  402. /*
  403.  * Each geometry manager (the packer, the placer, etc.) is represented
  404.  * by a structure of the following form, which indicates procedures
  405.  * to invoke in the geometry manager to carry out certain functions.
  406.  */
  407.  
  408. typedef void(Tk_GeomRequestProc) _ANSI_ARGS_ ((ClientData clientData, Tk_Window tkwin));
  409. typedef void(Tk_GeomLostSlaveProc) _ANSI_ARGS_ ((ClientData clientData, Tk_Window tkwin));
  410.  
  411. typedef struct Tk_GeomMgr
  412. {
  413.         char *name; /* Name of the geometry manager (command
  414.                      * used to invoke it, or name of widget
  415.                      * class that allows embedded widgets). */
  416.         Tk_GeomRequestProc *requestProc;
  417.         /* Procedure to invoke when a slave's
  418.          * requested geometry changes. */
  419.         Tk_GeomLostSlaveProc *lostSlaveProc;
  420.         /* Procedure to invoke when a slave is
  421.          * taken away from one geometry manager
  422.          * by another.  NULL means geometry manager
  423.          * doesn't care when slaves are lost. */
  424. } Tk_GeomMgr;
  425.  
  426. /*
  427.  * Result values returned by Tk_GetScrollInfo:
  428.  */
  429.  
  430. #define TK_SCROLL_MOVETO 1
  431. #define TK_SCROLL_PAGES 2
  432. #define TK_SCROLL_UNITS 3
  433. #define TK_SCROLL_ERROR 4
  434.  
  435. /*
  436.  *---------------------------------------------------------------------------
  437.  *
  438.  * Extensions to the X event set
  439.  *
  440.  *---------------------------------------------------------------------------
  441.  */
  442. #define VirtualEvent (LASTEvent)
  443. #define ActivateNotify (LASTEvent + 1)
  444. #define DeactivateNotify (LASTEvent + 2)
  445. #define MouseWheelEvent (LASTEvent + 3)
  446. #define TK_LASTEVENT (LASTEvent + 4)
  447.  
  448. #define MouseWheelMask (1L << 28)
  449.  
  450. #define ActivateMask (1L << 29)
  451. #define VirtualEventMask (1L << 30)
  452. #define TK_LASTEVENT (LASTEvent + 4)
  453.  
  454. /*
  455.  * A virtual event shares most of its fields with the XKeyEvent and
  456.  * XButtonEvent structures.  99% of the time a virtual event will be
  457.  * an abstraction of a key or button event, so this structure provides
  458.  * the most information to the user.  The only difference is the changing
  459.  * of the detail field for a virtual event so that it holds the name of the
  460.  * virtual event being triggered.
  461.  */
  462.  
  463. typedef struct
  464. {
  465.         int type;
  466.         unsigned long serial; /* # of last request processed by server */
  467.         Bool send_event;      /* True if this came from a SendEvent request */
  468.         Display *display;     /* Display the event was read from */
  469.         Window event;         /* Window on which event was requested. */
  470.         Window root;          /* root window that the event occured on */
  471.         Window subwindow;     /* child window */
  472.         Time time;            /* milliseconds */
  473.         int x, y;             /* pointer x, y coordinates in event window */
  474.         int x_root, y_root;   /* coordinates relative to root */
  475.         unsigned int state;   /* key or button mask */
  476.         Tk_Uid name;          /* Name of virtual event. */
  477.         Bool same_screen;     /* same screen flag */
  478. } XVirtualEvent;
  479.  
  480. typedef struct
  481. {
  482.         int type;
  483.         unsigned long serial; /* # of last request processed by server */
  484.         Bool send_event;      /* True if this came from a SendEvent request */
  485.         Display *display;     /* Display the event was read from */
  486.         Window window;        /* Window in which event occurred. */
  487. } XActivateDeactivateEvent;
  488. typedef XActivateDeactivateEvent XActivateEvent;
  489. typedef XActivateDeactivateEvent XDeactivateEvent;
  490.  
  491. /*
  492.  *--------------------------------------------------------------
  493.  *
  494.  * Macros for querying Tk_Window structures.  See the
  495.  * manual entries for documentation.
  496.  *
  497.  *--------------------------------------------------------------
  498.  */
  499.  
  500. #define Tk_Display(tkwin) (((Tk_FakeWin *) (tkwin))->display)
  501. #define Tk_ScreenNumber(tkwin) (((Tk_FakeWin *) (tkwin))->screenNum)
  502. #define Tk_Screen(tkwin) (ScreenOfDisplay (Tk_Display (tkwin), Tk_ScreenNumber (tkwin)))
  503. #define Tk_Depth(tkwin) (((Tk_FakeWin *) (tkwin))->depth)
  504. #define Tk_Visual(tkwin) (((Tk_FakeWin *) (tkwin))->visual)
  505. #define Tk_WindowId(tkwin) (((Tk_FakeWin *) (tkwin))->window)
  506. #define Tk_PathName(tkwin) (((Tk_FakeWin *) (tkwin))->pathName)
  507. #define Tk_Name(tkwin) (((Tk_FakeWin *) (tkwin))->nameUid)
  508. #define Tk_Class(tkwin) (((Tk_FakeWin *) (tkwin))->classUid)
  509. #define Tk_X(tkwin) (((Tk_FakeWin *) (tkwin))->changes.x)
  510. #define Tk_Y(tkwin) (((Tk_FakeWin *) (tkwin))->changes.y)
  511. #define Tk_Width(tkwin) (((Tk_FakeWin *) (tkwin))->changes.width)
  512. #define Tk_Height(tkwin) (((Tk_FakeWin *) (tkwin))->changes.height)
  513. #define Tk_Changes(tkwin) (&((Tk_FakeWin *) (tkwin))->changes)
  514. #define Tk_Attributes(tkwin) (&((Tk_FakeWin *) (tkwin))->atts)
  515. #define Tk_IsEmbedded(tkwin) (((Tk_FakeWin *) (tkwin))->flags & TK_EMBEDDED)
  516. #define Tk_IsContainer(tkwin) (((Tk_FakeWin *) (tkwin))->flags & TK_CONTAINER)
  517. #define Tk_IsMapped(tkwin) (((Tk_FakeWin *) (tkwin))->flags & TK_MAPPED)
  518. #define Tk_IsTopLevel(tkwin) (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL)
  519. #define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
  520. #define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
  521. #define Tk_InternalBorderWidth(tkwin) (((Tk_FakeWin *) (tkwin))->internalBorderWidth)
  522. #define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr)
  523. #define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap)
  524.  
  525. /*
  526.  * The structure below is needed by the macros above so that they can
  527.  * access the fields of a Tk_Window.  The fields not needed by the macros
  528.  * are declared as "dummyX".  The structure has its own type in order to
  529.  * prevent applications from accessing Tk_Window fields except using
  530.  * official macros.  WARNING!! The structure definition must be kept
  531.  * consistent with the TkWindow structure in tkInt.h.  If you change one,
  532.  * then change the other.  See the declaration in tkInt.h for
  533.  * documentation on what the fields are used for internally.
  534.  */
  535.  
  536. typedef struct Tk_FakeWin
  537. {
  538.         Display *display;
  539.         char *dummy1;
  540.         int screenNum;
  541.         Visual *visual;
  542.         int depth;
  543.         Window window;
  544.         char *dummy2;
  545.         char *dummy3;
  546.         Tk_Window parentPtr;
  547.         char *dummy4;
  548.         char *dummy5;
  549.         char *pathName;
  550.         Tk_Uid nameUid;
  551.         Tk_Uid classUid;
  552.         XWindowChanges changes;
  553.         unsigned int dummy6;
  554.         XSetWindowAttributes atts;
  555.         unsigned long dummy7;
  556.         unsigned int flags;
  557.         char *dummy8;
  558. #ifdef TK_USE_INPUT_METHODS
  559.         XIC dummy9;
  560. #endif /* TK_USE_INPUT_METHODS */
  561.         ClientData *dummy10;
  562.         int dummy11;
  563.         int dummy12;
  564.         char *dummy13;
  565.         char *dummy14;
  566.         ClientData dummy15;
  567.         int reqWidth, reqHeight;
  568.         int internalBorderWidth;
  569.         char *dummy16;
  570.         char *dummy17;
  571.         ClientData dummy18;
  572.         char *dummy19;
  573. } Tk_FakeWin;
  574.  
  575. /*
  576.  * Flag values for TkWindow (and Tk_FakeWin) structures are:
  577.  *
  578.  * TK_MAPPED:                   1 means window is currently mapped,
  579.  *                              0 means unmapped.
  580.  * TK_TOP_LEVEL:                1 means this is a top-level window (it
  581.  *                              was or will be created as a child of
  582.  *                              a root window).
  583.  * TK_ALREADY_DEAD:             1 means the window is in the process of
  584.  *                              being destroyed already.
  585.  * TK_NEED_CONFIG_NOTIFY:       1 means that the window has been reconfigured
  586.  *                              before it was made to exist.  At the time of
  587.  *                              making it exist a ConfigureNotify event needs
  588.  *                              to be generated.
  589.  * TK_GRAB_FLAG:                Used to manage grabs.  See tkGrab.c for
  590.  *                              details.
  591.  * TK_CHECKED_IC:               1 means we've already tried to get an input
  592.  *                              context for this window;  if the ic field
  593.  *                              is NULL it means that there isn't a context
  594.  *                              for the field.
  595.  * TK_DONT_DESTROY_WINDOW:      1 means that Tk_DestroyWindow should not
  596.  *                              invoke XDestroyWindow to destroy this widget's
  597.  *                              X window.  The flag is set when the window
  598.  *                              has already been destroyed elsewhere (e.g.
  599.  *                              by another application) or when it will be
  600.  *                              destroyed later (e.g. by destroying its
  601.  *                              parent).
  602.  * TK_WM_COLORMAP_WINDOW:       1 means that this window has at some time
  603.  *                              appeared in the WM_COLORMAP_WINDOWS property
  604.  *                              for its toplevel, so we have to remove it
  605.  *                              from that property if the window is
  606.  *                              deleted and the toplevel isn't.
  607.  * TK_EMBEDDED:                 1 means that this window (which must be a
  608.  *                              toplevel) is not a free-standing window but
  609.  *                              rather is embedded in some other application.
  610.  * TK_CONTAINER:                1 means that this window is a container, and
  611.  *                              that some other application (either in
  612.  *                              this process or elsewhere) may be
  613.  *                              embedding itself inside the window.
  614.  * TK_BOTH_HALVES:              1 means that this window is used for
  615.  *                              application embedding (either as
  616.  *                              container or embedded application), and
  617.  *                              both the containing and embedded halves
  618.  *                              are associated with windows in this
  619.  *                              particular process.
  620.  * TK_DEFER_MODAL:              1 means that this window has deferred a modal
  621.  *                              loop until all of the bindings for the current
  622.  *                              event have been invoked.
  623.  * TK_WRAPPER:                  1 means that this window is the extra
  624.  *                              wrapper window created around a toplevel
  625.  *                              to hold the menubar under Unix.  See
  626.  *                              tkUnixWm.c for more information.
  627.  * TK_REPARENTED:               1 means that this window has been reparented
  628.  *                              so that as far as the window system is
  629.  *                              concerned it isn't a child of its Tk
  630.  *                              parent.  Initially this is used only for
  631.  *                              special Unix menubar windows.
  632.  */
  633.  
  634. #define TK_MAPPED 1
  635. #define TK_TOP_LEVEL 2
  636. #define TK_ALREADY_DEAD 4
  637. #define TK_NEED_CONFIG_NOTIFY 8
  638. #define TK_GRAB_FLAG 0x10
  639. #define TK_CHECKED_IC 0x20
  640. #define TK_DONT_DESTROY_WINDOW 0x40
  641. #define TK_WM_COLORMAP_WINDOW 0x80
  642. #define TK_EMBEDDED 0x100
  643. #define TK_CONTAINER 0x200
  644. #define TK_BOTH_HALVES 0x400
  645. #define TK_DEFER_MODAL 0x800
  646. #define TK_WRAPPER 0x1000
  647. #define TK_REPARENTED 0x2000
  648.  
  649. /*
  650.  *--------------------------------------------------------------
  651.  *
  652.  * Procedure prototypes and structures used for defining new canvas
  653.  * items:
  654.  *
  655.  *--------------------------------------------------------------
  656.  */
  657.  
  658. /*
  659.  * For each item in a canvas widget there exists one record with
  660.  * the following structure.  Each actual item is represented by
  661.  * a record with the following stuff at its beginning, plus additional
  662.  * type-specific stuff after that.
  663.  */
  664.  
  665. #define TK_TAG_SPACE 3
  666.  
  667. typedef struct Tk_Item
  668. {
  669.         int id;                              /* Unique identifier for this item
  670.                                               * (also serves as first tag for
  671.                                               * item). */
  672.         struct Tk_Item *nextPtr;             /* Next in display list of all
  673.                                               * items in this canvas.  Later items
  674.                                               * in list are drawn on top of earlier
  675.                                               * ones. */
  676.         Tk_Uid staticTagSpace[TK_TAG_SPACE]; /* Built-in space for limited # of
  677.                                               * tags. */
  678.         Tk_Uid *tagPtr;                      /* Pointer to array of tags.  Usually
  679.                                               * points to staticTagSpace, but
  680.                                               * may point to malloc-ed space if
  681.                                               * there are lots of tags. */
  682.         int tagSpace;                        /* Total amount of tag space available
  683.                                               * at tagPtr. */
  684.         int numTags;                         /* Number of tag slots actually used
  685.                                               * at *tagPtr. */
  686.         struct Tk_ItemType *typePtr;         /* Table of procedures that implement
  687.                                               * this type of item. */
  688.         int x1, y1, x2, y2;                  /* Bounding box for item, in integer
  689.                                               * canvas units. Set by item-specific
  690.                                               * code and guaranteed to contain every
  691.                                               * pixel drawn in item.  Item area
  692.                                               * includes x1 and y1 but not x2
  693.                                               * and y2. */
  694.         struct Tk_Item *prevPtr;             /* Previous in display list of all
  695.                                               * items in this canvas. Later items
  696.                                               * in list are drawn just below earlier
  697.                                               * ones. */
  698.         int reserved1;                       /* This padding is for compatibility */
  699.         char *reserved2;                     /* with Jan Nijtmans dash patch */
  700.         int reserved3;
  701.  
  702.         /*
  703.          *------------------------------------------------------------------
  704.          * Starting here is additional type-specific stuff;  see the
  705.          * declarations for individual types to see what is part of
  706.          * each type.  The actual space below is determined by the
  707.          * "itemInfoSize" of the type's Tk_ItemType record.
  708.          *------------------------------------------------------------------
  709.          */
  710. } Tk_Item;
  711.  
  712. /*
  713.  * Records of the following type are used to describe a type of
  714.  * item (e.g.  lines, circles, etc.) that can form part of a
  715.  * canvas widget.
  716.  */
  717.  
  718. typedef int Tk_ItemCreateProc _ANSI_ARGS_ (
  719.     (Tcl_Interp * interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, char **argv));
  720. typedef int Tk_ItemConfigureProc _ANSI_ARGS_ (
  721.     (Tcl_Interp * interp,
  722.      Tk_Canvas canvas,
  723.      Tk_Item *itemPtr,
  724.      int argc,
  725.      char **argv,
  726.      int flags));
  727. typedef int Tk_ItemCoordProc _ANSI_ARGS_ (
  728.     (Tcl_Interp * interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, char **argv));
  729. typedef void
  730.     Tk_ItemDeleteProc _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, Display *display));
  731. typedef void Tk_ItemDisplayProc _ANSI_ARGS_ (
  732.     (Tk_Canvas canvas,
  733.      Tk_Item *itemPtr,
  734.      Display *display,
  735.      Drawable dst,
  736.      int x,
  737.      int y,
  738.      int width,
  739.      int height));
  740. typedef double
  741.     Tk_ItemPointProc _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, double *pointPtr));
  742. typedef int
  743.     Tk_ItemAreaProc _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr));
  744. typedef int Tk_ItemPostscriptProc
  745.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
  746. typedef void Tk_ItemScaleProc _ANSI_ARGS_ (
  747.     (Tk_Canvas canvas,
  748.      Tk_Item *itemPtr,
  749.      double originX,
  750.      double originY,
  751.      double scaleX,
  752.      double scaleY));
  753. typedef void Tk_ItemTranslateProc
  754.     _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, double deltaX, double deltaY));
  755. typedef int Tk_ItemIndexProc _ANSI_ARGS_ (
  756.     (Tcl_Interp * interp,
  757.      Tk_Canvas canvas,
  758.      Tk_Item *itemPtr,
  759.      char *indexString,
  760.      int *indexPtr));
  761. typedef void Tk_ItemCursorProc _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, int index));
  762. typedef int Tk_ItemSelectionProc
  763.     _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, int offset, char *buffer, int maxBytes));
  764. typedef void Tk_ItemInsertProc
  765.     _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, int beforeThis, char *string));
  766. typedef void
  767.     Tk_ItemDCharsProc _ANSI_ARGS_ ((Tk_Canvas canvas, Tk_Item *itemPtr, int first, int last));
  768.  
  769. typedef struct Tk_ItemType
  770. {
  771.         char *name;                       /* The name of this type of item, such
  772.                                            * as "line". */
  773.         int itemSize;                     /* Total amount of space needed for
  774.                                            * item's record. */
  775.         Tk_ItemCreateProc *createProc;    /* Procedure to create a new item of
  776.                                            * this type. */
  777.         Tk_ConfigSpec *configSpecs;       /* Pointer to array of configuration
  778.                                            * specs for this type.  Used for
  779.                                            * returning configuration info. */
  780.         Tk_ItemConfigureProc *configProc; /* Procedure to call to change
  781.                                            * configuration options. */
  782.         Tk_ItemCoordProc *coordProc;      /* Procedure to call to get and set
  783.                                            * the item's coordinates. */
  784.         Tk_ItemDeleteProc *deleteProc;    /* Procedure to delete existing item of
  785.                                            * this type. */
  786.         Tk_ItemDisplayProc *displayProc;  /* Procedure to display items of
  787.                                            * this type. */
  788.         int alwaysRedraw;                 /* Non-zero means displayProc should
  789.                                            * be called even when the item has
  790.                                            * been moved off-screen. */
  791.         Tk_ItemPointProc *pointProc;      /* Computes distance from item to
  792.                                            * a given point. */
  793.         Tk_ItemAreaProc *areaProc;        /* Computes whether item is inside,
  794.                                            * outside, or overlapping an area. */
  795.         Tk_ItemPostscriptProc *postscriptProc;
  796.         /* Procedure to write a Postscript
  797.          * description for items of this
  798.          * type. */
  799.         Tk_ItemScaleProc *scaleProc;         /* Procedure to rescale items of
  800.                                               * this type. */
  801.         Tk_ItemTranslateProc *translateProc; /* Procedure to translate items of
  802.                                               * this type. */
  803.         Tk_ItemIndexProc *indexProc;         /* Procedure to determine index of
  804.                                               * indicated character.  NULL if
  805.                                               * item doesn't support indexing. */
  806.         Tk_ItemCursorProc *icursorProc;      /* Procedure to set insert cursor pos.
  807.                                               * to just before a given position. */
  808.         Tk_ItemSelectionProc *selectionProc; /* Procedure to return selection (in
  809.                                               * STRING format) when it is in this
  810.                                               * item. */
  811.         Tk_ItemInsertProc *insertProc;       /* Procedure to insert something into
  812.                                               * an item. */
  813.         Tk_ItemDCharsProc *dCharsProc;       /* Procedure to delete characters
  814.                                               * from an item. */
  815.         struct Tk_ItemType *nextPtr;         /* Used to link types together into
  816.                                               * a list. */
  817.         char *reserved1;                     /* Reserved for future extension. */
  818.         int reserved2;                       /* Carefully compatible with */
  819.         char *reserved3;                     /* Jan Nijtmans dash patch */
  820.         char *reserved4;
  821. } Tk_ItemType;
  822.  
  823. /*
  824.  * The following structure provides information about the selection and
  825.  * the insertion cursor.  It is needed by only a few items, such as
  826.  * those that display text.  It is shared by the generic canvas code
  827.  * and the item-specific code, but most of the fields should be written
  828.  * only by the canvas generic code.
  829.  */
  830.  
  831. typedef struct Tk_CanvasTextInfo
  832. {
  833.         Tk_3DBorder selBorder;    /* Border and background for selected
  834.                                    * characters.  Read-only to items.*/
  835.         int selBorderWidth;       /* Width of border around selection.
  836.                                    * Read-only to items. */
  837.         XColor *selFgColorPtr;    /* Foreground color for selected text.
  838.                                    * Read-only to items. */
  839.         Tk_Item *selItemPtr;      /* Pointer to selected item.  NULL means
  840.                                    * selection isn't in this canvas.
  841.                                    * Writable by items. */
  842.         int selectFirst;          /* Index of first selected character.
  843.                                    * Writable by items. */
  844.         int selectLast;           /* Index of last selected character.
  845.                                    * Writable by items. */
  846.         Tk_Item *anchorItemPtr;   /* Item corresponding to "selectAnchor":
  847.                                    * not necessarily selItemPtr.   Read-only
  848.                                    * to items. */
  849.         int selectAnchor;         /* Fixed end of selection (i.e. "select to"
  850.                                    * operation will use this as one end of the
  851.                                    * selection).  Writable by items. */
  852.         Tk_3DBorder insertBorder; /* Used to draw vertical bar for insertion
  853.                                    * cursor.  Read-only to items. */
  854.         int insertWidth;          /* Total width of insertion cursor.  Read-only
  855.                                    * to items. */
  856.         int insertBorderWidth;    /* Width of 3-D border around insert cursor.
  857.                                    * Read-only to items. */
  858.         Tk_Item *focusItemPtr;    /* Item that currently has the input focus,
  859.                                    * or NULL if no such item.  Read-only to
  860.                                    * items.  */
  861.         int gotFocus;             /* Non-zero means that the canvas widget has
  862.                                    * the input focus.  Read-only to items.*/
  863.         int cursorOn;             /* Non-zero means that an insertion cursor
  864.                                    * should be displayed in focusItemPtr.
  865.                                    * Read-only to items.*/
  866. } Tk_CanvasTextInfo;
  867.  
  868. /*
  869.  *--------------------------------------------------------------
  870.  *
  871.  * Procedure prototypes and structures used for managing images:
  872.  *
  873.  *--------------------------------------------------------------
  874.  */
  875.  
  876. typedef struct Tk_ImageType Tk_ImageType;
  877. typedef int(Tk_ImageCreateProc) _ANSI_ARGS_ (
  878.     (Tcl_Interp * interp,
  879.      char *name,
  880.      int objc,
  881.      Tcl_Obj *CONST objv[],
  882.      Tk_ImageType *typePtr,
  883.      Tk_ImageMaster master,
  884.      ClientData *masterDataPtr));
  885. typedef ClientData (Tk_ImageGetProc) _ANSI_ARGS_ ((Tk_Window tkwin, ClientData masterData));
  886. typedef void(Tk_ImageDisplayProc) _ANSI_ARGS_ (
  887.     (ClientData instanceData,
  888.      Display *display,
  889.      Drawable drawable,
  890.      int imageX,
  891.      int imageY,
  892.      int width,
  893.      int height,
  894.      int drawableX,
  895.      int drawableY));
  896. typedef void(Tk_ImageFreeProc) _ANSI_ARGS_ ((ClientData instanceData, Display *display));
  897. typedef void(Tk_ImageDeleteProc) _ANSI_ARGS_ ((ClientData masterData));
  898. typedef void(Tk_ImageChangedProc) _ANSI_ARGS_ (
  899.     (ClientData clientData,
  900.      int x,
  901.      int y,
  902.      int width,
  903.      int height,
  904.      int imageWidth,
  905.      int imageHeight));
  906.  
  907. /*
  908.  * The following structure represents a particular type of image
  909.  * (bitmap, xpm image, etc.).  It provides information common to
  910.  * all images of that type, such as the type name and a collection
  911.  * of procedures in the image manager that respond to various
  912.  * events.  Each image manager is represented by one of these
  913.  * structures.
  914.  */
  915.  
  916. struct Tk_ImageType
  917. {
  918.         char *name; /* Name of image type. */
  919.         Tk_ImageCreateProc *createProc;
  920.         /* Procedure to call to create a new image
  921.          * of this type. */
  922.         Tk_ImageGetProc *getProc; /* Procedure to call the first time
  923.                                    * Tk_GetImage is called in a new way
  924.                                    * (new visual or screen). */
  925.         Tk_ImageDisplayProc *displayProc;
  926.         /* Call to draw image, in response to
  927.          * Tk_RedrawImage calls. */
  928.         Tk_ImageFreeProc *freeProc; /* Procedure to call whenever Tk_FreeImage
  929.                                      * is called to release an instance of an
  930.                                      * image. */
  931.         Tk_ImageDeleteProc *deleteProc;
  932.         /* Procedure to call to delete image.  It
  933.          * will not be called until after freeProc
  934.          * has been called for each instance of the
  935.          * image. */
  936.         struct Tk_ImageType *nextPtr;
  937.         /* Next in list of all image types currently
  938.          * known.  Filled in by Tk, not by image
  939.          * manager. */
  940.         char *reserved; /* reserved for future expansion */
  941. };
  942.  
  943. /*
  944.  *--------------------------------------------------------------
  945.  *
  946.  * Additional definitions used to manage images of type "photo".
  947.  *
  948.  *--------------------------------------------------------------
  949.  */
  950.  
  951. /*
  952.  * The following type is used to identify a particular photo image
  953.  * to be manipulated:
  954.  */
  955.  
  956. typedef void *Tk_PhotoHandle;
  957.  
  958. /*
  959.  * The following structure describes a block of pixels in memory:
  960.  */
  961.  
  962. typedef struct Tk_PhotoImageBlock
  963. {
  964.         unsigned char *pixelPtr; /* Pointer to the first pixel. */
  965.         int width;               /* Width of block, in pixels. */
  966.         int height;              /* Height of block, in pixels. */
  967.         int pitch;               /* Address difference between corresponding
  968.                                   * pixels in successive lines. */
  969.         int pixelSize;           /* Address difference between successive
  970.                                   * pixels in the same line. */
  971.         int offset[3];           /* Address differences between the red, green
  972.                                   * and blue components of the pixel and the
  973.                                   * pixel as a whole. */
  974.         int reserved;            /* Reserved for extensions (dash patch) */
  975. } Tk_PhotoImageBlock;
  976.  
  977. /*
  978.  * Procedure prototypes and structures used in reading and
  979.  * writing photo images:
  980.  */
  981.  
  982. typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat;
  983. typedef int(Tk_ImageFileMatchProc) _ANSI_ARGS_ (
  984.     (Tcl_Channel chan, char *fileName, char *formatString, int *widthPtr, int *heightPtr));
  985. typedef int(Tk_ImageStringMatchProc)
  986.     _ANSI_ARGS_ ((Tcl_Obj * dataObj, char *formatString, int *widthPtr, int *heightPtr));
  987. typedef int(Tk_ImageFileReadProc) _ANSI_ARGS_ (
  988.     (Tcl_Interp * interp,
  989.      Tcl_Channel chan,
  990.      char *fileName,
  991.      char *formatString,
  992.      Tk_PhotoHandle imageHandle,
  993.      int destX,
  994.      int destY,
  995.      int width,
  996.      int height,
  997.      int srcX,
  998.      int srcY));
  999. typedef int(Tk_ImageStringReadProc) _ANSI_ARGS_ (
  1000.     (Tcl_Interp * interp,
  1001.      Tcl_Obj *dataObj,
  1002.      char *formatString,
  1003.      Tk_PhotoHandle imageHandle,
  1004.      int destX,
  1005.      int destY,
  1006.      int width,
  1007.      int height,
  1008.      int srcX,
  1009.      int srcY));
  1010. typedef int(Tk_ImageFileWriteProc) _ANSI_ARGS_ (
  1011.     (Tcl_Interp * interp, char *fileName, char *formatString, Tk_PhotoImageBlock *blockPtr));
  1012. typedef int(Tk_ImageStringWriteProc) _ANSI_ARGS_ (
  1013.     (Tcl_Interp * interp,
  1014.      Tcl_DString *dataPtr,
  1015.      char *formatString,
  1016.      Tk_PhotoImageBlock *blockPtr));
  1017.  
  1018. /*
  1019.  * The following structure represents a particular file format for
  1020.  * storing images (e.g., PPM, GIF, JPEG, etc.).  It provides information
  1021.  * to allow image files of that format to be recognized and read into
  1022.  * a photo image.
  1023.  */
  1024.  
  1025. struct Tk_PhotoImageFormat
  1026. {
  1027.         char *name; /* Name of image file format */
  1028.         Tk_ImageFileMatchProc *fileMatchProc;
  1029.         /* Procedure to call to determine whether
  1030.          * an image file matches this format. */
  1031.         Tk_ImageStringMatchProc *stringMatchProc;
  1032.         /* Procedure to call to determine whether
  1033.          * the data in a string matches this format. */
  1034.         Tk_ImageFileReadProc *fileReadProc;
  1035.         /* Procedure to call to read data from
  1036.          * an image file into a photo image. */
  1037.         Tk_ImageStringReadProc *stringReadProc;
  1038.         /* Procedure to call to read data from
  1039.          * a string into a photo image. */
  1040.         Tk_ImageFileWriteProc *fileWriteProc;
  1041.         /* Procedure to call to write data from
  1042.          * a photo image to a file. */
  1043.         Tk_ImageStringWriteProc *stringWriteProc;
  1044.         /* Procedure to call to obtain a string
  1045.          * representation of the data in a photo
  1046.          * image.*/
  1047.         struct Tk_PhotoImageFormat *nextPtr;
  1048.         /* Next in list of all photo image formats
  1049.          * currently known.  Filled in by Tk, not
  1050.          * by image format handler. */
  1051. };
  1052.  
  1053. /*
  1054.  *--------------------------------------------------------------
  1055.  *
  1056.  * The definitions below provide backward compatibility for
  1057.  * functions and types related to event handling that used to
  1058.  * be in Tk but have moved to Tcl.
  1059.  *
  1060.  *--------------------------------------------------------------
  1061.  */
  1062.  
  1063. #define TK_READABLE TCL_READABLE
  1064. #define TK_WRITABLE TCL_WRITABLE
  1065. #define TK_EXCEPTION TCL_EXCEPTION
  1066.  
  1067. #define TK_DONT_WAIT TCL_DONT_WAIT
  1068. #define TK_X_EVENTS TCL_WINDOW_EVENTS
  1069. #define TK_WINDOW_EVENTS TCL_WINDOW_EVENTS
  1070. #define TK_FILE_EVENTS TCL_FILE_EVENTS
  1071. #define TK_TIMER_EVENTS TCL_TIMER_EVENTS
  1072. #define TK_IDLE_EVENTS TCL_IDLE_EVENTS
  1073. #define TK_ALL_EVENTS TCL_ALL_EVENTS
  1074.  
  1075. #define Tk_IdleProc Tcl_IdleProc
  1076. #define Tk_FileProc Tcl_FileProc
  1077. #define Tk_TimerProc Tcl_TimerProc
  1078. #define Tk_TimerToken Tcl_TimerToken
  1079.  
  1080. #define Tk_BackgroundError Tcl_BackgroundError
  1081. #define Tk_CancelIdleCall Tcl_CancelIdleCall
  1082. #define Tk_CreateFileHandler Tcl_CreateFileHandler
  1083. #define Tk_CreateTimerHandler Tcl_CreateTimerHandler
  1084. #define Tk_DeleteFileHandler Tcl_DeleteFileHandler
  1085. #define Tk_DeleteTimerHandler Tcl_DeleteTimerHandler
  1086. #define Tk_DoOneEvent Tcl_DoOneEvent
  1087. #define Tk_DoWhenIdle Tcl_DoWhenIdle
  1088. #define Tk_Sleep Tcl_Sleep
  1089.  
  1090. #define Tk_EventuallyFree Tcl_EventuallyFree
  1091. #define Tk_FreeProc Tcl_FreeProc
  1092. #define Tk_Preserve Tcl_Preserve
  1093. #define Tk_Release Tcl_Release
  1094. #define Tk_FileeventCmd Tcl_FileEventCmd
  1095.  
  1096. /*
  1097.  *--------------------------------------------------------------
  1098.  *
  1099.  * Additional procedure types defined by Tk.
  1100.  *
  1101.  *--------------------------------------------------------------
  1102.  */
  1103.  
  1104. typedef int(Tk_ErrorProc) _ANSI_ARGS_ ((ClientData clientData, XErrorEvent *errEventPtr));
  1105. typedef void(Tk_EventProc) _ANSI_ARGS_ ((ClientData clientData, XEvent *eventPtr));
  1106. typedef int(Tk_GenericProc) _ANSI_ARGS_ ((ClientData clientData, XEvent *eventPtr));
  1107. typedef int(Tk_GetSelProc)
  1108.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, char *portion));
  1109. typedef void(Tk_LostSelProc) _ANSI_ARGS_ ((ClientData clientData));
  1110. typedef Tk_RestrictAction (Tk_RestrictProc)
  1111.     _ANSI_ARGS_ ((ClientData clientData, XEvent *eventPtr));
  1112. typedef int(Tk_SelectionProc)
  1113.     _ANSI_ARGS_ ((ClientData clientData, int offset, char *buffer, int maxBytes));
  1114.  
  1115. /*
  1116.  *--------------------------------------------------------------
  1117.  *
  1118.  * Exported procedures and variables.
  1119.  *
  1120.  *--------------------------------------------------------------
  1121.  */
  1122.  
  1123. EXTERN XColor *Tk_3DBorderColor _ANSI_ARGS_ ((Tk_3DBorder border));
  1124. EXTERN GC Tk_3DBorderGC _ANSI_ARGS_ ((Tk_Window tkwin, Tk_3DBorder border, int which));
  1125. EXTERN void Tk_3DHorizontalBevel _ANSI_ARGS_ (
  1126.     (Tk_Window tkwin,
  1127.      Drawable drawable,
  1128.      Tk_3DBorder border,
  1129.      int x,
  1130.      int y,
  1131.      int width,
  1132.      int height,
  1133.      int leftIn,
  1134.      int rightIn,
  1135.      int topBevel,
  1136.      int relief));
  1137. EXTERN void Tk_3DVerticalBevel _ANSI_ARGS_ (
  1138.     (Tk_Window tkwin,
  1139.      Drawable drawable,
  1140.      Tk_3DBorder border,
  1141.      int x,
  1142.      int y,
  1143.      int width,
  1144.      int height,
  1145.      int leftBevel,
  1146.      int relief));
  1147. EXTERN void
  1148.     Tk_AddOption _ANSI_ARGS_ ((Tk_Window tkwin, char *name, char *value, int priority));
  1149. EXTERN void Tk_BindEvent _ANSI_ARGS_ (
  1150.     (Tk_BindingTable bindingTable,
  1151.      XEvent *eventPtr,
  1152.      Tk_Window tkwin,
  1153.      int numObjects,
  1154.      ClientData *objectPtr));
  1155. EXTERN void Tk_CanvasDrawableCoords _ANSI_ARGS_ (
  1156.     (Tk_Canvas canvas, double x, double y, short *drawableXPtr, short *drawableYPtr));
  1157. EXTERN void
  1158.     Tk_CanvasEventuallyRedraw _ANSI_ARGS_ ((Tk_Canvas canvas, int x1, int y1, int x2, int y2));
  1159. EXTERN int Tk_CanvasGetCoord
  1160.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Canvas canvas, char *string, double *doublePtr));
  1161. EXTERN Tk_CanvasTextInfo *Tk_CanvasGetTextInfo _ANSI_ARGS_ ((Tk_Canvas canvas));
  1162. EXTERN int Tk_CanvasPsBitmap _ANSI_ARGS_ (
  1163.     (Tcl_Interp * interp,
  1164.      Tk_Canvas canvas,
  1165.      Pixmap bitmap,
  1166.      int x,
  1167.      int y,
  1168.      int width,
  1169.      int height));
  1170. EXTERN int
  1171.     Tk_CanvasPsColor _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Canvas canvas, XColor *colorPtr));
  1172. EXTERN int Tk_CanvasPsFont _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Canvas canvas, Tk_Font font));
  1173. EXTERN void Tk_CanvasPsPath
  1174.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Canvas canvas, double *coordPtr, int numPoints));
  1175. EXTERN int
  1176.     Tk_CanvasPsStipple _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap));
  1177. EXTERN double Tk_CanvasPsY _ANSI_ARGS_ ((Tk_Canvas canvas, double y));
  1178. EXTERN void Tk_CanvasSetStippleOrigin _ANSI_ARGS_ ((Tk_Canvas canvas, GC gc));
  1179. EXTERN int Tk_CanvasTagsParseProc _ANSI_ARGS_ (
  1180.     (ClientData clientData,
  1181.      Tcl_Interp *interp,
  1182.      Tk_Window tkwin,
  1183.      char *value,
  1184.      char *widgRec,
  1185.      int offset));
  1186. EXTERN char *Tk_CanvasTagsPrintProc _ANSI_ARGS_ (
  1187.     (ClientData clientData,
  1188.      Tk_Window tkwin,
  1189.      char *widgRec,
  1190.      int offset,
  1191.      Tcl_FreeProc **freeProcPtr));
  1192. EXTERN Tk_Window Tk_CanvasTkwin _ANSI_ARGS_ ((Tk_Canvas canvas));
  1193. EXTERN void Tk_CanvasWindowCoords
  1194.     _ANSI_ARGS_ ((Tk_Canvas canvas, double x, double y, short *screenXPtr, short *screenYPtr));
  1195. EXTERN void Tk_ChangeWindowAttributes
  1196.     _ANSI_ARGS_ ((Tk_Window tkwin, unsigned long valueMask, XSetWindowAttributes *attsPtr));
  1197. EXTERN int Tk_CharBbox _ANSI_ARGS_ (
  1198.     (Tk_TextLayout layout, int index, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr));
  1199. EXTERN void Tk_ClearSelection _ANSI_ARGS_ ((Tk_Window tkwin, Atom selection));
  1200. EXTERN int Tk_ClipboardAppend _ANSI_ARGS_ (
  1201.     (Tcl_Interp * interp, Tk_Window tkwin, Atom target, Atom format, char *buffer));
  1202. EXTERN int Tk_ClipboardClear _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin));
  1203. EXTERN int Tk_ConfigureInfo _ANSI_ARGS_ (
  1204.     (Tcl_Interp * interp,
  1205.      Tk_Window tkwin,
  1206.      Tk_ConfigSpec *specs,
  1207.      char *widgRec,
  1208.      char *argvName,
  1209.      int flags));
  1210. EXTERN int Tk_ConfigureValue _ANSI_ARGS_ (
  1211.     (Tcl_Interp * interp,
  1212.      Tk_Window tkwin,
  1213.      Tk_ConfigSpec *specs,
  1214.      char *widgRec,
  1215.      char *argvName,
  1216.      int flags));
  1217. EXTERN int Tk_ConfigureWidget _ANSI_ARGS_ (
  1218.     (Tcl_Interp * interp,
  1219.      Tk_Window tkwin,
  1220.      Tk_ConfigSpec *specs,
  1221.      int argc,
  1222.      char **argv,
  1223.      char *widgRec,
  1224.      int flags));
  1225. EXTERN void Tk_ConfigureWindow
  1226.     _ANSI_ARGS_ ((Tk_Window tkwin, unsigned int valueMask, XWindowChanges *valuePtr));
  1227. EXTERN Tk_TextLayout Tk_ComputeTextLayout _ANSI_ARGS_ (
  1228.     (Tk_Font font,
  1229.      CONST char *string,
  1230.      int numChars,
  1231.      int wrapLength,
  1232.      Tk_Justify justify,
  1233.      int flags,
  1234.      int *widthPtr,
  1235.      int *heightPtr));
  1236. EXTERN Tk_Window Tk_CoordsToWindow _ANSI_ARGS_ ((int rootX, int rootY, Tk_Window tkwin));
  1237. EXTERN unsigned long Tk_CreateBinding _ANSI_ARGS_ (
  1238.     (Tcl_Interp * interp,
  1239.      Tk_BindingTable bindingTable,
  1240.      ClientData object,
  1241.      char *eventString,
  1242.      char *command,
  1243.      int append));
  1244. EXTERN Tk_BindingTable Tk_CreateBindingTable _ANSI_ARGS_ ((Tcl_Interp * interp));
  1245. EXTERN Tk_ErrorHandler Tk_CreateErrorHandler _ANSI_ARGS_ (
  1246.     (Display * display,
  1247.      int errNum,
  1248.      int request,
  1249.      int minorCode,
  1250.      Tk_ErrorProc *errorProc,
  1251.      ClientData clientData));
  1252. EXTERN void Tk_CreateEventHandler _ANSI_ARGS_ (
  1253.     (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData));
  1254. EXTERN void
  1255.     Tk_CreateGenericHandler _ANSI_ARGS_ ((Tk_GenericProc * proc, ClientData clientData));
  1256. EXTERN void Tk_CreateImageType _ANSI_ARGS_ ((Tk_ImageType * typePtr));
  1257. EXTERN void Tk_CreateItemType _ANSI_ARGS_ ((Tk_ItemType * typePtr));
  1258. EXTERN void Tk_CreatePhotoImageFormat _ANSI_ARGS_ ((Tk_PhotoImageFormat * formatPtr));
  1259. EXTERN void Tk_CreateSelHandler _ANSI_ARGS_ (
  1260.     (Tk_Window tkwin,
  1261.      Atom selection,
  1262.      Atom target,
  1263.      Tk_SelectionProc *proc,
  1264.      ClientData clientData,
  1265.      Atom format));
  1266. EXTERN Tk_Window Tk_CreateWindow
  1267.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window parent, char *name, char *screenName));
  1268. EXTERN Tk_Window Tk_CreateWindowFromPath
  1269.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, char *pathName, char *screenName));
  1270. EXTERN int Tk_DefineBitmap
  1271.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Uid name, char *source, int width, int height));
  1272. EXTERN void Tk_DefineCursor _ANSI_ARGS_ ((Tk_Window window, Tk_Cursor cursor));
  1273. EXTERN void
  1274.     Tk_DeleteAllBindings _ANSI_ARGS_ ((Tk_BindingTable bindingTable, ClientData object));
  1275. EXTERN int Tk_DeleteBinding _ANSI_ARGS_ (
  1276.     (Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, char *eventString));
  1277. EXTERN void Tk_DeleteBindingTable _ANSI_ARGS_ ((Tk_BindingTable bindingTable));
  1278. EXTERN void Tk_DeleteErrorHandler _ANSI_ARGS_ ((Tk_ErrorHandler handler));
  1279. EXTERN void Tk_DeleteEventHandler _ANSI_ARGS_ (
  1280.     (Tk_Window token, unsigned long mask, Tk_EventProc *proc, ClientData clientData));
  1281. EXTERN void
  1282.     Tk_DeleteGenericHandler _ANSI_ARGS_ ((Tk_GenericProc * proc, ClientData clientData));
  1283. EXTERN void Tk_DeleteImage _ANSI_ARGS_ ((Tcl_Interp * interp, char *name));
  1284. EXTERN void Tk_DeleteSelHandler _ANSI_ARGS_ ((Tk_Window tkwin, Atom selection, Atom target));
  1285. EXTERN void Tk_DestroyWindow _ANSI_ARGS_ ((Tk_Window tkwin));
  1286. EXTERN char *Tk_DisplayName _ANSI_ARGS_ ((Tk_Window tkwin));
  1287. EXTERN int Tk_DistanceToTextLayout _ANSI_ARGS_ ((Tk_TextLayout layout, int x, int y));
  1288. EXTERN void Tk_Draw3DPolygon _ANSI_ARGS_ (
  1289.     (Tk_Window tkwin,
  1290.      Drawable drawable,
  1291.      Tk_3DBorder border,
  1292.      XPoint *pointPtr,
  1293.      int numPoints,
  1294.      int borderWidth,
  1295.      int leftRelief));
  1296. EXTERN void Tk_Draw3DRectangle _ANSI_ARGS_ (
  1297.     (Tk_Window tkwin,
  1298.      Drawable drawable,
  1299.      Tk_3DBorder border,
  1300.      int x,
  1301.      int y,
  1302.      int width,
  1303.      int height,
  1304.      int borderWidth,
  1305.      int relief));
  1306. EXTERN void Tk_DrawChars _ANSI_ARGS_ (
  1307.     (Display * display,
  1308.      Drawable drawable,
  1309.      GC gc,
  1310.      Tk_Font tkfont,
  1311.      CONST char *source,
  1312.      int numChars,
  1313.      int x,
  1314.      int y));
  1315. EXTERN void
  1316.     Tk_DrawFocusHighlight _ANSI_ARGS_ ((Tk_Window tkwin, GC gc, int width, Drawable drawable));
  1317. EXTERN void Tk_DrawTextLayout _ANSI_ARGS_ (
  1318.     (Display * display,
  1319.      Drawable drawable,
  1320.      GC gc,
  1321.      Tk_TextLayout layout,
  1322.      int x,
  1323.      int y,
  1324.      int firstChar,
  1325.      int lastChar));
  1326. EXTERN void Tk_Fill3DPolygon _ANSI_ARGS_ (
  1327.     (Tk_Window tkwin,
  1328.      Drawable drawable,
  1329.      Tk_3DBorder border,
  1330.      XPoint *pointPtr,
  1331.      int numPoints,
  1332.      int borderWidth,
  1333.      int leftRelief));
  1334. EXTERN void Tk_Fill3DRectangle _ANSI_ARGS_ (
  1335.     (Tk_Window tkwin,
  1336.      Drawable drawable,
  1337.      Tk_3DBorder border,
  1338.      int x,
  1339.      int y,
  1340.      int width,
  1341.      int height,
  1342.      int borderWidth,
  1343.      int relief));
  1344. EXTERN Tk_PhotoHandle Tk_FindPhoto _ANSI_ARGS_ ((Tcl_Interp * interp, char *imageName));
  1345. EXTERN Font Tk_FontId _ANSI_ARGS_ ((Tk_Font font));
  1346. EXTERN void Tk_Free3DBorder _ANSI_ARGS_ ((Tk_3DBorder border));
  1347. EXTERN void Tk_FreeBitmap _ANSI_ARGS_ ((Display * display, Pixmap bitmap));
  1348. EXTERN void Tk_FreeColor _ANSI_ARGS_ ((XColor * colorPtr));
  1349. EXTERN void Tk_FreeColormap _ANSI_ARGS_ ((Display * display, Colormap colormap));
  1350. EXTERN void Tk_FreeCursor _ANSI_ARGS_ ((Display * display, Tk_Cursor cursor));
  1351. EXTERN void Tk_FreeFont _ANSI_ARGS_ ((Tk_Font));
  1352. EXTERN void Tk_FreeGC _ANSI_ARGS_ ((Display * display, GC gc));
  1353. EXTERN void Tk_FreeImage _ANSI_ARGS_ ((Tk_Image image));
  1354. EXTERN void Tk_FreeOptions
  1355.     _ANSI_ARGS_ ((Tk_ConfigSpec * specs, char *widgRec, Display *display, int needFlags));
  1356. EXTERN void Tk_FreePixmap _ANSI_ARGS_ ((Display * display, Pixmap pixmap));
  1357. EXTERN void Tk_FreeTextLayout _ANSI_ARGS_ ((Tk_TextLayout textLayout));
  1358. EXTERN void Tk_FreeXId _ANSI_ARGS_ ((Display * display, XID xid));
  1359. EXTERN GC Tk_GCForColor _ANSI_ARGS_ ((XColor * colorPtr, Drawable drawable));
  1360. EXTERN void Tk_GeometryRequest _ANSI_ARGS_ ((Tk_Window tkwin, int reqWidth, int reqHeight));
  1361. EXTERN Tk_3DBorder Tk_Get3DBorder
  1362.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid colorName));
  1363. EXTERN void Tk_GetAllBindings
  1364.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object));
  1365. EXTERN int
  1366.     Tk_GetAnchor _ANSI_ARGS_ ((Tcl_Interp * interp, char *string, Tk_Anchor *anchorPtr));
  1367. EXTERN char *Tk_GetAtomName _ANSI_ARGS_ ((Tk_Window tkwin, Atom atom));
  1368. EXTERN char *Tk_GetBinding _ANSI_ARGS_ (
  1369.     (Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, char *eventString));
  1370. EXTERN Pixmap Tk_GetBitmap _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid string));
  1371. EXTERN Pixmap Tk_GetBitmapFromData
  1372.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, char *source, int width, int height));
  1373. EXTERN int Tk_GetCapStyle _ANSI_ARGS_ ((Tcl_Interp * interp, char *string, int *capPtr));
  1374. EXTERN XColor *Tk_GetColor _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid name));
  1375. EXTERN XColor *Tk_GetColorByValue _ANSI_ARGS_ ((Tk_Window tkwin, XColor *colorPtr));
  1376. EXTERN
  1377.     Colormap Tk_GetColormap _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, char *string));
  1378. EXTERN
  1379.     Tk_Cursor Tk_GetCursor _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid string));
  1380. EXTERN Tk_Cursor Tk_GetCursorFromData _ANSI_ARGS_ (
  1381.     (Tcl_Interp * interp,
  1382.      Tk_Window tkwin,
  1383.      char *source,
  1384.      char *mask,
  1385.      int width,
  1386.      int height,
  1387.      int xHot,
  1388.      int yHot,
  1389.      Tk_Uid fg,
  1390.      Tk_Uid bg));
  1391. EXTERN Tk_Font Tk_GetFont
  1392.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, CONST char *string));
  1393. EXTERN Tk_Font Tk_GetFontFromObj
  1394.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj *objPtr));
  1395. EXTERN void Tk_GetFontMetrics _ANSI_ARGS_ ((Tk_Font font, Tk_FontMetrics *fmPtr));
  1396. EXTERN
  1397.     GC Tk_GetGC _ANSI_ARGS_ ((Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr));
  1398. /* CYGNUS LOCAL.  */
  1399. EXTERN GC Tk_GetGCColor _ANSI_ARGS_ (
  1400.     (Tk_Window tkwin,
  1401.      unsigned long valueMask,
  1402.      XGCValues *valuePtr,
  1403.      XColor *foreground,
  1404.      XColor *background));
  1405. EXTERN Tk_Image Tk_GetImage _ANSI_ARGS_ (
  1406.     (Tcl_Interp * interp,
  1407.      Tk_Window tkwin,
  1408.      char *name,
  1409.      Tk_ImageChangedProc *changeProc,
  1410.      ClientData clientData));
  1411. EXTERN ClientData Tk_GetImageMasterData
  1412.     _ANSI_ARGS_ ((Tcl_Interp * interp, char *name, Tk_ImageType **typePtrPtr));
  1413. EXTERN Tk_ItemType *Tk_GetItemTypes _ANSI_ARGS_ ((void) );
  1414. EXTERN int Tk_GetJoinStyle _ANSI_ARGS_ ((Tcl_Interp * interp, char *string, int *joinPtr));
  1415. EXTERN int
  1416.     Tk_GetJustify _ANSI_ARGS_ ((Tcl_Interp * interp, char *string, Tk_Justify *justifyPtr));
  1417. EXTERN int Tk_GetNumMainWindows _ANSI_ARGS_ ((void) );
  1418. EXTERN Tk_Uid Tk_GetOption _ANSI_ARGS_ ((Tk_Window tkwin, char *name, char *className));
  1419. EXTERN int Tk_GetPixels
  1420.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, char *string, int *intPtr));
  1421. EXTERN Pixmap Tk_GetPixmap
  1422.     _ANSI_ARGS_ ((Display * display, Drawable d, int width, int height, int depth));
  1423. EXTERN int Tk_GetRelief _ANSI_ARGS_ ((Tcl_Interp * interp, char *name, int *reliefPtr));
  1424. EXTERN void Tk_GetRootCoords _ANSI_ARGS_ ((Tk_Window tkwin, int *xPtr, int *yPtr));
  1425. EXTERN int Tk_GetScrollInfo
  1426.     _ANSI_ARGS_ ((Tcl_Interp * interp, int argc, char **argv, double *dblPtr, int *intPtr));
  1427. EXTERN int Tk_GetScreenMM
  1428.     _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, char *string, double *doublePtr));
  1429. EXTERN int Tk_GetSelection _ANSI_ARGS_ (
  1430.     (Tcl_Interp * interp,
  1431.      Tk_Window tkwin,
  1432.      Atom selection,
  1433.      Atom target,
  1434.      Tk_GetSelProc *proc,
  1435.      ClientData clientData));
  1436. EXTERN Tk_Uid Tk_GetUid _ANSI_ARGS_ ((CONST char *string));
  1437. EXTERN Visual *Tk_GetVisual _ANSI_ARGS_ ((
  1438.     Tcl_Interp * interp, Tk_Window tkwin, char *string, int *depthPtr, Colormap *colormapPtr));
  1439. EXTERN void Tk_GetVRootGeometry
  1440.     _ANSI_ARGS_ ((Tk_Window tkwin, int *xPtr, int *yPtr, int *widthPtr, int *heightPtr));
  1441. EXTERN int Tk_Grab _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_Window tkwin, int grabGlobal));
  1442. EXTERN void Tk_HandleEvent _ANSI_ARGS_ ((XEvent * eventPtr));
  1443. EXTERN Tk_Window Tk_IdToWindow _ANSI_ARGS_ ((Display * display, Window window));
  1444. EXTERN void Tk_ImageChanged _ANSI_ARGS_ (
  1445.     (Tk_ImageMaster master,
  1446.      int x,
  1447.      int y,
  1448.      int width,
  1449.      int height,
  1450.      int imageWidth,
  1451.      int imageHeight));
  1452. EXTERN int Tk_Init _ANSI_ARGS_ ((Tcl_Interp * interp));
  1453. EXTERN Atom Tk_InternAtom _ANSI_ARGS_ ((Tk_Window tkwin, char *name));
  1454. EXTERN int Tk_IntersectTextLayout
  1455.     _ANSI_ARGS_ ((Tk_TextLayout layout, int x, int y, int width, int height));
  1456. EXTERN void Tk_Main _ANSI_ARGS_ ((int argc, char **argv, Tcl_AppInitProc *appInitProc));
  1457. EXTERN void Tk_MainLoop _ANSI_ARGS_ ((void) );
  1458. EXTERN void Tk_MaintainGeometry
  1459.     _ANSI_ARGS_ ((Tk_Window slave, Tk_Window master, int x, int y, int width, int height));
  1460. EXTERN Tk_Window Tk_MainWindow _ANSI_ARGS_ ((Tcl_Interp * interp));
  1461. EXTERN void Tk_MakeWindowExist _ANSI_ARGS_ ((Tk_Window tkwin));
  1462. EXTERN void Tk_ManageGeometry
  1463.     _ANSI_ARGS_ ((Tk_Window tkwin, Tk_GeomMgr *mgrPtr, ClientData clientData));
  1464. EXTERN void Tk_MapWindow _ANSI_ARGS_ ((Tk_Window tkwin));
  1465. EXTERN int Tk_MeasureChars _ANSI_ARGS_ (
  1466.     (Tk_Font tkfont,
  1467.      CONST char *source,
  1468.      int maxChars,
  1469.      int maxPixels,
  1470.      int flags,
  1471.      int *lengthPtr));
  1472. EXTERN void
  1473.     Tk_MoveResizeWindow _ANSI_ARGS_ ((Tk_Window tkwin, int x, int y, int width, int height));
  1474. EXTERN void Tk_MoveWindow _ANSI_ARGS_ ((Tk_Window tkwin, int x, int y));
  1475. EXTERN void Tk_MoveToplevelWindow _ANSI_ARGS_ ((Tk_Window tkwin, int x, int y));
  1476. EXTERN char *Tk_NameOf3DBorder _ANSI_ARGS_ ((Tk_3DBorder border));
  1477. EXTERN char *Tk_NameOfAnchor _ANSI_ARGS_ ((Tk_Anchor anchor));
  1478. EXTERN char *Tk_NameOfBitmap _ANSI_ARGS_ ((Display * display, Pixmap bitmap));
  1479. EXTERN char *Tk_NameOfCapStyle _ANSI_ARGS_ ((int cap));
  1480. EXTERN char *Tk_NameOfColor _ANSI_ARGS_ ((XColor * colorPtr));
  1481. EXTERN char *Tk_NameOfCursor _ANSI_ARGS_ ((Display * display, Tk_Cursor cursor));
  1482. EXTERN char *Tk_NameOfFont _ANSI_ARGS_ ((Tk_Font font));
  1483. EXTERN char *Tk_NameOfImage _ANSI_ARGS_ ((Tk_ImageMaster imageMaster));
  1484. EXTERN char *Tk_NameOfJoinStyle _ANSI_ARGS_ ((int join));
  1485. EXTERN char *Tk_NameOfJustify _ANSI_ARGS_ ((Tk_Justify justify));
  1486. EXTERN char *Tk_NameOfRelief _ANSI_ARGS_ ((int relief));
  1487. EXTERN Tk_Window Tk_NameToWindow
  1488.     _ANSI_ARGS_ ((Tcl_Interp * interp, char *pathName, Tk_Window tkwin));
  1489. EXTERN void Tk_OwnSelection _ANSI_ARGS_ (
  1490.     (Tk_Window tkwin, Atom selection, Tk_LostSelProc *proc, ClientData clientData));
  1491. EXTERN int Tk_ParseArgv _ANSI_ARGS_ (
  1492.     (Tcl_Interp * interp,
  1493.      Tk_Window tkwin,
  1494.      int *argcPtr,
  1495.      char **argv,
  1496.      Tk_ArgvInfo *argTable,
  1497.      int flags));
  1498. EXTERN void Tk_PhotoPutBlock _ANSI_ARGS_ ((
  1499.     Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height));
  1500. EXTERN void Tk_PhotoPutZoomedBlock _ANSI_ARGS_ (
  1501.     (Tk_PhotoHandle handle,
  1502.      Tk_PhotoImageBlock *blockPtr,
  1503.      int x,
  1504.      int y,
  1505.      int width,
  1506.      int height,
  1507.      int zoomX,
  1508.      int zoomY,
  1509.      int subsampleX,
  1510.      int subsampleY));
  1511. EXTERN int
  1512.     Tk_PhotoGetImage _ANSI_ARGS_ ((Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr));
  1513. EXTERN void Tk_PhotoBlank _ANSI_ARGS_ ((Tk_PhotoHandle handle));
  1514. EXTERN void Tk_PhotoExpand _ANSI_ARGS_ ((Tk_PhotoHandle handle, int width, int height));
  1515. EXTERN void
  1516.     Tk_PhotoGetSize _ANSI_ARGS_ ((Tk_PhotoHandle handle, int *widthPtr, int *heightPtr));
  1517. EXTERN void Tk_PhotoSetSize _ANSI_ARGS_ ((Tk_PhotoHandle handle, int width, int height));
  1518. EXTERN int Tk_PointToChar _ANSI_ARGS_ ((Tk_TextLayout layout, int x, int y));
  1519. EXTERN int Tk_PostscriptFontName _ANSI_ARGS_ ((Tk_Font tkfont, Tcl_DString *dsPtr));
  1520. EXTERN void Tk_PreserveColormap _ANSI_ARGS_ ((Display * display, Colormap colormap));
  1521. EXTERN void Tk_QueueWindowEvent _ANSI_ARGS_ ((XEvent * eventPtr, Tcl_QueuePosition position));
  1522. EXTERN void Tk_RedrawImage _ANSI_ARGS_ (
  1523.     (Tk_Image image,
  1524.      int imageX,
  1525.      int imageY,
  1526.      int width,
  1527.      int height,
  1528.      Drawable drawable,
  1529.      int drawableX,
  1530.      int drawableY));
  1531. EXTERN void Tk_ResizeWindow _ANSI_ARGS_ ((Tk_Window tkwin, int width, int height));
  1532. EXTERN int Tk_RestackWindow _ANSI_ARGS_ ((Tk_Window tkwin, int aboveBelow, Tk_Window other));
  1533. EXTERN Tk_RestrictProc *Tk_RestrictEvents
  1534.     _ANSI_ARGS_ ((Tk_RestrictProc * proc, ClientData arg, ClientData *prevArgPtr));
  1535. EXTERN int Tk_SafeInit _ANSI_ARGS_ ((Tcl_Interp * interp));
  1536. EXTERN char *Tk_SetAppName _ANSI_ARGS_ ((Tk_Window tkwin, char *name));
  1537. EXTERN void Tk_SetBackgroundFromBorder _ANSI_ARGS_ ((Tk_Window tkwin, Tk_3DBorder border));
  1538. EXTERN void Tk_SetClass _ANSI_ARGS_ ((Tk_Window tkwin, char *className));
  1539. EXTERN void Tk_SetGrid _ANSI_ARGS_ (
  1540.     (Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight));
  1541. EXTERN void Tk_SetInternalBorder _ANSI_ARGS_ ((Tk_Window tkwin, int width));
  1542. EXTERN void Tk_SetWindowBackground _ANSI_ARGS_ ((Tk_Window tkwin, unsigned long pixel));
  1543. EXTERN void Tk_SetWindowBackgroundPixmap _ANSI_ARGS_ ((Tk_Window tkwin, Pixmap pixmap));
  1544. EXTERN void Tk_SetWindowBorder _ANSI_ARGS_ ((Tk_Window tkwin, unsigned long pixel));
  1545. EXTERN void Tk_SetWindowBorderWidth _ANSI_ARGS_ ((Tk_Window tkwin, int width));
  1546. EXTERN void Tk_SetWindowBorderPixmap _ANSI_ARGS_ ((Tk_Window tkwin, Pixmap pixmap));
  1547. EXTERN void Tk_SetWindowColormap _ANSI_ARGS_ ((Tk_Window tkwin, Colormap colormap));
  1548. EXTERN int Tk_SetWindowVisual
  1549.     _ANSI_ARGS_ ((Tk_Window tkwin, Visual *visual, int depth, Colormap colormap));
  1550. EXTERN void Tk_SizeOfBitmap
  1551.     _ANSI_ARGS_ ((Display * display, Pixmap bitmap, int *widthPtr, int *heightPtr));
  1552. EXTERN void Tk_SizeOfImage _ANSI_ARGS_ ((Tk_Image image, int *widthPtr, int *heightPtr));
  1553. EXTERN int Tk_StrictMotif _ANSI_ARGS_ ((Tk_Window tkwin));
  1554. EXTERN void
  1555.     Tk_TextLayoutToPostscript _ANSI_ARGS_ ((Tcl_Interp * interp, Tk_TextLayout layout));
  1556. EXTERN int Tk_TextWidth _ANSI_ARGS_ ((Tk_Font font, CONST char *string, int numChars));
  1557. EXTERN void Tk_UndefineCursor _ANSI_ARGS_ ((Tk_Window window));
  1558. EXTERN void Tk_UnderlineChars _ANSI_ARGS_ (
  1559.     (Display * display,
  1560.      Drawable drawable,
  1561.      GC gc,
  1562.      Tk_Font tkfont,
  1563.      CONST char *source,
  1564.      int x,
  1565.      int y,
  1566.      int firstChar,
  1567.      int lastChar));
  1568. EXTERN void Tk_UnderlineTextLayout _ANSI_ARGS_ (
  1569.     (Display * display,
  1570.      Drawable drawable,
  1571.      GC gc,
  1572.      Tk_TextLayout layout,
  1573.      int x,
  1574.      int y,
  1575.      int underline));
  1576. EXTERN void Tk_Ungrab _ANSI_ARGS_ ((Tk_Window tkwin));
  1577. EXTERN void Tk_UnmaintainGeometry _ANSI_ARGS_ ((Tk_Window slave, Tk_Window master));
  1578. EXTERN void Tk_UnmapWindow _ANSI_ARGS_ ((Tk_Window tkwin));
  1579. EXTERN void Tk_UnsetGrid _ANSI_ARGS_ ((Tk_Window tkwin));
  1580. EXTERN void Tk_UpdatePointer _ANSI_ARGS_ ((Tk_Window tkwin, int x, int y, int state));
  1581.  
  1582. /*
  1583.  * Tcl commands exported by Tk:
  1584.  */
  1585.  
  1586. EXTERN int Tk_BellObjCmd
  1587.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
  1588. EXTERN int Tk_BindCmd
  1589.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1590. EXTERN int Tk_BindtagsCmd
  1591.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1592. EXTERN int Tk_ButtonCmd
  1593.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1594. EXTERN int Tk_CanvasCmd
  1595.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1596. EXTERN int Tk_CheckbuttonCmd
  1597.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1598. EXTERN int Tk_ClipboardCmd
  1599.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1600. EXTERN int Tk_ChooseColorCmd
  1601.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1602. EXTERN int Tk_DestroyCmd
  1603.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1604. EXTERN int Tk_EntryCmd
  1605.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1606. EXTERN int Tk_EventCmd
  1607.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1608. EXTERN int Tk_FrameCmd
  1609.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1610. EXTERN int Tk_FocusCmd
  1611.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1612. EXTERN int Tk_FontObjCmd
  1613.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
  1614. EXTERN int Tk_GetOpenFileCmd
  1615.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1616. EXTERN int Tk_GetSaveFileCmd
  1617.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1618. EXTERN int Tk_GrabCmd
  1619.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1620. EXTERN int Tk_GridCmd
  1621.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1622. EXTERN int Tk_ImageCmd
  1623.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[]));
  1624. EXTERN int Tk_LabelCmd
  1625.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1626. EXTERN int Tk_ListboxCmd
  1627.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1628. EXTERN int Tk_LowerCmd
  1629.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1630. EXTERN int Tk_MenuCmd
  1631.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1632. EXTERN int Tk_MenubuttonCmd
  1633.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1634. EXTERN int Tk_MessageBoxCmd
  1635.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1636. EXTERN int Tk_MessageCmd
  1637.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1638. EXTERN int Tk_OptionCmd
  1639.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1640. EXTERN int Tk_PackCmd
  1641.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1642. EXTERN int Tk_PlaceCmd
  1643.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1644. EXTERN int Tk_RadiobuttonCmd
  1645.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1646. EXTERN int Tk_RaiseCmd
  1647.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1648. EXTERN int Tk_ScaleCmd
  1649.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1650. EXTERN int Tk_ScrollbarCmd
  1651.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1652. EXTERN int Tk_SelectionCmd
  1653.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1654. EXTERN int Tk_SendCmd
  1655.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1656. EXTERN int Tk_TextCmd
  1657.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1658. EXTERN int Tk_TkObjCmd
  1659.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
  1660. EXTERN int Tk_TkwaitCmd
  1661.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1662. EXTERN int Tk_ToplevelCmd
  1663.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1664. EXTERN int Tk_UpdateCmd
  1665.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1666. EXTERN int Tk_WinfoObjCmd
  1667.     _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
  1668. EXTERN int
  1669.     Tk_WmCmd _ANSI_ARGS_ ((ClientData clientData, Tcl_Interp *interp, int argc, char **argv));
  1670.  
  1671. #endif /* RESOURCE_INCLUDED */
  1672.  
  1673. #undef TCL_STORAGE_CLASS
  1674. #define TCL_STORAGE_CLASS DLLIMPORT
  1675.  
  1676. #endif /* _TK */
  1677.