/* * tkCanvImg.c -- * * This file implements image items for canvas widgets. * * Copyright (c) 1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tkCanvImg.c,v 1.6.2.1 2004/11/17 22:18:50 hobbs Exp $ */ #include #include "tkInt.h" #include "tkPort.h" #include "tkCanvas.h" /* * The structure below defines the record for each image item. */ typedef struct ImageItem { Tk_Item header; /* Generic stuff that's the same for all * types. MUST BE FIRST IN STRUCTURE. */ Tk_Canvas canvas; /* Canvas containing the image. */ double x, y; /* Coordinates of positioning point for * image. */ Tk_Anchor anchor; /* Where to anchor image relative to * (x,y). */ char *imageString; /* String describing -image option (malloc-ed). * NULL means no image right now. */ char *activeImageString; /* String describing -activeimage option. * NULL means no image right now. */ char *disabledImageString; /* String describing -disabledimage option. * NULL means no image right now. */ Tk_Image image; /* Image to display in window, or NULL if * no image at present. */ Tk_Image activeImage; /* Image to display in window, or NULL if * no image at present. */ Tk_Image disabledImage; /* Image to display in window, or NULL if * no image at present. */ } ImageItem; /* * Information used for parsing configuration specs: */ static Tk_CustomOption stateOption = { (Tk_OptionParseProc *) TkStateParseProc, TkStatePrintProc, (ClientData) 2 }; static Tk_CustomOption tagsOption = { (Tk_OptionParseProc *) Tk_CanvasTagsParseProc, Tk_CanvasTagsPrintProc, (ClientData) NULL }; static Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_STRING, "-activeimage", (char *) NULL, (char *) NULL, (char *) NULL, Tk_Offset(ImageItem, activeImageString), TK_CONFIG_NULL_OK}, {TK_CONFIG_ANCHOR, "-anchor", (char *) NULL, (char *) NULL, "center", Tk_Offset(ImageItem, anchor), TK_CONFIG_DONT_SET_DEFAULT}, {TK_CONFIG_STRING, "-disabledimage", (char *) NULL, (char *) NULL, (char *) NULL, Tk_Offset(ImageItem, disabledImageString), TK_CONFIG_NULL_OK}, {TK_CONFIG_STRING, "-image", (char *) NULL, (char *) NULL, (char *) NULL, Tk_Offset(ImageItem, imageString), TK_CONFIG_NULL_OK}, {TK_CONFIG_CUSTOM, "-state", (char *) NULL, (char *) NULL, (char *) NULL, Tk_Offset(Tk_Item, state), TK_CONFIG_NULL_OK, &stateOption}, {TK_CONFIG_CUSTOM, "-tags", (char *) NULL, (char *) NULL, (char *) NULL, 0, TK_CONFIG_NULL_OK, &tagsOption}, {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL, (char *) NULL, 0, 0} }; /* * Prototypes for procedures defined in this file: */ static void ImageChangedProc _ANSI_ARGS_((ClientData clientData, int x, int y, int width, int height, int imgWidth, int imgHeight)); static int ImageCoords _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, Tcl_Obj *CONST argv[])); static int ImageToArea _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, double *rectPtr)); static double ImageToPoint _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, double *coordPtr)); static int ImageToPostscript _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass)); static void ComputeImageBbox _ANSI_ARGS_((Tk_Canvas canvas, ImageItem *imgPtr)); static int ConfigureImage _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int argc, Tcl_Obj *CONST argv[], int flags)); static int CreateImage _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas, struct Tk_Item *itemPtr, int argc, Tcl_Obj *CONST argv[])); static void DeleteImage _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, Display *display)); static void DisplayImage _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, Display *display, Drawable dst, int x, int y, int width, int height)); static void ScaleImage _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, double originX, double originY, double scaleX, double scaleY)); static void TranslateImage _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item *itemPtr, double deltaX, double deltaY)); /* * The structures below defines the image item type in terms of * procedures that can be invoked by generic item code. */ Tk_ItemType tkImageType = { "image", /* name */ sizeof(ImageItem), /* itemSize */ CreateImage, /* createProc */ configSpecs, /* configSpecs */ ConfigureImage, /* configureProc */ ImageCoords, /* coordProc */ DeleteImage, /* deleteProc */ DisplayImage, /* displayProc */ TK_CONFIG_OBJS, /* flags */ ImageToPoint, /* pointProc */ ImageToArea, /* areaProc */ ImageToPostscript, /* postscriptProc */ ScaleImage, /* scaleProc */ TranslateImage, /* translateProc */ (Tk_ItemIndexProc *) NULL, /* indexProc */ (Tk_ItemCursorProc *) NULL, /* icursorProc */ (Tk_ItemSelectionProc *) NULL, /* selectionProc */ (Tk_ItemInsertProc *) NULL, /* insertProc */ (Tk_ItemDCharsProc *) NULL, /* dTextProc */ (Tk_ItemType *) NULL, /* nextPtr */ }; /* *-------------------------------------------------------------- * * CreateImage -- * * This procedure is invoked to create a new image * item in a canvas. * * Results: * A standard Tcl return value. If an error occurred in * creating the item, then an error message is left in * the interp's result; in this case itemPtr is left uninitialized, * so it can be safely freed by the caller. * * Side effects: * A new image item is created. * *-------------------------------------------------------------- */ static int CreateImage(interp, canvas, itemPtr, objc, objv) Tcl_Interp *interp; /* Interpreter for error reporting. */ Tk_Canvas canvas; /* Canvas to hold new item. */ Tk_Item *itemPtr; /* Record to hold new item; header * has been initialized by caller. */ int objc; /* Number of arguments in objv. */ Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; int i; if (objc == 0) { panic("canvas did not pass any coords\n"); } /* * Initialize item's record. */ imgPtr->canvas = canvas; imgPtr->anchor = TK_ANCHOR_CENTER; imgPtr->imageString = NULL; imgPtr->activeImageString = NULL; imgPtr->disabledImageString = NULL; imgPtr->image = NULL; imgPtr->activeImage = NULL; imgPtr->disabledImage = NULL; /* * Process the arguments to fill in the item record. * Only 1 (list) or 2 (x y) coords are allowed. */ if (objc == 1) { i = 1; } else { char *arg = Tcl_GetString(objv[1]); i = 2; if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) { i = 1; } } if ((ImageCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) { goto error; } if (ConfigureImage(interp, canvas, itemPtr, objc-i, objv+i, 0) == TCL_OK) { return TCL_OK; } error: DeleteImage(canvas, itemPtr, Tk_Display(Tk_CanvasTkwin(canvas))); return TCL_ERROR; } /* *-------------------------------------------------------------- * * ImageCoords -- * * This procedure is invoked to process the "coords" widget * command on image items. See the user documentation for * details on what it does. * * Results: * Returns TCL_OK or TCL_ERROR, and sets the interp's result. * * Side effects: * The coordinates for the given item may be changed. * *-------------------------------------------------------------- */ static int ImageCoords(interp, canvas, itemPtr, objc, objv) Tcl_Interp *interp; /* Used for error reporting. */ Tk_Canvas canvas; /* Canvas containing item. */ Tk_Item *itemPtr; /* Item whose coordinates are to be * read or modified. */ int objc; /* Number of coordinates supplied in * objv. */ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1, * x2, y2, ... */ { ImageItem *imgPtr = (ImageItem *) itemPtr; if (objc == 0) { Tcl_Obj *obj = Tcl_NewObj(); Tcl_Obj *subobj = Tcl_NewDoubleObj(imgPtr->x); Tcl_ListObjAppendElement(interp, obj, subobj); subobj = Tcl_NewDoubleObj(imgPtr->y); Tcl_ListObjAppendElement(interp, obj, subobj); Tcl_SetObjResult(interp, obj); } else if (objc < 3) { if (objc==1) { if (Tcl_ListObjGetElements(interp, objv[0], &objc, (Tcl_Obj ***) &objv) != TCL_OK) { return TCL_ERROR; } else if (objc != 2) { char buf[64]; sprintf(buf, "wrong # coordinates: expected 2, got %d", objc); Tcl_SetResult(interp, buf, TCL_VOLATILE); return TCL_ERROR; } } if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &imgPtr->x) != TCL_OK) || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1], &imgPtr->y) != TCL_OK)) { return TCL_ERROR; } ComputeImageBbox(canvas, imgPtr); } else { char buf[64]; sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc); Tcl_SetResult(interp, buf, TCL_VOLATILE); return TCL_ERROR; } return TCL_OK; } /* *-------------------------------------------------------------- * * ConfigureImage -- * * This procedure is invoked to configure various aspects * of an image item, such as its anchor position. * * Results: * A standard Tcl result code. If an error occurs, then * an error message is left in the interp's result. * * Side effects: * Configuration information may be set for itemPtr. * *-------------------------------------------------------------- */ static int ConfigureImage(interp, canvas, itemPtr, objc, objv, flags) Tcl_Interp *interp; /* Used for error reporting. */ Tk_Canvas canvas; /* Canvas containing itemPtr. */ Tk_Item *itemPtr; /* Image item to reconfigure. */ int objc; /* Number of elements in objv. */ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */ int flags; /* Flags to pass to Tk_ConfigureWidget. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; Tk_Window tkwin; Tk_Image image; tkwin = Tk_CanvasTkwin(canvas); if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc, (CONST char **) objv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) { return TCL_ERROR; } /* * Create the image. Save the old image around and don't free it * until after the new one is allocated. This keeps the reference * count from going to zero so the image doesn't have to be recreated * if it hasn't changed. */ if (imgPtr->activeImageString != NULL) { itemPtr->redraw_flags |= TK_ITEM_STATE_DEPENDANT; } else { itemPtr->redraw_flags &= ~TK_ITEM_STATE_DEPENDANT; } if (imgPtr->imageString != NULL) { image = Tk_GetImage(interp, tkwin, imgPtr->imageString, ImageChangedProc, (ClientData) imgPtr); if (image == NULL) { return TCL_ERROR; } } else { image = NULL; } if (imgPtr->image != NULL) { Tk_FreeImage(imgPtr->image); } imgPtr->image = image; if (imgPtr->activeImageString != NULL) { image = Tk_GetImage(interp, tkwin, imgPtr->activeImageString, ImageChangedProc, (ClientData) imgPtr); if (image == NULL) { return TCL_ERROR; } } else { image = NULL; } if (imgPtr->activeImage != NULL) { Tk_FreeImage(imgPtr->activeImage); } imgPtr->activeImage = image; if (imgPtr->disabledImageString != NULL) { image = Tk_GetImage(interp, tkwin, imgPtr->disabledImageString, ImageChangedProc, (ClientData) imgPtr); if (image == NULL) { return TCL_ERROR; } } else { image = NULL; } if (imgPtr->disabledImage != NULL) { Tk_FreeImage(imgPtr->disabledImage); } imgPtr->disabledImage = image; ComputeImageBbox(canvas, imgPtr); return TCL_OK; } /* *-------------------------------------------------------------- * * DeleteImage -- * * This procedure is called to clean up the data structure * associated with a image item. * * Results: * None. * * Side effects: * Resources associated with itemPtr are released. * *-------------------------------------------------------------- */ static void DeleteImage(canvas, itemPtr, display) Tk_Canvas canvas; /* Info about overall canvas widget. */ Tk_Item *itemPtr; /* Item that is being deleted. */ Display *display; /* Display containing window for * canvas. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; if (imgPtr->imageString != NULL) { ckfree(imgPtr->imageString); } if (imgPtr->activeImageString != NULL) { ckfree(imgPtr->activeImageString); } if (imgPtr->disabledImageString != NULL) { ckfree(imgPtr->disabledImageString); } if (imgPtr->image != NULL) { Tk_FreeImage(imgPtr->image); } if (imgPtr->activeImage != NULL) { Tk_FreeImage(imgPtr->activeImage); } if (imgPtr->disabledImage != NULL) { Tk_FreeImage(imgPtr->disabledImage); } } /* *-------------------------------------------------------------- * * ComputeImageBbox -- * * This procedure is invoked to compute the bounding box of * all the pixels that may be drawn as part of a image item. * This procedure is where the child image's placement is * computed. * * Results: * None. * * Side effects: * The fields x1, y1, x2, and y2 are updated in the header * for itemPtr. * *-------------------------------------------------------------- */ /* ARGSUSED */ static void ComputeImageBbox(canvas, imgPtr) Tk_Canvas canvas; /* Canvas that contains item. */ ImageItem *imgPtr; /* Item whose bbox is to be * recomputed. */ { int width, height; int x, y; Tk_Image image; Tk_State state = imgPtr->header.state; if(state == TK_STATE_NULL) { state = ((TkCanvas *)canvas)->canvas_state; } image = imgPtr->image; if (((TkCanvas *)canvas)->currentItemPtr == (Tk_Item *)imgPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } } else if (state == TK_STATE_DISABLED) { if (imgPtr->disabledImage != NULL) { image = imgPtr->disabledImage; } } x = (int) (imgPtr->x + ((imgPtr->x >= 0) ? 0.5 : - 0.5)); y = (int) (imgPtr->y + ((imgPtr->y >= 0) ? 0.5 : - 0.5)); if ((state == TK_STATE_HIDDEN) || (image == None)) { imgPtr->header.x1 = imgPtr->header.x2 = x; imgPtr->header.y1 = imgPtr->header.y2 = y; return; } /* * Compute location and size of image, using anchor information. */ Tk_SizeOfImage(image, &width, &height); switch (imgPtr->anchor) { case TK_ANCHOR_N: x -= width/2; break; case TK_ANCHOR_NE: x -= width; break; case TK_ANCHOR_E: x -= width; y -= height/2; break; case TK_ANCHOR_SE: x -= width; y -= height; break; case TK_ANCHOR_S: x -= width/2; y -= height; break; case TK_ANCHOR_SW: y -= height; break; case TK_ANCHOR_W: y -= height/2; break; case TK_ANCHOR_NW: break; case TK_ANCHOR_CENTER: x -= width/2; y -= height/2; break; } /* * Store the information in the item header. */ imgPtr->header.x1 = x; imgPtr->header.y1 = y; imgPtr->header.x2 = x + width; imgPtr->header.y2 = y + height; } /* *-------------------------------------------------------------- * * DisplayImage -- * * This procedure is invoked to draw a image item in a given * drawable. * * Results: * None. * * Side effects: * ItemPtr is drawn in drawable using the transformation * information in canvas. * *-------------------------------------------------------------- */ static void DisplayImage(canvas, itemPtr, display, drawable, x, y, width, height) Tk_Canvas canvas; /* Canvas that contains item. */ Tk_Item *itemPtr; /* Item to be displayed. */ Display *display; /* Display on which to draw item. */ Drawable drawable; /* Pixmap or window in which to draw * item. */ int x, y, width, height; /* Describes region of canvas that * must be redisplayed (not used). */ { ImageItem *imgPtr = (ImageItem *) itemPtr; short drawableX, drawableY; Tk_Image image; Tk_State state = itemPtr->state; if(state == TK_STATE_NULL) { state = ((TkCanvas *)canvas)->canvas_state; } image = imgPtr->image; if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } } else if (state == TK_STATE_DISABLED) { if (imgPtr->disabledImage != NULL) { image = imgPtr->disabledImage; } } if (image == NULL) { return; } /* * Translate the coordinates to those of the image, then redisplay it. */ Tk_CanvasDrawableCoords(canvas, (double) x, (double) y, &drawableX, &drawableY); Tk_RedrawImage(image, x - imgPtr->header.x1, y - imgPtr->header.y1, width, height, drawable, drawableX, drawableY); } /* *-------------------------------------------------------------- * * ImageToPoint -- * * Computes the distance from a given point to a given * rectangle, in canvas units. * * Results: * The return value is 0 if the point whose x and y coordinates * are coordPtr[0] and coordPtr[1] is inside the image. If the * point isn't inside the image then the return value is the * distance from the point to the image. * * Side effects: * None. * *-------------------------------------------------------------- */ static double ImageToPoint(canvas, itemPtr, coordPtr) Tk_Canvas canvas; /* Canvas containing item. */ Tk_Item *itemPtr; /* Item to check against point. */ double *coordPtr; /* Pointer to x and y coordinates. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; double x1, x2, y1, y2, xDiff, yDiff; x1 = imgPtr->header.x1; y1 = imgPtr->header.y1; x2 = imgPtr->header.x2; y2 = imgPtr->header.y2; /* * Point is outside rectangle. */ if (coordPtr[0] < x1) { xDiff = x1 - coordPtr[0]; } else if (coordPtr[0] > x2) { xDiff = coordPtr[0] - x2; } else { xDiff = 0; } if (coordPtr[1] < y1) { yDiff = y1 - coordPtr[1]; } else if (coordPtr[1] > y2) { yDiff = coordPtr[1] - y2; } else { yDiff = 0; } return hypot(xDiff, yDiff); } /* *-------------------------------------------------------------- * * ImageToArea -- * * This procedure is called to determine whether an item * lies entirely inside, entirely outside, or overlapping * a given rectangle. * * Results: * -1 is returned if the item is entirely outside the area * given by rectPtr, 0 if it overlaps, and 1 if it is entirely * inside the given area. * * Side effects: * None. * *-------------------------------------------------------------- */ static int ImageToArea(canvas, itemPtr, rectPtr) Tk_Canvas canvas; /* Canvas containing item. */ Tk_Item *itemPtr; /* Item to check against rectangle. */ double *rectPtr; /* Pointer to array of four coordinates * (x1, y1, x2, y2) describing rectangular * area. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; if ((rectPtr[2] <= imgPtr->header.x1) || (rectPtr[0] >= imgPtr->header.x2) || (rectPtr[3] <= imgPtr->header.y1) || (rectPtr[1] >= imgPtr->header.y2)) { return -1; } if ((rectPtr[0] <= imgPtr->header.x1) && (rectPtr[1] <= imgPtr->header.y1) && (rectPtr[2] >= imgPtr->header.x2) && (rectPtr[3] >= imgPtr->header.y2)) { return 1; } return 0; } /* *-------------------------------------------------------------- * * ImageToPostscript -- * * This procedure is called to generate Postscript for * image items. * * Results: * The return value is a standard Tcl result. If an error * occurs in generating Postscript then an error message is * left in interp->result, replacing whatever used to be there. * If no error occurs, then Postscript for the item is appended * to the result. * * Side effects: * None. * *-------------------------------------------------------------- */ static int ImageToPostscript(interp, canvas, itemPtr, prepass) Tcl_Interp *interp; /* Leave Postscript or error message * here. */ Tk_Canvas canvas; /* Information about overall canvas. */ Tk_Item *itemPtr; /* Item for which Postscript is * wanted. */ int prepass; /* 1 means this is a prepass to * collect font information; 0 means * final Postscript is being created.*/ { ImageItem *imgPtr = (ImageItem *)itemPtr; Tk_Window canvasWin = Tk_CanvasTkwin(canvas); char buffer[256]; double x, y; int width, height; Tk_Image image; Tk_State state = itemPtr->state; if (state == TK_STATE_NULL) { state = ((TkCanvas *)canvas)->canvas_state; } image = imgPtr->image; if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } } else if (state == TK_STATE_DISABLED) { if (imgPtr->disabledImage != NULL) { image = imgPtr->disabledImage; } } if (image == NULL) { /* * Image item without actual image specified. */ return TCL_OK; } Tk_SizeOfImage(image, &width, &height); /* * Compute the coordinates of the lower-left corner of the image, * taking into account the anchor position for the image. */ x = imgPtr->x; y = Tk_CanvasPsY(canvas, imgPtr->y); switch (imgPtr->anchor) { case TK_ANCHOR_NW: y -= height; break; case TK_ANCHOR_N: x -= width/2.0; y -= height; break; case TK_ANCHOR_NE: x -= width; y -= height; break; case TK_ANCHOR_E: x -= width; y -= height/2.0; break; case TK_ANCHOR_SE: x -= width; break; case TK_ANCHOR_S: x -= width/2.0; break; case TK_ANCHOR_SW: break; case TK_ANCHOR_W: y -= height/2.0; break; case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break; } if (!prepass) { sprintf(buffer, "%.15g %.15g", x, y); Tcl_AppendResult(interp, buffer, " translate\n", (char *) NULL); } return Tk_PostscriptImage(image, interp, canvasWin, ((TkCanvas *) canvas)->psInfo, 0, 0, width, height, prepass); } /* *-------------------------------------------------------------- * * ScaleImage -- * * This procedure is invoked to rescale an item. * * Results: * None. * * Side effects: * The item referred to by itemPtr is rescaled so that the * following transformation is applied to all point coordinates: * x' = originX + scaleX*(x-originX) * y' = originY + scaleY*(y-originY) * *-------------------------------------------------------------- */ static void ScaleImage(canvas, itemPtr, originX, originY, scaleX, scaleY) Tk_Canvas canvas; /* Canvas containing rectangle. */ Tk_Item *itemPtr; /* Rectangle to be scaled. */ double originX, originY; /* Origin about which to scale rect. */ double scaleX; /* Amount to scale in X direction. */ double scaleY; /* Amount to scale in Y direction. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; imgPtr->x = originX + scaleX*(imgPtr->x - originX); imgPtr->y = originY + scaleY*(imgPtr->y - originY); ComputeImageBbox(canvas, imgPtr); } /* *-------------------------------------------------------------- * * TranslateImage -- * * This procedure is called to move an item by a given amount. * * Results: * None. * * Side effects: * The position of the item is offset by (xDelta, yDelta), and * the bounding box is updated in the generic part of the item * structure. * *-------------------------------------------------------------- */ static void TranslateImage(canvas, itemPtr, deltaX, deltaY) Tk_Canvas canvas; /* Canvas containing item. */ Tk_Item *itemPtr; /* Item that is being moved. */ double deltaX, deltaY; /* Amount by which item is to be * moved. */ { ImageItem *imgPtr = (ImageItem *) itemPtr; imgPtr->x += deltaX; imgPtr->y += deltaY; ComputeImageBbox(canvas, imgPtr); } /* *---------------------------------------------------------------------- * * ImageChangedProc -- * * This procedure is invoked by the image code whenever the manager * for an image does something that affects the image's size or * how it is displayed. * * Results: * None. * * Side effects: * Arranges for the canvas to get redisplayed. * *---------------------------------------------------------------------- */ static void ImageChangedProc(clientData, x, y, width, height, imgWidth, imgHeight) ClientData clientData; /* Pointer to canvas item for image. */ int x, y; /* Upper left pixel (within image) * that must be redisplayed. */ int width, height; /* Dimensions of area to redisplay * (may be <= 0). */ int imgWidth, imgHeight; /* New dimensions of image. */ { ImageItem *imgPtr = (ImageItem *) clientData; /* * If the image's size changed and it's not anchored at its * northwest corner then just redisplay the entire area of the * image. This is a bit over-conservative, but we need to do * something because a size change also means a position change. */ if (((imgPtr->header.x2 - imgPtr->header.x1) != imgWidth) || ((imgPtr->header.y2 - imgPtr->header.y1) != imgHeight)) { x = y = 0; width = imgWidth; height = imgHeight; Tk_CanvasEventuallyRedraw(imgPtr->canvas, imgPtr->header.x1, imgPtr->header.y1, imgPtr->header.x2, imgPtr->header.y2); } ComputeImageBbox(imgPtr->canvas, imgPtr); Tk_CanvasEventuallyRedraw(imgPtr->canvas, imgPtr->header.x1 + x, imgPtr->header.y1 + y, (int) (imgPtr->header.x1 + x + width), (int) (imgPtr->header.y1 + y + height)); } ='#n136'>136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181
# tk.decls --
#
#	This file contains the declarations for all supported public
#	functions that are exported by the Tk library via the stubs table.
#	This file is used to generate the tkDecls.h, tkPlatDecls.h,
#	tkStub.c, and tkPlatStub.c files.
#
# Copyright (c) 1998-2000 Ajuba Solutions.
# Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: tk.decls,v 1.38.2.1 2010/02/07 23:24:13 nijtmans Exp $

library tk

# Define the tk interface with 3 sub interfaces:
#     tkPlat	 - platform specific public
#     tkInt	 - generic private
#     tkPlatInt - platform specific private

interface tk
hooks {tkPlat tkInt tkIntPlat tkIntXlib}

# Declare each of the functions in the public Tk interface.  Note that
# the an index should never be reused for a different function in order
# to preserve backwards compatibility.

declare 0 generic {
    void Tk_MainLoop(void)
}
declare 1 generic {
    XColor *Tk_3DBorderColor(Tk_3DBorder border)
}
declare 2 generic {
    GC Tk_3DBorderGC(Tk_Window tkwin, Tk_3DBorder border,
	    int which)
}
declare 3 generic {
    void Tk_3DHorizontalBevel(Tk_Window tkwin,
	    Drawable drawable, Tk_3DBorder border, int x,
	    int y, int width, int height, int leftIn,
	    int rightIn, int topBevel, int relief)
}
declare 4 generic {
    void Tk_3DVerticalBevel(Tk_Window tkwin,
	    Drawable drawable, Tk_3DBorder border, int x,
	    int y, int width, int height, int leftBevel,
	    int relief)
}
declare 5 generic {
    void Tk_AddOption(Tk_Window tkwin, CONST char *name,
	    CONST char *value, int priority)
}
declare 6 generic {
    void Tk_BindEvent(Tk_BindingTable bindingTable,
	    XEvent *eventPtr, Tk_Window tkwin, int numObjects,
	    ClientData *objectPtr)
}
declare 7 generic {
    void Tk_CanvasDrawableCoords(Tk_Canvas canvas,
	    double x, double y, short *drawableXPtr,
	    short *drawableYPtr)
}
declare 8 generic {
    void Tk_CanvasEventuallyRedraw(Tk_Canvas canvas, int x1, int y1,
	    int x2, int y2)
}
declare 9 generic {
    int Tk_CanvasGetCoord(Tcl_Interp *interp,
	    Tk_Canvas canvas, CONST char *str, double *doublePtr)
}
declare 10 generic {
    Tk_CanvasTextInfo *Tk_CanvasGetTextInfo(Tk_Canvas canvas)
}
declare 11 generic {
    int Tk_CanvasPsBitmap(Tcl_Interp *interp,
	    Tk_Canvas canvas, Pixmap bitmap, int x, int y,
	    int width, int height)
}
declare 12 generic {
    int Tk_CanvasPsColor(Tcl_Interp *interp,
	    Tk_Canvas canvas, XColor *colorPtr)
}
declare 13 generic {
    int Tk_CanvasPsFont(Tcl_Interp *interp,
	    Tk_Canvas canvas, Tk_Font font)
}
declare 14 generic {
    void Tk_CanvasPsPath(Tcl_Interp *interp,
	    Tk_Canvas canvas, double *coordPtr, int numPoints)
}
declare 15 generic {
    int Tk_CanvasPsStipple(Tcl_Interp *interp,
	    Tk_Canvas canvas, Pixmap bitmap)
}
declare 16 generic {
    double Tk_CanvasPsY(Tk_Canvas canvas, double y)
}
declare 17 generic {
    void Tk_CanvasSetStippleOrigin(Tk_Canvas canvas, GC gc)
}
declare 18 generic {
    int Tk_CanvasTagsParseProc(ClientData clientData, Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
}
declare 19 generic {
    char *Tk_CanvasTagsPrintProc(ClientData clientData, Tk_Window tkwin,
	    char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
declare 20 generic {
    Tk_Window	Tk_CanvasTkwin(Tk_Canvas canvas)
}
declare 21 generic {
    void Tk_CanvasWindowCoords(Tk_Canvas canvas, double x, double y,
	    short *screenXPtr, short *screenYPtr)
}
declare 22 generic {
    void Tk_ChangeWindowAttributes(Tk_Window tkwin, unsigned long valueMask,
	    XSetWindowAttributes *attsPtr)
}
declare 23 generic {
    int Tk_CharBbox(Tk_TextLayout layout, int index, int *xPtr,
	    int *yPtr, int *widthPtr, int *heightPtr)
}
declare 24 generic {
    void Tk_ClearSelection(Tk_Window tkwin, Atom selection)
}
declare 25 generic {
    int Tk_ClipboardAppend(Tcl_Interp *interp, Tk_Window tkwin,
	    Atom target, Atom format, char *buffer)
}
declare 26 generic {
    int Tk_ClipboardClear(Tcl_Interp *interp, Tk_Window tkwin)
}
declare 27 generic {
    int Tk_ConfigureInfo(Tcl_Interp *interp,
	    Tk_Window tkwin, Tk_ConfigSpec *specs,
	    char *widgRec, CONST char *argvName, int flags)
}
declare 28 generic {
    int Tk_ConfigureValue(Tcl_Interp *interp,
	    Tk_Window tkwin, Tk_ConfigSpec *specs,
	    char *widgRec, CONST char *argvName, int flags)
}
declare 29 generic {
    int Tk_ConfigureWidget(Tcl_Interp *interp,
	    Tk_Window tkwin, Tk_ConfigSpec *specs,
	    int argc, CONST84 char **argv, char *widgRec,
	    int flags)
}
declare 30 generic {
    void Tk_ConfigureWindow(Tk_Window tkwin,
	    unsigned int valueMask, XWindowChanges *valuePtr)
}
declare 31 generic {
    Tk_TextLayout Tk_ComputeTextLayout(Tk_Font font,
	    CONST char *str, int numChars, int wrapLength,
	    Tk_Justify justify, int flags, int *widthPtr,
	    int *heightPtr)
}
declare 32 generic {
    Tk_Window Tk_CoordsToWindow(int rootX, int rootY, Tk_Window tkwin)
}
declare 33 generic {
    unsigned long Tk_CreateBinding(Tcl_Interp *interp,
	    Tk_BindingTable bindingTable, ClientData object,
	    CONST char *eventStr, CONST char *command, int append)
}
declare 34 generic {
    Tk_BindingTable Tk_CreateBindingTable(Tcl_Interp *interp)
}
declare 35 generic {
    Tk_ErrorHandler Tk_CreateErrorHandler(Display *display,
	    int errNum, int request, int minorCode,
	    Tk_ErrorProc *errorProc, ClientData clientData)
}
declare 36 generic {
    void Tk_CreateEventHandler(Tk_Window token,
	    unsigned long mask, Tk_EventProc *proc,
	    ClientData clientData)
}
declare 37 generic {
    void Tk_CreateGenericHandler(Tk_GenericProc *proc, ClientData clientData)
}
declare 38 generic {
    void Tk_CreateImageType(Tk_ImageType *typePtr)
}
declare 39 generic {
    void Tk_CreateItemType(Tk_ItemType *typePtr)
}
declare 40 generic {
    void Tk_CreatePhotoImageFormat(Tk_PhotoImageFormat *formatPtr)
}
declare 41 generic {
    void Tk_CreateSelHandler(Tk_Window tkwin,
	    Atom selection, Atom target,
	    Tk_SelectionProc *proc, ClientData clientData,
	    Atom format)
}
declare 42 generic {
    Tk_Window Tk_CreateWindow(Tcl_Interp *interp,
	    Tk_Window parent, CONST char *name, CONST char *screenName)
}
declare 43 generic {
    Tk_Window Tk_CreateWindowFromPath(Tcl_Interp *interp, Tk_Window tkwin,
	    CONST char *pathName, CONST char *screenName)
}
declare 44 generic {
    int Tk_DefineBitmap(Tcl_Interp *interp, CONST char *name,
	    CONST char *source, int width, int height)
}
declare 45 generic {
    void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor)
}
declare 46 generic {
    void Tk_DeleteAllBindings(Tk_BindingTable bindingTable, ClientData object)
}
declare 47 generic {
    int Tk_DeleteBinding(Tcl_Interp *interp,
	    Tk_BindingTable bindingTable, ClientData object,
	    CONST char *eventStr)
}
declare 48 generic {
    void Tk_DeleteBindingTable(Tk_BindingTable bindingTable)
}
declare 49 generic {
    void Tk_DeleteErrorHandler(Tk_ErrorHandler handler)
}
declare 50 generic {
    void Tk_DeleteEventHandler(Tk_Window token,
	    unsigned long mask, Tk_EventProc *proc,
	    ClientData clientData)
}
declare 51 generic {
    void Tk_DeleteGenericHandler(Tk_GenericProc *proc, ClientData clientData)
}
declare 52 generic {
    void Tk_DeleteImage(Tcl_Interp *interp, CONST char *name)
}
declare 53 generic {
    void Tk_DeleteSelHandler(Tk_Window tkwin, Atom selection, Atom target)
}
declare 54 generic {
    void Tk_DestroyWindow(Tk_Window tkwin)
}
declare 55 generic {
    CONST84_RETURN char *Tk_DisplayName(Tk_Window tkwin)
}
declare 56 generic {
    int Tk_DistanceToTextLayout(Tk_TextLayout layout, int x, int y)
}
declare 57 generic {
    void Tk_Draw3DPolygon(Tk_Window tkwin,
	    Drawable drawable, Tk_3DBorder border,
	    XPoint *pointPtr, int numPoints, int borderWidth,
	    int leftRelief)
}
declare 58 generic {
    void Tk_Draw3DRectangle(Tk_Window tkwin, Drawable drawable,
	    Tk_3DBorder border, int x, int y, int width, int height,
	    int borderWidth, int relief)
}
declare 59 generic {
    void Tk_DrawChars(Display *display, Drawable drawable, GC gc,
	    Tk_Font tkfont, CONST char *source, int numBytes, int x, int y)
}
declare 60 generic {
    void Tk_DrawFocusHighlight(Tk_Window tkwin, GC gc, int width,
	    Drawable drawable)
}
declare 61 generic {
    void Tk_DrawTextLayout(Display *display,
	    Drawable drawable, GC gc, Tk_TextLayout layout,
	    int x, int y, int firstChar, int lastChar)
}
declare 62 generic {
    void Tk_Fill3DPolygon(Tk_Window tkwin,
	    Drawable drawable, Tk_3DBorder border,
	    XPoint *pointPtr, int numPoints, int borderWidth,
	    int leftRelief)
}
declare 63 generic {
    void Tk_Fill3DRectangle(Tk_Window tkwin,
	    Drawable drawable, Tk_3DBorder border, int x,
	    int y, int width, int height, int borderWidth,
	    int relief)
}
declare 64 generic {
    Tk_PhotoHandle Tk_FindPhoto(Tcl_Interp *interp, CONST char *imageName)
}
declare 65 generic {
    Font Tk_FontId(Tk_Font font)
}
declare 66 generic {
    void Tk_Free3DBorder(Tk_3DBorder border)
}
declare 67 generic {
    void Tk_FreeBitmap(Display *display, Pixmap bitmap)
}
declare 68 generic {
    void Tk_FreeColor(XColor *colorPtr)
}
declare 69 generic {
    void Tk_FreeColormap(Display *display, Colormap colormap)
}
declare 70 generic {
    void Tk_FreeCursor(Display *display, Tk_Cursor cursor)
}
declare 71 generic {
    void Tk_FreeFont(Tk_Font f)
}
declare 72 generic {
    void Tk_FreeGC(Display *display, GC gc)
}
declare 73 generic {
    void Tk_FreeImage(Tk_Image image)
}
declare 74 generic {
    void Tk_FreeOptions(Tk_ConfigSpec *specs,
	    char *widgRec, Display *display, int needFlags)
}
declare 75 generic {
    void Tk_FreePixmap(Display *display, Pixmap pixmap)
}
declare 76 generic {
    void Tk_FreeTextLayout(Tk_TextLayout textLayout)
}
declare 77 generic {
    void Tk_FreeXId(Display *display, XID xid)
}
declare 78 generic {
    GC Tk_GCForColor(XColor *colorPtr, Drawable drawable)
}
declare 79 generic {
    void Tk_GeometryRequest(Tk_Window tkwin, int reqWidth,  int reqHeight)
}
declare 80 generic {
    Tk_3DBorder	Tk_Get3DBorder(Tcl_Interp *interp, Tk_Window tkwin,
	    Tk_Uid colorName)
}
declare 81 generic {
    void Tk_GetAllBindings(Tcl_Interp *interp,
	    Tk_BindingTable bindingTable, ClientData object)
}
declare 82 generic {
    int Tk_GetAnchor(Tcl_Interp *interp,
	    CONST char *str, Tk_Anchor *anchorPtr)
}
declare 83 generic {
    CONST84_RETURN char *Tk_GetAtomName(Tk_Window tkwin, Atom atom)
}
declare 84 generic {
    CONST84_RETURN char *Tk_GetBinding(Tcl_Interp *interp,
	    Tk_BindingTable bindingTable, ClientData object,
	    CONST char *eventStr)
}
declare 85 generic {
    Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, CONST char *str)
}
declare 86 generic {
    Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *source, int width, int height)
}
declare 87 generic {
    int Tk_GetCapStyle(Tcl_Interp *interp, CONST char *str, int *capPtr)
}
declare 88 generic {
    XColor *Tk_GetColor(Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name)
}
declare 89 generic {
    XColor *Tk_GetColorByValue(Tk_Window tkwin, XColor *colorPtr)
}
declare 90 generic {
    Colormap Tk_GetColormap(Tcl_Interp *interp, Tk_Window tkwin,
	    CONST char *str)
}
declare 91 generic {
    Tk_Cursor Tk_GetCursor(Tcl_Interp *interp, Tk_Window tkwin,
	    Tk_Uid str)
}
declare 92 generic {
    Tk_Cursor Tk_GetCursorFromData(Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *source, CONST char *mask,
	    int width, int height, int xHot, int yHot,
	    Tk_Uid fg, Tk_Uid bg)
}
declare 93 generic {
    Tk_Font Tk_GetFont(Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *str)
}
declare 94 generic {
    Tk_Font Tk_GetFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 95 generic {
    void Tk_GetFontMetrics(Tk_Font font, Tk_FontMetrics *fmPtr)
}
declare 96 generic {
    GC Tk_GetGC(Tk_Window tkwin, unsigned long valueMask, XGCValues *valuePtr)
}
declare 97 generic {
    Tk_Image Tk_GetImage(Tcl_Interp *interp, Tk_Window tkwin, CONST char *name,
	    Tk_ImageChangedProc *changeProc, ClientData clientData)
}
declare 98 generic {
    ClientData Tk_GetImageMasterData(Tcl_Interp *interp,
	    CONST char *name, Tk_ImageType **typePtrPtr)
}
declare 99 generic {
    Tk_ItemType *Tk_GetItemTypes(void)
}
declare 100 generic {
    int Tk_GetJoinStyle(Tcl_Interp *interp, CONST char *str, int *joinPtr)
}
declare 101 generic {
    int Tk_GetJustify(Tcl_Interp *interp,
	    CONST char *str, Tk_Justify *justifyPtr)
}
declare 102 generic {
    int Tk_GetNumMainWindows(void)
}
declare 103 generic {
    Tk_Uid Tk_GetOption(Tk_Window tkwin, CONST char *name,
	    CONST char *className)
}
declare 104 generic {
    int Tk_GetPixels(Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *str, int *intPtr)
}
declare 105 generic {
    Pixmap Tk_GetPixmap(Display *display, Drawable d,
	    int width, int height, int depth)
}
declare 106 generic {
    int Tk_GetRelief(Tcl_Interp *interp, CONST char *name, int *reliefPtr)
}
declare 107 generic {
    void Tk_GetRootCoords(Tk_Window tkwin, int *xPtr, int *yPtr)
}
declare 108 generic {
    int Tk_GetScrollInfo(Tcl_Interp *interp,
	    int argc, CONST84 char **argv, double *dblPtr, int *intPtr)
}
declare 109 generic {
    int Tk_GetScreenMM(Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *str, double *doublePtr)
}
declare 110 generic {
    int Tk_GetSelection(Tcl_Interp *interp,
	    Tk_Window tkwin, Atom selection, Atom target,
	    Tk_GetSelProc *proc, ClientData clientData)
}
declare 111 generic {
    Tk_Uid Tk_GetUid(CONST char *str)
}
declare 112 generic {
    Visual *Tk_GetVisual(Tcl_Interp *interp,
	    Tk_Window tkwin, CONST char *str, int *depthPtr,
	    Colormap *colormapPtr)
}
declare 113 generic {
    void Tk_GetVRootGeometry(Tk_Window tkwin,
	    int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)
}
declare 114 generic {
    int Tk_Grab(Tcl_Interp *interp, Tk_Window tkwin, int grabGlobal)
}
declare 115 generic {
    void Tk_HandleEvent(XEvent *eventPtr)
}
declare 116 generic {
    Tk_Window Tk_IdToWindow(Display *display, Window window)
}
declare 117 generic {
    void Tk_ImageChanged(Tk_ImageMaster master, int x, int y,
	    int width, int height, int imageWidth, int imageHeight)
}
declare 118 generic {
    int Tk_Init(Tcl_Interp *interp)
}
declare 119 generic {
    Atom Tk_InternAtom(Tk_Window tkwin, CONST char *name)
}
declare 120 generic {
    int Tk_IntersectTextLayout(Tk_TextLayout layout, int x, int y,
	    int width, int height)
}
declare 121 generic {
    void Tk_MaintainGeometry(Tk_Window slave,
	    Tk_Window master, int x, int y, int width, int height)
}
declare 122 generic {
    Tk_Window Tk_MainWindow(Tcl_Interp *interp)
}
declare 123 generic {
    void Tk_MakeWindowExist(Tk_Window tkwin)
}
declare 124 generic {
    void Tk_ManageGeometry(Tk_Window tkwin,
	    CONST Tk_GeomMgr *mgrPtr, ClientData clientData)
}
declare 125 generic {
    void Tk_MapWindow(Tk_Window tkwin)
}
declare 126 generic {
    int Tk_MeasureChars(Tk_Font tkfont,
	    CONST char *source, int numBytes, int maxPixels,
	    int flags, int *lengthPtr)
}
declare 127 generic {
    void Tk_MoveResizeWindow(Tk_Window tkwin,
	    int x, int y, int width, int height)
}
declare 128 generic {
    void Tk_MoveWindow(Tk_Window tkwin, int x, int y)
}
declare 129 generic {
    void Tk_MoveToplevelWindow(Tk_Window tkwin, int x, int y)
}
declare 130 generic {
    CONST84_RETURN char *Tk_NameOf3DBorder(Tk_3DBorder border)
}
declare 131 generic {
    CONST84_RETURN char *Tk_NameOfAnchor(Tk_Anchor anchor)
}
declare 132 generic {
    CONST84_RETURN char *Tk_NameOfBitmap(Display *display, Pixmap bitmap)
}
declare 133 generic {
    CONST84_RETURN char *Tk_NameOfCapStyle(int cap)
}
declare 134 generic {
    CONST84_RETURN char *Tk_NameOfColor(XColor *colorPtr)
}
declare 135 generic {
    CONST84_RETURN char *Tk_NameOfCursor(Display *display, Tk_Cursor cursor)
}
declare 136 generic {
    CONST84_RETURN char *Tk_NameOfFont(Tk_Font font)
}
declare 137 generic {
    CONST84_RETURN char *Tk_NameOfImage(Tk_ImageMaster imageMaster)
}
declare 138 generic {
    CONST84_RETURN char *Tk_NameOfJoinStyle(int join)
}
declare 139 generic {
    CONST84_RETURN char *Tk_NameOfJustify(Tk_Justify justify)
}
declare 140 generic {
    CONST84_RETURN char *Tk_NameOfRelief(int relief)
}
declare 141 generic {
    Tk_Window Tk_NameToWindow(Tcl_Interp *interp,
	    CONST char *pathName, Tk_Window tkwin)
}
declare 142 generic {
    void Tk_OwnSelection(Tk_Window tkwin,
	    Atom selection, Tk_LostSelProc *proc,
	    ClientData clientData)
}
declare 143 generic {
    int Tk_ParseArgv(Tcl_Interp *interp,
	    Tk_Window tkwin, int *argcPtr, CONST84 char **argv,
	    Tk_ArgvInfo *argTable, int flags)
}
declare 144 generic {
    void Tk_PhotoPutBlock_NoComposite(Tk_PhotoHandle handle,
	    Tk_PhotoImageBlock *blockPtr, int x, int y,
	    int width, int height)
}
declare 145 generic {
    void Tk_PhotoPutZoomedBlock_NoComposite(Tk_PhotoHandle handle,
	    Tk_PhotoImageBlock *blockPtr, int x, int y,
	    int width, int height, int zoomX, int zoomY,
	    int subsampleX, int subsampleY)
}
declare 146 generic {
    int Tk_PhotoGetImage(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr)
}
declare 147 generic {
    void Tk_PhotoBlank(Tk_PhotoHandle handle)
}
declare 148 generic {
    void Tk_PhotoExpand_Panic(Tk_PhotoHandle handle, int width, int height )
}
declare 149 generic {
    void Tk_PhotoGetSize(Tk_PhotoHandle handle, int *widthPtr, int *heightPtr)
}
declare 150 generic {
    void Tk_PhotoSetSize_Panic(Tk_PhotoHandle handle, int width, int height)
}
declare 151 generic {
    int Tk_PointToChar(Tk_TextLayout layout, int x, int y)
}
declare 152 generic {
    int Tk_PostscriptFontName(Tk_Font tkfont, Tcl_DString *dsPtr)
}
declare 153 generic {
    void Tk_PreserveColormap(Display *display, Colormap colormap)
}
declare 154 generic {
    void Tk_QueueWindowEvent(XEvent *eventPtr, Tcl_QueuePosition position)
}
declare 155 generic {
    void Tk_RedrawImage(Tk_Image image, int imageX,
	    int imageY, int width, int height,
	    Drawable drawable, int drawableX, int drawableY)
}
declare 156 generic {
    void Tk_ResizeWindow(Tk_Window tkwin, int width, int height)
}
declare 157 generic {
    int Tk_RestackWindow(Tk_Window tkwin, int aboveBelow, Tk_Window other)
}
declare 158 generic {
    Tk_RestrictProc *Tk_RestrictEvents(Tk_RestrictProc *proc,
	    ClientData arg, ClientData *prevArgPtr)
}
declare 159 generic {
    int Tk_SafeInit(Tcl_Interp *interp)
}
declare 160 generic {
    CONST char *Tk_SetAppName(Tk_Window tkwin, CONST char *name)
}
declare 161 generic {
    void Tk_SetBackgroundFromBorder(Tk_Window tkwin, Tk_3DBorder border)
}
declare 162 generic {
    void Tk_SetClass(Tk_Window tkwin, CONST char *className)
}
declare 163 generic {
    void Tk_SetGrid(Tk_Window tkwin, int reqWidth, int reqHeight,
	    int gridWidth, int gridHeight)
}
declare 164 generic {
    void Tk_SetInternalBorder(Tk_Window tkwin, int width)
}
declare 165 generic {
    void Tk_SetWindowBackground(Tk_Window tkwin, unsigned long pixel)
}
declare 166 generic {
    void Tk_SetWindowBackgroundPixmap(Tk_Window tkwin, Pixmap pixmap)
}
declare 167 generic {
    void Tk_SetWindowBorder(Tk_Window tkwin, unsigned long pixel)
}
declare 168 generic {
    void Tk_SetWindowBorderWidth(Tk_Window tkwin, int width)
}
declare 169 generic {
    void Tk_SetWindowBorderPixmap(Tk_Window tkwin, Pixmap pixmap)
}
declare 170 generic {
    void Tk_SetWindowColormap(Tk_Window tkwin, Colormap colormap)
}
declare 171 generic {
    int Tk_SetWindowVisual(Tk_Window tkwin, Visual *visual, int depth,
	    Colormap colormap)
}
declare 172 generic {
    void Tk_SizeOfBitmap(Display *display, Pixmap bitmap, int *widthPtr,
	    int *heightPtr)
}
declare 173 generic {
    void Tk_SizeOfImage(Tk_Image image, int *widthPtr, int *heightPtr)
}
declare 174 generic {
    int Tk_StrictMotif(Tk_Window tkwin)
}
declare 175 generic {
    void Tk_TextLayoutToPostscript(Tcl_Interp *interp, Tk_TextLayout layout)
}
declare 176 generic {
    int Tk_TextWidth(Tk_Font font, CONST char *str, int numBytes)
}
declare 177 generic {
    void Tk_UndefineCursor(Tk_Window window)
}
declare 178 generic {
    void Tk_UnderlineChars(Display *display,
	    Drawable drawable, GC gc, Tk_Font tkfont,
	    CONST char *source, int x, int y, int firstByte,
	    int lastByte)
}
declare 179 generic {
    void Tk_UnderlineTextLayout(Display *display, Drawable drawable, GC gc,
	    Tk_TextLayout layout, int x, int y,
	    int underline)
}
declare 180 generic {
    void Tk_Ungrab(Tk_Window tkwin)
}
declare 181 generic {
    void Tk_UnmaintainGeometry(Tk_Window slave, Tk_Window master)
}
declare 182 generic {
    void Tk_UnmapWindow(Tk_Window tkwin)
}
declare 183 generic {
    void Tk_UnsetGrid(Tk_Window tkwin)
}
declare 184 generic {
    void Tk_UpdatePointer(Tk_Window tkwin, int x, int y, int state)
}

# new functions for 8.1

declare 185 generic {
    Pixmap  Tk_AllocBitmapFromObj(Tcl_Interp *interp, Tk_Window tkwin,
    Tcl_Obj *objPtr)
}
declare 186 generic {
    Tk_3DBorder Tk_Alloc3DBorderFromObj(Tcl_Interp *interp, Tk_Window tkwin,
	    Tcl_Obj *objPtr)
}
declare 187 generic {
    XColor *Tk_AllocColorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
	    Tcl_Obj *objPtr)
}
declare 188 generic {
    Tk_Cursor Tk_AllocCursorFromObj(Tcl_Interp *interp, Tk_Window tkwin,
	    Tcl_Obj *objPtr)
}
declare 189 generic {
    Tk_Font  Tk_AllocFontFromObj(Tcl_Interp *interp, Tk_Window tkwin,
	    Tcl_Obj *objPtr)

}
declare 190 generic {
    Tk_OptionTable Tk_CreateOptionTable(Tcl_Interp *interp,
	    CONST Tk_OptionSpec *templatePtr)
}
declare 191 generic {
    void  Tk_DeleteOptionTable(Tk_OptionTable optionTable)
}
declare 192 generic {
    void  Tk_Free3DBorderFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 193 generic {
    void  Tk_FreeBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 194 generic {
    void  Tk_FreeColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 195 generic {
    void  Tk_FreeConfigOptions(char *recordPtr, Tk_OptionTable optionToken,
	    Tk_Window tkwin)

}
declare 196 generic {
    void  Tk_FreeSavedOptions(Tk_SavedOptions *savePtr)
}
declare 197 generic {
    void  Tk_FreeCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 198 generic {
    void  Tk_FreeFontFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 199 generic {
    Tk_3DBorder Tk_Get3DBorderFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 200 generic {
    int	 Tk_GetAnchorFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr,
	    Tk_Anchor *anchorPtr)
}
declare 201 generic {
    Pixmap  Tk_GetBitmapFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 202 generic {
    XColor *Tk_GetColorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 203 generic {
    Tk_Cursor Tk_GetCursorFromObj(Tk_Window tkwin, Tcl_Obj *objPtr)
}
declare 204 generic {
    Tcl_Obj *Tk_GetOptionInfo(Tcl_Interp *interp,
	    char *recordPtr, Tk_OptionTable optionTable,
	    Tcl_Obj *namePtr, Tk_Window tkwin)
}
declare 205 generic {
    Tcl_Obj *Tk_GetOptionValue(Tcl_Interp *interp, char *recordPtr,
	    Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin)
}
declare 206 generic {
    int	 Tk_GetJustifyFromObj(Tcl_Interp *interp,
	    Tcl_Obj *objPtr, Tk_Justify *justifyPtr)
}
declare 207 generic {
    int	 Tk_GetMMFromObj(Tcl_Interp *interp,
	    Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr)
}
declare 208 generic {
    int	 Tk_GetPixelsFromObj(Tcl_Interp *interp,
	    Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr)
}
declare 209 generic {
    int	 Tk_GetReliefFromObj(Tcl_Interp *interp,
	    Tcl_Obj *objPtr, int *resultPtr)
}
declare 210 generic {
    int	 Tk_GetScrollInfoObj(Tcl_Interp *interp,
	    int objc, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr)
}
declare 211 generic {
    int	 Tk_InitOptions(Tcl_Interp *interp, char *recordPtr,
	    Tk_OptionTable optionToken, Tk_Window tkwin)
}
declare 212 generic {
    void  Tk_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc,
	    Tcl_Interp *interp)
}
declare 213 generic {
    void  Tk_RestoreSavedOptions(Tk_SavedOptions *savePtr)
}
declare 214 generic {
    int	 Tk_SetOptions(Tcl_Interp *interp, char *recordPtr,
	    Tk_OptionTable optionTable, int objc,
	    Tcl_Obj *CONST objv[], Tk_Window tkwin,
	    Tk_SavedOptions *savePtr, int *maskPtr)
}
declare 215 generic {
    void Tk_InitConsoleChannels(Tcl_Interp *interp)
}
declare 216 generic {
    int Tk_CreateConsoleWindow(Tcl_Interp *interp)
}
declare 217 generic {
    void Tk_CreateSmoothMethod(Tcl_Interp *interp, Tk_SmoothMethod *method)
}

#declare 218 generic {
#    void Tk_CreateCanvasVisitor(Tcl_Interp *interp, VOID *typePtr)
#}

#declare 219 generic {
#    VOID *Tk_GetCanvasVisitor(Tcl_Interp *interp, CONST char *name)
#}

declare 220 generic {
    int Tk_GetDash(Tcl_Interp *interp, CONST char *value, Tk_Dash *dash)
}
declare 221 generic {
    void Tk_CreateOutline(Tk_Outline *outline)
}
declare 222 generic {
    void Tk_DeleteOutline(Display *display, Tk_Outline *outline)
}
declare 223 generic {
    int Tk_ConfigOutlineGC(XGCValues *gcValues, Tk_Canvas canvas,
	    Tk_Item *item, Tk_Outline *outline)
}
declare 224 generic {
    int Tk_ChangeOutlineGC(Tk_Canvas canvas, Tk_Item *item,
	    Tk_Outline *outline)
}
declare 225 generic {
    int Tk_ResetOutlineGC(Tk_Canvas canvas, Tk_Item *item,
	    Tk_Outline *outline)
}
declare 226 generic {
    int Tk_CanvasPsOutline(Tk_Canvas canvas, Tk_Item *item,
	    Tk_Outline *outline)
}
declare 227 generic {
    void Tk_SetTSOrigin(Tk_Window tkwin, GC gc, int x, int y)
}
declare 228 generic {
    int Tk_CanvasGetCoordFromObj(Tcl_Interp *interp, Tk_Canvas canvas,
	    Tcl_Obj *obj, double *doublePtr)
}
declare 229 generic {
    void Tk_CanvasSetOffset(Tk_Canvas canvas, GC gc, Tk_TSOffset *offset)
}
declare 230 generic {
    void Tk_DitherPhoto(Tk_PhotoHandle handle, int x, int y, int width,
	    int height)
}
declare 231 generic {
    int Tk_PostscriptBitmap(Tcl_Interp *interp, Tk_Window tkwin,
	    Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX,
	    int startY, int width, int height)
}
declare 232 generic {
    int Tk_PostscriptColor(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
	    XColor *colorPtr)
}
declare 233 generic {
    int Tk_PostscriptFont(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
	    Tk_Font font)
}
declare 234 generic {
    int Tk_PostscriptImage(Tk_Image image, Tcl_Interp *interp,
	    Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y,
	    int width, int height, int prepass)
}
declare 235 generic {
    void Tk_PostscriptPath(Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
	    double *coordPtr, int numPoints)
}
declare 236 generic {
    int Tk_PostscriptStipple(Tcl_Interp *interp, Tk_Window tkwin,
	    Tk_PostscriptInfo psInfo, Pixmap bitmap)
}
declare 237 generic {
    double Tk_PostscriptY(double y, Tk_PostscriptInfo psInfo)
}
declare 238 generic {
    int	Tk_PostscriptPhoto(Tcl_Interp *interp,
	    Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo,
	    int width, int height)
}

# New in 8.4a1
#
declare 239 generic {
    void Tk_CreateClientMessageHandler(Tk_ClientMessageProc *proc)
}
declare 240 generic {
    void Tk_DeleteClientMessageHandler(Tk_ClientMessageProc *proc)
}

# New in 8.4a2
#
declare 241 generic {
    Tk_Window Tk_CreateAnonymousWindow(Tcl_Interp *interp,
	    Tk_Window parent, CONST char *screenName)
}
declare 242 generic {
    void Tk_SetClassProcs(Tk_Window tkwin,
	    Tk_ClassProcs *procs, ClientData instanceData)
}

# New in 8.4a4
#
declare 243 generic {
    void Tk_SetInternalBorderEx(Tk_Window tkwin, int left, int right,
	    int top, int bottom)
}
declare 244 generic {
    void Tk_SetMinimumRequestSize(Tk_Window tkwin,
	    int minWidth, int minHeight)
}

# New in 8.4a5
#
declare 245 generic {
    void Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height)
}
declare 246 generic {
    void Tk_PhotoPutBlock_Panic(Tk_PhotoHandle handle,
	    Tk_PhotoImageBlock *blockPtr, int x, int y,
	    int width, int height, int compRule)
}
declare 247 generic {
    void Tk_PhotoPutZoomedBlock_Panic(Tk_PhotoHandle handle,
	    Tk_PhotoImageBlock *blockPtr, int x, int y,
	    int width, int height, int zoomX, int zoomY,
	    int subsampleX, int subsampleY, int compRule)
}
declare 248 generic {
    int Tk_CollapseMotionEvents(Display *display, int collapse)
}

# Style engine
declare 249 generic {
    Tk_StyleEngine Tk_RegisterStyleEngine(CONST char *name,
	    Tk_StyleEngine parent)
}
declare 250 generic {
    Tk_StyleEngine Tk_GetStyleEngine(CONST char *name)
}
declare 251 generic {
    int Tk_RegisterStyledElement(Tk_StyleEngine engine,
	    Tk_ElementSpec *templatePtr)
}
declare 252 generic {
    int Tk_GetElementId(CONST char *name)
}
declare 253 generic {
    Tk_Style Tk_CreateStyle(CONST char *name, Tk_StyleEngine engine,
	    ClientData clientData)
}
declare 254 generic {
    Tk_Style Tk_GetStyle(Tcl_Interp *interp, CONST char *name)
}
declare 255 generic {
    void Tk_FreeStyle(Tk_Style style)
}
declare 256 generic {
    CONST char *Tk_NameOfStyle(Tk_Style style)
}
declare 257 generic {
    Tk_Style  Tk_AllocStyleFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr)
}
declare 258 generic {
    Tk_Style Tk_GetStyleFromObj(Tcl_Obj *objPtr)
}
declare 259 generic {
    void  Tk_FreeStyleFromObj(Tcl_Obj *objPtr)
}
declare 260 generic {
    Tk_StyledElement Tk_GetStyledElement(Tk_Style style, int elementId,
	Tk_OptionTable optionTable)
}
declare 261 generic {
    void Tk_GetElementSize(Tk_Style style, Tk_StyledElement element,
	    char *recordPtr, Tk_Window tkwin, int width, int height,
	    int inner, int *widthPtr, int *heightPtr)
}
declare 262 generic {
    void Tk_GetElementBox(Tk_Style style, Tk_StyledElement element,
	    char *recordPtr, Tk_Window tkwin, int x, int y, int width,
	    int height, int inner, int *xPtr, int *yPtr, int *widthPtr,
	    int *heightPtr)
}
declare 263 generic {
    int Tk_GetElementBorderWidth(Tk_Style style, Tk_StyledElement element,
	    char *recordPtr, Tk_Window tkwin)
}
declare 264 generic {
    void Tk_DrawElement(Tk_Style style, Tk_StyledElement element,
	    char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y,
	    int width, int height, int state)
}

# TIP#116
declare 265 generic {
    int Tk_PhotoExpand(Tcl_Interp *interp, Tk_PhotoHandle handle,
	    int width, int height)
}
declare 266 generic {
    int Tk_PhotoPutBlock(Tcl_Interp *interp, Tk_PhotoHandle handle,
	    Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height,
	    int compRule)
}
declare 267 generic {
    int Tk_PhotoPutZoomedBlock(Tcl_Interp *interp, Tk_PhotoHandle handle,
	    Tk_PhotoImageBlock *blockPtr, int x, int y, int width, int height,
	    int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule)
}
declare 268 generic {
    int Tk_PhotoSetSize(Tcl_Interp *interp, Tk_PhotoHandle handle,
	    int width, int height)
}
# TIP#245
declare 269 generic {
    long Tk_GetUserInactiveTime(Display *dpy)
}
declare 270 generic {
    void Tk_ResetUserInactiveTime(Display *dpy)
}

# TIP #264
declare 271 generic {
    Tcl_Interp *Tk_Interp(Tk_Window tkwin)
}

# Now that the Tk 8.2 -> 8.3 transition is long past, use more conventional
# means to continue support for extensions using the USE_OLD_IMAGE to
# continue use of their string-based Tcl_ImageTypes and Tcl_PhotoImageFormats.
#
# Note that this restores the usual rules for stub compatibility.  Stub-enabled
# extensions compiled against 8.5 headers and linked to the 8.5 stub library
# will produce a file [load]able into an interp with Tk 8.X, for X >= 5.
# It will *not* be [load]able into interps with Tk 8.4 (or Tk 8.2!).
# Developers who need to produce a file [load]able into legacy interps must
# build against legacy sources.
declare 272 generic {
    void Tk_CreateOldImageType(Tk_ImageType *typePtr)
}
declare 273 generic {
    void Tk_CreateOldPhotoImageFormat(Tk_PhotoImageFormat *formatPtr)
}

# Define the platform specific public Tk interface.  These functions are
# only available on the designated platform.

interface tkPlat

################################
# Unix specific functions
#   (none)

################################
# Windows specific functions

declare 0 win {
    Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd)
}
declare 1 win {
    HINSTANCE Tk_GetHINSTANCE(void)
}
declare 2 win {
    HWND Tk_GetHWND(Window window)
}
declare 3 win {
    Tk_Window Tk_HWNDToWindow(HWND hwnd)
}
declare 4 win {
    void Tk_PointerEvent(HWND hwnd, int x, int y)
}
declare 5 win {
    int Tk_TranslateWinEvent(HWND hwnd,
	    UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
}

################################
# Aqua specific functions

declare 0 aqua {
    void Tk_MacOSXSetEmbedHandler(
	    Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr,
	    Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr,
	    Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr,
	    Tk_MacOSXEmbedGetClipProc *getClipProc,
	    Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)
}
declare 1 aqua {
    void Tk_MacOSXTurnOffMenus(void)
}
declare 2 aqua {
    void Tk_MacOSXTkOwnsCursor(int tkOwnsIt)
}
declare 3 aqua {
    void TkMacOSXInitMenus(Tcl_Interp *interp)
}
declare 4 aqua {
    void TkMacOSXInitAppleEvents(Tcl_Interp *interp)
}
declare 5 aqua {
    void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, int width,
	    int height, int flags)
}
declare 6 aqua {
    void TkMacOSXInvalClipRgns(Tk_Window tkwin)
}
declare 7 aqua {
    GWorldPtr TkMacOSXGetDrawablePort(Drawable drawable)
}
declare 8 aqua {
    ControlRef TkMacOSXGetRootControl(Drawable drawable)
}
declare 9 aqua {
    void Tk_MacOSXSetupTkNotifier(void)
}
declare 10 aqua {
    int Tk_MacOSXIsAppInFront(void)
}

##############################################################################

# Public functions that are not accessible via the stubs table.

export {
    CONST char *Tk_InitStubs(Tcl_Interp *interp, CONST char *version,
	    int exact)
}
export {
    CONST char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, CONST char *version,
	    int exact)
}

# Global variables that need to be exported from the tcl shared library.

export {
    TkStubs *tkStubsPtr                         (fool checkstubs)
}
export {
    TkPlatStubs *tkPlatStubsPtr                 (fool checkstubs)
}
export {
    TkIntStubs *tkIntStubsPtr                   (fool checkstubs)
}
export {
    TkIntPlatStubs *tkIntPlatStubsPtr           (fool checkstubs)
}
export {
    TkIntXlibStubs *tkIntXlibStubsPtr           (fool checkstubs)
}